Skip to content

Commit f4a3f08

Browse files
committed
fix missing DPOther category for DPEBM visualizations
1 parent 5ddd5fb commit f4a3f08

File tree

1 file changed

+7
-7
lines changed
  • python/interpret-core/interpret/glassbox/ebm

1 file changed

+7
-7
lines changed

python/interpret-core/interpret/glassbox/ebm/ebm.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,15 +1180,15 @@ def explain_global(self, name=None):
11801180
histogram_counts = getattr(self, 'histogram_counts_', None)
11811181
if histogram_counts is not None:
11821182
histogram_counts = histogram_counts[feature_index0]
1183-
if histogram_counts is not None:
1184-
if len(bin_labels) != model_graph.shape[0]:
1185-
bin_labels.append('DPOther')
1186-
histogram_counts = histogram_counts[1:]
1187-
else:
1188-
histogram_counts = histogram_counts[1:-1]
11891183

11901184
if histogram_counts is None:
1191-
histogram_counts = mod_weights[term_idx]
1185+
histogram_counts = self.bin_weights_[term_idx]
1186+
1187+
if len(bin_labels) != model_graph.shape[0]:
1188+
bin_labels.append('DPOther')
1189+
histogram_counts = histogram_counts[1:]
1190+
else:
1191+
histogram_counts = histogram_counts[1:-1]
11921192

11931193
names=bin_labels
11941194
densities = list(histogram_counts)

0 commit comments

Comments
 (0)