Back to models
Classifier

ProximityForest

Proximity Forest classifier.

Quickstart

python
from sktime.classification.distance_based import ProximityForest

estimator = ProximityForest(random_state=None, n_estimators=100, distance_measure=None, verbosity=0, max_depth=inf, is_leaf=<function pure>, n_jobs=1, n_stump_evaluations=5)

Parameters(8)

random_state: int or np.RandomState, default=None
random seed for the random number generator
n_estimators: int, default=100
The number of trees in the forest.
distance_measure: ``None`` (default) or str; if str, one of

euclidean, dtw, ddtw, wdtw, wddtw, msm, lcss, erp distance measure to use if None, selects distances randomly from the list of available distances

verbosity: 0 or 1
number reflecting the verbosity of logging 0 = no logging, 1 = verbose logging
max_depth: int or math.inf, default=math.inf
maximum depth of the tree
is_leaf: function, default=pure
function to decide when to mark a node as a leaf node
n_jobs: int, default=1

number of jobs to run in parallel *across threads”

n_stump_evaluations: int, default=5
number of stump evaluations to do if find_stump method is None

Examples

>>> from sktime.classification.distance_based import ProximityForest
>>> from sktime.datasets import load_unit_test
>>> X_train, y_train = load_unit_test (split = "train", return_X_y = True)
>>> X_test, y_test = load_unit_test (split = "test", return_X_y = True)
>>> clf = ProximityForest (
... n_estimators = 2, max_depth = 2, n_stump_evaluations = 1
... )
>>> clf. fit (X_train, y_train) ProximityForest(
... )
>>> y_pred = clf. predict (X_test)

References

  1. [1 ] Ben Lucas et al., “Proximity Forest: an effective and scalable distance-based classifier for time series”,vData Mining and Knowledge Discovery, 33(3): 607-635, 2019 https://arxiv.org/abs/1808.10594 Java wrapper of authors original https://github.com/uea-machine-learning/tsml/blob/master/src/main/java/tsml/ classifiers/distance_based/ProximityForestWrapper.java Java version https://github.com/uea-machine-learning/tsml/blob/master/src/main/java/tsml/ classifiers/distance_based/proximity/ProximityForest.java