Back to models
Classifier

SummaryClassifier

Summary statistic classifier.

Quickstart

python
from sktime.classification.feature_based import SummaryClassifier

estimator = SummaryClassifier(summary_functions=('mean', 'std', 'min', 'max'), summary_quantiles=(0.25, 0.5, 0.75), estimator=None, n_jobs=1, random_state=None)

Parameters(5)

summary_functionsstr, list, tuple, default=(“mean”, “std”, “min”, “max”)
Either a string, or list or tuple of strings indicating the pandas summary functions that are used to summarize each column of the dataset. Must be one of (“mean”, “min”, “max”, “median”, “sum”, “skew”, “kurt”, “var”, “std”, “mad”, “sem”, “nunique”, “count”).
summary_quantilesstr, list, tuple or None, default=(0.25, 0.5, 0.75)
Optional list of series quantiles to calculate. If None, no quantiles are calculated.
estimatorsklearn classifier, default=None
An sklearn estimator to be built using the transformed data. Defaults to a Random Forest with 200 trees.
n_jobsint, default=1

The number of jobs to run in parallel for both fit and predict. -1 means using all processors.

random_stateint or None, default=None
Seed for random, integer.

Examples

>>> from sktime.classification.feature_based import SummaryClassifier
>>> from sklearn.ensemble import RandomForestClassifier
>>> 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 = SummaryClassifier (estimator = RandomForestClassifier (n_estimators = 5))
>>> clf. fit (X_train, y_train) SummaryClassifier(
... )
>>> y_pred = clf. predict (X_test)