27 February 2023 5 3K Report

For the same set of data, e.g.

x1=1, y1=3

x1=2, y1=2

x1=3, y1=1

  • calculated by r2_score:
  • ''' from sklearn.metrics import r2_score

    r2_score([1,2,3], [3,2,1])'''

    the result is -3

    2. plot graph in excel -- add a trendline -- right-click on your trendline -- Format Trendline --

    (1) if select the checkbox next to "Set Intercept = 0.0", the r2=-2.429

    (2) if deselect the checkbox next to "Set Intercept = 0.0", the r2=1

    3. linear regression in spss:

    the r2 and adjusted r2 is 1

    Why do the same set of data get different R2 calculated by three methods?

    More Naichi Zhang's questions See All
    Similar questions and discussions