Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tree.py中建树的分割指标MSE #5

Open
wai7niu8 opened this issue Nov 4, 2016 · 4 comments
Open

tree.py中建树的分割指标MSE #5

wai7niu8 opened this issue Nov 4, 2016 · 4 comments

Comments

@wai7niu8
Copy link

wai7niu8 commented Nov 4, 2016

@liudragonfly
MSE应该是对应regression的平方误差的分割原则吧,其实并不适用于二分类和多分类的损失函数吧~

@liudragonfly
Copy link
Owner

树的训练拟合的是残差,在训练单棵树的时候可以当成回归。

@galaxy-fangfang
Copy link

@liudragonfly
def MSE(values):
"""
均平方误差 mean square error
"""
if len(values) < 2:
return 0
mean = sum(values)/float(len(values))
error = 0.0
for v in values:
error += (mean-v)*(mean-v)
return error

有点不明白,我看均方误差的定义是sum(predict-label)^2,而这里感觉作者代码里面写的MSE是求的value的方差啊……求解答

@DeligientSloth
Copy link

树的训练拟合的是残差,在训练单棵树的时候可以当成回归。

在xgboost时划分特征就是根据划分之后loss最小来决定是否划分以及选择最优划分点,请问xgboost和gbdt这两种策略有什么区别吗?为何gbdt不使用类似xgboost那样的策略

@liudragonfly
Copy link
Owner

@DeligientSloth 应该是GBDT和xgboost的loss定义不同造成的。xgboost可以看成是优化版本的GBDT。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants