.. _f-neuraltree: module ``ml.neural_tree`` ========================= .. inheritance-diagram:: mlstatpy.ml.neural_tree Short summary +++++++++++++ module ``mlstatpy.ml.neural_tree`` Conversion from tree to neural network. :githublink:`%|py|6` Classes +++++++ +------------------------------------------------------------------------------------+-------------------------------------------------------------+ | class | truncated documentation | +====================================================================================+=============================================================+ | :class:`BaseNeuralTreeNet ` | Classifier or regressor following :epkg:`scikit-learn` API. | +------------------------------------------------------------------------------------+-------------------------------------------------------------+ | :class:`NeuralTreeNet ` | Node ensemble. | +------------------------------------------------------------------------------------+-------------------------------------------------------------+ | :class:`NeuralTreeNetClassifier ` | Classifier following :epkg:`scikit-learn` API. | +------------------------------------------------------------------------------------+-------------------------------------------------------------+ | :class:`NeuralTreeNetRegressor ` | Regressor following :epkg:`scikit-learn` API. | +------------------------------------------------------------------------------------+-------------------------------------------------------------+ Functions +++++++++ +-----------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------+ | function | truncated documentation | +===============================================================================================+================================================================================+ | :func:`label_class_to_softmax_output ` | Converts a binary class label into a matrix with two columns of probabilities. | +-----------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------+ 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:`shape ` | Returns the shape of the coefficients. | +--------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`training_weights ` | Returns the weights. | +--------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ Static Methods ++++++++++++++ +--------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------+ | staticmethod | truncated documentation | +========================================================================================================+=================================================================================+ | :py:meth:`_create_from_tree_compact ` | Implements strategy 'compact'. See @see meth create_from_tree. | +--------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------+ | :py:meth:`_create_from_tree_one ` | Implements strategy 'one'. See @see meth create_from_tree. | +--------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------+ | :meth:`create_from_tree ` | Creates a :class:`NeuralTreeNet` instance from a :epkg:`DecisionTreeClassifier` | +--------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------+ | :meth:`onnx_converter ` | Converts this model into ONNX. | +--------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------+ | :meth:`onnx_converter ` | Converts this model into ONNX. | +--------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------+ | :meth:`onnx_converter ` | Converts this model into ONNX. | +--------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------+ | :meth:`onnx_shape_calculator ` | Shape calculator when converting this model into ONNX. See :epkg:`skearn-onnx`. | +--------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------+ | :meth:`onnx_shape_calculator ` | Shape calculator when converting this model into ONNX. See :epkg:`skearn-onnx`. | +--------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------+ | :meth:`onnx_shape_calculator ` | Shape calculator when converting this model into ONNX. See :epkg:`skearn-onnx`. | +--------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------+ Methods +++++++ +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | method | truncated documentation | +=================================================================================================+==========================================================================+ | :py:meth:`__getitem__ ` | Retrieves node and attributes for node i. | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :py:meth:`__init__ ` | | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :py:meth:`__init__ ` | | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :py:meth:`__init__ ` | | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :py:meth:`__init__ ` | | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :py:meth:`__len__ ` | Returns the number of nodes | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :py:meth:`__repr__ ` | usual | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :py:meth:`_common_loss_dloss ` | Common beginning to methods *loss*, *dlossds*, *dlossdw*. | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :py:meth:`_get_output_node_attr ` | Retrieves the output nodes. *nb_last* is the number of expected outputs. | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :py:meth:`_predict_one ` | | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :py:meth:`_update_members ` | Updates internal members. | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :meth:`append ` | Appends a node into the graph. | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :meth:`clear ` | Clear all nodes | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :meth:`copy ` | | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :meth:`decision_function ` | Returns the classification probabilities. | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :meth:`decision_function ` | Returns the classification probabilities. | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :meth:`decision_function ` | Returns the classification probabilities. | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :meth:`dlossds ` | Computes the loss derivative against the inputs. | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :meth:`fill_cache ` | Creates a cache with intermediate results. | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :meth:`fit ` | Trains the estimator. | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :meth:`fit ` | Trains the estimator. | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :meth:`fit ` | Trains the estimator. | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :meth:`gradient_backward ` | Computes the gradient in X. | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :meth:`loss ` | Computes the loss due to prediction error. Returns a float. | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :meth:`predict ` | | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :meth:`predict ` | Returns the predicted classes. | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :meth:`predict ` | Returns the predicted classes. | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :meth:`predict_proba ` | Returns the classification probabilities. | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :meth:`to_dot ` | Exports the neural network into :epkg:`dot`. | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :meth:`update_training_weights ` | Updates weights. | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: mlstatpy.ml.neural_tree :members: :special-members: __init__ :show-inheritance: