liveBook · Manning

Coefficient of determination

As explained in Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI

R-squared is a goodness-of-fit metric measuring the proportion of variance in the target explained by a predictive model.

The coefficient of determination, usually written as R-squared, measures how much of the target's variance a predictive model captures. Use it as a goodness-of-fit signal, not as a complete model diagnosis. section 7.2.3

Evaluate R-squared on cross-validation predictions to see how consistently a model performs across validation subsets. Pair it with error metrics and prediction plots before deciding whether the fit is useful. section 7.2.3

Tokyo Airbnb baseline

A linear-regression baseline produced an R-squared of 0.320, with RMSE of 17,197 and MAE of 12,568 Yen. Its predictions followed a flat trend away from the ideal-fit line, indicating underfitting; a few predictions were also negative, which is infeasible for listing prices. section 7.2.3

Comparing models

For the same Tokyo Airbnb problem, XGBoost reached R-squared 0.599 while fastai reached 0.572. Comparing R-squared alongside RMSE and MAE showed XGBoost performing better across all three measures. section 12.4

How Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI covers it

How deep it goes
Defines variance captured, calculates the metric in Python, and interprets it alongside plots and error metrics; it stops short of mathematical derivation.
Examples
Uses Tokyo Airbnb linear-regression predictions, diagnostic plots, outlier checks, and an XGBoost-versus-fastai metric table.
What you can do after
Evaluate model fit and compare regressors using R-squared together with RMSE, MAE, cross-validation predictions, and diagnostic plots.
How it connects
Connects R-squared with cross-validation, linear regression, underfitting, overfitting, RMSE, MAE, and prediction diagnostics.

Also explained in

Compare how 7 books explain coefficient of determination →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI. The section links point to the parts of the book it draws on.