I have my confusion matrix as C.mat
8263 20 39 2 3826 14 43 7 4431
My predicted class labels are Ypred and actual labels are Ytest. Ypred size is 16000*1 and Ytest 16000*1.
I am trying to calculate the R-squared and RMSE. Is there a way to directly calculate RMSE and R-squared from the confusion matrix?
I tried this:
RMSE = sqrt(immse(Ypred, Ytest))
However, it didn't work.
I can use either R or Matlab.
Any advice will be appreciated!