-
Notifications
You must be signed in to change notification settings - Fork 792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a knn module #1117
Merged
Merged
Add a knn module #1117
Changes from all commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
b9b9274
Add test for all identical examples in test_regression.py
elisno 182f50c
Add tests for detecting label issues in all identical examples dataset
elisno a0c197c
Add tests for detecting label issues in all identical examples dataset
elisno fb93c07
clarify test_all_identical_examples in test_regression.py
elisno 08e86a6
remove unused Datalab test fixtures in test_all_identical_examples.py
elisno ec8743e
Improve readability and documentation of test class for all identical…
elisno cbd1eab
Rename variable for number of feature columns (K -> M)
elisno e841249
add more issue types for classification (underperforming groups and c…
elisno 49b17ee
fix typos
elisno 25c4c83
update documentation of TestAllIdenticalExamplesDataset
elisno 747331a
Add decide_metric function to determine distance metric for neighbor …
elisno e6f2251
Add NeighborSearch protocol for k-nearest neighbors search
elisno f90641e
Add types for FeatureArray and Metric in neighbor/types.py
elisno eae62e8
rename test file
elisno a40f31d
Add features_to_knn function to build and fit a k-nearest neighbors s…
elisno a588774
export features_to_knn from neighbor submodule
elisno 0604ab3
Add docs for cleanlab.internal.neighbor modules
elisno a0d6579
correct neighbor.py
elisno 638ae31
let search.py only work with NearestNeighbors
elisno a13c1f8
refactor outlier.py to use knn construction function
elisno 76d16d2
Refactor duplicate.py to use features_to_knn function for constructin…
elisno 5b33870
Refactor duplicate.py to use the knn_to_knn_graph function defined in…
elisno 45c4c3f
remove unused imports in outlier.py
elisno 32d80ff
test knn_to_knn_graph
elisno a44d367
ignore unused import in __init__.py
elisno ceb3744
Refactor regression.rank.py to use features_to_knn function for const…
elisno 1082702
Fix default value for neighbor_metric in rank.py
elisno 8d662e2
improve clarity of code selecting number of neighbors, add comments
elisno 4395874
Refactor metric.py to improve clarity of code selecting number of nei…
elisno e2dd0fc
rename knn_to_knn_graph to construct_knn_graph_from_index
elisno 47a7715
add edge case for test_features_to_knn where last 11 points are ident…
elisno 85b7704
Test more attributes of NearestNeighbors object
elisno c69205c
comment on DEFAULT_K
elisno c826901
Appy suggestion
elisno 04ef982
Move type alias definitions to cleanlab/typing.py
elisno 019629b
add comment about distance_metric being logged as string
elisno b21db8f
fix imports of types
elisno 3eb4d1b
delete types.py, all types moved to typing.py
elisno f45370d
enumerate properties and attributes that a NearestNeighbors-like obje…
elisno dd331c6
Split decide_metric into two functions
elisno 304ef71
ensure euclidean metric is used for outre method of computing label q…
elisno e392b73
rename module neighbor.py to knn_graph.py
elisno 981776f
fix import of renamed function for deciding on default metric
elisno 694625b
Replace .kneighbors_graph calls with construct_knn_graph_from_index c…
elisno b4f7a1e
Add construct_knn_graph_from_features to let issue managers create kn…
elisno fb52a6b
add more test cases for all-identical examples.
elisno 31f9350
Refactor NearDuplicateIssueManager to use construct_knn_graph_from_fe…
elisno acefd1d
update docs
elisno cf798b0
update comment
elisno b420a5a
Merge branch 'master' into knn-module
elisno 579bdb0
remove unused imports
elisno 3314ea3
Update cleanlab/internal/neighbor/knn_graph.py
elisno 402d3fe
Update cleanlab/internal/neighbor/knn_graph.py
elisno d100541
Update construct_knn_graph_from_features to return both knn_graph and…
elisno c6ec459
improve code readability in _configure_num_neighbors
elisno 318d9a5
Rename function for accuracy
elisno c8a7061
remove unused import
elisno 22965b9
Apply suggestions from code review
elisno d4d2d3a
Update cleanlab/internal/neighbor/metric.py
elisno bda30f2
apply black formatter
elisno File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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 @@ | ||
from .knn_graph import features_to_knn |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition won't evaluate to
True
, because even if the metric changed, then theknn
object must have been given the same metric in this part of the code.Removing it is safe.