mirror of
https://github.com/apachecn/ailearning.git
synced 2026-02-13 15:26:28 +08:00
更新3.decisionTree文件路径
This commit is contained in:
@@ -12,7 +12,7 @@ def createDataSet():
|
||||
''' 数据读入 '''
|
||||
data = []
|
||||
labels = []
|
||||
with open("input/03.DecisionTree/data.txt") as ifile:
|
||||
with open("input/3.DecisionTree/data.txt") as ifile:
|
||||
for line in ifile:
|
||||
# 特征: 身高 体重 label: 胖瘦
|
||||
tokens = line.strip().split(' ')
|
||||
@@ -93,7 +93,7 @@ def show_pdf(clf):
|
||||
dot_data = StringIO()
|
||||
tree.export_graphviz(clf, out_file=dot_data)
|
||||
graph = pydotplus.graph_from_dot_data(dot_data.getvalue())
|
||||
graph.write_pdf("output/03.DecisionTree/tree.pdf")
|
||||
graph.write_pdf("output/3.DecisionTree/tree.pdf")
|
||||
|
||||
# from IPython.display import Image
|
||||
# Image(graph.create_png())
|
||||
|
||||
BIN
src/python/3.DecisionTree/decisionTreePlot.pyc
Normal file
BIN
src/python/3.DecisionTree/decisionTreePlot.pyc
Normal file
Binary file not shown.
Reference in New Issue
Block a user