Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Calcul scientifique
avec Python
Voir le programme détaillé
Module « scipy.special »

Fonction entr - module scipy.special

Signature de la fonction entr

def entr(*args, **kwargs) 

Description

help(scipy.special.entr)

entr(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

entr(x, out=None)

Elementwise function for computing entropy.

.. math:: \text{entr}(x) = \begin{cases} - x \log(x) & x > 0  \\ 0 & x = 0
          \\ -\infty & \text{otherwise} \end{cases}

Parameters
----------
x : ndarray
    Input array.
out : ndarray, optional
    Optional output array for the function values

Returns
-------
res : scalar or ndarray
    The value of the elementwise entropy function at the given points `x`.

See Also
--------
kl_div, rel_entr, scipy.stats.entropy

Notes
-----
.. versionadded:: 0.15.0

This function is concave.

The origin of this function is in convex programming; see [1]_.
Given a probability distribution :math:`p_1, \ldots, p_n`,
the definition of entropy in the context of *information theory* is

.. math::

    \sum_{i = 1}^n \mathrm{entr}(p_i).

To compute the latter quantity, use `scipy.stats.entropy`.

References
----------
.. [1] Boyd, Stephen and Lieven Vandenberghe. *Convex optimization*.
       Cambridge University Press, 2004.
       :doi:`https://doi.org/10.1017/CBO9780511804441`


Vous êtes un professionnel et vous avez besoin d'une formation ? Mise en oeuvre d'IHM
avec Qt et PySide6
Voir le programme détaillé