.. _f-decisiontreelogreg: module ``mlmodel.decision_tree_logreg`` ======================================= .. inheritance-diagram:: mlinsights.mlmodel.decision_tree_logreg Short summary +++++++++++++ module ``mlinsights.mlmodel.decision_tree_logreg`` Builds a tree of logistic regressions. :githublink:`%|py|5` Classes +++++++ +----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | class | truncated documentation | +============================================================================================================================+=========================================================================================================================================+ | :class:`_DecisionTreeLogisticRegressionNode ` | Describes the tree structure hold by class :class:`DecisionTreeLogisticRegression`. See also notebook :ref:`decisiontreelogregrst`. ... | +----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :class:`DecisionTreeLogisticRegression ` | Fits a logistic regression, then fits two other logistic regression for every observation on both sides of the border. ... | +----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ Functions +++++++++ +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ | function | truncated documentation | +=========================================================================+=====================================================================================================================================================+ | :func:`likelihood ` | Computes :math:`\sum_i y_i f(\theta (x_i - x_0)) + (1 - y_i) (1 - f(\theta (x_i - x_0)))` where :math:`f(x_i)` is :math:`\frac{1}{1 + e^{-x}}`. ... | +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`logistic ` | Computes :math:`\frac{1}{1 + e^{-x}}`. | +-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ 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:`tree_depth_ ` | Returns the maximum depth of the tree. | +---------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`tree_depth_ ` | Returns the maximum depth of the tree. | +---------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ Methods +++++++ +-------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | method | truncated documentation | +=====================================================================================================================================+==================================================================================================================+ | :py:meth:`__init__ ` | constructor | +-------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | constructor | +-------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_fit_parallel ` | Implements the parallel strategy. | +-------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_fit_perpendicular ` | Implements the perpendicular strategy. | +-------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`decision_function ` | Calls *decision_function*. | +-------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`decision_path ` | Returns the decision path. | +-------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`decision_path ` | Returns the classification probabilities. | +-------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`enumerate_leaves_index ` | Returns the leaves index. | +-------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`fit ` | Builds the tree model. | +-------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`fit ` | Fits a logistic regression, then splits the sample into positive and negative examples, finally tries to fit ... | +-------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`fit_improve ` | The method only works on a linear classifier, it changes the intercept in order to be within the constraints ... | +-------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`get_leaves_index ` | Returns the index of every leave. | +-------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`predict ` | Runs the predictions. | +-------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`predict ` | Predicts | +-------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`predict_proba ` | Converts predictions into probabilities. | +-------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`predict_proba ` | Returns the classification probabilities. | +-------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: mlinsights.mlmodel.decision_tree_logreg :members: :special-members: __init__ :show-inheritance: