Options
"how to write my JAVA application by learning the XML from RM"
Hi, I am beginning to integrate RM into my own application.
First of all, I want to implement the following by java codes,
Thank you very much.
First of all, I want to implement the following by java codes,
This is what I know:
<operator name="Root" class="Process" expanded="yes">
<operator name="ArffExampleSource" class="ArffExampleSource">
<parameter key="data_file" value="../data/iris.arff"/>
<parameter key="label_attribute" value="class"/>
</operator>
<operator name="SimpleValidation" class="SimpleValidation" expanded="yes">
<operator name="NaiveBayes" class="NaiveBayes">
</operator>
<operator name="ApplierChain" class="OperatorChain" expanded="yes">
<operator name="Test" class="ModelApplier">
<list key="application_parameters">
</list>
</operator>
<operator name="Performance" class="Performance">
</operator>
</operator>
</operator>
</operator>
Of course, it does not work. How could I really make the application run? That is, inputting data, validating naive bayes, and then outputting the accuracy?
RapidMiner.init();
//read the data
Operator inputData = OperatorService.createOperator(ArffExampleSource.class);
inputData.setParameter("data_file", "C:/data/iris.arff");
inputData.setParameter("label_attribute", "class");
IOContainer container = inputData.apply(new IOContainer());
//build the model
OperatorChain simpleValidate =
(OperatorChain) OperatorService.createOperator("SimpleValidation");
OperatorChain applierChain =
(OperatorChain) OperatorService.createOperator("ApplierChain");
Operator naiveBayes = OperatorService.createOperator("NaiveBayes");
Operator test = OperatorService.createOperator("ModelApplier");
Operator performance = OperatorService.createOperator("Performance");
applierChain.addOperator(test);
applierChain.addOperator(performance);
simpleValidate.addOperator(naiveBayes);
simpleValidate.addOperator(applierChain);
Thank you very much.
0
Answers
There is a file called "rapidminer-<version>-tutorial.pdf" which you download from the rapidminer page at sourceforge (http://sourceforge.net/projects/yale/files/). In this you can find a chapter "Integrating RapidMiner into your application" where everything is explained.
If you have further questions, do not hesitate to ask.
regards,
Steffen
Thanks a lot for the reply. I have found the tutorial, and it is very helpful.
I build a complete process. However, I do not know how to get the value of the testing result (not from the console).
For example, The accuracy is stored in PerformanceVector, but how to println this double value?
Sincerely yours,
gfyang
regards,
Steffen