Coefficient of determination (R2) - Fundamentals of Machine Learning

Chris 25 Reputation points
2024-03-05T17:51:54.6833333+00:00

Hello

I would like to understand from where this ȳ is coming from in the R2 formula.(R2 = 1- ∑(y-ŷ)2 ÷ ∑(y-ȳ)2)

In the example of ice cream selling, I understood that it corresponds to the mean of actual label values (= the mean of the actual sales). So is it 121/6 = 20.16666? is this the right calculation?

Cause on my calculations, I found 0.96 whereas you stated 0.95 (In the case of the ice cream regression model, the R2 calculated from the validation data is 0.95.)

Thanks

Christophe Ristevski

Azure | Azure Training
{count} votes

Accepted answer
  1. Rakesh Gurram 15,715 Reputation points Microsoft External Staff Moderator
    2024-03-06T08:02:50.3133333+00:00

    Hi Chris,

    Thanks for reaching out to us on Microsoft Q&A forum.

    From the given formula R2 = 1- ∑(y-ŷ)2 ÷ ∑(y-ȳ)2

    Where y = actual values, ŷ= predicted values, ȳ= mean of actual values = 121/6 = 20.16666 (Yes, you calculated correctly).

    User's image

    R2 = 1- ∑(y-ŷ)2 ÷ ∑(y-ȳ)2

    R2 = 1- 36 / 740.8336

    R2 = 1-0.04859391

    R2= 0.951

    So, R2 = 0.95 the validation value was correct as per the Learn Path document.

    I hope you understand! Thank you.


    If the information is helpful, please Accept Answer so that it would be helpful to community members.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.