Created
May 16, 2018 19:48
-
-
Save WillKoehrsen/b6d38b4e020ebe0b45ae24901730287c 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
from sklearn.ensemble import GradientBoostingRegressor | |
# Create the model | |
gradient_boosted = GradientBoostingRegressor() | |
# Fit the model on the training data | |
gradient_boosted.fit(X, y) | |
# Make predictions on the test data | |
predictions = gradient_boosted.predict(X_test) | |
# Evaluate the model | |
mae = np.mean(abs(predictions - y_test)) | |
print('Gradient Boosted Performance on the test set: MAE = %0.4f' % mae) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment