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.
[MRG+1] FIX Negative or null sample_weights in SVM #14286
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
[MRG+1] FIX Negative or null sample_weights in SVM #14286
Changes from all commits
9f6914b
b5663e4
090d038
2586bcf
e0b2119
0beacb6
3f90e78
83bcdb5
5e649c6
a8a50fb
1ecf05f
8471b33
a4ffddf
176b1f2
c6c9e3b
0ddcb18
f569a86
db9474f
578e830
b2b3a79
f7ec6ea
212f7bb
4900e66
b70acc2
54d588f
7d1d1ab
7a93169
267836f
808f71c
3546fda
208f46d
accb79a
3855c7d
90acfaa
534e1f4
8d83f48
43a39ed
632f445
21d8926
923aeee
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 test doesn't fail in master for me. Should it?
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 test doesn't check zero or negative weights. I added it to the unit tests for this feature as asked by @glemaitre who was working on another feature related to weights in SVM. Probably that feature is already merged.
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.
If you check the previous
test_sample_weights
, it was not testing anything from thesample_weight
.The added tests do not fail because it was no bug because at least they are added to be sure that the results are rights. It could be done in another PR but I wanted to avoid splitting it for simplicity for a first contrib :)
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 test doesn't fail in master for me. Should it?
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 test doesn't check zero or negative weights. I added it to the unit tests for this feature as asked by @glemaitre who was working on another feature related weights in SVM. Probably that feature is already merged.
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 test doesn't fail in master for me. Should it?
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 test shouldn't fail. It does not verify the main goal of the feature - throw Exception during fit() if samples of one label are totaly removed because they all had zero or negative weghts.
Insted this test validates the "healthy behaviour" of current model. That is, If only a few samples are removed and the ratio between the samples with diferent labels is not severely disrupted, then the classifier's model doesen't change much. The model coefficients that were originally equal, still remain close to each other.
Since this test doesen't actually verify the feature I intend to add, I can remove the test if you think we are better without it
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.
I added the test, thinking it can detect future changes to the classifier model which will change this present behaviour.