Skip to content

Commit

Permalink
Fix function
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasMeissnerDS committed Jul 12, 2024
1 parent a97f7e8 commit 942c233
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions bluecast/evaluation/eval_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,24 +118,15 @@ def plot_probability_distribution(
probs.shape[0] == y_classes.shape[0]
), "probs and y_classes must have the same number of samples"

print(f"Initial shape of probs: {probs.shape}")

# Ensure probs is a 2D array
if probs.ndim == 1:
probs = np.column_stack((probs, 1 - probs))
elif probs.ndim == 2 and probs.shape[1] == 1:
probs = np.column_stack((probs[:, 0], 1 - probs[:, 0]))

Check warning on line 125 in bluecast/evaluation/eval_metrics.py

View check run for this annotation

Codecov / codecov/patch

bluecast/evaluation/eval_metrics.py#L125

Added line #L125 was not covered by tests

print(f"Shape of probs after ensuring 2D: {probs.shape}")

colors = plt.get_cmap("tab10") # Get a colormap

for class_idx in range(probs.shape[1]):
print(class_idx)
class_probs = probs[:, class_idx]
print(f"Class {class_idx} has {class_probs.shape} shape")
class_labels = y_classes == class_idx
print(f"Class labels {class_labels} ")
plt.hist(
class_probs,
bins=30,
Expand Down

0 comments on commit 942c233

Please sign in to comment.