Open vaidyasm opened 5 years ago
@SauceCat I was wondering how master branch build is passing in the first place as the errors are emanating from https://github.com/SauceCat/PDPbox/blob/master/pdpbox/pdp_plot_utils.py#L251
Error:
TypeError: clabel() got an unexpected keyword argument 'contour_label_fontsize'
In this PR,
pdpbox.pdp.pdp_interact_plot()
makes use of user specified (if any)matplotlib.colors.Normalize
object as value for'norm'
key in'plot_params'
dictionary argument. A user initialized normalize object can be used & reused to obtain consistent normalization of 'marginal effect' being plotted. If this key is not set, the method is set to behave as unmodified version by passingNone
as norm to_pdp_inter_one()
.This PR was created to address https://github.com/SauceCat/PDPbox/issues/39
Affect of this PR can be seen in following two plots. The 'Before' plots uses full color scale regardless of the range of 'marginal effect' being plotted. In the 'After' plots, color mappings are consistent with values of the 'marginal effect' being plotted.
Interaction plots with large variations in marginal effects can now be identified with cursory look at 'After' plots, without having to read off range from color scale.
Plot 1: Small Range of Marginal Effect
Before:
After:
Plot 2: Large Range of Marginal Effect
Before:
After: