d*****y 发帖数: 1058 | 1 [b,dev] = glmfit(...)returns dev, the deviance of the fit at the solution ve
ctor. The deviance is a generalization of the residual sum of squares. It is
possible to perform an analysis of deviance to compare several models, each
a subset of the other, and to test whether the model with more terms is sig
nificantly better than the model with fewer terms.
for example:
y--[x1,x2,x3,x4,x5]
y--[x1,x3,x5]
我想知道哪个模型更好一点,我看网上的例子是
[b,dev1]=glmfit([x1,x2,x3,x4,x5],y,'normal');
[b,dev2]=glmfit([x1,x3,x5], y, 'normal');
请问如何用dev1和dev2来确定哪个模型好啊?
我知道可以用AIC来计算,选AIC低的那个,但是AIC怎么在matlab
里面计算啊,想请大牛们confirm一下下面的公式对不对
AIC=dev+2*(length(b))
谢谢 | r********n 发帖数: 6979 | 2 这不就是做feature selection么
你可以google一下
方法多了去了
forward, backward, AIC, BIC。。。
你说的这个例子其实就是做一个F-test(anova)
如果用更少predictor的那个model能够得到和更多predictor的model相似的fitness
那就应该选那个predictor比较少的
一般来说这样产生的model更robust
如果你只是先快速检验一下那个model可能会更好一点
可以用这个方法
不过我个人不是太喜欢这么做
因为做出来的model在新的数据里面“不一定”更好
如果愿意多花些时间的话
我一般会先做cross validatiaon或者bootstrapping
重复N次
然后比较两个model在test set里面的fitness
然后选择那个fitness error更低的那个
优点是这样做出来的model一般来说更robust
缺点是花的时间可能是几十倍甚至几百倍
如果你的feature比较多的时候
可以先用uni-variate model, forward, backward等方法找到有限的一些feature
然后用以上的方法
just my 2cents
ve
is
each
sig
【在 d*****y 的大作中提到】 : [b,dev] = glmfit(...)returns dev, the deviance of the fit at the solution ve : ctor. The deviance is a generalization of the residual sum of squares. It is : possible to perform an analysis of deviance to compare several models, each : a subset of the other, and to test whether the model with more terms is sig : nificantly better than the model with fewer terms. : for example: : y--[x1,x2,x3,x4,x5] : y--[x1,x3,x5] : 我想知道哪个模型更好一点,我看网上的例子是 : [b,dev1]=glmfit([x1,x2,x3,x4,x5],y,'normal');
|
|