sklearn.utils.sparsefuncs.mean_variance_axis

sklearn.utils.sparsefuncs.mean_variance_axis(X, axis)

源码

计算CSR或CSC矩阵上沿轴的均值和方差

参数 说明
X CSR or CSC sparse matrix, shape (n_samples, n_features)
输入数据
axis int (either 0 or 1)
设置沿哪个轴进行计算
返回值 说明
means float array with shape (n_features,)
Feature-wise的平均值
variances float array with shape (n_features,)
Feature-wise的方差