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
"Issue in getting the predicted label from a Java application"
Hi,
I created a classification process using Rapidminer, now I'm trying to get the predicted label from this process in my JAVA application, for that I am using the following code:
I am using the same files and data in both sides.
Thanks for any help.
I created a classification process using Rapidminer, now I'm trying to get the predicted label from this process in my JAVA application, for that I am using the following code:
RapidMiner.setExecutionMode(RapidMiner.ExecutionMode.COMMAND_LINE);The problem is that the predicted label that I receive in my application is different from the predicted label from the rapidminer.
RapidMiner.init();
com.rapidminer.Process process = new com.rapidminer.Process(new File("readModel.rmp"));
IOContainer results = process.run();
results.asList();
ExampleSet resultSet2 = results.get(ExampleSet.class);
for (Example example : resultSet2) {
Attribute predictedLabel = example.getAttributes().getPredictedLabel();
predictionLabel = Double.parseDouble(example.getNominalValue(predictedLabel));
System.out.println(predictionLabel);
}
I am using the same files and data in both sides.
Thanks for any help.
0
Answers
please be more specific. What do you mean by different? 0.349745 instead of 0.35? Or 0.1 instead of 0.7? Also please post the process XML here.
Regards,
Marco
My classification process classifies new data into one of four possible classes (1.0, 2.0, 3.0 or 4.0).
I'm trying get the prediction label in my JAVA application.
The problem is that sometimes for example I get the prediction label 1.0, but if I run the calssification process with the same new data (test data) in Rapidminer I get the prediction label 3.0.
I don't know why this happens, I think the results should be the same. Thanks for any help
what is the actual model you are using? Your process hides that quite well
Also it would be quite helpful if you provided a sample of the data with which I could replicate this behavior.
Regards,
Marco
http://pastebin.com/q4Fq021j
Data sample:
ID Project NUM_T NUM_M INSTANT C_EST LABEL
2196 A 13 3 81 132 1
2197 B 14 3 51 136 2
2198 C 15 3 94 145 2
2199 D 16 3 48 152 2
2200 E 17 3 12 136 3
2201 F 18 3 100 151 2
2202 G 19 3 22 162 3
2203 H 20 3 66 177 4
2204 I 21 3 130 184 2
2205 J 22 3 29 199 3
2206 M 23 3 90 213 2
2207 N 6 4 9 21 4
2208 O 8 5 55 129 2
2209 P 9 3 2 95 1
2210 Q 6 4 2 17 2
The model is using just the vars C_EST, NUM_M and INSTANT.
Thanks for any help
the following code produces the exact same result with your model and your sample data regardless whether I use the GUI or a custom Java program to execute it. Regards,
Marco