如何在matlab中进行weka分类器的拆分百分比 hi有以下代码,但我无法获得拆分百分比它显示错误
javaaddpath('weka.jar');
import weka.core.Instances.*
import weka.classifiers.functions.supportVector.*
%import weka.core.converters.ConverterUtils$DataSource.*
filename = 'c.arff';
filename1 = 'ctest.arff';
cross='10';
reader = javaObject('java.io.FileReader', filename);
data = javaObject('weka.core.Instances', reader);
if (data.classIndex() == -1) % -1 means that it is undefined
data.setClassIndex(data.numAttributes() - 1);
end
c = weka.classifiers.functions.SMO();
c.setC(100);
k = weka.classifiers.functions.supportVector.Puk();
k.setOmega(1.0);
k.setSigma(1.0);
c.setKernel(k);
c.buildClassifier(data); %% "data" here is the training data
% evaluate model (simple evaluation over training set)
ev = weka.classifiers.Evaluation(data); % "data" here is the test data
v(1) = java.lang.String('-t');
v(2) = java.lang.String(filename);
v(3) = java.lang.String('-T');
v(4) = java.lang.String(filename1);
v(5) = java.lang.String('-split-percentage');
v(6) = java.lang.String('80');
v(7) = java.lang.String('-i');
params = cat(1,v(1:end));
ev.evaluateModel(c, params)