📜  python代码示例中的特征缩放

📅  最后修改于: 2022-03-11 14:46:19.456000             🧑  作者: Mango

代码示例1
from sklearn.preprocessing import MinMaxScaler
scaler = MinMaxScaler()
from sklearn.linear_model import Ridge
X_train, X_test, y_train, y_test = train_test_split(X_data, y_data,
                                                   random_state = 0)

X_train_scaled = scaler.fit_transform(X_train)
X_test_scaled = scaler.transform(X_test)