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

Editing Bayesian Ridge sample weight for y_predict std #30433

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sinhabintebabul
Copy link

Reference Issues/PRs

Fixes #24313

What does this implement/fix? Explain your changes.

This fixes the effect of uniform sample weights on the standard deviation of y_predict in the Bayesian Ridge Regression model. The sample weights have been normalized by dividing them by their mean. This ensured that the absolute scale of uniform weights did not affect the calculations, preserving only their relative importance.

Before:

if sample_weight is not None:
            sample_weight = _check_sample_weight(sample_weight, X, dtype=dtype)

After:

if sample_weight is not None:
            sample_weight = _check_sample_weight(sample_weight, X, dtype=dtype)
            sample_weight = sample_weight / np.mean(sample_weight)

Any other comments?

Copy link

github-actions bot commented Dec 9, 2024

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 5dff9f1. Link to the linter CI: here

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.

BayesianRidge prediction standard deviation affected by uniform sample weights
1 participant