liveBook · Manning

Coefficient of determination

Also called ℝ2, R-squared

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 9 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
Uses R² to communicate regression fit and assess predictive models alongside other diagnostics.
How deep it goes
Defines and interprets R² and adjusted R², then places them within a broader diagnostic workflow.
Examples
Illustrates R² with house prices and daily rat sightings, and assigns a product-margin prediction exercise.
What you can do after
Evaluate and understand regression fit by interpreting R² alongside complexity and residual diagnostics.

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 regression models explain when investigating product attributes and shipping costs.
How deep it goes
Defines explained variation and interprets calculated R² values alongside prediction errors and model summaries.
Examples
Compares freight-value models using product weight, product volume, and both attributes together.
What you can do after
Evaluate regression results by interpreting R² with prediction errors and recognizing that low values can still be informative.

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 →

Vibe Engineering

A regression metric, also called R-squared or R², measuring the proportion of target variance explained by a model.

How it is used
Uses explained target variation to judge whether a regression model learned meaningful pricing structure.
How deep it goes
Defines R², gives its 0-to-1 interpretation, and stops short of treating it as sufficient without error metrics and plots.
Examples
Uses a Random Forest drug-price estimator with R² = 0.3744, MAE = 77.50 INR, and RMSE = 179.69 INR.
What you can do after
Evaluate regression models by combining explained variance with typical error, large-error sensitivity, and visual residual evidence.

Read how Vibe Engineering 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 →

Build AI Drug Discovery Pipelines

R2 is the coefficient of determination measuring the proportion of target variance explained by a fitted model.

How it is used
Evaluates regression fit and helps screen predictive QSAR models alongside unseen-data performance.
How deep it goes
Defines the metric, gives its equation and limitations, and applies it through linear-regression and QSAR evaluation.
Examples
Uses logP-based solubility regression and small-molecule ligand QSAR model screening with R² and Q² thresholds.
What you can do after
Evaluate regression fit, recognize feature-count inflation, and distinguish training performance from predictive performance.

Read how Build AI Drug Discovery Pipelines 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 →

Also covered in

What to know first

Related concepts

Questions about coefficient of determination

What is 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.

Which Manning books explain coefficient of determination?

Effective Data Analysis, Statistics Every Programmer Needs, Starting Data Analytics with Generative AI and Python, Causal Inference for Data Science, Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI, Vibe Engineering, Ensemble Methods for Machine Learning, Build AI Drug Discovery Pipelines and 1 more.

What should I know before learning coefficient of determination?

Manning books that teach coefficient of determination usually introduce independent variable, normal distribution, anomaly and histogram first.

What is the difference between coefficient of determination and Q2?

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. Q2 is a predictive-performance metric analogous to R2 but calculated on held-out test data.

What kinds of coefficient of determination are there?

Kinds of coefficient of determination include adjusted r-squared.

What is coefficient of determination a kind of?

Coefficient of determination is a kind of fit-quality metric. A metric that evaluates how well a model fits its training data or observed outcomes.

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.