I have used the WEKA GUI Java here to do the preprocessing of the data. I would like to use the same preprocessing steps now in R.
For example, I want to load the preprocessing of MultiFilter of WEKA GUI to R. I cannot find it in RWeka.
How to load the WEKA prepreprocessing steps to R?
You can load WEKA GUI steps partially with RWeka or with Weka command line tools that are are far more extensive than the available functions in RWeka. So you can extend the RWeka with the command line commands through the system command in R. Luckily, the parameters in WEKA GUI and the WEKA commandline are the same. I recommend extracting the
weka-src.jar
withjar xf weka-src.jar
to read the source.There exist many functions for the MultiFilter
where the second allows you specify the attribute range. Otherwise, they seem to be identical.
Then you can run your first discretize filter with
and then direct its output to next
Discretize
, eventually toNumericTransform
andResample
. The command line provides fabulous instructions on the commands in the following wayand you can check them from the directory structure or the index.
RWeka
RWeka package provides the functions
and there is no NumericTransform and Remove functions. You need to use their arguments so not directly just by copy-pasting a java code from WEKA GUI. Perhaps, one solution could be use the system command and execute the Java code with it, without having to need to learn the RWeka itself. There seems to be some gap between the WEKA GUI and the R package.
Running Weka on Commandline
Even though the commands are missing through RWeka interface, you can also use the system commands in R. For example, you can run the remove command
such that
I have the following setup here so we can run Discretize with the following way.
Some useful information