Options

Null Pointer Exception in Set Role when handling with AdaBoost

seesivaseesiva Member Posts: 4 Contributor I
edited November 2018 in Help
1. I have naive bayes implementation on the dataset with  16 attributes, with label which is of type nominal (String)
2. With Naive Bayes I could get the desiered results, when I try to implement adaboost and having Naive Bayes as the Learning Process and providing Input values from the CSV file to the apply model I'm getting a SEVERE: java.lang.NullPointerException in the Set Role Operator. Can you please advice.
3. My goal is apply the CSV sample data on to the trained model outcome from Adaboost algorithm.

Answers

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

    can you please post the process xml of your setup? (Click von "View" -> "Show View" -> "XML" in the top menu bar and copy&paste the xml here)

    Regards,
    Marco
  • Options
    seesivaseesiva Member Posts: 4 Contributor I
    Marco Boeck wrote:

    Hi,

    can you please post the process xml of your setup? (Click von "View" -> "Show View" -> "XML" in the top menu bar and copy&paste the xml here)

    Regards,
    Marco
    Please find the XML here:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.3.015">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="5.3.015" expanded="true" name="Process">
        <process expanded="true">
          <operator activated="true" class="read_database" compatibility="5.3.015" expanded="true" height="60" name="Read Database" width="90" x="45" y="165">
            <parameter key="connection" value="MySQL"/>
            <parameter key="query" value="select * from summarymarks"/>
            <enumeration key="parameters"/>
          </operator>
          <operator activated="true" class="read_csv" compatibility="5.3.015" expanded="true" height="60" name="Read CSV" width="90" x="179" y="165">
            <parameter key="csv_file" value="C:\Users\k.siva\Documents\InputFile.csv"/>
            <parameter key="column_separators" value=","/>
            <list key="annotations"/>
            <list key="data_set_meta_data_information"/>
          </operator>
          <operator activated="true" class="select_attributes" compatibility="5.3.015" expanded="true" height="76" name="Select Attributes" width="90" x="45" y="30"/>
          <operator activated="true" class="set_role" compatibility="5.3.015" expanded="true" height="76" name="Set Role" width="90" x="179" y="30">
            <parameter key="attribute_name" value="Performance"/>
            <parameter key="target_role" value="label"/>
            <list key="set_additional_roles"/>
          </operator>
          <operator activated="true" class="adaboost" compatibility="5.3.015" expanded="true" height="76" name="AdaBoost" width="90" x="313" y="30">
            <process expanded="true">
              <operator activated="true" class="naive_bayes" compatibility="5.3.015" expanded="true" height="76" name="Naive Bayes" width="90" x="112" y="75"/>
              <connect from_port="training set" to_op="Naive Bayes" to_port="training set"/>
              <connect from_op="Naive Bayes" from_port="model" to_port="model"/>
              <portSpacing port="source_training set" spacing="0"/>
              <portSpacing port="sink_model" spacing="0"/>
            </process>
          </operator>
          <operator activated="true" class="apply_model" compatibility="5.3.015" expanded="true" height="76" name="Apply Model" width="90" x="447" y="120">
            <list key="application_parameters"/>
          </operator>
          <connect from_op="Read Database" from_port="output" to_op="Select Attributes" to_port="example set input"/>
          <connect from_op="Read CSV" from_port="output" to_op="Apply Model" to_port="unlabelled data"/>
          <connect from_op="Select Attributes" from_port="example set output" to_op="Set Role" to_port="example set input"/>
          <connect from_op="Set Role" from_port="example set output" to_op="AdaBoost" to_port="training set"/>
          <connect from_op="AdaBoost" from_port="model" to_op="Apply Model" to_port="model"/>
          <connect from_op="Apply Model" from_port="model" to_port="result 1"/>
          <portSpacing port="source_input 1" spacing="0"/>
          <portSpacing port="sink_result 1" spacing="0"/>
          <portSpacing port="sink_result 2" spacing="0"/>
        </process>
      </operator>
    </process>
  • Options
    Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,996 RM Engineering
    Hi,

    you can try and add a breakpoint after the "Select Attributes" operator. Then you see the actual data coming into the "Set Role" operator. Make sure that the selected attribute does actually exist in your data. Normally it should simply tell you that the attribute does not exist, but it might be a bug that existed in RM Studio 5 and was fixed in RM Studio 6.

    Regards,
    Marco
  • Options
    seesivaseesiva Member Posts: 4 Contributor I
    Marco Boeck wrote:

    Hi,

    you can try and add a breakpoint after the "Select Attributes" operator. Then you see the actual data coming into the "Set Role" operator. Make sure that the selected attribute does actually exist in your data. Normally it should simply tell you that the attribute does not exist, but it might be a bug that existed in RM Studio 5 and was fixed in RM Studio 6.

    Regards,
    Marco
    This is the log I'm getting:

    Aug 5, 2014 7:14:41 PM SEVERE: Here:          Process[1] (Process)
              subprocess 'Main Process'
                +- Read Database[1] (Read Database)
                +- Read CSV[1] (Read CSV)
                +- Select Attributes[1] (Select Attributes)
                +- Set Role[1] (Set Role)
                +- AdaBoost[1] (AdaBoost)
              subprocess 'Learning Process'
                |    +- Naive Bayes[10] (Naive Bayes)
          ==>  +- Apply Model[1] (Apply Model)
    Aug 5, 2014 7:14:41 PM SEVERE: java.lang.NullPointerException
  • Options
    Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,996 RM Engineering
    Hi,

    the real log can be found in USER_HOME/.RapidMiner5/rm.log. However I suspect that this is a bug that no longer exists in Studio 6.

    Regards,
    Marco
  • Options
    seesivaseesiva Member Posts: 4 Contributor I
    Update: When I'm not applying model its generating the model in the result without any issues. In the below xml we can see that output is connected to Result1 and we are also getting the result of the model through the iteration. So when we are applying the model it is causing the issue.

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.3.015">
     <context>
       <input/>
       <output/>
       <macros/>
     </context>
     <operator activated="true" class="process" compatibility="5.3.015" expanded="true" name="Process">
       <process expanded="true">
         <operator activated="true" class="read_database" compatibility="5.3.015" expanded="true" height="60" name="Read Database" width="90" x="45" y="165">
           <parameter key="connection" value="MySQL"/>
           <parameter key="query" value="select * from summarymarks"/>
           <enumeration key="parameters"/>
         </operator>
         <operator activated="true" class="read_csv" compatibility="5.3.015" expanded="true" height="60" name="Read CSV" width="90" x="179" y="165">
           <parameter key="csv_file" value="C:\Users\k.siva\Documents\InputFile.csv"/>
           <parameter key="column_separators" value=","/>
           <list key="annotations"/>
           <list key="data_set_meta_data_information"/>
         </operator>
         <operator activated="true" class="select_attributes" compatibility="5.3.015" expanded="true" height="76" name="Select Attributes" width="90" x="45" y="30"/>
         <operator activated="true" class="set_role" compatibility="5.3.015" expanded="true" height="76" name="Set Role" width="90" x="179" y="30">
           <parameter key="attribute_name" value="Performance"/>
           <parameter key="target_role" value="label"/>
           <list key="set_additional_roles"/>
         </operator>
         <operator activated="true" class="adaboost" compatibility="5.3.015" expanded="true" height="76" name="AdaBoost" width="90" x="313" y="30">
           <process expanded="true">
             <operator activated="true" class="naive_bayes" compatibility="5.3.015" expanded="true" height="76" name="Naive Bayes" width="90" x="112" y="75"/>
             <connect from_port="training set" to_op="Naive Bayes" to_port="training set"/>
             <connect from_op="Naive Bayes" from_port="model" to_port="model"/>
             <portSpacing port="source_training set" spacing="0"/>
             <portSpacing port="sink_model" spacing="0"/>
           </process>
         </operator>
         <connect from_op="Read Database" from_port="output" to_op="Select Attributes" to_port="example set input"/>
         <connect from_op="Select Attributes" from_port="example set output" to_op="Set Role" to_port="example set input"/>
         <connect from_op="Set Role" from_port="example set output" to_op="AdaBoost" to_port="training set"/>
         <connect from_op="AdaBoost" from_port="model" to_port="result 1"/>
         <portSpacing port="source_input 1" spacing="0"/>
         <portSpacing port="sink_result 1" spacing="0"/>
         <portSpacing port="sink_result 2" spacing="0"/>
       </process>
     </operator>
    </process>


    Also as per the additional input the log file rm.log gives the following message:
    SEVERE: Process failed: operator cannot be executed. Check the log messages...
    java.lang.NullPointerException
    at com.rapidminer.operator.learner.meta.AdaBoostModel.evaluateSpecialAttributes(AdaBoostModel.java:215)
    at com.rapidminer.operator.learner.meta.AdaBoostModel.performPrediction(AdaBoostModel.java:168)
    at com.rapidminer.operator.learner.PredictionModel.apply(PredictionModel.java:76)
    at com.rapidminer.operator.ModelApplier.doWork(ModelApplier.java:100)
    at com.rapidminer.operator.Operator.execute(Operator.java:866)
    at com.rapidminer.operator.execution.SimpleUnitExecutor.execute(SimpleUnitExecutor.java:51)
    at com.rapidminer.operator.ExecutionUnit.execute(ExecutionUnit.java:711)
    at com.rapidminer.operator.OperatorChain.doWork(OperatorChain.java:375)
    at com.rapidminer.operator.Operator.execute(Operator.java:866)
    at com.rapidminer.Process.run(Process.java:949)
    at com.rapidminer.Process.run(Process.java:873)
    at com.rapidminer.Process.run(Process.java:832)
    at com.rapidminer.Process.run(Process.java:827)
    at com.rapidminer.Process.run(Process.java:817)
    at com.rapidminer.gui.ProcessThread.run(ProcessThread.java:63)


    I think we dont' t have community edition for Studio 6? Because when I try to update the studio it gives 400 error.
Sign In or Register to comment.