Você está na página 1de 1

Introduction to Statistical Learning https://www-bcf.usc.edu/~gareth/ISL/errata.

html

An Introduction to Statistical Learning


with Applications in R

Gareth James, Daniela Witten, Trevor Hastie and Robert Tibshirani

Home

About this Book

R Code for Labs

Data Sets and Figures

ISLR Package

Get the Book

Author Bios

Errata

Errata for the 1st Edition, since the 7th printing (June 2017) and not reflected in online version

Page 254. The glmnet package has been updated so two lines of code need to change. The line

ridge.pred=predict(ridge.mod,s=0,newx=x[test,],exact=T) should be changed to

ridge.pred=predict(ridge.mod,s=0,newx=x[test,],exact=T,x=x[train,],y=y[train])

In addition the line

predict(ridge.mod,s=0,exact=T,type="coefficients")[1:20,] should be changed to

predict(ridge.mod,s=0,exact=T,type="coefficients",x=x[train,],y=y[train])[1:20,]

The code on the website has been updated accordingly.

Thanks to

Lenna Choi

1 of 1 4/30/2019, 11:49 AM

Você também pode gostar