Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Image classification
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Massala Corentin
Image classification
Commits
a3d152ab
Commit
a3d152ab
authored
1 year ago
by
corentin
Browse files
Options
Downloads
Patches
Plain Diff
update the graph
parent
815d6e3c
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
knn.py
+6
-8
6 additions, 8 deletions
knn.py
with
6 additions
and
8 deletions
knn.py
+
6
−
8
View file @
a3d152ab
...
...
@@ -55,12 +55,15 @@ def bench_knn():
accuracies
.
append
(
accuracy
)
# Save and show the graph of accuracies
fig
=
plt
.
figure
()
plt
.
figure
(
figsize
=
(
8
,
6
))
plt
.
xlabel
(
'
K
'
)
plt
.
ylabel
(
'
Accuracy
'
)
plt
.
plot
(
k_indices
,
accuracies
)
plt
.
title
(
"
Accuracy as function of k
"
)
plt
.
legend
()
plt
.
grid
(
True
)
plt
.
show
()
plt
.
savefig
(
'
image-classification/results/knn_batch_1.png
'
)
plt
.
close
(
fig
)
if
__name__
==
"
__main__
"
:
...
...
@@ -75,9 +78,4 @@ if __name__ == "__main__":
# x_test = np.array([[1,2],[4,6]])
# x_train = np.array([[2,4],[7,2],[4,6]])
# y_train = [1,2,1]
# dist = distance_matrix(x_test,x_train)
\ No newline at end of file
# dist = distance_matrix(x_test,x_train)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment