Toggle Menu
Prev Up Next

scikit-learn 1.3.2
Other versions

Please cite us if you use the software.

# `sklearn.utils`.safe_sqr

sklearn.utils.safe_sqr(X, *, copy=True)

  Element wise squaring of array-likes and sparse matrices.

  Parameters:
    X{array-like, ndarray, sparse matrix}
    copy bool, default=True

      Whether to create a copy of X and operate on it or to perform inplace computation (default behaviour).

  Returns:
    X ** 2 element wise square

      Return the element-wise square of the input.