predict_leaf_node_assignment.H2OModel | R Documentation |
Obtains leaf node assignment from fitted H2O model objects.
predict_leaf_node_assignment.H2OModel(
object,
newdata,
type = c("Path", "Node_ID"),
...
)
h2o.predict_leaf_node_assignment(
object,
newdata,
type = c("Path", "Node_ID"),
...
)
object |
a fitted H2OModel object for which prediction is desired |
newdata |
An H2OFrame object in which to look for variables with which to predict. |
type |
choice of either "Path" when tree paths are to be returned (default); or "Node_ID" when the output |
... |
additional arguments to pass on. |
For every row in the test set, return the leaf placements of the row in all the trees in the model. Placements can be represented either by paths to the leaf nodes from the tree root or by H2O's internal identifiers. The order of the rows in the results is the same as the order in which the data was loaded
Returns an H2OFrame object with categorical leaf assignment identifiers for each tree in the model.
h2o.gbm
and h2o.randomForest
for model
generation in h2o.
## Not run:
library(h2o)
h2o.init()
prostate_path <- system.file("extdata", "prostate.csv", package = "h2o")
prostate <- h2o.uploadFile(path = prostate_path)
prostate$CAPSULE <- as.factor(prostate$CAPSULE)
prostate_gbm <- h2o.gbm(3:9, "CAPSULE", prostate)
h2o.predict(prostate_gbm, prostate)
h2o.predict_leaf_node_assignment(prostate_gbm, prostate)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.