.. _f-piecewisetreeregression: module ``mlmodel.piecewise_tree_regression`` ============================================ .. inheritance-diagram:: mlinsights.mlmodel.piecewise_tree_regression Short summary +++++++++++++ module ``mlinsights.mlmodel.piecewise_tree_regression`` Implements a kind of piecewise linear regression by modifying the criterion used by the algorithm which builds a decision tree. :githublink:`%|py|7` Classes +++++++ +-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+ | class | truncated documentation | +=======================================================================================================+===============================================================================================================================+ | :class:`PiecewiseTreeRegressor ` | Implements a kind of piecewise linear regression by modifying the criterion used by the algorithm which builds a decision ... | +-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+ Properties ++++++++++ +-------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | property | truncated documentation | +=========================================================================================================================+========================================================================================================================+ | :py:meth:`_repr_html_ ` | HTML representation of estimator. This is redundant with the logic of `_repr_mimebundle_`. The latter should ... | +-------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`feature_importances_ ` | Return the feature importances. The importance of a feature is computed as the (normalized) total reduction ... | +-------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`n_features_ ` | DEPRECATED: The attribute `n_features_` is deprecated in 1.0 and will be removed in 1.2. Use `n_features_in_` instead. | +-------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ Methods +++++++ +------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+ | method | truncated documentation | +==================================================================================================================+=================================================================================================================+ | :py:meth:`__init__ ` | | +------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+ | :py:meth:`_fit_reglin ` | Fits linear regressions for all leaves. Sets attributes ``leaves_mapping_``, ``betas_``, ``leaves_index_``. ... | +------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+ | :py:meth:`_mapping_train ` | | +------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+ | :py:meth:`_predict_reglin ` | Computes the predictions with a linear regression fitted with the observations mapped to each leave of the ... | +------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+ | :meth:`fit ` | Replaces the string stored in criterion by an instance of a class. | +------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+ | :meth:`predict ` | Overloads method *predict*. Falls back into the predict from a decision tree is criterion is *mse*, *mae*, ... | +------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+ | :meth:`predict_leaves ` | Returns the leave index for each observation of *X*. | +------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: mlinsights.mlmodel.piecewise_tree_regression :members: :special-members: __init__ :show-inheritance: