liveBook · Manning

Coefficient of determination

The coefficient of determination, or R-squared, is a regression metric measuring the proportion of target variation explained by a fitted model relative to a mean-value baseline.

How 7 Manning books explain it

Effective Data Analysis

R2 is the proportion of variation in an outcome explained by a fitted regression model relative to a baseline model.

How it is used
Communicates how much outcome variation a fitted regression model explains, especially when presenting its fit to stakeholders.
How deep it goes
Defines and interprets R² in model summaries and contrasts it with adjusted R², without deriving a formula.
Examples
Interprets R² values of 0.836 for house prices and 0.588 for daily rat-sighting calls.
What you can do after
Evaluate/understand a regression model’s explained variation while checking other metrics and residuals before judging its fit.

Read how Effective Data Analysis explains coefficient of determination →

Statistics Every Programmer Needs

The coefficient of determination, commonly denoted R-squared, is a regression metric measuring the proportion of dependent-variable variance explained by a fitted model.

How it is used
Assesses how much observed response variation a linear regression explains and helps compare models fitted to the same data.
How deep it goes
Derives R² from explained and total sums of squares, works through a Python calculation, and cautions against judging fit from one statistic.
Examples
Uses runners’ Stage 1 and Stage 2 split times, a fitted regression line, and NumPy sums of squares yielding R² ≈ 0.575.
What you can do after
Evaluate/understand it by calculating R² from fitted values and observed responses, interpreting explained variation, and checking whether other diagnostics support the fit.

Read how Statistics Every Programmer Needs explains coefficient of determination →

Starting Data Analytics with Generative AI and Python

R2 is the proportion of variance in a dependent variable explained by a regression model's independent variables.

How it is used
Assesses how much variation in shipping costs regression inputs explain when comparing models based on product weight and volume.
How deep it goes
Defines variance explained and calculates R2 in Python, but does not derive its formula.
Examples
Compares freight-value models using weight, volume, and both together; also considers a retention-campaign result.
What you can do after
Evaluate/understand it to compare regression results without mistaking explained variation for precise individual predictions.

Read how Starting Data Analytics with Generative AI and Python explains coefficient of determination →

Causal Inference for Data Science

R squared is the coefficient of determination measuring the proportion of outcome variation explained by a model.

How it is used
Uses R squared to compare predictive fit while warning that fit alone cannot guide redesigned or intervention-driven settings.
How deep it goes
Explains model comparison with synthetic data and predictions, but stops short of treating R squared as evidence of causal usefulness.
Examples
Compares bonuses-only and bonuses-plus-ghosts regressions using synthetic Pac-Man level data and counterfactual-looking predictions.
What you can do after
Evaluate predictive models by comparing R squared with predictions under redesigned combinations of variables.

Read how Causal Inference for Data Science explains coefficient of determination →

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.

How it is used
Uses cross-validation predictions to assess model fit, compare approaches, and expose underfitting or overfitting.
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.

Read how Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI explains coefficient of determination →

Ensemble Methods for Machine Learning

The coefficient of determination, or R² score, is a regression metric measuring the proportion of target variance explained by a model relative to a constant-mean baseline.

How it is used
Evaluates regression models and helps select decision-tree depth using training and test performance.
How deep it goes
Defines R² through RSS and TSS, explains negative scores, and demonstrates repeated validation without deriving the statistic further.
Examples
Uses Friedman-1 data, tree depths from 1 through 10, five random splits, and a scikit-learn validation curve.
What you can do after
Evaluate regression models with R² and identify generalization problems by comparing averaged training and test scores.

Read how Ensemble Methods for Machine Learning explains coefficient of determination →

Statistics Slam Dunk

R2, or the coefficient of determination, is the proportion of variation in a response explained by a regression model.

How it is used
Evaluates how much variation in NBA regular-season wins a regression model explains.
How deep it goes
Defines R² and adjusted R², interprets output, and stops short of deriving their formulas.
Examples
Uses an NBA wins model, broom output, fitted wins, and an average absolute error of 8.27 wins.
What you can do after
Evaluate regression fit with broom’s glance() output and distinguish raw R² from adjusted R².

Read how Statistics Slam Dunk explains coefficient of determination →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.