scikit-learn: how to scale back the 'y' predicted result

后端 未结 2 926
情深已故
情深已故 2020-12-13 04:17

I\'m trying to learn scikit-learn and Machine Learning by using the Boston Housing Data Set.

# I splitted the initial dataset (\'housing_X\' and         


        
相关标签:
2条回答
  • 2020-12-13 04:29

    You can use inverse_transform using your scalery object:

    y_new_inverse = scalery.inverse_transform(y_new)
    
    0 讨论(0)
  • 2020-12-13 04:50

    Bit late to the game: Just don't scale your y. With scaling y you actually loose your units. The regression or loss optimization is actually determined by the relative differences between the features. BTW for house prices (or any other monetary value) it is common practice to take the logarithm. Then you obviously need to do an numpy.exp() to get back to the actual dollars/euros/yens...

    0 讨论(0)
提交回复
热议问题