Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- k=10;
- cp = classperf(groups);
- cvFolds = crossvalind('Kfold', groups, k);
- for i = 1:k
- testIdx = (cvFolds == i); %# get indices of test instances
- trainIdx = ~testIdx; %# get indices training instances
- svmModel = fitcsvm(data(trainIdx,:), groups(trainIdx),
- 'Standardize',true,'KernelFunction','RBF','KernelScale','auto');
- pred = predict(svmModel, meas(testIdx,:));
- cp = classperf(cp, pred, testIdx);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement