Stumps#

The splits of the nodes, given to a tree with base_stumps. A tree accepts only the stumps of its task: classification stumps for RuleTreeClassifier, regression stumps for RuleTreeRegressor and the clustering trees. See Choosing the splits: stumps.

Classification#

DecisionTreeStumpClassifier

Decision tree stump for classification: a threshold on a numerical feature (x <= t) or a value of a categorical feature (x == v), chosen to maximize the information gain.

ObliqueDecisionTreeStumpClassifier

Oblique stump for classification of tabular data: a threshold on a linear combination of a few numerical features (0.8 * X_2 - 0.6 * X_3 <= t goes left), i.e. a hyperplane that is not parallel to the axes.

PivotTreeStumpClassifier

Pivot stump for classification: a threshold on the distance from a pivot, an instance of the training set (distance <= t goes left).

ProximityPivotTreeStumpClassifier

Proximity pivot stump for classification of tabular data, time series and images: the instances closer to one pivot than to another one go left (P_a <= P_b, where P_i is the distance from the training instance i).

ObliquePivotTreeStumpClassifier

Oblique pivot stump for classification of tabular data, time series and images: a threshold on a linear combination of the distances from a few pivots (0.7 * P_12 - 0.3 * P_57 <= t goes left, where P_i is the distance from the training instance i).

ObliqueProximityPivotTreeStumpClassifier

Oblique proximity pivot stump for classification of tabular data, time series and images: as :class: ~RuleTree.stumps.classification.ProximityPivotTreeStumpClassifier.ProximityPivotTreeStumpClassifier ` (the instances closer to one pivot than to another one go left, ``P_a <= P_b`), but the discriminative pivots of each class are the instances combined by an oblique direction on the distances (oblique_split_type), instead of the root split of a decision tree: up to max_oblique_features (Householder) or two (bivariate) for each class.

PartialPivotTreeStumpClassifier

Partial pivot stump for classification of tabular data: a threshold on the distance from a partial pivot, an instance of the node restricted to a few features (distance <= t goes left).

PartialProximityTreeStumpClassifier

Partial proximity stump for classification of tabular data: the instances closer to one partial pivot than to another one go left (euclidean(x, SP0(...)) <= euclidean(x, SP1(...))).

ShapeletTreeStumpClassifier

Shapelet stump for classification of time series: a threshold on the distance of the time series from a shapelet (distance <= t goes left).

ProximityTreeStumpClassifier

Proximity stump for classification of time series: the time series closer to one shapelet than to another one go left (euclidean(TS, green_shp) <= euclidean(TS, red_shp)).

Regression#

DecisionTreeStumpRegressor

Decision tree stump for regression: a threshold on a numerical feature (x <= t) or a value of a categorical feature (x == v), chosen to maximize the decrease of impurity.

ObliqueDecisionTreeStumpRegressor

Oblique stump for regression of tabular data: a threshold on a linear combination of a few numerical features (0.8 * X_2 - 0.6 * X_3 <= t goes left).

PivotTreeStumpRegressor

Pivot stump for regression: a threshold on the distance from a pivot, an instance of the training set (distance <= t goes left).

ShapeletTreeStumpRegressor

Shapelet stump for regression of time series: a threshold on the distance of the time series from a shapelet (distance <= t goes left).

ProximityTreeStumpRegressor

Proximity stump for regression of time series: the time series closer to one shapelet than to another one go left (euclidean(TS, green_shp) <= euclidean(TS, red_shp)).

FairTreeStumpRegressor

Fair stump for regression: the threshold on a numerical feature with the highest gain, penalized by how unfair the split is with respect to a sensitive attribute.

XGBoostStumpRegressor

Stump of the XGBoost trees (regression): the threshold with the highest XGBoost gain, the similarity score of the two children minus the one of the node.

Building blocks#

Stump composes a transformer and a splitter (see Transformers and splitters); the other classes hold what the classification and regression versions of a stump have in common. See Extending the library.

Stump

Stump made of a transformer and a splitter: the transformer turns the data of one type into a feature matrix, the splitter finds the best split of that matrix.

DecisionTreeStump

Base class of the decision tree stumps (DecisionTreeStumpClassifier and DecisionTreeStumpRegressor): a MatrixTransformer and the splitter _splitter_class (ClassificationSplitter or RegressionSplitter) with the parameters of the stump.

ObliqueTreeStump

Mixin of the oblique stumps (ObliqueDecisionTreeStumpClassifier and ObliqueDecisionTreeStumpRegressor): the oblique transformer built from the parameters of the stump, and the rule of the split.

PivotTreeStump

Mixin of the pivot stumps (PivotTreeStumpClassifier and PivotTreeStumpRegressor): the PivotTransformer built from the parameters of the stump, the pivots of the split and its rule.

ProximityPivotTreeStump

Mixin of the proximity pivot stumps (ProximityPivotTreeStumpClassifier and ObliqueProximityPivotTreeStumpClassifier): the ProximityPivotTransformer built from the parameters of the stump, the pivots of the split and its rule, P_<a> <= P_<b> (closer to the training instance a than to b).

ObliquePivotTreeStump

Mixin of the oblique pivot stumps (ObliquePivotTreeStumpClassifier): the ObliquePivotTransformer built from the parameters of the stump, the pivots of the split and its rule, e.g. 0.7 * P_12 - 0.3 * P_57 <= 1.2.

ShapeletTreeStump

Mixin of the shapelet stumps (ShapeletTreeStumpClassifier and ShapeletTreeStumpRegressor): the ShapeletTransformer built from the parameters of the stump, the parameters of the splitter, the rule and its drawing.

ProximityTreeStump

Mixin of the proximity stumps for time series (ProximityTreeStumpClassifier and ProximityTreeStumpRegressor): the ProximityTransformer built from the parameters of the stump, the rule and its drawing.

PartialProximityTreeStump

Mixin of the proximity stumps for tabular data (PartialProximityTreeStumpClassifier): the PartialProximityTransformer built from the parameters of the stump and the rule.