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!