-
preprocessing模块
sklearn.preprocessing包提供几种常用的效用函数及转换器类,用于更改原始特征向量表示形式以适应后续评估量。
-
sklearn.preprocessing.scale()函数
sklearn.preprocessing.scale(X, axis=0, with_mean=True, with_std=True, copy=True)
沿着某个轴标准化数据集,以均值为中心,以分量为单位方差。
参数 数据类型 意义 X {array-like, sparse matrix} 以此数据为中心缩放 axis int (0 by default) 沿着计算均值和标准差的轴。如果是0,独立的标准化每个特征,如果是1则标准化每个样本(即行) with_mean boolean, True by default 如果是True,缩放之前先中心化数据 with_std boolean, True by default 如果是True,以单位方差法缩放数据(或者等价地,单位标准差) copy boolean, optional, default True False:原地执行行标准化并避免复制(如果输入已经是一个numpy数组或者scipy.sparse CSC矩阵以及axis是1)
preprocessing.scale()函数详解
最新推荐文章于 2025-02-20 10:35:28 发布