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
Hi - firstly I'd like to thank you for producing this package, it's really great! I was just reading the ICEBox paper recently and was considering building something, but was delighted to see somebody else already had :)
I'm having issues with calling pdp_isolate on a regression model - it throws the following exception:
usr/local/lib/python3.5/dist-packages/PDPbox-0.1-py3.5.egg/pdpbox/pdp.py in pdp_isolate(model, train_X, feature, num_grid_points, percentile_range)
113 # store the ICE lines
114 # for multi-classifier, a dictionary is created
--> 115 if n_classes > 2:
116 ice_lines = {}
117 for n_class in range(n_classes):
TypeError: unorderable types: NoneType() > int()
Even the 'Regression.ipynb' example in PDPbox/test/Regression/ does this. A cursory glance at the codebase seems to suggest that when we have a sklearn model without a classes property, n_classes gets set to None on pdp.py line 64. Then all subsequent comparisons of n_classes to an integer will throw this error. Any suggestions?
The text was updated successfully, but these errors were encountered:
Thanks for informing the issue!
I notice that you are using Python3, while I used Python2 when I built the package. So the issue might be, rules are stricter in Python3. For example, you can't compare None with an integer. And this is the reason why you got the error. Because when the model is not a classifier, I set n_classes equal to None. Now I have changed it to 0. So now everything should be fine. 😸
It is so good to have someone help test PDPbox using Python3. If you find any issues in the further, feel free to open an issue.
Great - I suspected it might be a python 2/3 issue! Your fix resolves the issue on the call in question.
I have found at least 1 more python3 related issue, would you prefer I open individual tickets for them, or collate everything in one place once I've found a couple? Cheers.
Hi - firstly I'd like to thank you for producing this package, it's really great! I was just reading the ICEBox paper recently and was considering building something, but was delighted to see somebody else already had :)
I'm having issues with calling pdp_isolate on a regression model - it throws the following exception:
Even the 'Regression.ipynb' example in
PDPbox/test/Regression/
does this. A cursory glance at the codebase seems to suggest that when we have a sklearn model without a classes property, n_classes gets set to None on pdp.py line 64. Then all subsequent comparisons of n_classes to an integer will throw this error. Any suggestions?The text was updated successfully, but these errors were encountered: