Calculate cross validation in Generalized Linear Model
1 次查看(过去 30 天)
显示 更早的评论
This link provides example of using cvpartition and classification class to find cross validation of fisheriris data set. How is it possible to find the cross validation error for other canonical function , for example the predict for the Generalized Linear Model. The snippet of code for cross-validation of fisheriris dataset is:
load('fisheriris');
y = species;
X = meas;
cp = cvpartition(y,'k',10); % Stratified cross-validation
classf = @(XTRAIN, ytrain,XTEST)(classify(XTEST,XTRAIN,...
ytrain));
cvMCR = crossval('mcr',X,y,'predfun',classf,'partition',cp)
cvMCR =
0.0200
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Model Building and Assessment 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!