Why Is My R² Score Negative on the Test Set?
Calculate a negative R² by hand and in Python, then compare your model with a baseline you could actually use at prediction time.
In this category you will find interesting articles about Machine Learning and Data Science, both written by us or fished online.
We have tried to cover a wide variety of topics, and we will keep posting here regularly, so be sure to follow us!
Calculate a negative R² by hand and in Python, then compare your model with a baseline you could actually use at prediction time.
Learn GridSearchCV with a hands-on Python example. Tune a pipeline, understand cross-validation scores, and unlock the test set with practical challenges.
Build a scikit-learn pipeline for numeric and categorical data. Handle missing values, avoid leakage, and solve practical Python challenges.
Build your first machine learning project in Python. Train an Iris classifier, beat a baseline, explore ten combinations, and evaluate your model step by step.
Calculate bootstrap confidence intervals in Python and compare model errors with paired resampling. Includes tested code, a chart, and clear limitations.
Learn permutation feature importance in Python with tested code, a grouped-feature example, and a clear explanation of correlated-feature pitfalls.
Build learning curves in Python to investigate whether more training data will help. Includes tested scikit-learn code and a linear-versus-cubic comparison.
A friendly guide to probability calibration in Python, with a tested scikit-learn example, reliability diagram, and honest before-and-after results.
Choose a classification threshold using validation data, error costs and a tested Python example. Compare the trade-offs on an untouched test set.
Compare ROC AUC, PR AUC and average precision with a reproducible Python example showing how class imbalance changes precision.