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

patch: ZeroInflatedRegressor fix training indices #666

Merged
merged 1 commit into from
May 12, 2024

Conversation

FBruzzesi
Copy link
Collaborator

Description

Issue reported in #664 is very reasonable. I tried to take a look at when ZeroInflatedRegressor was introduced in #442, but I couldn't find any related discussion on such choice.

Fix #664

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

@@ -108,7 +108,7 @@ def fit(self, X, y, sample_weight=None):
logging.warning("Classifier ignores sample_weight.")
self.classifier_.fit(X, y != 0)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just as a side note after taking a look at the internals: as classifier_ is supposed to classify zeros, wouldn't make sense to fit on y==0? If so, that's a total of 3 lines that need changes. Not big deal anyway

@FBruzzesi FBruzzesi requested a review from koaning May 11, 2024 12:49
@koaning koaning marked this pull request as ready for review May 12, 2024 11:13
@FBruzzesi FBruzzesi merged commit d6eac98 into koaning:main May 12, 2024
17 checks passed
@FBruzzesi FBruzzesi deleted the patch/zero-inflated-regressor branch May 12, 2024 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] zero_inflated_regressor.py
2 participants