🦉 🎤   RapidMiner Wisdom 2020 - CALL FOR SPEAKERS DEADLINE IS NOVEMBER 15   🦉 🎤

CLICK HERE TO GO TO ENTRY FORM

Problem with Model Loader

JorgeJorge Member Posts: 19  Maven
edited November 2018 in Help
Hi!

I'm having problems with my application and I don't know how to solve it :(

My XML process is that:

<?xml version="1.0" encoding="windows-1252"?>
<process version="4.4">
 <operator name="Apply" class="Process" expanded="yes">
     <parameter key="logverbosity" value="init"/>
     <parameter key="random_seed" value="2001"/>
     <parameter key="encoding" value="SYSTEM"/>
     <operator name="OperatorChain" class="OperatorChain" expanded="yes">
         <operator name="XrffExampleSource" class="XrffExampleSource">
             <parameter key="data_file" value="C:\Algoritmo definitivo\Input2.xrff"/>
             <parameter key="datamanagement" value="double_array"/>
             <parameter key="decimal_point_character" value="."/>
             <parameter key="sample_ratio" value="1.0"/>
             <parameter key="sample_size" value="-1"/>
             <parameter key="local_random_seed" value="-1"/>
         </operator>
         <operator name="ChangeAttributeRole" class="ChangeAttributeRole">
             <parameter key="name" value="Trust"/>
             <parameter key="target_role" value="label"/>
         </operator>
         <operator name="ExampleFilter" class="ExampleFilter">
             <parameter key="condition_class" value="missing_labels"/>
             <parameter key="invert_filter" value="false"/>
         </operator>
         <operator name="ChangeAttributeRole (2)" class="ChangeAttributeRole">
             <parameter key="name" value="Trust"/>
             <parameter key="target_role" value="id"/>
         </operator>
         <operator name="Root" class="Process" expanded="yes">
             <parameter key="logverbosity" value="init"/>
             <parameter key="random_seed" value="2001"/>
             <parameter key="encoding" value="SYSTEM"/>
             <operator name="Numerical2Polynominal" class="Numerical2Polynominal">
             </operator>
             <operator name="Nominal2Binominal" class="Nominal2Binominal">
                 <parameter key="return_preprocessing_model" value="false"/>
                 <parameter key="create_view" value="false"/>
                 <parameter key="transform_binominal" value="true"/>
                 <parameter key="use_underscore_in_name" value="false"/>
             </operator>
             <operator name="Nominal2Numerical" class="Nominal2Numerical">
                 <parameter key="return_preprocessing_model" value="false"/>
                 <parameter key="create_view" value="false"/>
             </operator>
         </operator>
         <operator name="ChangeAttributeRole (3)" class="ChangeAttributeRole">
             <parameter key="name" value="Trust"/>
             <parameter key="target_role" value="prediction"/>
         </operator>
     </operator>
     <operator name="ModelLoader" class="ModelLoader">
         <parameter key="model_file" value="C:\Algoritmo definitivo\model.mod"/>
     </operator>
     <operator name="ModelApplier" class="ModelApplier">
         <parameter key="keep_model" value="false"/>
         <list key="application_parameters">
         </list>
         <parameter key="create_view" value="false"/>
     </operator>
     <operator name="AttributeFilter" class="AttributeFilter">
         <parameter key="condition_class" value="attribute_name_filter"/>
         <parameter key="parameter_string" value="prediction(Trust)"/>
         <parameter key="invert_filter" value="false"/>
         <parameter key="apply_on_special" value="false"/>
     </operator>
     <operator name="XrffExampleSetWriter" class="XrffExampleSetWriter">
         <parameter key="example_set_file" value="C:\Algoritmo definitivo\definitivo.xrff"/>
     </operator>
 </operator>
</process>
When I execute that:

RapidMiner.init();
               
               File f = new File("Trust.xml");
               try {
                       Process process = new Process(f);
                       process.run();


               } catch (IOException e) {
                       // TODO Auto-generated catch block
                       e.printStackTrace();
               } catch (XMLException e) {
                       // TODO Auto-generated catch block
                       e.printStackTrace();
               }
The execution, when arrives to that point

  <operator name="ModelLoader" class="ModelLoader">
         <parameter key="model_file" value="C:\Algoritmo definitivo\model.mod"/>
     </operator>
Gives me that error:

P May 27, 2009 9:44:29 AM: Initialising process setup
P May 27, 2009 9:44:29 AM: [NOTE] No filename given for result file, using stdout for logging results!
P May 27, 2009 9:44:29 AM: Checking properties...
P May 27, 2009 9:44:29 AM: Properties are ok.
P May 27, 2009 9:44:29 AM: Checking process setup...
P May 27, 2009 9:44:29 AM: Inner operators are ok.
P May 27, 2009 9:44:29 AM: Checking i/o classes...
P May 27, 2009 9:44:29 AM: i/o classes are ok. Process output: Model, ExampleSet.
P May 27, 2009 9:44:29 AM: Process ok.
P May 27, 2009 9:44:29 AM: Process initialised
P May 27, 2009 9:44:29 AM: [NOTE] Process starts
P May 27, 2009 9:44:29 AM: Process:
  Apply[0] (Process)
  +- OperatorChain[0] (OperatorChain)
  |  +- XrffExampleSource[0] (XrffExampleSource)
  |  +- ChangeAttributeRole[0] (ChangeAttributeRole)
  |  +- ExampleFilter[0] (ExampleFilter)
  |  +- ChangeAttributeRole (2)[0] (ChangeAttributeRole)
  |  +- Root[0] (Process)
  |  |  +- Numerical2Polynominal[0] (Numerical2Polynominal)
  |  |  +- Nominal2Binominal[0] (Nominal2Binominal)
  |  |  +- Nominal2Numerical[0] (Nominal2Numerical)
  |  +- ChangeAttributeRole (3)[0] (ChangeAttributeRole)
  +- ModelLoader[0] (ModelLoader)
  +- ModelLoader (2)[0] (ModelLoader)
  +- ModelApplier[0] (ModelApplier)
27-may-2009 9:44:29 org.apache.catalina.core.ApplicationContext log
SEVERE: Exception while dispatching incoming RPC call
com.google.gwt.user.client.rpc.SerializationException: Type 'com.rapidminer.operator.UserError' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized.
at com.google.gwt.user.server.rpc.impl.StandardSerializationPolicy.validateSerialize(StandardSerializationPolicy.java:83)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:591)
at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:129)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter$ValueWriter$8.write(ServerSerializationStreamWriter.java:146)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:530)
at com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:573)
at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:365)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:546)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:164)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
...
Can anyone help me?

Thanks,

Jorge

Answers

  • JorgeJorge Member Posts: 19  Maven
    I solved it! :P

    The model was in xml...

    With the model in binary type don't throws that exception :)



    Jorge
Sign In or Register to comment.