0
$\begingroup$

I am using the MinMaxScaler() of sklearn to scale my features before using kmeans.I needed to find the scale used.

from sklearn import preprocessing
scaler = preprocessing.MinMaxScaler()
scaler= scaler.fit_transform(finance_features)
print scaler.scale_

However on using the line

print scaler.scale_

It shows an error saying no such attribute

$\endgroup$
  • $\begingroup$ Working for me. Using python 3.5 installed with anaconda. $\endgroup$ – SaiNageswar S Dec 23 '16 at 8:26
  • $\begingroup$ Which version of sklearn are you using ? $\endgroup$ – enterML Dec 23 '16 at 10:27
0
$\begingroup$

This is because you were importing a class as name 'scalar' and modifying it by assigning value obtained after transforming. Just change

from sklearn import preprocessing
scaler = preprocessing.MinMaxScaler()
scaled = scaler.fit_transform(finance_features)
print scaler.scale_

This should work.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.