Get the paths that are defining my predictions in some decision trees
Hello everyone:
I have been using this tool for a very short time and a "small" setback has arisen, or so I hope.
I'm running a model for which I'm using a meta-operator, specifically, metacost, with an assembled decision tree. The model returns me to different trees, so far so good. The problem arises now. I can not find how to get the paths that are defining the prediction in each of these trees separately.
In a previous post I could read this solution:
Solution
Accepted by topic author cypressproject0
06-09-2017 04:15 AM
Re: How to know ... in a tree model or tree to rules?
You can also use the "Operator Toolbox" Extension. This extension has an operator named "Get Decision Tree Path" that will produce a new variable with the path (a text variable) you have to follow to reach the final node for each observation. Be aware that this extension requires the Text Mining extension. So make sure you load it too.
Here's the process:
"Process:
Screen Shot 2017-06-07 at 8.49.19 AM.png "
And here's the output:
"Output:
Screen Shot 2017-06-07 at 8.50.45 AM.png "
And later and in this same post is the same problem that brings me today to you: "This solution is for a pure tree not for an operator assembled as a metacost."
Then offer this solution:
"Whoops,
my problem MetaCost is also an ensemble model. Attached is a process with a small script converting the meta model into a collection of models and then transforming them into example sets. Note that it does not take the logic of MetaCost into account. "
And then the script.
Well: My question is: What do I do with that script? How can I achieve what I need? How can I know which path leads me to each prediction in each of the trees? Anyway. Any help will be a great help.
Thank you
Answers
hello @PB941 - did you actually run the process that @mschmitz posted in that thread? It works very well. He inserted his groovy code inside the Execute Script operator, etc...
Scott
Hi,
the point is, that MetaCost is an ensemble operator. For one example you will get one tree branch for every tree. This is then combined to a prediction. So the final model is not one branch but a linear combination of many. For details, i would refer to the paper or the apply() code of the MetaCostModel.
Best,
Martin
Dortmund, Germany
Hi sgenzer.
Thank you very much for your help. I inserted the script and this was the reusltado.
Hello Martin. Thanks for your help. Yes, it is, but I am trying to know what each of those branches is. Is this possible?