liveBook · Manning

Coefficient of determination

As explained in 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.

The coefficient of determination, or R² score, measures how much variation in regression labels is predictable from features. It compares residual error with total label variation: R² = 1 − RSS/TSS. A perfect model scores 1, strong models approach 1, and sufficiently poor models can score below 0. section 1.3.1

Use R² to compare regression models while checking performance on unseen data:

  • Split examples into training and test subsets, then train models with different settings such as tree depth. section 1.3.1
  • Compute R² on both subsets; a large training score paired with weaker test performance signals overfitting. section 1.3.1
  • Repeat random splits and average scores to reduce the influence of a lucky or unlucky split. section 1.3.1

Comparing tree depths

On Friedman-1 regression data, evaluate decision trees with depths from 1 through 10. A validation curve with scikit-learn's scoring='r2' reports mean training and test scores across five ShuffleSplit runs. section 1.3.1

How Ensemble Methods for Machine Learning covers it

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 it assumes
Assumes regression datasets with features and labels, then reinforces training-test evaluation and regression-error concepts.
What you can do after
Evaluate regression models with R² and identify generalization problems by comparing averaged training and test scores.
How it connects
Connects regression with mean squared error, decision trees, train-test splits, cross-validation, and overfitting.

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 Ensemble Methods for Machine Learning. The section links point to the parts of the book it draws on.