ProximityTreeStump#

class ProximityTreeStump[source]#

Bases: object

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.

The subclass defines the parameters and the splitter, by deriving also from the shapelet stump of its task (class ProximityTreeStumpClassifier(ProximityTreeStump, ShapeletTreeStumpClassifier)).

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

Rule of the split, euclidean(TS, green_shp) <= euclidean(TS, red_shp): the time series closer to the first shapelet (green in the drawing, st.shapelets[0]) than to the second one (red, st.shapelets[1]) go left.

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

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

  • float_precision (int, default=3) – Not used: the rule has no number.

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 the two shapelets, green and red as in the rule, on the arrows of the two children: the green one on the left arrow (the series closer to it), the red one on the right arrow.

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

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

  • float_precision (int, default=3) – Not used.

Returns:

rule – label, media_values (the two shapelets), media_kind, media_names, their media_colors and media_on_edges (True).

Return type:

dict