Decision Tree to Ruleset error

Hi,

I tried to use the Decision Tree to Ruleset node in the following way:
46 Screen Shot 2018-11-03 at 12.46.46

After it is executed, I see a red error icon and no data in the node rules table. What could cause this?

Could you provide us with more details. Eg. what the log says or what the error message is once you hover over the node with your mouse.

Thanks for having a look at this @mlauber71. Here is the log output referring to this node after I tried to execute it. Any clues from this?

018-11-04 12:29:26,364 : DEBUG : main : NodeContainerEditPart : : : Decision Tree to Ruleset 0:40 (CONFIGURED)
2018-11-04 12:29:58,038 : DEBUG : main : OpenPortViewAction : : : Open Port View Decision Tree to Ruleset (#2)
2018-11-04 12:29:58,104 : DEBUG : AWT-EventQueue-0 : Buffer : Decision Tree to Ruleset : 0:40 : Using table format org.knime.core.data.container.DefaultTableStoreFormat
2018-11-04 12:29:58,109 : DEBUG : AWT-EventQueue-0 : Buffer : Decision Tree to Ruleset : 0:40 : Using table format org.knime.core.data.container.DefaultTableStoreFormat
2018-11-04 12:30:04,425 : DEBUG : main : OpenPortViewAction : : : Open Port View Decision Tree to Ruleset (#1)
2018-11-04 12:30:04,470 : DEBUG : AWT-EventQueue-0 : Buffer : Decision Tree to Ruleset : 0:40 : Using table format org.knime.core.data.container.DefaultTableStoreFormat
2018-11-04 12:30:08,625 : DEBUG : main : NodeContainerEditPart : : : Decision Tree to Ruleset 0:40 (CONFIGURED)
2018-11-04 12:30:08,625 : DEBUG : main : NodeContainerEditPart : : : Decision Tree to Ruleset 0:40 (CONFIGURED)
2018-11-04 12:30:10,764 : DEBUG : main : ExecuteAction : : : Creating execution job for 1 node(s)…
2018-11-04 12:30:10,764 : DEBUG : main : NodeContainer : : : Setting dirty flag on Decision Tree to Ruleset 0:40
2018-11-04 12:30:10,764 : DEBUG : main : NodeContainer : : : Setting dirty flag on data_preparation_ecom_churn 0
2018-11-04 12:30:10,764 : DEBUG : main : NodeContainer : : : Decision Tree to Ruleset 0:40 has new state: CONFIGURED_MARKEDFOREXEC
2018-11-04 12:30:10,765 : DEBUG : main : NodeContainer : : : Decision Tree to Ruleset 0:40 has new state: CONFIGURED_QUEUED
2018-11-04 12:30:10,766 : DEBUG : KNIME-Workflow-Notifier : WorkflowEditor : : : Workflow event triggered: WorkflowEvent [type=WORKFLOW_DIRTY;node=0;old=null;new=null;timestamp=04-Nov-2018 12:30:10]
2018-11-04 12:30:10,766 : DEBUG : main : NodeContainer : : : data_preparation_ecom_churn 0 has new state: EXECUTING
2018-11-04 12:30:10,766 : DEBUG : KNIME-Worker-82 : WorkflowManager : Decision Tree to Ruleset : 0:40 : Decision Tree to Ruleset 0:40 doBeforePreExecution
2018-11-04 12:30:10,766 : DEBUG : KNIME-Worker-82 : NodeContainer : Decision Tree to Ruleset : 0:40 : Decision Tree to Ruleset 0:40 has new state: PREEXECUTE
2018-11-04 12:30:10,766 : DEBUG : KNIME-Worker-82 : WorkflowManager : Decision Tree to Ruleset : 0:40 : Decision Tree to Ruleset 0:40 doBeforeExecution
2018-11-04 12:30:10,766 : DEBUG : KNIME-Worker-82 : NodeContainer : Decision Tree to Ruleset : 0:40 : Decision Tree to Ruleset 0:40 has new state: EXECUTING
2018-11-04 12:30:10,767 : DEBUG : KNIME-Worker-82 : WorkflowFileStoreHandlerRepository : Decision Tree to Ruleset : 0:40 : Adding handler c2dfb908-c492-4f59-b507-35fcfa93844a (Decision Tree to Ruleset 0:40: ) - 34 in total
2018-11-04 12:30:10,767 : DEBUG : KNIME-Worker-82 : LocalNodeExecutionJob : Decision Tree to Ruleset : 0:40 : Decision Tree to Ruleset 0:40 Start execute
2018-11-04 12:30:10,767 : DEBUG : KNIME-WFM-Parent-Notifier : NodeContainer : : : ROOT has new state: EXECUTING
2018-11-04 12:30:11,029 : DEBUG : KNIME-Worker-82 : Node : Decision Tree to Ruleset : 0:40 : reset
2018-11-04 12:30:11,029 : ERROR : KNIME-Worker-82 : Node : Decision Tree to Ruleset : 0:40 : Execute failed: For input string: “true”
2018-11-04 12:30:11,029 : DEBUG : KNIME-Worker-82 : Node : Decision Tree to Ruleset : 0:40 : Execute failed: For input string: “true”
java.lang.NumberFormatException: For input string: “true”
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043)
at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
at java.lang.Double.parseDouble(Double.java:538)
at org.knime.base.node.rules.engine.totable.RuleSetToTable.convertToExpectedType(RuleSetToTable.java:416)
at org.knime.base.node.rules.engine.totable.RuleSetToTable.asComparisonValue(RuleSetToTable.java:660)
at org.knime.base.node.rules.engine.totable.RuleSetToTable.asComparisonValues(RuleSetToTable.java:644)
at org.knime.base.node.rules.engine.totable.RuleSetToTable.convertToStringPrecedence(RuleSetToTable.java:476)
at org.knime.base.node.rules.engine.totable.RuleSetToTable.join(RuleSetToTable.java:607)
at org.knime.base.node.rules.engine.totable.RuleSetToTable.convertToStringPrecedence(RuleSetToTable.java:491)
at org.knime.base.node.rules.engine.totable.RuleSetToTable.convertToString(RuleSetToTable.java:431)
at org.knime.base.node.rules.engine.totable.RuleSetToTable.createRow(RuleSetToTable.java:297)
at org.knime.base.node.rules.engine.totable.RuleSetToTable.execute(RuleSetToTable.java:235)
at org.knime.base.node.rules.engine.decisiontree.FromDecisionTreeNodeModel.execute(FromDecisionTreeNodeModel.java:100)
at org.knime.core.node.NodeModel.executeModel(NodeModel.java:567)
at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1177)
at org.knime.core.node.Node.execute(Node.java:964)
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-11-04 12:30:11,031 : DEBUG : KNIME-Worker-82 : WorkflowManager : Decision Tree to Ruleset : 0:40 : Decision Tree to Ruleset 0:40 doBeforePostExecution
2018-11-04 12:30:11,031 : DEBUG : KNIME-Worker-82 : NodeContainer : Decision Tree to Ruleset : 0:40 : Decision Tree to Ruleset 0:40 has new state: POSTEXECUTE
2018-11-04 12:30:11,047 : DEBUG : KNIME-Worker-82 : WorkflowManager : Decision Tree to Ruleset : 0:40 : Decision Tree to Ruleset 0:40 doAfterExecute - failure
2018-11-04 12:30:11,047 : DEBUG : KNIME-Worker-82 : Node : Decision Tree to Ruleset : 0:40 : reset
2018-11-04 12:30:11,047 : DEBUG : KNIME-Worker-82 : Node : Decision Tree to Ruleset : 0:40 : clean output ports.
2018-11-04 12:30:11,047 : DEBUG : KNIME-Worker-82 : WorkflowFileStoreHandlerRepository : Decision Tree to Ruleset : 0:40 : Removing handler c2dfb908-c492-4f59-b507-35fcfa93844a (Decision Tree to Ruleset 0:40: ) - 33 remaining
2018-11-04 12:30:11,047 : DEBUG : KNIME-Worker-82 : NodeContainer : Decision Tree to Ruleset : 0:40 : Decision Tree to Ruleset 0:40 has new state: IDLE
2018-11-04 12:30:11,048 : DEBUG : KNIME-Worker-82 : Node : Decision Tree to Ruleset : 0:40 : Configure succeeded. (Decision Tree to Ruleset)
2018-11-04 12:30:11,048 : DEBUG : KNIME-Worker-82 : NodeContainer : Decision Tree to Ruleset : 0:40 : Decision Tree to Ruleset 0:40 has new state: CONFIGURED
2018-11-04 12:30:11,048 : DEBUG : KNIME-Worker-82 : NodeContainer : Decision Tree to Ruleset : 0:40 : data_preparation_ecom_churn 0 has new state: CONFIGURED
2018-11-04 12:30:11,048 : DEBUG : KNIME-WFM-Parent-Notifier : NodeContainer : : : ROOT has new state: IDLE
2018-11-04 12:30:11,057 : DEBUG : KNIME-Node-Usage-Writer : NodeTimer$GlobalNodeStats : : : Successfully wrote node usage stats to file: /Users/johanohlin/knime-workspace/.metadata/knime/nodeusage_3.0.json
2018-11-04 12:30:11,472 : DEBUG : KNIME-Node-Usage-Sender : NodeTimer$GlobalNodeStats : : : Successfully sent node usage stats to server
2018-11-04 12:30:18,464 : DEBUG : main : NodeContainerEditPart : : : Decision Tree to Ruleset 0:40 (CONFIGURED)

