decorate.glmnet {r2pmml} | R Documentation |
Decorates a "glmnet" object with a "lambda.s" element.
Description
Decorates a "glmnet" object with a "lambda.s" element.
Usage
## S3 method for class 'glmnet'
decorate(x, lambda.s, ...)
Arguments
x |
A "glmnet" object. |
lambda.s |
The best lambda value. Must be one of listed "glmnet$lambda" values. |
... |
Arguments to pass on to the "decorate.default" function. |
Examples
library("glmnet")
library("r2pmml")
data(iris)
iris_X = as.matrix(iris[, -ncol(iris)])
iris_y = iris[, ncol(iris)]
iris.glmnet = glmnet(x = iris_X, y = iris_y, family = "multinomial")
iris.glmnet = decorate(iris.glmnet, lambda.s = iris.glmnet$lambda[49])
r2pmml(iris.glmnet, file.path(tempdir(), "Iris-GLMNet.pmml"))
[Package r2pmml version 0.28.0 Index]