ObliqueTreeStump#

class ObliqueTreeStump[source]#

Bases: object

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

The subclass defines the parameters and the splitter, by deriving also from the decision tree stump of its task (class ObliqueDecisionTreeStumpClassifier(ObliqueTreeStump, DecisionTreeStumpClassifier)).

property coefficients#

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

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

Rule of the split, e.g. 0.8 * X_2 - 0.6 * X_3 <= 1.5.

Parameters:
  • columns_names (list of str, default=None) – Names of the columns of the data, used instead of X_<index>.

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

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

Returns:

rule – feature_idx (the columns of the combination), coefficients, threshold, is_categorical, feature_name (the combination), the condition of the left child (textual_rule, blob_rule) and its negation. Empty if the stump is not fitted.

Return type:

dict

Raises:

ValueError – If a scaler is given.