daily pastebin goal
0%
SHARE
TWEET

Untitled

a guest Jan 24th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from sklearn.ensemble import GradientBoostingClassifier
  2.  
  3. X_train, X_test, y_train, y_test = train_test_split(X, y, random_state = 0)
  4.  
  5. clf = GradientBoostingClassifier(random_state = 0)
  6. clf.fit(X_train, y_train)
  7.  
  8. print('Breast cancer dataset (learning_rate=0.1, max_depth=3)')
  9. print('Accuracy of GBDT classifier on training set: {:.2f}'
  10.      .format(clf.score(X_train, y_train)))
  11. print('Accuracy of GBDT classifier on test set: {:.2f}\n'
  12.      .format(clf.score(X_test, y_test)))
  13.      
  14. clf = GradientBoostingClassifier(learning_rate = 0.01, max_depth = 2, random_state = 0)
  15. clf.fit(X_train, y_train)
  16.  
  17. print('Breast cancer dataset (learning_rate=0.01, max_depth=2)')
  18. print('Accuracy of GBDT classifier on training set: {:.2f}'
  19.      .format(clf.score(X_train, y_train)))
  20. print('Accuracy of GBDT classifier on test set: {:.2f}'
  21.      .format(clf.score(X_test, y_test)))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top