ArrayIndexOutOfBoundsException

marvin_souza
marvin_souza New Altair Community Member
edited November 5 in Community Q&A
Hi all.
I am using the RapidMiner to do Task Inference in my Master tesis. After some tests with different data, occured a strange error.
First I will describe my scenario.
XML:
<operator name="Root" class="Process" expanded="yes">
    <operator name="DatabaseExampleSource" class="DatabaseExampleSource">
        <parameter key="database_system" value="PostgreSQL"/>
        <parameter key="database_url" value="jdbc:postgresql://parara:5432/exehda"/>
        <parameter key="username" value="marcos"/>
        <parameter key="password" value="vBwyakUxtRE="/>
        <parameter key="query" value="SELECT  t.name as task,h.sector, h.time_frame, h.main_device, sec.info, sec.type  FROM  exehda_history h left join exehda_history_sec_ctx sec on sec.id_history=h.id  join exehda_task t on h.id_task = t.id where h.id_user = 1"/>
        <parameter key="label_attribute" value="task"/>
        <parameter key="datamanagement" value="double_sparse_array"/>
    </operator>
    <operator name="DecisionTree" class="DecisionTree">
        <parameter key="criterion" value="information_gain"/>
        <parameter key="minimal_size_for_split" value="5"/>
        <parameter key="minimal_leaf_size" value="3"/>
        <parameter key="minimal_gain" value="0.2"/>
        <parameter key="number_of_prepruning_alternatives" value="2"/>
        <parameter key="no_pre_pruning" value="true"/>
        <parameter key="no_pruning" value="true"/>
    </operator>
</operator>
My data:

AtendimentoPaciente clinica 43 desktop (null) (null)
AtendimentoPaciente clinica 42 desktop (null) (null)
AtendimentoPaciente clinica 42 desktop (null) (null)
AtendimentoPaciente clinica 41 desktop (null) (null)
AtendimentoPaciente clinica 41 desktop (null) (null)
AtendimentoPaciente clinica 40 desktop (null) (null)
AtendimentoPaciente clinica 40 desktop (null) (null)
Cirurgia         clinica 45 desktop (null) (null)
When I run this proccess, I got the error:

java.lang.ArrayIndexOutOfBoundsException: 0
    at com.rapidminer.operator.learner.tree.InfoGainCriterion.getBenefit(InfoGainCriterion.java:66)
    at com.rapidminer.operator.learner.tree.InfoGainCriterion.getNominalBenefit(InfoGainCriterion.java:56)
    at com.rapidminer.operator.learner.tree.TreeBuilder.calculateBenefit(TreeBuilder.java:108)
    at com.rapidminer.operator.learner.tree.TreeBuilder.calculateAllBenefits(TreeBuilder.java:134)
    at com.rapidminer.operator.learner.tree.TreeBuilder.buildTree(TreeBuilder.java:157)
    at com.rapidminer.operator.learner.tree.TreeBuilder.learnTree(TreeBuilder.java:93)
    at com.rapidminer.operator.learner.tree.AbstractTreeLearner.learn(AbstractTreeLearner.java:109)
    at com.rapidminer.operator.learner.AbstractLearner.apply(AbstractLearner.java:88)
    at com.rapidminer.operator.Operator.apply(Operator.java:671)
    at com.rapidminer.operator.OperatorChain.apply(OperatorChain.java:424)
    at com.rapidminer.operator.Operator.apply(Operator.java:671)
    at com.rapidminer.Process.run(Process.java:735)
    at com.rapidminer.Process.run(Process.java:704)
    at com.rapidminer.Process.run(Process.java:694)
    at com.rapidminer.gui.ProcessThread.run(ProcessThread.java:59)
If the data is generated randomically, this don't happen. Some suggestion ?
Tagged:

Answers

  • marvin_souza
    marvin_souza New Altair Community Member
    By some obscure reason, the RM don't handles the null values.
    When I remove the columns info and type, everything works fine.
  • steffen
    steffen New Altair Community Member
    Hello marvin

    I assume that the data is loaded as "(null)", not as missing values. Correct ?
    Another Question: Do the mentioned columns have each only one unique value ?

    regards,

    Steffen