"java.lang.NullPointerExceptiond:when using Voting inside X-Validation"

Legacy User
Legacy User New Altair Community Member
edited November 5 in Community Q&A
Helllo,

I a trying to use a voting operator inside X-Validation but it fails. In the log I can find a  java.lang.NullPointerException. The same happens when I use stacking as well, but only sometimes and I am not able to reproduce it now.
I am using RM 5.3.01, so the latest update.

Best,
Elena
<?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="retrieve" compatibility="5.3.015" expanded="true" height="60" name="Retrieve mapping_locationTypeID_tags_noOutliers_ResultSet" width="90" x="45" y="120">
        <parameter key="repository_entry" value="../../data/mapping_locationTypeID_tags_noOutliers_ResultSet"/>
      </operator>
      <operator activated="true" class="retrieve" compatibility="5.3.015" expanded="true" height="60" name="Retrieve ResultSet_Combined_DFKI_and_IMMI (2)" width="90" x="45" y="30">
        <parameter key="repository_entry" value="../../results/Combined_ResultSets/ResultSet_Combined_DFKI_and_IMMI"/>
      </operator>
      <operator activated="true" class="join" compatibility="5.3.015" expanded="true" height="76" name="Join" width="90" x="179" y="75">
        <parameter key="use_id_attribute_as_key" value="false"/>
        <list key="key_attributes">
          <parameter key="FileName" value="filename"/>
        </list>
      </operator>
      <operator activated="true" class="set_role" compatibility="5.3.015" expanded="true" height="76" name="Set Role" width="90" x="313" y="75">
        <parameter key="attribute_name" value="locationtype"/>
        <parameter key="target_role" value="label"/>
        <list key="set_additional_roles"/>
      </operator>
      <operator activated="true" class="normalize" compatibility="5.3.015" expanded="true" height="94" name="Normalize" width="90" x="447" y="75"/>
      <operator activated="true" class="x_validation" compatibility="5.3.015" expanded="true" height="130" name="Validation" width="90" x="447" y="255">
        <process expanded="true">
          <operator activated="true" class="vote" compatibility="5.3.015" expanded="true" height="60" name="Vote" width="90" x="112" y="75">
            <process expanded="true">
              <operator activated="true" class="weka:W-RandomForest" compatibility="5.3.001" expanded="true" height="76" name="W-RandomForest" width="90" x="328" y="30"/>
              <operator activated="true" class="polynomial_by_binomial_classification" compatibility="5.3.015" expanded="true" height="76" name="Polynominal by Binominal Classification" width="90" x="328" y="48">
                <parameter key="classification_strategies" value="1 against 1"/>
                <process expanded="true">
                  <operator activated="true" class="support_vector_machine_linear" compatibility="5.3.015" expanded="true" name="SVM (Linear)"/>
                  <connect from_port="training set" to_op="SVM (Linear)" to_port="training set"/>
                  <connect from_op="SVM (Linear)" 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="polynomial_by_binomial_classification" compatibility="5.3.015" expanded="true" height="76" name="Polynominal by Binominal Classification (2)" width="90" x="328" y="66">
                <process expanded="true">
                  <operator activated="true" class="support_vector_machine_linear" compatibility="5.3.015" expanded="true" name="SVM (2)"/>
                  <connect from_port="training set" to_op="SVM (2)" to_port="training set"/>
                  <connect from_op="SVM (2)" 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="naive_bayes_kernel" compatibility="5.3.015" expanded="true" height="76" name="Naive Bayes (Kernel)" width="90" x="328" y="84"/>
              <connect from_port="training set 1" to_op="W-RandomForest" to_port="training set"/>
              <connect from_port="training set 2" to_op="Polynominal by Binominal Classification" to_port="training set"/>
              <connect from_port="training set 3" to_op="Polynominal by Binominal Classification (2)" to_port="training set"/>
              <connect from_port="training set 4" to_op="Naive Bayes (Kernel)" to_port="training set"/>
              <connect from_op="W-RandomForest" from_port="model" to_port="base model 1"/>
              <connect from_op="Polynominal by Binominal Classification" from_port="model" to_port="base model 2"/>
              <connect from_op="Polynominal by Binominal Classification (2)" from_port="model" to_port="base model 3"/>
              <connect from_op="Naive Bayes (Kernel)" from_port="model" to_port="base model 4"/>
              <portSpacing port="source_training set 1" spacing="0"/>
              <portSpacing port="source_training set 2" spacing="0"/>
              <portSpacing port="source_training set 3" spacing="0"/>
              <portSpacing port="source_training set 4" spacing="0"/>
              <portSpacing port="source_training set 5" spacing="0"/>
              <portSpacing port="sink_base model 1" spacing="0"/>
              <portSpacing port="sink_base model 2" spacing="0"/>
              <portSpacing port="sink_base model 3" spacing="0"/>
              <portSpacing port="sink_base model 4" spacing="0"/>
              <portSpacing port="sink_base model 5" spacing="0"/>
            </process>
          </operator>
          <connect from_port="training" to_op="Vote" to_port="training set"/>
          <connect from_op="Vote" from_port="model" to_port="model"/>
          <portSpacing port="source_training" spacing="0"/>
          <portSpacing port="sink_model" spacing="0"/>
          <portSpacing port="sink_through 1" spacing="0"/>
        </process>
        <process expanded="true">
          <operator activated="true" class="apply_model" compatibility="5.3.015" expanded="true" height="76" name="Apply Model (2)" width="90" x="45" y="30">
            <list key="application_parameters"/>
          </operator>
          <operator activated="true" class="performance_classification" compatibility="5.3.015" expanded="true" height="76" name="Performance" width="90" x="196" y="97">
            <list key="class_weights"/>
          </operator>
          <connect from_port="model" to_op="Apply Model (2)" to_port="model"/>
          <connect from_port="test set" to_op="Apply Model (2)" to_port="unlabelled data"/>
          <connect from_op="Apply Model (2)" from_port="labelled data" to_op="Performance" to_port="labelled data"/>
          <connect from_op="Performance" from_port="performance" to_port="averagable 1"/>
          <portSpacing port="source_model" spacing="0"/>
          <portSpacing port="source_test set" spacing="0"/>
          <portSpacing port="source_through 1" spacing="0"/>
          <portSpacing port="sink_averagable 1" spacing="0"/>
          <portSpacing port="sink_averagable 2" spacing="0"/>
          <portSpacing port="sink_averagable 3" spacing="0"/>
        </process>
      </operator>
      <connect from_op="Retrieve mapping_locationTypeID_tags_noOutliers_ResultSet" from_port="output" to_op="Join" to_port="right"/>
      <connect from_op="Retrieve ResultSet_Combined_DFKI_and_IMMI (2)" from_port="output" to_op="Join" to_port="left"/>
      <connect from_op="Join" from_port="join" to_op="Set Role" to_port="example set input"/>
      <connect from_op="Set Role" from_port="example set output" to_op="Normalize" to_port="example set input"/>
      <connect from_op="Normalize" from_port="example set output" to_op="Validation" to_port="training"/>
      <connect from_op="Validation" from_port="model" to_port="result 1"/>
      <connect from_op="Validation" from_port="training" to_port="result 2"/>
      <connect from_op="Validation" from_port="averagable 1" to_port="result 3"/>
      <connect from_op="Validation" from_port="averagable 2" to_port="result 4"/>
      <portSpacing port="source_input 1" spacing="0"/>
      <portSpacing port="sink_result 1" spacing="0"/>
      <portSpacing port="sink_result 2" spacing="0"/>
      <portSpacing port="sink_result 3" spacing="0"/>
      <portSpacing port="sink_result 4" spacing="0"/>
      <portSpacing port="sink_result 5" spacing="0"/>
    </process>
  </operator>
