I added the Weka.jar file to my environment variables and can already loadARFF files into Matlab and read the instances. Now I would like to perform batch attribute selection on a set of training and testing pairs of files but I cannot seem to find any tutorials on how to do that from Matlab.
I do not want to do it through weka command line because I have a set of 15 training files, and 15 test files for only one trial (and I have many trials with different ARFF files) hence I wanted to loop through them fast from Matlab.
Your help will be highly appreciated 🙂 thanks!
Two things:
First, if you are in the MATLAB Desktop (the MATLAB console) and you preface your command with an exclamation point (!) then you can run command-line arguments. This works in scripts (.m MATLAB files) too.
Ex:
What this means is that the things you can do in a terminal (like from this tutorial), you should be able to do in MATLAB.
Second, you can access Java libraries from MATLAB. You can access functions from
weka.attributeSelectionby importing it into your MATLAB workspace and then using the methods you need as you would do in java. For example, here’s a .m file written by Matthew Dunham that imports a weka library (weka.core.converters.ArffLoader) and uses it in a .m file: