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

0 Likes

(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.

2 Likes

(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.

0 Likes

(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

1 Like

(Yaswanth Bangaru) #5

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

0 Likes

(zeng) #6

solved it ,replace pdp_plot_utils.py and restart jupyter notebook

0 Likes

#7

That does not solve it, as it should output three plots instead of one.

0 Likes

#8

As far as I remember the API has been changed. It now only outputs a single plot. If you want to reproduce the exact same plot from the course, you’ll have to add the other plots manually. But the important information is there.

I am going from memory, though, so might be wrong

0 Likes