[FEATURE] Run with given regressor instead of raising warning in ZeroInflatedRegressor
See original GitHub issueI am using the ZeroInflatedRegressor for the prediction of some materials’ prices. For some materials I am getting this error:
Traceback (most recent call last):
File "/home/bugra/project-mats/mat_analyser.py", line 61, in apply_regression
zir.fit(X_train, y_train)
File "/home/bugra/project-mats/mats_folder/lib/python3.7/site-packages/sklego/meta/zero_inflated_regressor.py", line 107, in fit
"The predicted training labels are all zero, making the regressor obsolete. Change the classifier or use a plain regressor instead.")
ValueError: The predicted training labels are all zero, making the regressor obsolete. Change the classifier or use a plain regressor instead.
Tbh. I didn’t understand much from the error. But, I guess using the regressor (in my case this is LinearRegression from sklearn) could give me some results. Why ZeroInflatedRegressor can’t use the regressor I defined for it but instead raising this error? I think there should be a flag (a parameter) in ZeroInflatedRegressor which would let it fit the regressor as suggested by the error message if the user wants. If not, it could still raise this error.
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Zero-Inflated Regression. Teach your regressor how to output…
When working on regression problems, often you have target values that are continuously and evenly distributed in some range.
Read more >Zero-Inflated Negative Binomial Regression | R Data Analysis ...
Zero -inflated negative binomial regression is for modeling count variables with excessive zeros and it is usually for over-dispersed count outcome variables ...
Read more >A guide to modeling outcomes that have lots of zeros with ...
In a previous post, I wrote a guide to doing beta, zero-inflated beta, and zero-one-inflated beta regression for outcome variables that are ...
Read more >Zero-Inflated Generalized Linear Mixed Models: A Better Way ...
The coefficients of a Poisson regression are estimated by the likelihood function given by Expression (A4) as follows: L ...
Read more >Approaches to regression with zero inflated response
In this case, where your data is simply overwhelmed by the number of zeros, IMO it makes the most sense to split this...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m thinking something along the lines of
handle_unknown
in sklearnsOneHotEncoder
@koaning I wish I could, currently struggling with health issues 😦