Classifier
ProbabilityThresholdEarlyClassifier
Probability Threshold Early Classifier.
Schnellstart
python
from sktime.classification.early_classification import ProbabilityThresholdEarlyClassifier
estimator = ProbabilityThresholdEarlyClassifier(probability_threshold=0.85, consecutive_predictions=1, estimator=None, classification_points=None, n_jobs=1, random_state=None)Parameter(6)
- probability_thresholdfloat, default=0.85
- The class prediction probability required to deem a prediction as safe.
- consecutive_predictionsint, default=1
- The number of consecutive predictions for a class above the threshold required to deem a prediction as safe.
- estimator: sktime classifier, default=None
- An sktime estimator to be built using the transformed data. Defaults to a CanonicalIntervalForest.
- classification_pointsList or None, default=None
- List of integer time series time stamps to build classifiers and allow predictions at. Early predictions must have a series length that matches a value in the _classification_points List. Duplicate values will be removed, and the full series length will be appended if not present. If None, will use 20 thresholds linearly spaces from 0 to the series length.
- n_jobsint, default=1
The number of jobs to run in parallel for both
fitandpredict.-1means using all processors.- random_stateint or None, default=None
- Seed for random number generation.
Beispiele
>>> from sktime.classification.early_classification import (
... ProbabilityThresholdEarlyClassifier
... )
>>> from sktime.classification.interval_based import TimeSeriesForestClassifier
>>> 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 = ProbabilityThresholdEarlyClassifier (
... classification_points = [6, 16, 24 ],
... estimator = TimeSeriesForestClassifier (n_estimators = 10)
... )
>>> clf. fit (X_train, y_train) ProbabilityThresholdEarlyClassifier(
... )
>>> y_pred = clf. predict (X_test)