Skip to content

Commit

Permalink
fix parrt#304
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammedAlsayed committed Sep 13, 2023
1 parent be0cdfc commit 892a4a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dtreeviz/models/shadow_decision_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,8 @@ def n_sample_classes(self):
return node_values
node_y_data = self.shadow_tree.y_train[samples]
unique, counts = np.unique(node_y_data, return_counts=True)

if unique.dtype != 'int':
raise ValueError(f"Target values should be type int got {unique.dtype}")
for i in range(len(unique)):
node_values[unique[i]] = counts[i]

Expand Down

0 comments on commit 892a4a1

Please sign in to comment.