Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC Ensures that l1_min_c passes numpydoc validation #24134

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

Merged

Conversation

kshitijkapadni
Copy link
Contributor

Reference Issues/PRs

Addresses #21350

What does this implement/fix? Explain your changes.

  • remove sklearn.svm._bounds.l1_min_c from scikit-learn/maint_tools/test_docstrings.py
  • fix numpydoc validation error in sklearn.svm._bounds.l1_min_c

Any other comments?

@lucyleeow lucyleeow added the Validation related to input validation label Aug 7, 2022
linear_model.LogisticRegression with penalty='l1'.

This value is valid if class_weight parameter in fit() is not set.
Return the lowest bound for C such that for C in (l1_min_C, infinity) the model is guaranteed not to be empty. This applies to l1 penalized classifiers, such as LinearSVC with penalty='l1' and linear_model.LogisticRegression with penalty='l1'. This value is valid if class_weight parameter in fit() is not set.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kshitijkapadni , any reason for changing the docstring to be one line? We generally like to keep lines <88 characters

Copy link
Contributor Author

@kshitijkapadni kshitijkapadni Aug 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get this SS06: Summary should fit in a single line. If I keep it multiple lines in the docstring validation. Can you guide me on this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It just means that the short summary should be less than 88 characters.

You can then use a long summary. The following will solve the problem

Suggested change
Return the lowest bound for C such that for C in (l1_min_C, infinity) the model is guaranteed not to be empty. This applies to l1 penalized classifiers, such as LinearSVC with penalty='l1' and linear_model.LogisticRegression with penalty='l1'. This value is valid if class_weight parameter in fit() is not set.
Return the lowest bound for C.
The lower bound C is computed such that for C in (l1_min_C, infinity)
the model is guaranteed not to be empty. This applies to l1 penalized
classifiers, such as LinearSVC with penalty='l1' and
linear_model.LogisticRegression with penalty='l1'.

@glemaitre glemaitre requested review from glemaitre and removed request for glemaitre August 24, 2022 15:45
@jeremiedbb jeremiedbb removed the Validation related to input validation label Aug 30, 2022
Copy link
Member

@jeremiedbb jeremiedbb left a 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 @kshitijkapadni. I directly pushed to apply the last review comment. LGTM

@jeremiedbb jeremiedbb merged commit 6d16698 into scikit-learn:main Sep 6, 2022
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants