Different result when calling the same process from RM and from IDE[SOLVED]
Hello to all,
i have created a RM process that reads a text document, process it with simple text mining operators (e.g. tokenize, transform cases, stopwords) and then loads a weight file and model file (i also tryied to add these as repositories, using retrieve) and classifies the document as positive or negative.
The same document is classified as negative (the right class when someone reads the content of the document) within RM but when called from inside the Java code in Netbeans (again the same process!) it is classified as positive
i am attaching a piece of code that calls the process. Any help is appreciated!
Manolis
i have created a RM process that reads a text document, process it with simple text mining operators (e.g. tokenize, transform cases, stopwords) and then loads a weight file and model file (i also tryied to add these as repositories, using retrieve) and classifies the document as positive or negative.
The same document is classified as negative (the right class when someone reads the content of the document) within RM but when called from inside the Java code in Netbeans (again the same process!) it is classified as positive

i am attaching a piece of code that calls the process. Any help is appreciated!
Manolis
File z=new File("C://Users//.....//Classify.rmp");
Process process1;
IOContainer ioResult1 = null;
try {
process1 = new Process(z);
ioResult1 = process1.run();
} catch (XMLException ex) {
System.out.println("problem with XML Rapidminer");
} catch (OperatorException ex) {
System.out.println("problem with Operator Rapidminer");
}
ExampleSet resultSet1=(ExampleSet)ioResult1.getElementAt(0);
Example example1=resultSet1.getExample(0);
Attribute opinion=example1.getAttributes().get("prediction(Class)");
String resultString1=example1.getValueAsString(opinion);
System.out.println(comment+"->"+resultString1);
Tagged:
0
Answers
Best regards
Manolis
when creating a process by supplying a File parameter, RapidMiner uses UTF-8 encoding to read the file. If your textfile uses a different encoding, problems like yours may arise.
Regards,
Marco