-
-
Notifications
You must be signed in to change notification settings - Fork 256
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
Fix confusion matrix using only predictions as source for labels #249
Open
levkk
wants to merge
24
commits into
rust-ml:master
Choose a base branch
from
postgresml:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 13 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
fb7a1fa
Add serialization for LogisticRegression
levkk 0930322
Merge pull request #1 from postgresml/levkk-add-ser-for-logistic
levkk 378c3b4
Serialization for multi-class
levkk ecd48d0
Merge pull request #2 from postgresml/levkk-fix-missing-ser
levkk fe3ae53
Float type restriction with handwritten bounds
gkobeaga 9392fe6
Merge pull request #3 from gkobeaga/serde-logistic
levkk 3fa43a8
Merge branch 'rust-ml:master' into master
levkk c44940b
Confusion matrix should use labels from predictions and ground truth
levkk 4057c2d
Merge pull request #4 from postgresml/levkk-f1-division-by-zero
levkk d91de55
Clippy fixes
levkk 3356d42
Merge pull request #5 from postgresml/levkk-fix-f1-metric
levkk 4ac3ec8
This is the correct test
levkk 3dd71b1
Merge pull request #6 from postgresml/levkk-fix-test-not-sure
levkk 1e8ac38
Merge branch 'rust-ml:master' into master
montanalow ef0a23a
Merge branch 'rust-ml:master' into master
montanalow 01c8224
Merge branch 'rust-ml:master' into master
levkk 4004fec
Merge branch 'rust-ml:master' into master
montanalow 7dee254
fix warnings
montanalow e9904a8
remove lifetimes
montanalow 4f8ccef
clippy lints
montanalow 5ec7b2f
fix ownership
montanalow 97d52e7
fix ownership
montanalow d4a5744
cleanup lints
montanalow 9d615fc
Merge pull request #7 from postgresml/montana/a
montanalow 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -323,6 +323,18 @@ pub trait Labels { | |
fn labels(&self) -> Vec<Self::Elem> { | ||
self.label_set().into_iter().flatten().collect() | ||
} | ||
|
||
fn combined_labels(&self, other: Vec<Self::Elem>) -> Vec<Self::Elem> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better to have this method take |
||
let mut combined = self.labels(); | ||
combined.extend(other); | ||
|
||
combined | ||
.iter() | ||
.collect::<HashSet<_>>() | ||
.into_iter() | ||
.cloned() | ||
.collect() | ||
} | ||
} | ||
|
||
#[cfg(test)] | ||
|
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
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.
For some reason this method doesn't dedup the final vector. It should do something like union all
HashSet
together. Or we can just change the return type toHashSet
, but that might be too invasive.