Machine-Learning-in-Action-Python3 icon indicating copy to clipboard operation
Machine-Learning-in-Action-Python3 copied to clipboard

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

Open xiaoliou008 opened this issue 6 years ago • 1 comments

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))

xiaoliou008 avatar Jul 08 '19 04:07 xiaoliou008

是这样子,谢谢指正

wzy6642 avatar Jul 24 '19 04:07 wzy6642