Back to models
Classifier

ColumnEnsembleClassifier

Applies estimators to columns of an array or pandas DataFrame.

Quickstart

python
from sktime.classification.compose import ColumnEnsembleClassifier

estimator = ColumnEnsembleClassifier(estimators, remainder='drop', verbose=False)

Parameters(2)

estimatorslist of tuples

List of (name, estimator, column(s)) tuples specifying the transformer objects to be applied to subsets of the data.

namestring

Like in Pipeline and FeatureUnion, this allows the transformer and its parameters to be set using set_params and searched in grid search.

remainder{‘drop’, ‘passthrough’} or estimator, default ‘drop’

By default, only the specified columns in transformations are transformed and combined in the output, and the non-specified columns are dropped. (default of 'drop'). By specifying remainder='passthrough', all remaining columns that were not specified in transformations will be automatically passed through. This subset of columns is concatenated with the output of the transformations. By setting remainder to be an estimator, the remaining non-specified columns will use the remainder estimator. The estimator must support fit and transform.

Examples

>>> from sktime.classification.dictionary_based import ContractableBOSS
>>> from sktime.classification.interval_based import CanonicalIntervalForest
>>> from sktime.datasets import load_basic_motions
>>> X_train, y_train = load_basic_motions (split = "train")
>>> X_test, y_test = load_basic_motions (split = "test")
>>> cboss = ContractableBOSS (
... n_parameter_samples = 4, max_ensemble_size = 2, random_state = 0
... )
>>> cif = CanonicalIntervalForest (
... n_estimators = 2, n_intervals = 4, att_subsample_size = 4, random_state = 0
... )
>>> estimators = [("cBOSS", cboss, 5), ("CIF", cif, [3, 4 ])]
>>> col_ens = ColumnEnsembleClassifier (estimators = estimators)
>>> col_ens. fit (X_train, y_train) ColumnEnsembleClassifier(
... )
>>> y_pred = col_ens. predict (X_test)