Pbpbox error on pdp_interact_plot


(Buddhi De Seram) #1

Hi,

I ran the code to generate the interact plots in lecture 4 but I end up with the following error.

TypeError: clabel() got an unexpected keyword argument ‘contour_label_fontsize’

Anyone else had a similar issue?

I think the issue has something to do with matplotlib, I’m currently running V3.0.0


(Buddhi De Seram) #2

Solved it, its to do with matplotlib version 3. I updated pdp_plot_utils.py and replaced

251 inter_ax.clabel(c2, contour_label_fontsize=fontsize, inline=1)
with
251 inter_ax.clabel(c2, fontsize=fontsize, inline=1)

But now mine only plots the contour graph and not the other two.


(Steve Zhang) #3

https://github.com/SauceCat/PDPbox/blob/master/CHANGELOG.md
According to the pdpbox change logs, the latest pdp_interact_plot no longer support plotting single pdp. So it can no longer automatically plot those two pdp for us. Maybe you can try plotting them yourself and putting them together.


(Juan Velasquez) #4

PDPbox was updated after the video and the pdp.pdp_interact_plot() function is now returning 1 graph instead of three. To have the notebook working as in the lectures you need to do the following:

pip install pdpbox==0.1.0
conda install matplotlib=2.2.3

Then, you need to change the calls to pdp_interact() (I believe there are 3 in total) from pdp_interact(m, x, feats, x.columns) to pdp_interact(m, x, feats) and it should work


(Yaswanth Bangaru) #5

This doesn’t seem to work. I still get the same error after trying this! What else can I try?