【发布时间】:2019-03-10 09:52:03
【问题描述】:
下面是 DecisionTreeClassifier 的参数:max_depth
http://scikit-learn.org/stable/modules/generated/sklearn.tree.DecisionTreeClassifier.html
max_depth : int or None, optional (default=None)
The maximum depth of the tree. If None, then nodes are expanded until all leaves are pure or until all leaves contain less than min_samples_split samples.
我一直认为决策树的深度应该等于或小于给定数据集的特征(属性)的数量。如果我们在提到的那个参数的输入之前找到纯类怎么办?它会停止分裂还是进一步分裂直到提到的输入?
拆分时是否可以在决策树的两个不同级别中使用相同的属性?
【问题讨论】:
-
树深度仅用作给定数字(小于
log(n))的停止标准。如果你到达一片叶子(只有 1 次观察),你将从此时开始停止构建。
标签: machine-learning scikit-learn decision-tree supervised-learning