Spaces:
Sleeping
Sleeping
Update pages/10_Decision_Tree.py
Browse files
pages/10_Decision_Tree.py
CHANGED
|
@@ -129,13 +129,13 @@ elif section == "Visualize Example Tree":
|
|
| 129 |
clf = tree.DecisionTreeClassifier(max_depth=3)
|
| 130 |
clf = clf.fit(iris.data, iris.target)
|
| 131 |
dot_data = tree.export_graphviz(clf, out_file=None,
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
graph = graphviz.source(dot_data)
|
| 137 |
st.graphviz_chart(dot_data)
|
| 138 |
|
|
|
|
| 139 |
elif section == "Try with Iris Data":
|
| 140 |
st.header("🌸 Try with Iris Dataset")
|
| 141 |
iris = load_iris()
|
|
|
|
| 129 |
clf = tree.DecisionTreeClassifier(max_depth=3)
|
| 130 |
clf = clf.fit(iris.data, iris.target)
|
| 131 |
dot_data = tree.export_graphviz(clf, out_file=None,
|
| 132 |
+
feature_names=iris.feature_names,
|
| 133 |
+
class_names=iris.target_names,
|
| 134 |
+
filled=True, rounded=True,
|
| 135 |
+
special_characters=True)
|
|
|
|
| 136 |
st.graphviz_chart(dot_data)
|
| 137 |
|
| 138 |
+
|
| 139 |
elif section == "Try with Iris Data":
|
| 140 |
st.header("🌸 Try with Iris Dataset")
|
| 141 |
iris = load_iris()
|