Accuracy measures the share of classification predictions that match their true labels. It gives a direct answer to a practical question: how often is the model correct? section 3.3.1
Use accuracy as a standard measure for balanced binary or multiclass problems, especially when classes have approximately equal sample sizes. For uneven classes, ROC-AUC or average precision may be more suitable. section 4.3
A practical evaluation workflow is:
- Choose accuracy as the classification evaluation metric. section 4.3
- Measure it consistently with cross-validation rather than relying on a single split. section 4.1 section 4.3
- Report the average and standard deviation across folds to reveal both typical performance and variation between samples. section 4.3
Comparing classification models
For the Airbnb NYC price-classification problem, XGBoost produced test accuracy between 79% and 81%, while the Keras model produced 80% to 81%. The similar accuracy did not imply identical operating choices: XGBoost trained in roughly 3–4 seconds, compared with 10–15 seconds for Keras without a Colab GPU. section 3.3.1
y_pred = model.predict(xgb_X_test)
xgb_predictions = [round(value) for value in y_pred]
xgb_accuracy = accuracy_score(test.target, xgb_predictions)
print("Accuracy: %.2f%%" % (xgb_accuracy * 100.0))
Inspect a compact Python pattern that rounds classification predictions, computes accuracy with accuracy_score, and prints the result as a percentage. section 3.3.1