</process>

Answers

  • fras
    fras New Altair Community Member
    Hi Elena,

    inside the X-Validation I found a dummy Random Forrest operator.
    Please remove and try to reproduce. If you can not this was the problem.

    -Frank
  • Legacy User
    Legacy User New Altair Community Member
    Hi Frank,

    it is not dummy. It is an operator coming from the Weka extension.
  • fras
    fras New Altair Community Member
    If it happens again please provide the complete Exception message.
  • Legacy User
    Legacy User New Altair Community Member
    Hi the error message appearing when the process fails says:
    "The setup does not seem to contain any obvious errors, but you should check the log messages or activate the debug mode in the settings dialog in order to get more information about this problem."
    Here is the RM log:
    Dec 2, 2013 3:58:01 PM SEVERE: Process failed: operator cannot be executed. Check the log messages...
    Dec 2, 2013 3:58:01 PM SEVERE: Here:          Process[1] (Process)
              subprocess 'Main Process'
                +- Retrieve mapping_locationTypeID_tags_noOutliers_ResultSet[1] (Retrieve)
                +- Retrieve ResultSet_Combined_DFKI_and_IMMI (2)[1] (Retrieve)
                +- Join[1] (Join)
                +- Set Role[1] (Set Role)
                +- Normalize[1] (Normalize)
                +- Validation[1] (X-Validation)
              subprocess 'Training'
                    |  +- Vote[2] (Vote)
              subprocess 'Base Learner'
                    |        +- W-RandomForest[2] (W-RandomForest)
                    |        +- Polynominal by Binominal Classification[2] (Polynominal by Binominal Classification)
              subprocess 'Learning Process'
                    |        |    +- SVM (Linear)[6] (Support Vector Machine (Linear))
                    |        +- Polynominal by Binominal Classification (2)[2] (Polynominal by Binominal Classification)
              subprocess 'Learning Process'
                    |        |    +- SVM (2)[6] (Support Vector Machine (Linear))
          ==>      |        +- Naive Bayes (Kernel)[2] (Naive Bayes (Kernel))
              subprocess 'Testing'
                      +- Apply Model (2)[1] (Apply Model)
                      +- Performance[1] (Performance (Classification))
    Dec 2, 2013 3:58:01 PM SEVERE: java.lang.NullPointerException
  • Marco_Boeck
    Marco_Boeck New Altair Community Member
    Hi,

    can you please post the contents of the rm.log file inside the USER_HOME/.RapidMiner(5) folder?

    Regards,
    Marco
  • Legacy User
    Legacy User New Altair Community Member
    This is where the error begins:
    SEVERE: Process failed: operator cannot be executed. Check the log messages...
    java.lang.NullPointerException
    at com.rapidminer.operator.learner.meta.Binary2MultiClassModel.startNonECOCProcess(Binary2MultiClassModel.java:164)
    at com.rapidminer.operator.learner.meta.Binary2MultiClassModel.performPrediction(Binary2MultiClassModel.java:278)
    at com.rapidminer.operator.learner.PredictionModel.apply(PredictionModel.java:76)
    at com.rapidminer.operator.learner.meta.AbstractStacking.learn(AbstractStacking.java:108)
    at com.rapidminer.operator.learner.meta.AbstractStacking.doWork(AbstractStacking.java:90)
    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.validation.ValidationChain.executeLearner(ValidationChain.java:214)
    at com.rapidminer.operator.validation.ValidationChain.learn(ValidationChain.java:305)
    at com.rapidminer.operator.validation.XValidation.performIteration(XValidation.java:159)
    at com.rapidminer.operator.validation.XValidation.estimatePerformance(XValidation.java:151)
    at com.rapidminer.operator.validation.ValidationChain.doWork(ValidationChain.java:273)
    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)

    Dec 02, 2013 11:14:39 PM com.rapidminer.gui.ProcessThread run
    SEVERE: Here:          Process[1] (Process)
              subprocess 'Main Process'
                +- Retrieve mapping_locationTypeID_tags_noOutliers_ResultSet[1] (Retrieve)
                +- Retrieve ResultSet_Combined_DFKI_and_IMMI (2)[1] (Retrieve)
                +- Join[1] (Join)
                +- Set Role[1] (Set Role)
                +- Normalize[1] (Normalize)
                +- Validation[1] (X-Validation)
              subprocess 'Training'
                    |  +- Vote[2] (Vote)
              subprocess 'Base Learner'
                    |        +- Polynominal by Binominal Classification[2] (Polynominal by Binominal Classification)
              subprocess 'Learning Process'
                    |        |    +- SVM (Linear)[6] (Support Vector Machine (Linear))
                    |        +- Polynominal by Binominal Classification (2)[2] (Polynominal by Binominal Classification)
              subprocess 'Learning Process'
                    |        |    +- SVM (2)[6] (Support Vector Machine (Linear))
          ==>      |        +- Naive Bayes (Kernel)[2] (Naive Bayes (Kernel))
              subprocess 'Testing'
                      +- Apply Model (2)[1] (Apply Model)
                      +- Performance[1] (Performance (Classification))
    Dec 02, 2013 11:14:39 PM com.rapidminer.gui.ProcessThread run
    SEVERE: java.lang.NullPointerException
    java.lang.NullPointerException
    at com.rapidminer.operator.learner.meta.Binary2MultiClassModel.startNonECOCProcess(Binary2MultiClassModel.java:164)
    at com.rapidminer.operator.learner.meta.Binary2MultiClassModel.performPrediction(Binary2MultiClassModel.java:278)
    at com.rapidminer.operator.learner.PredictionModel.apply(PredictionModel.java:76)
    at com.rapidminer.operator.learner.meta.AbstractStacking.learn(AbstractStacking.java:108)
    at com.rapidminer.operator.learner.meta.AbstractStacking.doWork(AbstractStacking.java:90)
    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.validation.ValidationChain.executeLearner(ValidationChain.java:214)
    at com.rapidminer.operator.validation.ValidationChain.learn(ValidationChain.java:305)
    at com.rapidminer.operator.validation.XValidation.performIteration(XValidation.java:159)
    at com.rapidminer.operator.validation.XValidation.estimatePerformance(XValidation.java:151)
    at com.rapidminer.operator.validation.ValidationChain.doWork(ValidationChain.java:273)
    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.ProcessThrea
  • Legacy User
    Legacy User New Altair Community Member
    Hello guys,

    I keep on having this problem annd I have identified that it is caused by the  Polynominal by Binominal Classification operator.
  • MariusHelf
    MariusHelf New Altair Community Member
    As a workaround, does it help to add a Materialize Data operator as the very first operator on both sides of the X-Validation?

    Best regards,
    Marius
  • Legacy User
    Legacy User New Altair Community Member
    Hi Maruis!

    Yeap it worked!

    Thanks a lot,
    Elena