wildboar.tree._tree#
Module Contents#
Classes#
Base class for all estimators in scikit-learn. |
|
A shapelet tree regressor. |
|
An extra shapelet tree regressor. |
|
A shapelet tree classifier. |
|
An extra shapelet tree classifier. |
- class wildboar.tree._tree.BaseShapeletTree(*, max_depth=None, min_samples_split=2, n_shapelets=10, min_shapelet_size=0, max_shapelet_size=1, metric='euclidean', metric_params=None, force_dim=None, random_state=None)#
Bases:
sklearn.base.BaseEstimatorBase class for all estimators in scikit-learn.
Notes
All estimators should specify all the parameters that can be set at the class level in their
__init__as explicit keyword arguments (no*argsor**kwargs).- decision_path(x, check_input=True)#
- apply(x, check_input=True)#
- class wildboar.tree._tree.ShapeletTreeRegressor(*, max_depth=None, min_samples_split=2, n_shapelets=10, min_shapelet_size=0, max_shapelet_size=1, metric='euclidean', metric_params=None, force_dim=None, random_state=None)#
Bases:
sklearn.base.RegressorMixin,BaseShapeletTreeA shapelet tree regressor.
- tree_#
- Type:
Tree
- fit(X, y, sample_weight=None, check_input=True)#
Fit a shapelet tree regressor from the training set
- Parameters:
X (array-like of shape (n_samples, n_timesteps) or (n_samples, n_dimensions, n_timesteps)) – The training time series.
y (array-like of shape (n_samples,)) – Target values as floating point values
sample_weight (array-like of shape (n_samples,)) – If None, then samples are equally weighted. Splits that would create child nodes with net zero or negative weight are ignored while searching for a split in each node. Splits are also ignored if they would result in any single class carrying a negative weight in either child node.
check_input (bool, optional) – Allow to bypass several input checking. Don’t use this parameter unless you know what you do.
- Returns:
self
- Return type:
object
- predict(x, check_input=True)#
Predict the regression of the input samples x.
- Parameters:
x (array-like of shape (n_samples, n_timesteps) or (n_samples, n_dimensions, n_timesteps])) – The input time series
check_input (bool, optional) – Allow to bypass several input checking. Don’t use this parameter unless you know what you do.
- Returns:
y – The predicted classes.
- Return type:
ndarray of shape (n_samples,)
- class wildboar.tree._tree.ExtraShapeletTreeRegressor(*, max_depth=None, n_shapelets=1, min_samples_split=2, min_shapelet_size=0, max_shapelet_size=1, metric='euclidean', metric_params=None, force_dim=None, random_state=None)#
Bases:
ShapeletTreeRegressorAn extra shapelet tree regressor.
Extra shapelet trees are constructed by sampling a distance threshold uniformly in the range [min(dist), max(dist)].
- tree_#
- Type:
Tree
- class wildboar.tree._tree.ShapeletTreeClassifier(max_depth=None, min_samples_split=2, n_shapelets=10, min_shapelet_size=0, max_shapelet_size=1, metric='euclidean', metric_params=None, force_dim=None, random_state=None)#
Bases:
sklearn.base.ClassifierMixin,BaseShapeletTreeA shapelet tree classifier.
- tree_#
The tree data structure used internally
- Type:
Tree
- classes_#
The class labels
- Type:
ndarray of shape (n_classes,)
- n_classes_#
The number of class labels
- Type:
int
See also
ShapeletTreeRegressorA shapelet tree regressor.
ExtraShapeletTreeClassifierAn extra random shapelet tree classifier.
- fit(x, y, sample_weight=None, check_input=True)#
Fit a shapelet tree regressor from the training set
- Parameters:
X (array-like of shape (n_samples, n_timesteps) or (n_samples, n_dimensions, n_timesteps)) – The training time series.
y (array-like of shape (n_samples,) or (n_samples, n_classes)) – The target values (class labels) as integers
sample_weight (array-like of shape (n_samples,)) – If None, then samples are equally weighted. Splits that would create child nodes with net zero or negative weight are ignored while searching for a split in each node. Splits are also ignored if they would result in any single class carrying a negative weight in either child node.
check_input (bool, optional) – Allow to bypass several input checking. Don’t use this parameter unless you know what you do.
- Returns:
self
- Return type:
object
- predict(x, check_input=True)#
Predict the regression of the input samples x.
- Parameters:
x (array-like of shape (n_samples, n_timesteps) or (n_samples, n_dimensions, n_timesteps])) – The input time series
check_input (bool, optional) – Allow to bypass several input checking. Don’t use this parameter unless you know what you do.
- Returns:
y – The predicted classes.
- Return type:
ndarray of shape (n_samples,)
- predict_proba(x, check_input=True)#
Predict class probabilities of the input samples X. The predicted class probability is the fraction of samples of the same class in a leaf.
- Parameters:
x (array-like of shape (n_samples, n_timesteps) or (n_samples, n_dimensions, n_timesteps])) – The input time series
check_input (bool, optional) – Allow to bypass several input checking. Don’t use this parameter unless you know what you do.
- Returns:
proba – The class probabilities of the input samples. The order of the classes corresponds to that in the attribute classes_
- Return type:
ndarray of shape (n_samples, n_classes)
- class wildboar.tree._tree.ExtraShapeletTreeClassifier(max_depth=None, n_shapelets=1, min_samples_split=2, min_shapelet_size=0, max_shapelet_size=1, metric='euclidean', metric_params=None, force_dim=None, random_state=None)#
Bases:
ShapeletTreeClassifierAn extra shapelet tree classifier.
Extra shapelet trees are constructed by sampling a distance threshold uniformly in the range [min(dist), max(dist)].
- tree_#
- Type:
Tree