3

I recently updated my sklearn. However, since the upgrade I'm getting the error "'StandardScaler' object has no attribute '_validate_data'". The following is a snippet of the code:

Xs = pd.DataFrame([[10,20], [20,30], [30,40], [40,50]])
scalerx = preprocessing.StandardScaler()
scalerx.fit(Xs)

1 Answers1

0

You can scale the data frame using

from sklearn.preprocessing import StandardScaler

Xs = pd.DataFrame([[10,20], [20,30], [30,40], [40,50]])
scalerx = StandardScaler()
X = scalerx.fit_transform(Xs.values)
Furqan Hashim
  • 1,304
  • 2
  • 15
  • 35