Scikit-Learnで決定木分析をしていますが、max_depth,max_leaf_nodesを指定していますがその指定通りになりません。
Python
1clf = tree.DecisionTreeClassifier(max_depth=1, max_leaf_nodes=4, random_state=0) 2clf = clf.fit(X_train,y_train) 3dot_data = tree.export_graphviz( 4 clf, 5 out_file=None, 6 feature_names=iris.feature_names, 7 class_names=iris.target_names, 8 filled=True, 9 proportion=True) 10graph = pydotplus.graph_from_dot_data(dot_data) 11Image(graph.create_png())
最大深さ:1
を指定しているはずなのに、指定通りになりません。
理由を教えてください
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。