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$
2
  • $\begingroup$ Working for me. Using python 3.5 installed with anaconda. $\endgroup$ Commented Dec 23, 2016 at 8:26
  • $\begingroup$ Which version of sklearn are you using ? $\endgroup$
    – enterML
    Commented Dec 23, 2016 at 10:27

1 Answer 1

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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