Classification Tree Diagram from H2O Mojo/Pojo
This question draws heavily from the solution to this question as a jumping off point.
Given that I can use R to produce a mojo model object:
library(h2o)
h2o.init()
airlinedf <- h2o.importFile("http://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/allyears2k_headers.zip")
airlinemodel <- h2o.gbm(model_id = "airlinemodel",
training_frame = airlinedf,
x = c("Year", "Month", "DayofMonth", "DayOfWeek", "UniqueCarrier"),
y = "IsDepDelayed",
max_depth = 3,
ntrees = 5)
h2o.download_mojo(airlinemodel, getwd(), FALSE)
And bash/graphviz to produce a tree diagram of that model:
java -cp h2o.jar hex.genmodel.tools.PrintMojo --tree 0 -i airlinemodel.zip -o airlinemodel.gv
dot -Tpng airlinemodel.gv -o airlinemodel.png
My question is three fold:
How do I explain the values and decisions in this visualization and the values at the terminal nodes? What are the NAs in the second tier? If the values in the terminal nodes are "class probabilities", how can they be negative?
Is there a way to visualize or conceptualize a "summary tree" of all the trees in the model?
How can I produce a diagram to use color or shape to indicate the binary classification assignments of items in the end node?
r graphviz h2o gbm
add a comment |
This question draws heavily from the solution to this question as a jumping off point.
Given that I can use R to produce a mojo model object:
library(h2o)
h2o.init()
airlinedf <- h2o.importFile("http://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/allyears2k_headers.zip")
airlinemodel <- h2o.gbm(model_id = "airlinemodel",
training_frame = airlinedf,
x = c("Year", "Month", "DayofMonth", "DayOfWeek", "UniqueCarrier"),
y = "IsDepDelayed",
max_depth = 3,
ntrees = 5)
h2o.download_mojo(airlinemodel, getwd(), FALSE)
And bash/graphviz to produce a tree diagram of that model:
java -cp h2o.jar hex.genmodel.tools.PrintMojo --tree 0 -i airlinemodel.zip -o airlinemodel.gv
dot -Tpng airlinemodel.gv -o airlinemodel.png
My question is three fold:
How do I explain the values and decisions in this visualization and the values at the terminal nodes? What are the NAs in the second tier? If the values in the terminal nodes are "class probabilities", how can they be negative?
Is there a way to visualize or conceptualize a "summary tree" of all the trees in the model?
How can I produce a diagram to use color or shape to indicate the binary classification assignments of items in the end node?
r graphviz h2o gbm
for your first question please take a look at this question which asked the same thing: stats.stackexchange.com/questions/374569/…. thanks!
– Lauren
Nov 19 '18 at 21:08
add a comment |
This question draws heavily from the solution to this question as a jumping off point.
Given that I can use R to produce a mojo model object:
library(h2o)
h2o.init()
airlinedf <- h2o.importFile("http://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/allyears2k_headers.zip")
airlinemodel <- h2o.gbm(model_id = "airlinemodel",
training_frame = airlinedf,
x = c("Year", "Month", "DayofMonth", "DayOfWeek", "UniqueCarrier"),
y = "IsDepDelayed",
max_depth = 3,
ntrees = 5)
h2o.download_mojo(airlinemodel, getwd(), FALSE)
And bash/graphviz to produce a tree diagram of that model:
java -cp h2o.jar hex.genmodel.tools.PrintMojo --tree 0 -i airlinemodel.zip -o airlinemodel.gv
dot -Tpng airlinemodel.gv -o airlinemodel.png
My question is three fold:
How do I explain the values and decisions in this visualization and the values at the terminal nodes? What are the NAs in the second tier? If the values in the terminal nodes are "class probabilities", how can they be negative?
Is there a way to visualize or conceptualize a "summary tree" of all the trees in the model?
How can I produce a diagram to use color or shape to indicate the binary classification assignments of items in the end node?
r graphviz h2o gbm
This question draws heavily from the solution to this question as a jumping off point.
Given that I can use R to produce a mojo model object:
library(h2o)
h2o.init()
airlinedf <- h2o.importFile("http://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/allyears2k_headers.zip")
airlinemodel <- h2o.gbm(model_id = "airlinemodel",
training_frame = airlinedf,
x = c("Year", "Month", "DayofMonth", "DayOfWeek", "UniqueCarrier"),
y = "IsDepDelayed",
max_depth = 3,
ntrees = 5)
h2o.download_mojo(airlinemodel, getwd(), FALSE)
And bash/graphviz to produce a tree diagram of that model:
java -cp h2o.jar hex.genmodel.tools.PrintMojo --tree 0 -i airlinemodel.zip -o airlinemodel.gv
dot -Tpng airlinemodel.gv -o airlinemodel.png
My question is three fold:
How do I explain the values and decisions in this visualization and the values at the terminal nodes? What are the NAs in the second tier? If the values in the terminal nodes are "class probabilities", how can they be negative?
Is there a way to visualize or conceptualize a "summary tree" of all the trees in the model?
How can I produce a diagram to use color or shape to indicate the binary classification assignments of items in the end node?
r graphviz h2o gbm
r graphviz h2o gbm
edited Nov 20 '18 at 17:52
user6910411
34.4k1080104
34.4k1080104
asked Nov 19 '18 at 20:28
RealViaCauchyRealViaCauchy
1629
1629
for your first question please take a look at this question which asked the same thing: stats.stackexchange.com/questions/374569/…. thanks!
– Lauren
Nov 19 '18 at 21:08
add a comment |
for your first question please take a look at this question which asked the same thing: stats.stackexchange.com/questions/374569/…. thanks!
– Lauren
Nov 19 '18 at 21:08
for your first question please take a look at this question which asked the same thing: stats.stackexchange.com/questions/374569/…. thanks!
– Lauren
Nov 19 '18 at 21:08
for your first question please take a look at this question which asked the same thing: stats.stackexchange.com/questions/374569/…. thanks!
– Lauren
Nov 19 '18 at 21:08
add a comment |
1 Answer
1
active
oldest
votes
There is a better way to build decision trees with H2O - without extracting MOJOs or leaving R/Python - using new Tree API (starting with 3.22.0.1). For comprehensive explanations see:
- Inspecting Decision Trees with H2O
- Finally, You can Plot H2O Decision Trees in R
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53382158%2fclassification-tree-diagram-from-h2o-mojo-pojo%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
There is a better way to build decision trees with H2O - without extracting MOJOs or leaving R/Python - using new Tree API (starting with 3.22.0.1). For comprehensive explanations see:
- Inspecting Decision Trees with H2O
- Finally, You can Plot H2O Decision Trees in R
add a comment |
There is a better way to build decision trees with H2O - without extracting MOJOs or leaving R/Python - using new Tree API (starting with 3.22.0.1). For comprehensive explanations see:
- Inspecting Decision Trees with H2O
- Finally, You can Plot H2O Decision Trees in R
add a comment |
There is a better way to build decision trees with H2O - without extracting MOJOs or leaving R/Python - using new Tree API (starting with 3.22.0.1). For comprehensive explanations see:
- Inspecting Decision Trees with H2O
- Finally, You can Plot H2O Decision Trees in R
There is a better way to build decision trees with H2O - without extracting MOJOs or leaving R/Python - using new Tree API (starting with 3.22.0.1). For comprehensive explanations see:
- Inspecting Decision Trees with H2O
- Finally, You can Plot H2O Decision Trees in R
answered Dec 29 '18 at 2:56
topcheftopchef
13.2k65091
13.2k65091
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53382158%2fclassification-tree-diagram-from-h2o-mojo-pojo%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
for your first question please take a look at this question which asked the same thing: stats.stackexchange.com/questions/374569/…. thanks!
– Lauren
Nov 19 '18 at 21:08