作者clansoda (小笨)
看板R_Language
标题[问题] xgboost regression
时间Wed Jul 13 14:48:36 2016
首先我先贴出资料
train
https://drive.google.com/file/d/0B3xY9FMzjybzZ1pCTDE1cE1yVmM/view?usp=sharing
test
https://drive.google.com/file/d/0B3xY9FMzjybzWUpzdmNmWlhwUmc/view?usp=sharing
这是一个hackthon上面的资料,我只是想用实际一点的资料来做我正在研究的package
train跟test都是数字资料是因为xgboost本身只吃数字资料,因此类别变数我全部都
转成dummy variable,我用train data训练一个random forest得到的RMSE在1179
但是我用相同的train data去训练xgbooster然後predict,得到的RMSE居然2800多
已经是最後一名的边都摸不到的那种,我觉得应该是我的code哪里写错了,但是我看
vignette,我一开始是写成classification的样子,後来改成regression後却跑出
负数的值,比用classification去跑更离谱,因此发文请教
xgboost(data = trainmatrix,label = train$Item_Outlet_Sales,max_depth=2
,eta=1,nthread=2,nrounds = 2,objective="reg:linear",booster="gblinear")->s
上面是我用来训练xgbooster的语法跟参数,我一开始跟着vignette写如果booster不写
=gblinear好像会试classfication,多写以後跑出来是负数。
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 1.175.245.91
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/R_Language/M.1468392521.A.C4F.html