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

模型的min_sample_leaf问题 #12

Open
shdiuhiuhkj opened this issue Apr 13, 2022 · 2 comments
Open

模型的min_sample_leaf问题 #12

shdiuhiuhkj opened this issue Apr 13, 2022 · 2 comments

Comments

@shdiuhiuhkj
Copy link

image
您好老师,请问一下,这样在分裂的时候,当子节点样本数小于等于min_sample_leaf时,父节点停止分裂,这样感觉min_sample_leaf的设置有点奇怪,比如min_sample_leaf=1,就是他可能会在子节点中划分到1和xx,就删除了子节点,只划分到父节点了,这样会导致子节点中的最小样本数为2,我在pima数据集上做,和sklearn上实现的决策树相比,他的节点数少了一半以上,那这样的设置,是不是在上图应该把小于等于改成小于。
有点疑问
期待您的回复

@zhaoxingfeng
Copy link
Owner

你的考虑是对的,代码中的<=改为<更合适,这样更符合叶子结点最小样本数的定义。

@shdiuhiuhkj
Copy link
Author

shdiuhiuhkj commented Apr 21, 2022 via email

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

2 participants