skbio.stats.ordination.scale

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

按列缩放数组以获得加权平均值0和标准

状态:自0.4.0起处于实验状态。偏差1。

参数:
  • a (array_like) -- 根据权重对列进行标准化的二维数组。

  • weights (array_like, optional) -- 与下列列相关联的权重数组 a 。默认情况下,缩放是未加权的。

  • with_mean (bool, optional, defaults to True) -- 将柱居中,使其加权平均值为0。

  • with_std (bool, optional, defaults to True) -- 缩放列以使用单位加权标准。

  • ddof (int, optional, defaults to 0) -- 如果WITH_STD为True,则通过除以计算差异 n - ddof (其中 n 是元素的数量)。默认情况下,它计算最大似然比。

  • copy (bool, optional, defaults to True) -- 是就地执行标准化,还是返回新的 a

返回:

已缩放的数组。

返回类型:

2D ndarray

备注

只要std等于0,它就会被替换为1,以避免被零除。