Different result when calling the same process from RM and from IDE[SOLVED]

mmaragmmarag Member Posts: 35 Maven
edited November 2018 in Help
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 :o

i am attaching a piece of code that calls the process. Any help is appreciated!


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);



  • SkirzynskiSkirzynski Member Posts: 164 Maven
    Can you attach a minimal version of your process and a small amount of your data where this behaviour occurs?
  • mmaragmmarag Member Posts: 35 Maven
    The problem is figured out and solved locally from netbeans. It seemed that Greek and Slovenian characters were not realized by Rapidminer when called from Java, a simple replace made the job. However, I think you people from RapidMiner have to check this issue for future cases..

    Best regards

  • Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,993 RM Engineering

    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.

Sign In or Register to comment.