R2 score

R2 score is a criteria for linear model.

R 2 = 1 − S S E S S T R^2 = 1 - \frac{SSE}{SST} R2=1SSTSSE

where, S S E SSE SSE is the residual sum of squares

S S E = ∑ i = 1 n ( y ^ i − y i ) 2 SSE = \sum_{i=1}^n (\hat y_i - y_i)^2 SSE=i=1n(y^iyi)2

S S R SSR SSR is the regression sum of squares

S S R = ∑ i = 1 n ( y ^ i − y ˉ i ) 2 SSR = \sum_{i=1}^n (\hat {y}_i - \bar y_i)^2 SSR=i=1n(y^iyˉi)2

S S T SST SST is the total sum of squares

S S T = ∑ i = 1 n ( y i − y ˉ i ) 2 = S S E + S S R SST = \sum_{i=1}^n(y_i - \bar y_i)^2 = SSE + SSR SST=i=1n(yiyˉi)2=SSE+SSR

R 2 R^2 R2 in [ 0 , 1 ] [0,1] [0,1], the closer 1 1 1, the better the model.

R 2 R^2 R2 can be calculated from

R 2 = 1 − ∑ i = 0 n ( y i − y ^ i ) 2 / n ∑ i = 0 n ( y i − y ˉ i ) 2 / n = 1 − M S E V a r R^2 = 1 - \frac{\sum_{i=0}^n (y_i - \hat y_i)^2 / n}{\sum_{i=0}^n (y_i - \bar y_i)^2 / n} = 1 - \frac{MSE}{Var} R2=1i=0n(yiyˉi)2/ni=0n(yiy^i)2/n=1VarMSE

你可能感兴趣的:(数学)