skbio.stats.ordination.scale

skbio.stats.ordination.scale(a, weights=None, with_mean=True, with_std=True, ddof=0, copy=True)[source]

Scale array by columns to have weighted average 0 and standard

State: Experimental as of 0.4.0. deviation 1.

Parameters:
  • a (array_like) – 2D array whose columns are standardized according to the weights.
  • weights (array_like, optional) – Array of weights associated with the columns of a. By default, the scaling is unweighted.
  • with_mean (bool, optional, defaults to True) – Center columns to have 0 weighted mean.
  • with_std (bool, optional, defaults to True) – Scale columns to have unit weighted std.
  • ddof (int, optional, defaults to 0) – If with_std is True, variance is calculated by dividing by n - ddof (where n is the number of elements). By default it computes the maximum likelyhood stimator.
  • copy (bool, optional, defaults to True) – Whether to perform the standardization in place, or return a new copy of a.
Returns:

Scaled array.

Return type:

2D ndarray

Notes

Wherever std equals 0, it is replaced by 1 in order to avoid division by zero.