RapidMiner

RapidMiner

[SOLVED] Performance (Costs) - NullPointerException

Regular Contributor

[SOLVED] Performance (Costs) - NullPointerException

Hello,

  I think I have misconfigured the Performance (Costs) node, but do not see the error. It results in the following exception:
SEVERE: Process failed: operator cannot be executed. Check the log messages...
java.lang.NullPointerException
       at com.rapidminer.example.Example.getNominalValue(Example.java:102)
       at com.rapidminer.operator.performance.cost.ClassificationCostCriterion.countExample(ClassificationCostCriterion.java:128)
       at com.rapidminer.operator.performance.cost.CostEvaluator.doWork(CostEvaluator.java:127)
       at com.rapidminer.operator.Operator.execute(Operator.java:834)
       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.executeEvaluator(ValidationChain.java:223)
       at com.rapidminer.operator.validation.ValidationChain.evaluate(ValidationChain.java:324)
       at com.rapidminer.operator.validation.SplitValidationOperator.estimatePerformance(SplitValidationOperator.java:160)
       at com.rapidminer.operator.validation.ValidationChain.doWork(ValidationChain.java:273)
       at com.rapidminer.operator.Operator.execute(Operator.java:834)
       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:379)
       at com.rapidminer.operator.Operator.execute(Operator.java:834)
       at com.rapidminer.Process.run(Process.java:925)
       at com.rapidminer.Process.run(Process.java:848)
       at com.rapidminer.Process.run(Process.java:807)
       at com.rapidminer.Process.run(Process.java:802)
       at com.rapidminer.Process.run(Process.java:792)
       at com.rapidminer.gui.ProcessThread.run(ProcessThread.java:63)


With the following process:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.2.008">
 <context>
   <input>
     <location>//Samples/data/Iris</location>
   </input>
   <output/>
   <macros/>
 </context>
 <operator activated="true" class="process" compatibility="5.2.008" expanded="true" name="Process">
   <process expanded="true" height="152" width="145">
     <operator activated="true" class="split_validation" compatibility="5.2.008" expanded="true" height="112" name="Validation" width="90" x="45" y="30">
       <process expanded="true" height="445" width="258">
         <operator activated="true" class="auto_mlp" compatibility="5.2.008" expanded="true" height="76" name="AutoMLP" width="90" x="45" y="30"/>
         <connect from_port="training" to_op="AutoMLP" to_port="training set"/>
         <connect from_op="AutoMLP" 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" height="445" width="258">
         <operator activated="true" class="performance_costs" compatibility="5.2.008" expanded="true" height="76" name="Performance" width="90" x="45" y="30">
           <parameter key="cost_matrix" value="[0.0 1.0 10.0;3.0 0.0 0.3;1.0 1.0 0.0]"/>
           <enumeration key="class_order_definition">
             <parameter key="class_name" value="Iris-setosa"/>
             <parameter key="class_name" value="Iris-virginica"/>
             <parameter key="class_name" value="Iris-versicolor"/>
           </enumeration>
         </operator>
         <connect from_port="test set" to_op="Performance" to_port="example set"/>
         <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"/>
       </process>
     </operator>
     <connect from_port="input 1" to_op="Validation" to_port="training"/>
     <connect from_op="Validation" from_port="model" to_port="result 2"/>
     <connect from_op="Validation" from_port="training" to_port="result 1"/>
     <connect from_op="Validation" from_port="averagable 1" to_port="result 3"/>
     <portSpacing port="source_input 1" spacing="0"/>
     <portSpacing port="source_input 2" 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"/>
   </process>
 </operator>
</process>

Should I open a ticket asking for a better error message, or I made an obvious mistake?
Thanks, gabor
1 REPLY
Super Contributor

Re: Performance (Costs) - NullPointerException

Hi Gabor,

this is a combination of a bug and a misconfiguration. The bug is, that the performance operator should give you a decent and descriptive error message. We'll fix that.

The misconfiguration is that you are missing an Apply Model operator. Just add it before the performance operator and your process will run fine.

Best regards,
Marius