Evaluation of Generalized Linear Model in Machine Learning

1 次查看(过去 30 天)
Hi,I have this line of code which help to fit a normal distribution curve over my predictors.The problem is I have searched through whole of the GLM page and could not find the appropriate function which would enable to find the RMSE of my model. Further more I was looking for appropriate function that would give the error obtained from the testing set. Do it have to call the predict method manually, is there a more automatic process for it. Thanks.
mdl = GeneralizedLinearModel.stepwise(X,Y,'linear','distr','normal')

采纳的回答

Star Strider
Star Strider 2014-5-26
Probably the easiest way:
r = mdl.Residuals.Raw
RMSE = sqrt(mean(r.^2));
  3 个评论
Motiur
Motiur 2014-5-26
Is there a general formula for finding R-squared using the raw residuals.I want to find R-squared and RMSE for ensemble methods; and at the end compare with the linear model and GLM.
Star Strider
Star Strider 2014-5-26
Yes. See the documentation for Coefficient of Determination (R-Squared) for calculation details.
SSR is the regression sum of squares, the sum of squared deviations of the fitted values from their mean.
SSE is the sum of squared errors (residuals).
SST is the total sum of squares, the sum of squared deviations of y from mean(y).
These are probably easy to code, possibly with an ‘anonymous function’. (I haven’t coded them because I get them from the functions.) I suggest you get them from the structures returned by the functions, and store them in a ‘.mat’ file for future reference if you’re going to be using them more than once.

请先登录,再进行评论。

更多回答(0 个)

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by