plot.sgdnet: Plot Coefficients from an 'sgdnet' Object

Description Usage Arguments Details Value See Also Examples

Description

Plot coefficients from an object of class 'sgdnet' against the L1-norm, lambda penalty, or deviance ratio.

Usage

1
2
## S3 method for class 'sgdnet'
plot(x, xvar = c("norm", "lambda", "dev"), ...)

Arguments

x

an object of class 'sgdnet', commonly the result from calling sgdnet().

xvar

value to be plotted on the x axis. "norm" plots the L1 norm, "lambda" the logarithmized lambda (penalty) values, and "dev" the percent of deviance explained.

...

parameters passed down to lattice::xyplot().

Details

This function calls lattice::xyplot() under the hood after having arranged the plotting data slightly.

Value

A graphical description of class 'trellis', which will be plotted on the current graphical device in interactive sessions.

See Also

lattice::xyplot(), sgdnet()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Gaussian logistic regression
gfit <- sgdnet(abalone$x, abalone$y, alpha = 0)
plot(gfit, auto.key = list(columns = 2, space = "top"))

# Binomial logistic regression
bfit <- sgdnet(with(infert, cbind(age, parity)),
               infert$case,
               family = "binomial")
plot(bfit, xvar = "lambda", grid = TRUE)

# Multinomial logistic regression
mfit <- sgdnet(iris[, 1:4], iris[, 5], family = "multinomial")
plot(mfit, xvar = "dev", main = "Lassoing with sgdnet")

# Multivariate gaussian regression
mgfit <- sgdnet(student$x, student$y, family = "mgaussian")
plot(mgfit, lty = 1:9, layout = c(1, 2))

jolars/sgdnet documentation built on May 22, 2019, 11:52 p.m.