.. _f-sklearnexampleclassifier: module ``mltricks.sklearn_example_classifier`` ============================================== .. inheritance-diagram:: papierstat.mltricks.sklearn_example_classifier Short summary +++++++++++++ module ``papierstat.mltricks.sklearn_example_classifier`` Defines :class:`SkCustomKnn` :githublink:`%|py|5` Classes +++++++ +-----------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ | class | truncated documentation | +===================================================================================+====================================================================================================================+ | :class:`SkCustomKnn ` | Implements the `k-Nearest Neighbors `_ as an example. | +-----------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ Methods +++++++ +----------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ | method | truncated documentation | +==========================================================================================================+===============================================================================================================================================+ | :py:meth:`__init__ ` | constructor | +----------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`decision_function ` | Computes the output of the model in case of a regressor, matrix with a score for each class and each sample ... | +----------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`distance2weight ` | Converts a distance to weight. | +----------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`fit ` | Train a k-NN model. There is not much to do except storing the training examples. | +----------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`knn_search ` | Finds the *k* nearest neighbors for x. | +----------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`predict ` | Predicts, usually, it calls the :meth:`decision_function ` ... | +----------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: papierstat.mltricks.sklearn_example_classifier :members: :special-members: __init__ :show-inheritance: