这种情况下,可以使用robust_scale和RobustScaler。 sklearn.preprocessing.robust_scale(X, axis=0, with_centering=True, with_scaling=True, quantile_range=(25.0, 75.0), copy=True)[source] class sklearn.preprocessing.RobustScaler(with_centering=True, with_scaling=True, quantile_range=(25.0, 75.0), copy...
import pandas as pd from sklearn import preprocessing import matplotlib.pyplot as plt from sklearn.datasets import make_moons import matplotlib.pyplot as plt %matplotlib inline # 导入数据 data = make_moons(n_samples=200, noise=10)[0] #Z-Score标准化 #建立StandardScaler对象 zscore = preprocessing...