How to load two ARFF file in Matlab?

5 次查看(过去 30 天)
afef
afef 2017-4-24
I want to load ARFF file to matlab and i find this function
function wekaOBJ = loadARFF(filename)
import weka.core.converters.ArffLoader;
import java.io.File;
loader = ArffLoader();
loader.setFile(File('train.arff'));
wekaOBJ = loader.getDataSet();
wekaOBJ.setClassIndex(wekaOBJ.numAttributes -1);
end
But when i try to load 2 ARFF files with this code i only get the last file.How can i solve this ?
function wekaOBJ = loadARFF(filename)
import weka.core.converters.ArffLoader;
import java.io.File;
loader = ArffLoader();
loader.setFile(File('train.arff'));
wekaOBJ = loader.getDataSet();
wekaOBJ.setClassIndex(wekaOBJ.numAttributes -1);
loader = ArffLoader();
loader.setFile(File('test.arff'));
wekaOBJ = loader.getDataSet();
wekaOBJ.setClassIndex(wekaOBJ.numAttributes -1);
end

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by