Toggle Menu
Prev Up Next

scikit-learn 1.3.2
Other versions

Please cite us if you use the software.

# `sklearn.utils.sparsefuncs`.inplace_column_scale

sklearn.utils.sparsefuncs.inplace_column_scale(X, scale)

  Inplace column scaling of a CSC/CSR matrix.

  Scale each feature of the data matrix by multiplying with specific scale provided by the caller assuming a (n_samples, n_features) shape.

  Parameters:
    X sparse matrix of shape (n_samples, n_features)

      Matrix to normalize using the variance of the features. It should be of CSC or CSR format.

    scale ndarray of shape (n_features,), dtype={np.float32, np.float64}

      Array of precomputed feature-wise values to use for scaling.