h2o (version 3.10.5.3)

predict_leaf_node_assignment.H2OModel: Predict the Leaf Node Assignment on an H2O Model

Description

Obtains leaf node assignment from fitted H2O model objects.

Usage

predict_leaf_node_assignment.H2OModel(object, newdata, ...)

h2o.predict_leaf_node_assignment(object, newdata, ...)

Arguments

object

a fitted 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.

Value

Returns an H2OFrame object with categorical leaf assignment identifiers for each tree in the model.

Details

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

See Also

h2o.gbm and h2o.randomForest for model generation in h2o.

Examples

Run this code

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)

Run the code above in your browser using DataCamp Workspace