Evaluation of Generalized Linear Model in Machine Learning
1 view (last 30 days)
Show older comments
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')
0 Comments
Accepted Answer
Star Strider
on 26 May 2014
Probably the easiest way:
r = mdl.Residuals.Raw
RMSE = sqrt(mean(r.^2));
3 Comments
Star Strider
on 26 May 2014
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.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!