-
Notifications
You must be signed in to change notification settings - Fork 119
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
first docstrings for linear model #691
Conversation
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 your PR!
I have a minor concern for DemographicParity and EqualOpportunity: the code snippet "overflows" the screen, even on a large one - (see screenshot). I left comments for how we could format the code for DemographicParityClassifier
, and the same should apply to EqualOpportunityClassifier
.
We may consider linting and formatting docstring code snippet programmatically as well in the future I guess.
# The weights sum up to 1 | ||
assert np.isclose(pwr.coef_.sum(), 1) | ||
|
||
X_test = np.array([[5, 6], [6, 7]]) | ||
|
||
# The prediction is positive (all weights are positive, and features are positive) | ||
assert all(pwr.predict(X_test) > 0) | ||
|
||
# The weights are positive | ||
assert all(pwr.coef_ > -1e-8) |
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 really like these "behavior"-like assertions :)
Co-authored-by: Francesco Bruzzesi <42817048+FBruzzesi@users.noreply.github.com>
Co-authored-by: Francesco Bruzzesi <42817048+FBruzzesi@users.noreply.github.com>
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 @david26694 🙌🏼🚀
This adds docstrings for all the linear_model in #596. It's just basic fit-predict usage, let me know if you'd like something more detailed @FBruzzesi