W3cubDocs

/scikit-learn

sklearn.utils.extmath.density

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

Compute density of a sparse vector

Parameters:
w : array_like

The sparse vector

Returns:
float

The density of w, between 0 and 1

Examples using sklearn.utils.extmath.density

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