python 西瓜书决策树实现(可以直接运行)
姓伍不姓六:
Traceback (most recent call last):
File "C:\dev\python\python3.11.4\Lib\site-packages\pandas\core\indexes\base.py", line 3805, in get_loc
return self._engine.get_loc(casted_key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "index.pyx", line 167, in pandas._libs.index.IndexEngine.get_loc
File "index.pyx", line 196, in pandas._libs.index.IndexEngine.get_loc
File "pandas\\_libs\\hashtable_class_helper.pxi", line 7081, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas\\_libs\\hashtable_class_helper.pxi", line 7089, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: '好瓜'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\study\python-learn\demo1.py", line 168, in
main()
File "C:\study\python-learn\demo1.py", line 159, in main
idx, plist = get_p(root_node, data)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\study\python-learn\demo1.py", line 20, in get_p
|