ObliquePivotTreeStump#

class ObliquePivotTreeStump[source]#

Bases: object

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.

property coefficients#

Coefficients of the combination of the split, None if not fitted.

get_pivots()[source]#

Pivots of the node, as indices of instances of the training set.

Returns:

pivots – descriptives, discriminatives and candidates pivots of the node, and the pivots used by the combination of the split.

Return type:

dict

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

Rule of the split, e.g. 0.7 * P_12 - 0.3 * P_57 <= 1.2, where P_<i> is the distance from the training instance i.

Parameters:
  • columns_names (list of str, default=None) – Not used: the rule does not name the features.

  • scaler (TransformerMixin, default=None) – Not used: the distances are computed on the data standardized by the stump.

  • float_precision (int, default=3) – Number of decimals of the coefficients and of the threshold; None for no rounding.

Returns:

rule – See RuleTreeBaseStump.get_rule; also coefficients. Empty if the stump is not fitted.

Return type:

dict

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

What the node of the split shows in RuleTree.plot_tree: the rule, and the pivots of the combination as given to fit, drawn below it with show_media.

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

  • scaler (TransformerMixin, default=None) – Not used.

  • float_precision (int, default=3) – Number of decimals of the coefficients and of the threshold.

Returns:

rule – label, and media_values with the pivots (see pivot_media()).

Return type:

dict