简体   繁体   中英

Report the depth and number of leaves of the learned tree of DecisionTreeClassifier in scikit-learn

How to extract the depth and number of leaves of the learned tree of DecisionTreeClassifier in scikit-learn ?

[ https://scikit-learn.org/stable/modules/generated/sklearn.tree.DecisionTreeClassifier.html][1]

我意识到可以分别使用 clf.get_depth() 和 clf.get_n_leaves() 函数提取学习树的深度和叶子数

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM