Created
January 28, 2020 10:33
-
-
Save lakshay-arora/3e9394fb4453d1e783114724068af9d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create an object of the RandomForestRegressor | |
model_RFR = RandomForestRegressor(max_depth=10) | |
# fit the model with the training data | |
model_RFR.fit(train_x, train_y) | |
# predict the target on train and test data | |
predict_train = model_RFR.predict(train_x) | |
predict_test = model_RFR.predict(test_x) | |
# Root Mean Squared Error on train and test data | |
print('RMSE on train data: ', mean_squared_error(train_y, predict_train)**(0.5)) | |
print('RMSE on test data: ', mean_squared_error(test_y, predict_test)**(0.5)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment