添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
严肃的双杠  ·  解决double转 BigDecimal ...·  1 年前    · 
风度翩翩的排球  ·  %E5%BD%A9%E7%A5%A8%E6% ...·  1 年前    · 
严肃的豌豆  ·  Troubleshooting ...·  2 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I'm trying to draw a tree through sklearn lib tree, but the problem is that column indexes are written in the picture.

tree.plot_tree(clf_decision)

make use of feature_names and class_names parameters :

from sklearn.datasets import load_iris
from sklearn import tree
iris = load_iris()
clf = tree.DecisionTreeClassifier(random_state=0).fit(iris.data, iris.target)
tree.plot_tree(clf, feature_names=iris.feature_names, class_names=iris.target_names)
        

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.