Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- xgb_clf = xgb.XGBClassifier(n_estimators=1000,
- learning_rate=0.01,
- max_depth=3,
- subsample=0.8,
- colsample_bytree=1,
- gamma=1,
- objective='binary:logistic',
- scale_pos_weight = 10)
- y_score_xgb = cross_val_predict(estimator=xgb_clf, X=X, y=y, method='predict_proba', cv=5)
- plot_calibration_curves(y_true=y, y_prob=y_score_xgb[:,1], n_bins=10)
- calibrated = CalibratedClassifierCV(xgb_clf, method='sigmoid', cv=5)
- y_score_xgb_clb = cross_val_predict(estimator=calibrated, X=X, y=y, method='predict_proba', cv=5)
- plot_calibration_curves(y_true=y, y_prob=y_score_xgb_clb[:,1], n_bins=10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement