R/models.R
Obtains leaf node assignment from fitted H2O model objects.
predict_leaf_node_assignment.H2OModel(object, newdata, ...) h2o.predict_leaf_node_assignment(object, newdata, ...)
object | a fitted H2OModel object for which prediction is desired |
---|---|
newdata | An H2OFrame object in which to look for variables with which to predict. |
... | additional arguments to pass on. |
Returns an H2OFrame object with categorical leaf assignment identifiers for each tree in the model.
For every row in the test set, return a set of factors that identify the leaf placements of the row in all the trees in the model. The order of the rows in the results is the same as the order in which the data was loaded
h2o.gbm
and h2o.randomForest
for model
generation in h2o.
# NOT RUN { library(h2o) h2o.init() prosPath <- system.file("extdata", "prostate.csv", package="h2o") prostate.hex <- h2o.uploadFile(path = prosPath) prostate.hex$CAPSULE <- as.factor(prostate.hex$CAPSULE) prostate.gbm <- h2o.gbm(3:9, "CAPSULE", prostate.hex) h2o.predict(prostate.gbm, prostate.hex) h2o.predict_leaf_node_assignment(prostate.gbm, prostate.hex) # }