.. _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:`NeuralTreeNet ` | Node ensemble. | +----------------------------------------------------------------+-------------------------+ 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 | +===================================================================================+========================================+ | :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 one. 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` | +--------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------+ Methods +++++++ +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | method | truncated documentation | +=================================================================================================+==========================================================================+ | :py:meth:`__getitem__ ` | Retrieves node and attributes for node i. | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :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:`dlossds ` | Computes the loss derivative against the inputs. | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :meth:`fill_cache ` | Creates a cache with intermediate results. | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :meth:`gradient_backward ` | Computes the gradient in X. | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :meth:`loss ` | Computes the loss due to prediction error. Returns a float. | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :meth:`predict ` | | +-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :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: