August 2019
Intermediate to advanced
342 pages
9h 35m
English
The classification report for the XGBClassifier metrics is shown in the following code:
print('classification report')print(metrics.classification_report(ytest, y_pred))print("Accuracy is :")print(metrics.accuracy_score(ytest, y_pred))print('Area under the curve : %f' % (metrics.roc_auc_score(ytest, y_pred)))classification report precision recall f1-score support 0 1.00 1.00 1.00 17030 1 0.93 0.79 0.85 33avg / total 1.00 1.00 1.00 17063Accuracy is : 0.999472542929Area under the curve : 0.893881
By comparing the AUC and F1 score values, which are calculated using the individual classifiers, XGBClassifier remains the most accurate classifier and GradientBoostingClassifier is the least accurate of the three.
Read now
Unlock full access