.. _f-imageknn: module ``hackathon.image_knn`` ============================== .. inheritance-diagram:: ensae_projects.hackathon.image_knn Short summary +++++++++++++ module ``ensae_projects.hackathon.image_knn`` Builds a knn classifier for image in order to find close images. :githublink:`%|py|0` Classes +++++++ +-------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+ | class | truncated documentation | +===========================================================================================+======================================================================================+ | :class:`ImageNearestNeighbors ` | Builds a model on the top of :epkg:`NearestNeighbors` in order to find close images. | +-------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+ Properties ++++++++++ +-----------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | property | truncated documentation | +===============================================================================================+==================================================================================================================+ | :py:meth:`_repr_html_ ` | HTML representation of estimator. This is redundant with the logic of `_repr_mimebundle_`. The latter should ... | +-----------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ Methods +++++++ +--------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ | method | truncated documentation | +========================================================================================================+==========================================================================================================================+ | :py:meth:`__init__ ` | | +--------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_folder2matrix ` | Converts images stored in a folder into a matrix of features. | +--------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_get_transform ` | Returns the associated transform function with ``self.transform_``. | +--------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_imglist2matrix ` | Converts a list of images into a matrix of features. | +--------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_private_kn ` | Commun private function to handle the same kind of inputs in all transform functions. | +--------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ | :meth:`fit ` | Fits the model. *X* can be a folder. | +--------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ | :meth:`get_image_classes ` | Returns images classes for the given list of indices. | +--------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ | :meth:`get_image_names ` | Returns images names for the given list of indices. | +--------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ | :meth:`kneighbors ` | See :epkg:`NearestNeighbors`, method :epkg:`kneighbors`. Parameter *X* can be a file, the image is then loaded and ... | +--------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ | :meth:`kneighbors_graph ` | See :epkg:`NearestNeighbors`, method :epkg:`kneighbors_graph`. Parameter *X* can be a file, the image is then loaded ... | +--------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ | :meth:`plot_neighbors ` | Calls :epkg:`plot_gallery_images` with information on the neighbors. | +--------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ | :meth:`radius_neighbors ` | See :epkg:`NearestNeighbors`, method :epkg:`radius_neighbors`. Parameter *X* can be a file, the image is then loaded ... | +--------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: ensae_projects.hackathon.image_knn :members: :special-members: __init__ :show-inheritance: