Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Petra
DM_course
Commits
64563c6a
Commit
64563c6a
authored
Nov 15, 2019
by
Petra
Browse files
accuracy computation separate from print
parent
bca2d502
Changes
1
Hide whitespace changes
Inline
Side-by-side
2_classification.py
View file @
64563c6a
...
...
@@ -43,7 +43,9 @@ print("\n Actual Predicted")
for
i
in
range
(
10
):
print
(
"{0:6.2f} {1:8.2f}"
.
format
(
y_test
[
i
],
y_pred
[
i
]))
print
(
""" -- Performance ---"""
)
print
(
"Accuracy
\t
{0:5.2f}"
.
format
(
metrics
.
accuracy_score
(
y_test
,
y_pred
)))
accuracy
=
metrics
.
accuracy_score
(
y_test
,
y_pred
)
print
(
"Accuracy
\t
{0:5.2f}"
.
format
(
accuracy
))
""" Visualize the tree """
# https://scikit-learn.org/stable/auto_examples/tree/plot_unveil_tree_structure.html#sphx-glr-auto-examples-tree-plot-unveil-tree-structure-py
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment