"Issue in getting the predicted label from a Java application"

User: "spg"
New Altair Community Member
Updated by Jocelyn
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:
            RapidMiner.setExecutionMode(RapidMiner.ExecutionMode.COMMAND_LINE);
            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);
            }
The problem is that the predicted label that I receive in my application is different from the predicted label from the rapidminer.

I am using the same files and data in both sides.

Thanks for any help.

Find more posts tagged with