Skip to content
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

DOC Ensures that LinearRegression passes numpydoc validation #20369

Merged
merged 4 commits into from
Jun 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion maint_tools/test_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@
"LatentDirichletAllocation",
"LedoitWolf",
"LinearDiscriminantAnalysis",
"LinearRegression",
"LinearSVC",
"LinearSVR",
"LocalOutlierFactor",
Expand Down
3 changes: 1 addition & 2 deletions sklearn/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,7 @@ class RegressorMixin:
_estimator_type = "regressor"

def score(self, X, y, sample_weight=None):
"""Return the coefficient of determination :math:`R^2` of the
prediction.
"""Return the coefficient of determination :math:`R^2` of the prediction.

The coefficient :math:`R^2` is defined as :math:`(1 - \\frac{u}{v})`,
where :math:`u` is the residual sum of squares ``((y_true - y_pred)
Expand Down
9 changes: 5 additions & 4 deletions sklearn/linear_model/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,20 +624,21 @@ def fit(self, X, y, sample_weight=None):
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
Training data
Training data.

y : array-like of shape (n_samples,) or (n_samples, n_targets)
Target values. Will be cast to X's dtype if necessary
Target values. Will be cast to X's dtype if necessary.

sample_weight : array-like of shape (n_samples,), default=None
Individual weights for each sample
Individual weights for each sample.

.. versionadded:: 0.17
parameter *sample_weight* support to LinearRegression.

Returns
-------
self : returns an instance of self.
self : object
Fitted Estimator.
"""

_normalize = _deprecate_normalize(
Expand Down