plot.H2OModel: Plot an H2O Model

View source: R/models.R

plot.H2OModelR Documentation

Plot an H2O Model

Description

Plots training set (and validation set if available) scoring history for an H2O Model

Usage

## S3 method for class 'H2OModel'
plot(x, timestep = "AUTO", metric = "AUTO", ...)

Arguments

x

A fitted H2OModel object for which the scoring history plot is desired.

timestep

A unit of measurement for the x-axis.

metric

A unit of measurement for the y-axis.

...

additional arguments to pass on.

Details

This method dispatches on the type of H2O model to select the correct scoring history. The timestep and metric arguments are restricted to what is available in the scoring history for a particular type of model.

Value

Returns a scoring history plot.

See Also

h2o.deeplearning, h2o.gbm, h2o.glm, h2o.randomForest for model generation in h2o.

Examples

## Not run: 
if (requireNamespace("mlbench", quietly=TRUE)) {
    library(h2o)
    h2o.init()

    df <- as.h2o(mlbench::mlbench.friedman1(10000, 1))
    rng <- h2o.runif(df, seed = 1234)
    train <- df[rng < 0.8,]
    valid <- df[rng >= 0.8,]

    gbm <- h2o.gbm(x = 1:10, y = "y", training_frame = train, validation_frame = valid,
                   ntrees = 500, learn_rate = 0.01, score_each_iteration = TRUE)
    plot(gbm)
    plot(gbm, timestep = "duration", metric = "deviance")
    plot(gbm, timestep = "number_of_trees", metric = "deviance")
    plot(gbm, timestep = "number_of_trees", metric = "rmse")
    plot(gbm, timestep = "number_of_trees", metric = "mae")
}

## End(Not run)

h2o documentation built on Aug. 9, 2023, 9:06 a.m.