code_9.py 296 字节
Newer Older
ToTensor's avatar
ToTensor 已提交
1 2 3 4
from sklearn.preprocessing import Min Max Scaler # 导入数据缩放器
scaler = Min Max Scaler() # 选择归一化数据缩放器Min Max Scaler
X_train = scaler.fit_transform(X_train) # 特征归一化训练集fit_transform
X_test = scaler.transform(X_test) # 特征归一化测试集transform