使用标准化 (StandardScaler()) 时,在训练集上使用fit_transform(),在测试集上使用transform()

scaled_train = (train - train_mean) / train_std_deviation

scaled_test = (test - train_mean) / train_std_deviation

https://sebastianraschka.com/faq/docs/scale-training-test.html
https://blog.csdn.net/q2972112/article/details/122137480

你可能感兴趣的:(Notebook,python)