df =
df_train_x.head()
Out[43]:
longevity_endfy18 ... memc_err_law
1029 9 ... 0
79 9 ... 0
1464 9 ... 0
2620 3 ... 0
808 3 ... 0
type(df_train_x)
Out[44]: pandas.core.frame.DataFrame
normalizer = preprocessing.StandardScaler.fit(df_train_x)
trainx_norm = normalizer.transform(df_train_x)
testx_norm = normalizer.transform(df_test_x)
我正在尝试应用standardscaler并收到此错误:
normalizer = preprocessing.StandardScaler.fit(df_train_x)
TypeError: fit() missing 1 required positional argument: 'X'
在使用Keras的过程中,我从未想到这将是最困难的部分。我看了很多例子,看不出有什么问题。
答案 0 :(得分:2)
StandardScaler
后缺少括号。
normalizer = preprocessing.StandardScaler().fit(df_train_x)