The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
"[SOLVED] Integrating RapidMiner into Java Application - Beginner's Questions"
Dear all,
i just started to work with RapidMiner some days ago. I'd like to integrate RM into an existing Java Application, which offers all data I need for the classification task in RM. So, I created an ExampleSet within my Java Application according to the last section in http://rapid-i.com/wiki/index.php?title=Integrating_RapidMiner_into_your_application.
I know that I have to model my process within the RM GUI and export it as XML file which can be passed to RM later in my Java Application. My question is how to model the data import in RM GUI. What should I insert instead of my Retrieve Operator (from repository), so that I can add my ExampleSets directly from my Java Application into the operators.
Thanks in advance.
Best regards
Merlot
i just started to work with RapidMiner some days ago. I'd like to integrate RM into an existing Java Application, which offers all data I need for the classification task in RM. So, I created an ExampleSet within my Java Application according to the last section in http://rapid-i.com/wiki/index.php?title=Integrating_RapidMiner_into_your_application.
I know that I have to model my process within the RM GUI and export it as XML file which can be passed to RM later in my Java Application. My question is how to model the data import in RM GUI. What should I insert instead of my Retrieve Operator (from repository), so that I can add my ExampleSets directly from my Java Application into the operators.
Thanks in advance.
Best regards
Merlot
Tagged:
0
Answers
you can draw a line (or several) from the input port(s) to your data. Then you can just hand over these IOObjects when you execute the process. See here for details.
Regards,
Marco
sometimes, it can be so simple.
Thank you!
Regards
Merlot
i got my next problem. ;D
I managed to get my code working with an ExampleSet which uses double values only: Now, I want to use a String attribute instead of a double attribute, but there seems to be no DataRow implementation for String attributes.
The solution might be as simple as the solution for my first beginner's question. It would be very nice if you could help me again.
Regards
Merlot
use DataRowFactory class http://rapid-i.com/api/rapidminer-5.1/com/rapidminer/example/table/DataRowFactory.html it can handle Object array, so it can be combined - number and string together.
Cheers,
Vaclav
thank you very much.
Now, I got managed to make RapidMiner working in my own Java Application. My next step was to separate the steps "generate model" and "apply model". Using a ModelWriter, I am able to store a model learned with labeled training data on my hard disk. Now I want to apply this stored model to unlabeled test data. So I created another process within the GUI and stored it as xml File.
I assume that I have to connect the model input port of my "Apply Model" operator to the second Main process input port in RM GUI to access the stored model. Is it right?
How do I load the model into RM within my Java Source Code? I found a ModelLoader, but don't know how to use it properly.* Are there any source code examples available? (More generelly, are there tutorials or instructions on how to integrate RM in Java Applications as I had to do quite a lot of research to find all pieces I needed to integrate RM.)
* All Google results I found on this topic refer to RapidMiner 4. I am looking for a code example working with RM 5's API.
Thanks to all of you having a look at my beginner's questions.
Regards
Merlot
EDIT: I found another way to realize the model import. I created a "read model" operator in RM GUI and set the model's filename as fixed parameter. So I don't need to set the filename in my Java source code. Nevertheless, I'm interested on how to set the model's filename directly in the Java source code.
if you have model in some file, first read it: than you can pass it to RM - http://rapid-i.com/rapidforum/index.php/topic,4312.0.html
Some more codes are here - http://rapid-i.com/rapidforum/index.php/topic,3596.msg13398.html
Cheers
Vaclav
I didn't try your solution as I save my model in the respository now. Nervertheless, thank you very much!
Cheers
Merlot