# regression metrics rmse

import numpy as np from sklearn.datasets import make_regression from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestRegressor from sklearn.metrics import mean_squared_log_error, mean_squared_log_error, mean_absolute_percentage_error # Train a linear regression model model = RandomForestRegressor() model.fit(X_train_sscaler, y_train) #Make predictions y_pred = model.predict(X_test_sscaler) #Calculate regression metrics msle = mean_squared_log_error(y_test, y_pred) rmsle = np.sqrt(msle) mape = mean_absolute_percentage_error(y_test, y_pred) print(f"MSLE: {mse:.2f}, nRMSLE: {rmsle:.2f}, nMAPE: {mape:.2f}")