全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
2249 3
2010-02-08
这几天在看linear models with R这本书,学到了不少实用东西,在学到第九章的shrinkage methods 时,遇到一些问题,希望和大家讨论一下。首先,在学习这本书的过程中,我觉得这本书上的东西与现在的R软件中的相比有一些过时了,书上的某些packaga在软件中没有,如mva ,pls.pcr等。我在练习书上的东西时,没找到pcr()和pls()这两个函数,(也许是我的方法不当吧,所以拿到论坛里来和大家讨论一下)。
如有熟悉这方面的朋友,可以讨论一下。谢谢!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2010-2-9 06:36:24
Have a look this website

http://www.maths.bath.ac.uk/~jjf23/LMR/errata.html

p139, package pls.pcr has been replaced with package pls in more recent versions of R. Last paragraph is now: The pls package can compute this CV. By default, the data is divided into ten parts for the CV: > pcrmod <- pcr(fat ~ ., data=meatspec[1:172,], validation="CV",ncomp=50)> validationplot(pcrmod)p140, validationplot() above produces a slightly different plot for the right panel of Figure 9.5. p141, The plsr() function now centers the predictors internally. So first sentence can now read "We now compute the PLS on all models up to size 50". The next chunk of R code becomes: > plsg <- plsr(fat ~ ., data=meatspec[1:172,], ncomp=50, validation="CV")> coefplot(plsg,ncomp=4,xlab="Frequency")> validationplot(plsg)The centering described in the last two sentences of p141 is now redundant. Last chunk of R code becomes: > ypred <- predict(plsg,ncomp=14)> rmse(ypred,meatspec$fat[1:172])p142, chunk of R code becomes: > ytpred <- predict(plsg,meatspec[173:215,],ncomp=14)> rmse(ytpred,meatspec$fat[173:215])Note also that Figure 9.7 is somewhat changed by using the plotting functions from the pls package.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2010-2-9 22:43:44
谢谢2楼的朋友的回复!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2011-5-27 16:10:45
谢谢楼主的分享
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群