Decision Tree Learner Execute failed: ("ArrayIndexOutOfBoundsException"): -1

Hello,

This is my first time working with Knime and I am just testing things out right now. When I tried to use a decision tree learner node I realized that it wasn't using all of the columns of the data set that I imported. When I try to force the root split on any of the columns that weren't used in the decision tree I get this error.

ERROR Decision Tree Learner 0:4        Execute failed: ("ArrayIndexOutOfBoundsException"): -1

I can't seem to figure out why it doesn't like those columns. All of the columns in the data set have nominal values. The columns that aren't being used have many possible values (between 20 and 100s), while the columns that the tree uses only have between 3 and 5 possible values. 

Thanks in advance for any help! 

P.S. Won't be able to provide the data set as it is customer data

Without further information (like stacktrace, you can find them in the logs), I guess there is a configuration problem in your node, most probably referring to a non-existing column. (But there might be other problems too.)

Hi,

I have good and bad news :-)

The bad news: Yes this is a small bug, this should be handled more apropriate.

The good news: We can work around it!

The Decision Tree Learner node only uses column which have possilbe values in their domain saved. And only columns with little numerical columns have those assigned on default. To add the poss values please use the Domain Calculator and deactivate the option "Restrict number of possible values:" (or just set it very high)

However, this should be used with care. If you have a unique identifier the DT algorithm will use it as the first split, based on the information gain methodology.

I will let you know when the bug is fixed.

Best, Iris

Hi Iris I think I have the same problem when trying to split the tree with a nominal variable that has 153 unique values.

I am using knime 3.6 and this is the bit of the log file

2018-09-05 08:43:16,371 : DEBUG : KNIME-Worker-41 : Node : Decision Tree Learner : 2:608:615 : reset
2018-09-05 08:43:16,371 : ERROR : KNIME-Worker-41 : Node : Decision Tree Learner : 2:608:615 : Execute failed: ("ArrayIndexOutOfBoundsException"): -1
2018-09-05 08:43:16,371 : DEBUG : KNIME-Worker-41 : Node : Decision Tree Learner : 2:608:615 : Execute failed: ("ArrayIndexOutOfBoundsException"): -1
java.lang.ArrayIndexOutOfBoundsException: -1
	at org.knime.base.node.mine.decisiontree2.learner2.InMemoryTable.isNominal(InMemoryTable.java:291)
	at org.knime.base.node.mine.decisiontree2.learner2.DecisionTreeLearnerNodeModel2.buildTree(DecisionTreeLearnerNodeModel2.java:704)
	at org.knime.base.node.mine.decisiontree2.learner2.DecisionTreeLearnerNodeModel2.execute(DecisionTreeLearnerNodeModel2.java:532)
	at org.knime.core.node.NodeModel.executeModel(NodeModel.java:567)
	at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1173)
	at org.knime.core.node.Node.execute(Node.java:960)
	at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:561)
	at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
	at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:179)
	at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:110)
	at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:328)
	at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:204)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)
	at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)
2018-09-05 08:43:16,371 : DEBUG : KNIME-Worker-41 : WorkflowManager : Decision Tree Learner : 2:608:615 : Decision Tree Learner 2:608:615 doBeforePostExecution
2018-09-05 08:43:16,371 : DEBUG : KNIME-Worker-41 : NodeContainer : Decision Tree Learner : 2:608:615 : Decision Tree Learner 2:608:615 has new state: POSTEXECUTE
2018-09-05 08:43:16,371 : DEBUG : KNIME-Worker-41 : WorkflowManager : Decision Tree Learner : 2:608:615 : Decision Tree Learner 2:608:615 doAfterExecute - failure
2018-09-05 08:43:16,371 : DEBUG : KNIME-Worker-41 : Node : Decision Tree Learner : 2:608:615 : reset
2018-09-05 08:43:16,371 : DEBUG : KNIME-Worker-41 : Node : Decision Tree Learner : 2:608:615 : clean output ports.
2018-09-05 08:43:16,371 : DEBUG : KNIME-Worker-41 : WorkflowFileStoreHandlerRepository : Decision Tree Learner : 2:608:615 : Removing handler 51431fe1-9f85-4d0f-9803-12f2a0cb678a (Decision Tree Learner 2:608:615: <no directory>) - 2 remaining
2018-09-05 08:43:16,372 : DEBUG : KNIME-Worker-41 : NodeContainer : Decision Tree Learner : 2:608:615 : Decision Tree Learner 2:608:615 has new state: IDLE
2018-09-05 08:43:16,372 : DEBUG : KNIME-Worker-41 : Node : Decision Tree Learner : 2:608:615 : Configure succeeded. (Decision Tree Learner)
2018-09-05 08:43:16,372 : DEBUG : KNIME-Worker-41 : NodeContainer : Decision Tree Learner : 2:608:615 : Decision Tree Learner 2:608:615 has new state: CONFIGURED
2018-09-05 08:43:16,372 : DEBUG : KNIME-Worker-41 : NodeContainer : Decision Tree Learner : 2:608:615 : Metanode 2:608 has new state: IDLE

Any help will be appreciated

Best Regards

Mau

Did you use the workaround with the domain calculator as I described above?
I will check if this bug got fixed.

Hi Iris, in the previous example I did not use the domain calculator, but now when applying it the node says that the “maximum length is 63”

Domain

I guess that this is the limit which is half of the number of categories (153).

Thank you

Mau

Hi Iris I forgot to mention if there is a way to increase the number of categories in the decision tree learner node?

Cheers

Mau

I unfortunately not able to reconstruct this. I never get the 63 error and it works when I use the Domain Calculator inbetween.

Can you in the Domain Calculator make sure the checkbox “Restrict number of possible values” is deactivated?

And can you make me a minimal workflow reconstructing the problem?

Best wishes, Iris

1 Like

Hi Iris, by I managed to execute the Decisión Tree thanks to your advice in the Domain Calculator node.

There was no restriction in my case.

Best regards

Mau

1 Like