Guest User

Untitled

a guest
May 21st, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. from sklearn.ensemble import GradientBoostingRegressor
  2.  
  3. # Create the model
  4. gradient_boosted = GradientBoostingRegressor()
  5.  
  6. # Fit the model on the training data
  7. gradient_boosted.fit(X, y)
  8.  
  9. # Make predictions on the test data
  10. predictions = gradient_boosted.predict(X_test)
  11.  
  12. # Evaluate the model
  13. mae = np.mean(abs(predictions - y_test))
  14.  
  15. print('Gradient Boosted Performance on the test set: MAE = %0.4f' % mae)
Add Comment
Please, Sign In to add comment