MiniRocket

class MiniRocket(num_features=10000, max_dilations_per_kernel=32, random_state=None)[source]

MINIROCKET

MINImally RandOm Convolutional KErnel Transform

Univariate

Unviariate input only. Use class MiniRocketMultivariate for multivariate input.

@article{dempster_etal_2020,

author = {Dempster, Angus and Schmidt, Daniel F and Webb, Geoffrey I}, title = {{MINIROCKET}: A Very Fast (Almost) Deterministic Transform for

Time Series Classification},

year = {2020}, journal = {arXiv:2012.08791}

}

Parameters
num_featuresint, number of features (default 10,000)
max_dilations_per_kernelint, maximum number of dilations per kernel (default 32)
random_stateint, random seed (optional, default None)
Attributes
is_fitted

Whether fit has been called.

Methods

check_is_fitted()

Check if the estimator has been fitted.

clone_tags(estimator[, tag_names])

clone/mirror tags from another estimator as dynamic override.

create_test_instance()

Construct Estimator instance if possible.

fit(X[, y])

Fits dilations and biases to input time series.

fit_transform(Z[, X])

Fit to data, then transform it.

get_class_tag(tag_name[, tag_value_default])

Get tag value from estimator class (only class tags).

get_class_tags()

Get class tags from estimator class and all its parent classes.

get_params([deep])

Get parameters for this estimator.

get_tag(tag_name[, tag_value_default, …])

Get tag value from estimator class and dynamic tag overrides.

get_tags()

Get tags from estimator class and dynamic tag overrides.

get_test_params()

Return testing parameter settings for the estimator.

set_params(**params)

Set the parameters of this estimator.

set_tags(**tag_dict)

Set dynamic tags to given values.

transform(X[, y])

Transforms input time series.

fit(X, y=None)[source]

Fits dilations and biases to input time series.

Parameters
Xpandas DataFrame, input time series (sktime format)
yarray_like, target values (optional, ignored as irrelevant)
Returns
self
transform(X, y=None)[source]

Transforms input time series.

Parameters
Xpandas DataFrame, input time series (sktime format)
yarray_like, target values (optional, ignored as irrelevant)
Returns
pandas DataFrame, transformed features
check_is_fitted()[source]

Check if the estimator has been fitted.

Raises
NotFittedError

If the estimator has not been fitted yet.

clone_tags(estimator, tag_names=None)[source]

clone/mirror tags from another estimator as dynamic override.

Parameters
estimatorestimator inheriting from :class:BaseEstimator
tag_namesstr or list of str, default = None

Names of tags to clone. If None then all tags in estimator are used as tag_names.

Returns
Self :

Reference to self.

Notes

Changes object state by setting tag values in tag_set from estimator as dynamic tags in self.

classmethod create_test_instance()[source]

Construct Estimator instance if possible.

Returns
instanceinstance of the class with default parameters

Notes

get_test_params can return dict or list of dict. This function takes first or single dict that get_test_params returns, and constructs the object with that.

fit_transform(Z, X=None)[source]

Fit to data, then transform it.

Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.

Parameters
Zpd.DataFrame, pd.Series or np.ndarray

Data to be transformed

Xpd.Series or np.ndarray, optional (default=None)

Target values of data to be transformed.

Returns
Ztpd.DataFrame, pd.Series or np.ndarray

Transformed data.

classmethod get_class_tag(tag_name, tag_value_default=None)[source]

Get tag value from estimator class (only class tags).

Parameters
tag_namestr

Name of tag value.

tag_value_defaultany type

Default/fallback value if tag is not found.

Returns
tag_value :

Value of the tag_name tag in self. If not found, returns tag_value_default.

classmethod get_class_tags()[source]

Get class tags from estimator class and all its parent classes.

Returns
collected_tagsdict

Dictionary of tag name : tag value pairs. Collected from _tags class attribute via nested inheritance. NOT overridden by dynamic tags set by set_tags or mirror_tags.

get_params(deep=True)[source]

Get parameters for this estimator.

Parameters
deepbool, default=True

If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns
paramsdict

Parameter names mapped to their values.

get_tag(tag_name, tag_value_default=None, raise_error=True)[source]

Get tag value from estimator class and dynamic tag overrides.

Parameters
tag_namestr

Name of tag to be retrieved

tag_value_defaultany type, optional; default=None

Default/fallback value if tag is not found

raise_errorbool

whether a ValueError is raised when the tag is not found

Returns
tag_value :

Value of the tag_name tag in self. If not found, returns an error if raise_error is True, otherwise it returns tag_value_default.

Raises
ValueError if raise_error is True i.e. if tag_name is not in self.get_tags(
).keys()
get_tags()[source]

Get tags from estimator class and dynamic tag overrides.

Returns
collected_tagsdict

Dictionary of tag name : tag value pairs. Collected from _tags class attribute via nested inheritance and then any overrides and new tags from _tags_dynamic object attribute.

classmethod get_test_params()[source]

Return testing parameter settings for the estimator.

Returns
paramsdict or list of dict, default = {}

Parameters to create testing instances of the class Each dict are parameters to construct an “interesting” test instance, i.e., MyClass(**params) or MyClass(**params[i]) creates a valid test instance. create_test_instance uses the first (or only) dictionary in params

property is_fitted[source]

Whether fit has been called.

set_params(**params)[source]

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.

Parameters
**paramsdict

Estimator parameters.

Returns
selfestimator instance

Estimator instance.

set_tags(**tag_dict)[source]

Set dynamic tags to given values.

Parameters
tag_dictdict

Dictionary of tag name : tag value pairs.

Returns
Self :

Reference to self.

Notes

Changes object state by settting tag values in tag_dict as dynamic tags in self.