When I plot other kinds of divergence such as JSD, the system names are written next to purple and orange bars at the top of the plot. However, with ProportionShift those top bars are unlabeled (see attached).
Comparing the two get_shift_graph definitions in shifts.py the main differences appears to be that JSD passes all_pos_contributions while ProportionShift does not, and ProportionShift passes an explicit show_total=False. Here's the JSD definition:
|
def get_shift_graph( |
|
self, |
|
top_n=50, |
|
show_plot=True, |
|
detailed=False, |
|
text_size_inset=True, |
|
cumulative_inset=True, |
|
title=None, |
|
filename=None, |
|
**kwargs |
|
): |
|
if self.alpha == 1 and self.reference_value == 0: |
|
all_pos_contributions = True |
|
else: |
|
all_pos_contributions = False |
|
if title is None: |
|
title = "" |
|
ax = super().get_shift_graph( |
|
top_n=top_n, |
|
text_size_inset=text_size_inset, |
|
cumulative_inset=cumulative_inset, |
|
detailed=detailed, |
|
show_plot=show_plot, |
|
filename=filename, |
|
title=title, |
|
all_pos_contributions=all_pos_contributions, |
|
**kwargs |
|
) |
|
return ax |
And the ProportionShift definition:
|
def get_shift_graph( |
|
self, |
|
top_n=50, |
|
show_plot=True, |
|
detailed=False, |
|
text_size_inset=True, |
|
cumulative_inset=True, |
|
title=None, |
|
filename=None, |
|
**kwargs |
|
): |
|
if title is None: |
|
title = "" |
|
ax = super().get_shift_graph( |
|
top_n=top_n, |
|
text_size_inset=text_size_inset, |
|
cumulative_inset=cumulative_inset, |
|
detailed=detailed, |
|
show_plot=show_plot, |
|
filename=filename, |
|
show_total=False, |
|
title=title, |
|
**kwargs |
|
) |
|
return ax |
When I add all_pos_contributions=True to ProportionShift it does add the system names as desired, but also breaks the plot and puts all bars on the right-hand side. I haven't been able to track down exactly where the system names are added to the plot, but hopefully this can help with debugging.
When I plot other kinds of divergence such as JSD, the system names are written next to purple and orange bars at the top of the plot. However, with ProportionShift those top bars are unlabeled (see attached).
Comparing the two
get_shift_graphdefinitions inshifts.pythe main differences appears to be that JSD passesall_pos_contributionswhile ProportionShift does not, and ProportionShift passes an explicitshow_total=False. Here's the JSD definition:shifterator/shifterator/shifts.py
Lines 396 to 424 in ce7f00b
And the ProportionShift definition:
shifterator/shifterator/shifts.py
Lines 114 to 138 in ce7f00b
When I add
all_pos_contributions=Trueto ProportionShift it does add the system names as desired, but also breaks the plot and puts all bars on the right-hand side. I haven't been able to track down exactly where the system names are added to the plot, but hopefully this can help with debugging.