.. _l-functions: Functions ========= .. contents:: :local: :depth: 1 Summary +++++++ +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | function | class parent | truncated documentation | +================================================================================================================================+==============+===============================================================================================================================================================================+ | :func:`_calcule_gradient ` | | Retourne le gradient d'une image sous forme d'une matrice de Point, consideres ici comme des vecteurs. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`_load_image ` | | Charge une image en différents formats. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`_setup_hook ` | | if this function is added to the module, the help automation and unit tests call it first before anything goes on ... | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`check ` | | Checks the library is working. It raises an exception. If you want to disable the logs: | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`compute_gradient ` | | Retourne le gradient d'une image sous forme d'une matrice de Point, consideres ici comme des vecteurs. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`convert_PIL2array ` | | Convertit une image donnée sous la forme d'une image :epkg:`Pillow` au format :epkg:`numpy:array`. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`convert_array2PIL ` | | Convertit une image donnée sous la forme d'un array au format :epkg:`numpy:array`. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`criteria ` | | Computes Gini, information gain, likelihood on a dataset with two features assuming the first coordinates is used to ... | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`criteria2 ` | | Computes Gini, information gain, likelihood on a dataset with two features assuming the first coordinates is used to ... | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`detect_segments ` | | Détecte les segments dans une image. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`download_dump ` | | Downloads *wikipedia dumps* from `dumps.wikimedia.org/frwiki/latest/ `_. ... | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`download_pageviews ` | | Downloads wikipedia pagacount for a precise date (up to the hours), the url follows the pattern | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`download_titles ` | | Downloads wikipedia titles from `dumps.wikimedia.org/frwiki/latest/latest-all-titles-in-ns0.gz `_. ... | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`draw_graph_graphviz ` | | Draws a graph using :epkg:`Graphviz`. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`edges2gv ` | | Converts a graph into a :epkg:`GraphViz` file format. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`enumerate_titles ` | | Enumerates titles from a file. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`esperance ` | | Espérance du profit en faisant varier le nombre de poulet vendus. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`exponentielle ` | | Simule une loi exponentielle de paramètre :math:`\lambda`. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`f_proba_poisson_melange ` | | Wraps function *proba_poisson_melange* to avoid global variable. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`factorielle ` | | Calcule :math:`x!` de façon récursive. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`find_maximum ` | | Trouver le couple (nombre de poulets achetés, profit) lorsque le profit est maximum. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`gram_schmidt ` | | Applies the `Gram–Schmidt process `_. Due to performance, ... | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`histogramme_poisson_melange ` | | Calcule un histogramme d'un mélange de loi de Poisson. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`label_class_to_softmax_output ` | | Converts a binary class label into a matrix with two columns of probabilities. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :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:`linear_regression ` | | Solves the linear regression problem, find :math:`\beta` which minimizes :math:`\norme{y - X\beta}`, based on the ... | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`local_proba_poisson_melange ` | | Calcule la probabilité :math:`\pr{X=i}`` lorsque :math:`X` suit un mélange de lois. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`logistic ` | | Computes :math:`\frac{1}{1 + e^{-x}}`. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`maximum ` | | Calcule les espérances de profit pour différents nombres de poulets achetés. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`norm2 ` | | Computes the square norm for all rows of a matrix. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`normalize_wiki_text ` | | Normalizes a text such as a wikipedia title. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`plog2 ` | | Computes :math:`x \ln_2 x`. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`plot_ds ` | | Plots a dataset, *X* is a dataset with two features, *y* contains the binary labels. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`plot_gradient ` | | Construit une image a partir de la matrice de gradient afin de pouvoir l'afficher grace au module pygame, cette ... | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`plot_segments ` | | Dessine les segments produits par la fonction :func:`detect_segments` | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`poisson ` | | Simule une loi de Poisson de paramètre :math:`\lambda`. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`poisson_melange ` | | Simule une variable selon un mélange de loi de Poisson. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`proba_poisson ` | | Calcule la probabilité :math:`\pr{X=i}`` lorsque :math:`X` suit une loi de Poisson de paramètre :math:`\lambda`. ... | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`profit ` | | Calcule le profit. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`random_noise_image ` | | Construit une image blanche de taille *size*, noircit aléatoirement *ratio x nb pixels* pixels. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`random_segment_image ` | | Ajoute un segment aléatoire à une image. Génère des points le long d'un segment aléatoire. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`random_set_1d ` | | Builds a random dataset as describes in example :ref:`l-example-logistic-decision`. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`remove_diacritics ` | | remove diacritics | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`run_graphviz ` | | Run :epkg:`GraphViz`. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`streaming_gram_schmidt ` | | Solves the linear regression problem, find :math:`\beta` which minimizes :math:`\norme{y - X\beta}`, based on ... | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`streaming_gram_schmidt_update ` | | Updates matrix :math:`P_k` to produce :math:`P_{k+1}` which is the matrix *P* in algorithm :ref:`Streaming Linear Regression `. ... | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`streaming_linear_regression ` | | Streaming algorithm to solve a linear regression. See :ref:`l-piecewise-linear-regression`. | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`streaming_linear_regression_gram_schmidt ` | | Streaming algorithm to solve a linear regression with Gram-Schmidt algorithm. See :ref:`l-piecewise-linear-regression-gram_schmidt`. ... | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`streaming_linear_regression_gram_schmidt_update ` | | Updates coefficients :math:`\beta_k` to produce :math:`\beta_{k+1}` in :ref:`Streaming Linear Regression `. ... | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`streaming_linear_regression_update ` | | Updates coefficients :math:`\beta_k` to produce :math:`\beta_{k+1}` in :ref:`l-piecewise-linear-regression`. The ... | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`tabule_queue_binom ` | | Retourne un dictionnaire dont la clé est couple d'entiers *(a,b)* si *t* est le resultat, alors :math:`t=[(a,b)]` est ... | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`voronoi_estimation_from_lr ` | | Determines a Voronoi diagram close to a convex partition defined by a logistic regression in *n* classes. :math:`M \in \mathbb{M}_{nd}` ... | +--------------------------------------------------------------------------------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+