.. _f-piecewiseestimator: module ``mlmodel.piecewise_estimator`` ====================================== .. inheritance-diagram:: mlinsights.mlmodel.piecewise_estimator Short summary +++++++++++++ module ``mlinsights.mlmodel.piecewise_estimator`` Implements a piecewise linear regression. :githublink:`%|py|5` Classes +++++++ +-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | class | truncated documentation | +===========================================================================================+==============================================================================================================================+ | :class:`PiecewiseClassifier ` | Uses a :epkg:`decision tree` to split the space of features into buckets and trains a logistic regression (default) ... | +-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :class:`PiecewiseEstimator ` | Uses a :epkg:`decision tree` to split the space of features into buckets and trains a linear regression on each of them. ... | +-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :class:`PiecewiseRegressor ` | Uses a :epkg:`decision tree` to split the space of features into buckets and trains a linear regression (default) on ... | +-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ Functions +++++++++ +--------------------------------------------------------------------------------------------------------------------------------+-------------------------+ | function | truncated documentation | +================================================================================================================================+=========================+ | :func:`_decision_function_piecewise_estimator ` | | +--------------------------------------------------------------------------------------------------------------------------------+-------------------------+ | :func:`_fit_piecewise_estimator ` | | +--------------------------------------------------------------------------------------------------------------------------------+-------------------------+ | :func:`_predict_piecewise_estimator ` | | +--------------------------------------------------------------------------------------------------------------------------------+-------------------------+ | :func:`_predict_proba_piecewise_estimator ` | | +--------------------------------------------------------------------------------------------------------------------------------+-------------------------+ Properties ++++++++++ +--------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | property | truncated documentation | +==================================================================================================+==================================================================================================================+ | :py:meth:`_repr_html_ ` | HTML representation of estimator. This is redundant with the logic of `_repr_mimebundle_`. The latter should ... | +--------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_repr_html_ ` | HTML representation of estimator. This is redundant with the logic of `_repr_mimebundle_`. The latter should ... | +--------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_repr_html_ ` | HTML representation of estimator. This is redundant with the logic of `_repr_mimebundle_`. The latter should ... | +--------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`n_estimators_ ` | Returns the number of estimators = the number of buckets the data was split in. | +--------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`n_estimators_ ` | Returns the number of estimators = the number of buckets the data was split in. | +--------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`n_estimators_ ` | Returns the number of estimators = the number of buckets the data was split in. | +--------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ Methods +++++++ +---------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+ | method | truncated documentation | +=====================================================================================================================+======================================================================================+ | :py:meth:`__init__ ` | | +---------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | | +---------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | | +---------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+ | :py:meth:`_apply_predict_method ` | Generic *predict* method, works for *predict_proba* and *decision_function* as well. | +---------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+ | :py:meth:`_apply_predict_method ` | Generic *predict* method, works for *predict_proba* and *decision_function* as well. | +---------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+ | :py:meth:`_apply_predict_method ` | Generic *predict* method, works for *predict_proba* and *decision_function* as well. | +---------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+ | :py:meth:`_mapping_train ` | | +---------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+ | :py:meth:`_mapping_train ` | | +---------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+ | :py:meth:`_mapping_train ` | | +---------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+ | :meth:`decision_function ` | Computes the predictions probabilities. | +---------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+ | :meth:`fit ` | Trains the binner and an estimator on every bucket. | +---------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+ | :meth:`fit ` | Trains the binner and an estimator on every bucket. | +---------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+ | :meth:`fit ` | Trains the binner and an estimator on every bucket. | +---------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+ | :meth:`predict ` | Computes the predictions. | +---------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+ | :meth:`predict ` | Computes the predictions. | +---------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+ | :meth:`predict_proba ` | Computes the predictions probabilities. | +---------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+ | :meth:`transform_bins ` | Maps every row to a tree in *self.estimators_*. | +---------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+ | :meth:`transform_bins ` | Maps every row to a tree in *self.estimators_*. | +---------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+ | :meth:`transform_bins ` | Maps every row to a tree in *self.estimators_*. | +---------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: mlinsights.mlmodel.piecewise_estimator :members: :special-members: __init__ :show-inheritance: