8000 [MRG] BUG apply sample weights to RANSAC loss functions by jcusick13 · Pull Request #15952 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

[MRG] BUG apply sample weights to RANSAC loss functions #15952

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

Closed
Closed
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
3 changes: 2 additions & 1 deletion sklearn/linear_model/_ransac.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,8 @@ def fit(self, X, y, sample_weight=None):

# residuals of all data for current random sample model
y_pred = base_estimator.predict(X)
residuals_subset = loss_function(y, y_pred)
sample_weight = _check_sample_weight(sample_weight, X)
residuals_subset = loss_function(y, y_pred) * sample_weight

# classify data into inliers and outliers
inlier_mask_subset = residuals_subset < residual_threshold
Expand Down
0