It seems there is a problem with a string variable. You could try a few things:

  • use a domain calculator node before you start the whole thing
  • use a missing value replacement and see if that changes anything
  • see if your string variables have any strange values or are completely consisting of missings
  • remove all string values and see if that changes anything (to narrow the problem down)
  • try to save the model as PMML and see if that does work
  • see if you can convert the decision tree model to SQL with “PMML to SQL” to see if that works at all PMML to SQL — NodePit
  • The Decision Tree to Ruleset has several settings. You could see if turning them on and off changes anything

If you could provide a sample workflow that produces the error it might be easier to see what is going on.

I agree, it might be easier if I share the workflow:

data_preparation_ecom_churn_itr2.knar.knwf (94.5 KB)

The input data I use is to big to keep in the knwf file but it is publicly available at:

I’ll go through your suggestions meanwhile and let you know if any of them work. Thanks again for helping @mlauber71

I think I know what is causing this. It is the Boolean values. Once you convert them to strings it does work. This could be a thing for the KNIME developers. Decision Tree to Ruleset has a problem with boolean values.

I have distilled that into a small workflow so it is possible to see what is happening.

kn_example_ruleset_problem_with_boolean_values.knwf (351.5 KB)

3 Likes

Hi @mlauber71, this did the trick and the ruleset is not generated. Thanks so much for the help in solving this.

3 Likes

Hello @cason and @mlauber71 ,
this is indeed a bug in the node and I opened a bug report for it.
As long as it is not fixed, converting boolean columns to string as proposed by mlauber71 is a viable workaround that will yield the same results as a model trained with the boolean column.

Cheers,

nemad

2 Likes