Learn R Programming

h2o (version 2.8.4.4)

h2o.getGLMLambdaModel: Get H2O GLM Model for Specific Lambda

Description

Retrieve the H2O GLM model built using a specific value of lambda from a lambda search.

Usage

h2o.getGLMLambdaModel(model, lambda)

Arguments

model
An H2OGLMModel object generated by h2o.glm with lambda search enabled.
lambda
The specific value of lambda for which model to retrieve. If that lambda was not include in or saved during the search, the method throws an error.

Value

  • Returns an object of class H2OGLMModel.

Examples

Run this code
library(h2o)
localH2O = h2o.init()
prosPath = system.file("extdata", "prostate.csv", package = "h2o")
prostate.hex = h2o.importFile(localH2O, path = prosPath)
prostate.srch = h2o.glm(x = 3:9, y = 2, data = prostate.hex, family = "binomial", 
  nlambda = 3, lambda_search = TRUE, nfolds = 0)
random_lambda = sample(prostate.srch@model$params$lambda_all, 1)
random_model = h2o.getGLMLambdaModel(prostate.srch, random_lambda)

Run the code above in your browser using DataLab