I‘m using scaler = preprocessing.StandardScaler().fit(X)
to pre-process my feature values.
However, when it is run, there's an error saying:
AttributeError: 'module' object has no attribute 'StandardScaler'
I can successfully import preprocessing from sklearn
and use its 'scale' method:X_scaled = preprocessing.scale(X)
.
But StandardScaler
just doesn't work. Could anybody help? Thanks