ShapeletTreeStump#

class ShapeletTreeStump[source]#

Bases: object

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.

The subclass defines the parameters, by deriving also from the decision tree stump of its task (class ShapeletTreeStumpClassifier(ShapeletTreeStump, DecisionTreeStumpClassifier)).

property st#

The fitted shapelet transform.

get_rule(columns_names=None, scaler=None, float_precision: int | None = 3)[source]#

Rule of the split, e.g. euclidean(TS, shp) <= 1.2.

Parameters:
  • columns_names (list of str, default=None) – Not used.

  • scaler (TransformerMixin, default=None) – Not supported: must be None.

  • float_precision (int, default=3) – Number of decimals of the threshold. If None, it is not rounded.

Returns:

rule – See RuleTreeBaseStump.get_rule.

Return type:

dict

Raises:

ValueError – If a scaler is given.

get_plot_rule(columns_names=None, scaler=None, float_precision: int | None = 3)[source]#

What the node of the split shows in RuleTree.plot_tree: the rule and, below it, the shapelet.

Parameters:
  • columns_names (list of str, default=None) – Not used.

  • scaler (TransformerMixin, default=None) – Not supported: must be None.

  • float_precision (int, default=3) – Number of decimals of the threshold. If None, it is not rounded.

Returns:

rule – label, media_values (the shapelet), media_kind and media_names.

Return type:

dict