"Getting Results from Exampleset in Java"
Hi,
I created a Process which calculates the Crossdistance between 1 single document and an Excelfile. The Process works fine and is properly executed in my Javaprogramm. Now i would like to get the Results or the Values of the 5 closest Documents to my Document out of the Exampleset. I understood that by the following code I can get the Examplesetresults. But how do i get the Values.

Thank you very much for you Help !
I created a Process which calculates the Crossdistance between 1 single document and an Excelfile. The Process works fine and is properly executed in my Javaprogramm. Now i would like to get the Results or the Values of the 5 closest Documents to my Document out of the Exampleset. I understood that by the following code I can get the Examplesetresults. But how do i get the Values.
I attached a picture of which values i would like to get in my Program.
IOContainer ioResult = rm5.run();
ExampleSet resultSet = (ExampleSet) ioResult.getElementAt(1);

Thank you very much for you Help !
Find more posts tagged with
Sort by:
1 - 5 of
51
So Basically what i am trying to get is a working method so i can store the data from the data view in the rapidminer gui into an integer value or string value in my java programm.
I am sure there must be an easy way to do it since its an common idea to further use the results calculated with rapidminer.
Thank you very much for your help !
I am sure there must be an easy way to do it since its an common idea to further use the results calculated with rapidminer.
Thank you very much for your help !

Hello maxfax,
you can sort ExampleSet by operator "Sort" and that select only the first five by operator "Filter Example Range".
You can get values in java this way:
Václav
you can sort ExampleSet by operator "Sort" and that select only the first five by operator "Filter Example Range".
You can get values in java this way:
Best,
ExampleSet es = (ExampleSet) ioResult.getElementAt(1);
Attributes ats = es.getAttributes();
double[] dataRow = new double[ats.size()];
for (Example example : es) {
int i = 0;
for (Attribute attribute : ats) {
dataRow = example.getValue(attribute);
i++;
}
//TODO operation with one dataRow = example
}
Václav
Just in case it will move along here is a copy of it: