from sklearn.preprocessing import MinMaxScaler
# initialize min-max scaler
mm_scaler = MinMaxScaler()
temp1_df = train_df.copy()
column_names = temp1_df.columns.tolist()
# transform all attributes
temp1_df[column_names] = mm_scaler.fit_transform(temp1_df[column_names])
temp1_df.sort_index(inplace=True)
temp1_df.head()
对数据进行标准化
最新推荐文章于 2023-01-13 15:36:15 发布