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

BUG: Machine-Learning-in-Action-Python3/CART_Project3/CART.py #1

Open
xiaoliou008 opened this issue Jul 8, 2019 · 1 comment
Open

Comments

@xiaoliou008
Copy link

Machine-Learning-in-Action-Python3/CART_Project3/CART.py
第285行
errorNoMerge = np.sum(np.power(lSet[:, -1] - tree['left'], 2)) + np.sum(np.power(rSet[:, 1] - tree['right'], 2))
中的后半部分rSet的索引似乎应该是[:, -1]。应修改为:
errorNoMerge = np.sum(np.power(lSet[:, -1] - tree['left'], 2)) + np.sum(np.power(rSet[:, -1] - tree['right'], 2))

@wzy6642
Copy link
Owner

wzy6642 commented Jul 24, 2019

是这样子,谢谢指正

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