Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MinMaxScaler inverse_transform diferente size array

So I have a Scaler:

scaler = MinMaxScaler(feature_range=(0, 1))

that has 9 columns, where column 0 is my Y, and i use my scaler to work all columns.

When I make the predict:

yhat = model.predict(test_X)

I want to use the same scaler so I can transform back my values to normal, but now my output only has 1 column, and my scaler has 9 and this is a problem.

So what I am hopping to find is a way where I can do something like, grab the scaler and tell him "inverse_transform using the [0] column to work my prediction out."

Is there a way to do this?

Or the only way is to do other Scaler for my Y column and use it?

like image 719
saga56 Avatar asked Oct 12 '25 04:10

saga56


1 Answers

You can combine the new predicted y value with the x value,get a 9 column matrix and scale it back.But it would be just easier to use two different instances of MinmaxScaler for x and y , so that you can just scale the predicted output back by in-versing the scale for y.

like image 168
kerastf Avatar answered Oct 14 '25 17:10

kerastf