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

Enhance docstring for LinearRegression.fit #28741

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions sklearn/linear_model/_base.py
Expand Up @@ -560,8 +560,13 @@ def fit(self, X, y, sample_weight=None):
y : array-like of shape (n_samples,) or (n_samples, n_targets)
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.
sample_weight : float or array-like of shape (n_samples,), default=None

The options are:

- `float`: all samples have a weight equal to the value provided.
- `array-like`: should contain the individual weight of each sample.
- `None`: all samples have a weight equal to 1.

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