Be sure to review our Idea Submission Guidelines for more information!
Submission Guidelines
Yes, I know, it's weird to have a situation where a decision tree decides that no branches should be created, but it happened, and caused great confusion, panic, and delay among my students.
v1.1 of the Decision Tool does a hard-stop and outputs nothing when this happens, not even the succesfully-created model object while v1.0 of the stool still creates the model ("O") and the report ("R") ... just not the "I" (interactive report). Using the v1.0 version of the tool, I traced the problem down to this call:
dt = renderTree(the.model, tooltipParams = tooltipParams)
Where `renderTree` is part of the `AlteryxRviz` library.
I dug deeper and printed a traceback.
9: stop("dim(X) must have a positive length") 8: apply(prob, 1, max) at <tmp>#5 7: getConfidence(frame) 6: eval(expr, envir, enclos) 5: eval(substitute(list(...)), `_data`, parent.frame()) 4: transform.data.frame(vertices, predicted = attr(fit, "ylevels")[frame$yval], support = frame$yval2[, "nodeprob"], confidence = getConfidence(frame), probs = getProb(frame), counts = getCount(frame)) 3: transform(vertices, predicted = attr(fit, "ylevels")[frame$yval], support = frame$yval2[, "nodeprob"], confidence = getConfidence(frame), probs = getProb(frame), counts = getCount(frame)) 2: getVertices(fit, colpal) 1: renderTree(the.model)
The problem is that `getConfidence` pulls `prob` from the `frame` given to it, and in the case of a model with no branches, `prob` is a list. And dim(<a list>) return null. Ergo explosion.
Toy dataset that triggers the error, sample from the Titanic Kaggle competition (in which my students are competing). Predict "Survived" by "Pclass".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.