def _sparseness(x):
    sqrt_n = np.sqrt(len(x))
    return (sqrt_n - np.linalg.norm(x, 1) / norm(x)) / (sqrt_n - 1)
Hoyer's measure of sparsity for a vector
dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/decomposition/nmf.py/_sparseness