scikit_learn / latest / modules / generated / sklearn.utils.extmath.density.html

sklearn.utils.extmath.density

sklearn.utils.extmath.density(w, **kwargs)[source]

Compute density of a sparse vector.

Parameters:
warray-like

The sparse vector.

Returns:
float

The density of w, between 0 and 1.

Examples using sklearn.utils.extmath.density

© 2007–2022 The scikit-learn developers
Licensed under the 3-clause BSD License.
https://scikit-learn.org/1.1/modules/generated/sklearn.utils.extmath.density.html