Toggle Menu
Prev Up Next

scikit-learn 1.3.2
Other versions

Please cite us if you use the software.

# `sklearn.utils.extmath`.density

sklearn.utils.extmath.density(w, **kwargs)

  Compute density of a sparse vector.

  Parameters:
    w array-like

      The sparse vector.

    **kwargs keyword arguments

      Ignored.

      Deprecated since version 1.2: `**kwargs` were deprecated in version 1.2 and will be removed in 1.4.

  Returns:
    float

      The density of w, between 0 and 1.

## Examples using `sklearn.utils.extmath.density`

Classification of text documents using sparse features

Classification of text documents using sparse features