ENH add vlines_ attribute to PDP Display to hide deciles#15785
ENH add vlines_ attribute to PDP Display to hide deciles#15785rth merged 11 commits intoscikit-learn:masterfrom
Conversation
|
There is a way to access everything through I think adding |
| lines_ravel = self.lines_.ravel(order='C') | ||
| contours_ravel = self.contours_.ravel(order='C') | ||
|
|
||
| vlines = np.empty_like(self.axes_).ravel() |
There was a problem hiding this comment.
To keep with the style of the surrounding code:
self.vlines_ = np.empty_like(self.axes_)
vlines_ravel = self.vlines_.ravel(order='C')(Yes the order is C by default, but I recall a comment wanting this to be explicit)
There was a problem hiding this comment.
Given #15788, we should specific the dtype as object as well.
There was a problem hiding this comment.
OK I'll make it explicit, though note thatempty_like will explicitly set the dtype to that of axes_
|
Thanks for the feedback. ready for actual reviews now. I also realized we would need a hlines attribute for 2-way PDPs |
thomasjpfan
left a comment
There was a problem hiding this comment.
LGTM! Needs whats new in 0.23
|
Easy one @rth if you have time? |
|
Sounds good. Could you point me to an example of PDP plot with deciles that we would be hiding? |
|
here you have plots with deciles https://scikit-learn.org/stable/modules/partial_dependence.html which are the black vertical bars on the 1-way plots and the the 2-way plot also has horizontal bars here is an example without deciles (first plot) http://nicolas-hug.com/blog/pdps |
The ticks on the axis, right? I guess you can always change |
rth
left a comment
There was a problem hiding this comment.
Ahh, I didn't get that you are drawing them manually, so they are not part of the ax.xaxis / ax.yaxis objects.
LGTM.
|
thanks! |
I added a
vlines_attribute to the PDP Display so that we can hide the deciles vertical lines. But maybe there's a way to access the lines via theax? I couldn't find anything.@thomasjpfan please LMK if it's worth it, and I'll add test or close