You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What happened:
I was running GridSearchCV with multiple scoring metrics. One of them ("neg_mean_poisson_deviance") was undefined for some folds b/c it is undefined when y_hat is 0. This was handled during scoring but when create_cv_results was called, this raised a TypeError: 'float' object is not subscriptable. This is b/c score would normally return a dictionary when mutliple scorers are requested but in this case it returned the value I had passed as error_score to GridSearchCV, which in this case was np.nan. The issue is between L274 and L297 in methods.py.
What you expected to happen:
I expected that score to be np.nan for the folds in which the scorer failed, but not to raise an error
What happened:
I was running GridSearchCV with multiple scoring metrics. One of them ("neg_mean_poisson_deviance") was undefined for some folds b/c it is undefined when y_hat is 0. This was handled during scoring but when
create_cv_results
was called, this raised aTypeError: 'float' object is not subscriptable
. This is b/cscore
would normally return a dictionary when mutliple scorers are requested but in this case it returned the value I had passed aserror_score
toGridSearchCV
, which in this case wasnp.nan
. The issue is between L274 and L297 in methods.py.What you expected to happen:
I expected that score to be
np.nan
for the folds in which the scorer failed, but not to raise an errorMinimal Complete Verifiable Example:
This gives the TypeError I mentioned
Anything else we need to know?:
I think this should be a fairly quick fix so I'm going to give it a try
The text was updated successfully, but these errors were encountered: