-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add knn to classifier comparison
- Loading branch information
Showing
5 changed files
with
160 additions
and
22 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
"""This file runs `classifier_comparison_utils.py` script for the KNN classifier, because it doesn't | ||
work on Jupyter for now. This file must be deleted once: | ||
https://github.com/zama-ai/concrete-ml-internal/issues/4018 is solved.""" | ||
|
||
from functools import partial | ||
|
||
from classifier_comparison_utils import make_classifier_comparison | ||
|
||
from concrete.ml.sklearn import KNeighborsClassifier | ||
|
||
if __name__ == "__main__": | ||
knn_classifiers = [ | ||
(partial(KNeighborsClassifier, n_bits=2, n_neighbors=3), "3nn"), | ||
(partial(KNeighborsClassifier, n_bits=4, n_neighbors=5), "5nn"), | ||
] | ||
|
||
# pylint: disable-next=unexpected-keyword-arg | ||
make_classifier_comparison( | ||
"KNN_Classifier", knn_classifiers, 0, verbose=True, show_score=False, save_plot=True | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters