You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to compute R-Squared from predicted and actual values, the results from R2_Score() did not match other methods. (they were very large and negative).
Here is some R-Code to reproduce this issue:
`x = rnorm(20)
y = rnorm(20)
test = lm(y~x)
summary(test)
y_pred = predict(test)
When trying to compute R-Squared from predicted and actual values, the results from R2_Score() did not match other methods. (they were very large and negative).
Here is some R-Code to reproduce this issue:
`x = rnorm(20)
y = rnorm(20)
test = lm(y~x)
summary(test)
y_pred = predict(test)
MLmetrics
R2_Score(y, y_pred)
squared correlation
cor(y_pred, y)^2
sums of squares formula
PRESS = sum((y - y_pred)^2)
SS = sum((y - mean(y))^2)
1 - (PRESS/SS)`
The text was updated successfully, but these errors were encountered: