Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Data Science by (17.6k points)

I have a dataset with 8 dependent variables (2 categorical data). I have applied ExtraTreeClassifier() to eliminate some of dependent variables. I had also feature scale the X,y .

 from sklearn.preprocessing import StandardScaler

 sc = StandardScaler()

 X = sc.fit_transform(X)

 X = sc.transform(X)

 y = sc.fit_transform(y)

 y = sc.transform(y)

And after this I have split the dataset like

from sklearn.cross_validation import train_test_split

X_train, X_test, y_train, y_test = train_test_split(X_new, encoded2, 

test_size = 0.25, random_state = 0)

And now I am applying DecisionTreeRegressor algorithm for prediction. But I want to the actual prediction (right now I am getting scaled value). How to do that? Is there any other approach to do it? Because the way I have done is giving RMSE = 0.02 and if I am not feature scaling dependent variable RMSE = 18.4. Please suggest how to solve this kind of problem.

1 Answer

0 votes
by (41.4k points)

Scaling of target variable(y)  is not required.But if you still need to scale it, there is an inverse_transform function in StandardScaler and various other preprocessing techniques with the help of which we can get the original values. 

inverse_transform(X[, copy])

Scale back the data to the original representation.

Browse Categories

...