File:Glmnet4plot.svg: Difference between revisions

From 太極
Jump to navigation Jump to search
(library(glmnet) data(QuickStartExample) cvfit = cv.glmnet(x, y) fit = glmnet(x, y) oldpar <- par(mfrow=c(2,2)) plot(cvfit) # mse vs log(lambda) plot(fit) # coef vs L1 norm plot(fit, xvar = "lambda", label = TRUE) # coef vs log(lambda) plot(fit, xvar = "dev", label = TRUE) # coef vs Fraction Deviance Explained par(oldpar))
 
 
Line 1: Line 1:
== Summary ==
== Summary ==
<syntaxhighlight lang='rsplus'>
library(glmnet)
library(glmnet)
data(QuickStartExample)
data(QuickStartExample)
Line 12: Line 13:
plot(fit, xvar = "dev", label = TRUE) # coef vs Fraction Deviance Explained
plot(fit, xvar = "dev", label = TRUE) # coef vs Fraction Deviance Explained
par(oldpar)
par(oldpar)
</syntaxhighlight>

Latest revision as of 12:03, 13 April 2020

Summary

library(glmnet)
data(QuickStartExample)

cvfit = cv.glmnet(x, y)
fit = glmnet(x, y)

oldpar <- par(mfrow=c(2,2))
plot(cvfit) # mse vs log(lambda)
plot(fit) # coef vs L1 norm
plot(fit, xvar = "lambda", label = TRUE) # coef vs log(lambda)
plot(fit, xvar = "dev", label = TRUE) # coef vs Fraction Deviance Explained
par(oldpar)

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current12:01, 13 April 2020Thumbnail for version as of 12:01, 13 April 2020563 × 563 (216 KB)Brb (talk | contribs)library(glmnet) data(QuickStartExample) cvfit = cv.glmnet(x, y) fit = glmnet(x, y) oldpar <- par(mfrow=c(2,2)) plot(cvfit) # mse vs log(lambda) plot(fit) # coef vs L1 norm plot(fit, xvar = "lambda", label = TRUE) # coef vs log(lambda) plot(fit, xvar = "dev", label = TRUE) # coef vs Fraction Deviance Explained par(oldpar)

There are no pages that use this file.

Metadata