Skip to content

Instantly share code, notes, and snippets.

@WillKoehrsen
Created May 16, 2018 19:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WillKoehrsen/b6d38b4e020ebe0b45ae24901730287c to your computer and use it in GitHub Desktop.
Save WillKoehrsen/b6d38b4e020ebe0b45ae24901730287c to your computer and use it in GitHub Desktop.
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