Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.
[SOLVED] Classifying an input from Java Code while Loading model only once
I'm developing an app which uses RapidMiner for classification. I train the classifier time to time (e.g. daily) but I use the classifier in very high rate (250 per sec).
For this purpose, I created two Processes using RM GUI. First one trains the classifier and saves it into a model file while the second one uses it for classification.
In the second process I load the model file which the first process creates. This made it very slow since it seems that the process loads it every time I want to classify an input.
You can see the second process in the following picture:
What's the more smart way of doing this?
P.S. I think a solution is to create another process which only loads the created classifier only once and then give it to ApplyModel subprocess as another input. But I didn't find a solution for doing so in Java code.
For this purpose, I created two Processes using RM GUI. First one trains the classifier and saves it into a model file while the second one uses it for classification.
In the second process I load the model file which the first process creates. This made it very slow since it seems that the process loads it every time I want to classify an input.
You can see the second process in the following picture:
What's the more smart way of doing this?
P.S. I think a solution is to create another process which only loads the created classifier only once and then give it to ApplyModel subprocess as another input. But I didn't find a solution for doing so in Java code.
Tagged:
0
Answers
Furthermore, is there any reason why you store your model in a file system file, instead of using a RapidMiner repository? We usually suggest using Store and Retrieve instead of any of the old Read/Write operators.
What you could also do is to programatically run your training process and grab the Model object from its output, and then pass the model as the second input to your classification process, the same way as you did with the input data.
One last note: it's usually easier and more helpful to post the XML of your process instead of a screenshot. See the big red link in my signature for instructions.
Best, Marius
indeed you should only load the model once (after you created it, you don't even need a process for that) and then create a process which uses the model directly from a process input port. See here.
Also please note that your application needs to be licensed under the AGPL.
Edit: Someone was faster ;D
Regards,
Marco
Just out of curiosity: how can I do this without creating a process?
did you check the link I posted? Regards,
Marco