The Altair Community is migrating to a new platform to provide a better experience for you. The RapidMiner Community will merge with the Altair Community at the same time. In preparation for the migration, both communities are on read-only mode from July 15th - July 24th, 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.
Options

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!

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:

Answers

  • Options
    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?
  • Options
    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

    Manolis
  • Options
    Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,996 RM Engineering
    Hi,

    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
Sign In or Register to comment.