-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
MAINT validate parameters in LogisticRegression and LogisiticRegressionCV #23565
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
MAINT validate parameters in LogisticRegression and LogisiticRegressionCV #23565
Conversation
Closed the Pull Request because of failure of tests. |
Removed tests that were validating error messages for Logistic Regression and Logistic Regression CV estimators. |
…stic_regression_validate_params
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.
Thanks for the PR @Jitensid. Here are some suggestions
…stic_regression_validate_params
…stic_regression_validate_params
…com/Jitensid/scikit-learn into logistic_regression_validate_params
@Jitensid I directly pushed some small fixes. Otherwise LGTM |
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.
LGTM
…ssion and logsitic regression CV
…ssion and logsitic regression CV
@glemaitre I have made changes as per your suggestions. |
I don't think that we need the test @pytest.mark.parametrize("solver", ["lbfgs", "newton-cg", "sag", "saga"])
def test_multinomial_validation(solver):
lr = LogisticRegression(C=-1, solver=solver, multi_class="multinomial")
with pytest.raises(ValueError):
lr.fit([[0, 1], [1, 0]], [0, 1])
|
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.
Otherwise LGTM
Removed the |
Thanks @Jitensid All good to be merged. |
Thank you @jeremiedbb @glemaitre for making my first open source contribution experience memorable. |
…onCV (scikit-learn#23565) Co-authored-by: jeremie du boisberranger <jeremiedbb@yahoo.fr> Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Reference Issues/PRs
Logistic Regression and Logistic Regression CV uses _validate_parameters as part of #23462
What does this implement/fix? Explain your changes.
_parameter_constraints
that defines the valid types and values for the parameters.fit
method first callsself._validate_params()
method.Any other comments?
match=msg
from it as I am not sure what to do about it.This is my first contribution. If I missed anything let me know I will fix it as soon as possible.