Should the KNIME Decision Tree Learner and Decision Tree Predictor work with boolean variables?
I have a dataset in which all input variables (except one ID String) and the output/target/class variable are all boolean (type = BooleanCell).
The Decision Tree Learner does appear to create a proper tree model. Though I'm guessing it is not treating the boolean values as boolean, but as the string values "false" and "true". When I try to run that model and the same data through a Decision Tree Predictor, I get the following error messages:
ERROR DecTreePredictorNodeModel Decision Tree evaluation failed: For input string: "false"
ERROR Decision Tree Predictor Execute failed: For input string: "false"
-- Randy Kerber
San Jose, California
Nice report. I will log this in our issue tracking system directly. I don’t know when a fix will be available, but for now you could try the suboptimal step of converting your booleans to integers and using them instead for the decision tree. Might that work for now?
Thanks for posting!
When they didn't work as booleans I converted them to Strings, and that seemed to work fine for now. I considered converting true and false to 1 and 0, but I wasn't sure if KNIME would treat that as categorical or as numeric, and I wanted them treated as categorical.
One slight annoyance when converting to String is that for the target variable it treated the value 'false' as the target value, meaning the tree was selecting nodes for predicting outcome=false. So when this is fixed for booleans one desirable behavior when the target variable is boolean would be for 'true' to be the target value that the tree is attempting to predict.