[BUG] AttributeError: 'GroupedPredictor' object has no attribute 'predict_proba'
See original GitHub issueI am not sure if it’s me that I am not using correctly the API.
When doing a classification problem and using a GroupedPredictor to estimate probabilities I can’t get the probabilities
from sklego.meta import GroupedPredictor
import numpy as np
from sklearn.linear_model import LogisticRegression
from sklego.datasets import load_chicken
df = load_chicken(as_frame=True)
# Create a binary target
X = df.drop(columns='weight')
y = np.where(df.weight>df.weight.mean(),1,0)
mod = GroupedPredictor(LogisticRegression(), groups=["diet"])
mod.fit(X,y)
mod.predict_proba(X)
Traceback (most recent call last): File "bug.py", line 25, in <module> mod.predict_proba(X) AttributeError: 'GroupedPredictor' object has no attribute 'predict_proba'
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
AttributeError: 'Sequential' object has no attribute 'predict_proba'
predict_proba returns the error in the neural network.
Read more >'sequential' object has no attribute 'predict_proba' - You.com
I ran into an error message <'History' object has no attribute 'predict'> when trying to run the code down. Y_predict = model.predict(X_test).reshape ...
Read more >'CustomScaler' object has no attribute 'predict_proba'
Hi dear 365 team,. i downloaded and executed the modules like shown, but i am getting Attribute Error when i try to:.
Read more >[Scikit-learn-general] Ovr Classifier predict error
Hello, I see an issue with predict in case of predicting a text document. [I load an already trained classifier (OneVsRest(SGDClassifier(loss=log))) using
Read more >AttributeError: 'dict' object has no attribute 'predict_proba'
I try all versions, Windows/Ubuntu and a virtualenv. Nothing works! ... hi @joicepreuss - what command are you running that makes this error...
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 FreeTop 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
Top GitHub Comments
This can be closed, right?
I do confirm that in this exact code, if you change mod.predict_proba, by mod. predict you get an output