Create the Scaler object
scaler = preprocessing.StandardScaler()
Fit your training data on the scaler object
scaled_X_train = scaler.fit_transform(training_data)
scaled_X_train = pd.DataFrame(scaled_X_train, columns = training_data.columns)
scaled_X_train.head()
Train your model here
Fit your testing data on the scaler object
scaled_X_test = scaler.fit_transform(testing_data)
scaled_X_test = pd.DataFrame(scaled_X_test, columns = testing_data.columns)
scaled_X_test.head()
Predict on test data using the trained model and the scaled test data
If y_test_actual is the scaled actual y &
If y_test_predicted is the scaled predicted y
Then would this be the right way to evaluate MSE, RMSE, MAE, MAPE
testing_mse = mean_squared_error(y_test_actual, y_test_predicted, squared=True)
testing_rmse = mean_squared_error(y_test_actual, y_test_predicted, squared=False)
testing_mae = mean_absolute_error(y_test_actual, y_test_predicted)
testing_mape = mean_absolute_percentage_error(y_test_actual, y_test_predicted)
Would these metrics be the same if the model was trained without performing any scaling?
The metrics would most likely be different. My question is how to get the right metrics when performing scaling of all features including the target variable ?