Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions Python Class Work 4 - ML.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1312,48 +1312,6 @@
"print(\"DecisionTrees's Accuracy: \", metrics.accuracy_score(y_testset, predTree))"
]
},
{
"cell_type": "code",
"execution_count": 63,
"metadata": {},
"outputs": [],
"source": [
"# Notice: You might need to uncomment and install the pydotplus and graphviz libraries if you have not installed these before\n",
"# !conda install -c conda-forge pydotplus -y\n",
"#!conda install -c conda-forge python-graphviz -y"
]
},
{
"cell_type": "code",
"execution_count": 64,
"metadata": {},
"outputs": [],
"source": [
"#from sklearn.externals.six import StringIO\n",
"#import pydotplus\n",
"#import matplotlib.image as mpimg\n",
"#from sklearn import tree\n",
"#%matplotlib inline "
]
},
{
"cell_type": "code",
"execution_count": 65,
"metadata": {},
"outputs": [],
"source": [
"#dot_data = StringIO()\n",
"#filename = \"drugtree.png\"\n",
"#featureNames = dfLabs.columns[0:5]\n",
"#targetNames = dfLabs[\"Drug\"].unique().tolist()\n",
"#out=tree.export_graphviz(drugTree,feature_names=featureNames, out_file=dot_data, class_names= np.unique(y_trainset), filled=True, #special_characters=True,rotate=False) \n",
"#graph = pydot.graph_from_dot_data(dot_data.getvalue()) \n",
"#graph.write_png(filename)\n",
"#img = mpimg.imread(filename)\n",
"#plt.figure(figsize=(100, 200))\n",
"#plt.imshow(img,interpolation='nearest')"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down