sklearn.tree' has no attribute '
2019-10-31 本文已影响0人
biu4beng3
在scikit-learn官网中有例子,通过plot_tree画出决策树

运行代码报错:sklearn.tree' has no attribute 'plot_tree'
网上看是版本问题,要0.21以上才有
查看版本help(sklearn),显示为0.19,
通过conda更新:conda update scikit-learn,此时版本显示为 0.21
再度运行plot_tree,还是报错sklearn.tree' has no attribute 'plot_tree'
关掉Spyder再运行plot_tree即可:
