gemseo / mlearning / qual_measure

# r2_measure module¶

## R2 error measure¶

The r2_measure module implements the concept of R2 measures for machine learning algorithms.

This concept is implemented through the R2Measure class and overloads the MLErrorMeasure._compute_measure() method.

The R2 is defined by

$R_2(\hat{y}) = 1 - \frac{\sum_i (\hat{y}_i - y_i)^2} {\sum_i (y_i-\bar{y})^2},$

where $$\hat{y}$$ are the predictions, $$y$$ are the data points and $$\bar{y}$$ is the mean of $$y$$.

class gemseo.mlearning.qual_measure.r2_measure.R2Measure(algo)[source]

R2 measure for machine learning.

Constructor.

Parameters

algo (MLAlgo) – machine learning algorithm.