SHARE
TWEET

Untitled

a guest Mar 20th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. k=10;
  2. cp = classperf(groups);
  3. cvFolds = crossvalind('Kfold', groups, k);  
  4. for i = 1:k                                
  5.  testIdx = (cvFolds == i);                %# get indices of test instances
  6.  trainIdx = ~testIdx;                     %# get indices training instances
  7.  svmModel = fitcsvm(data(trainIdx,:), groups(trainIdx),
  8. 'Standardize',true,'KernelFunction','RBF','KernelScale','auto');
  9.  pred = predict(svmModel, meas(testIdx,:));
  10.  cp = classperf(cp, pred, testIdx);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top