Skip to content

Commit

Permalink
Update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasMeissnerDS committed Jul 12, 2024
1 parent e36b2a8 commit 971111e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bluecast/evaluation/eval_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,11 @@ def plot_probability_distribution(

# Ensure probs is a 2D array
if probs.ndim == 1:
probs = np.column_stack(
(probs, 1 - probs)
) # Create a 2D array with (probs, 1 - probs)
# Convert 1D binary probabilities to 2D
probs = np.column_stack((probs, 1 - probs))
elif probs.ndim == 2 and probs.shape[1] == 1:
# Handle the case where probs is (n_samples, 1) by converting it to (n_samples, 2)
probs = np.column_stack((probs[:, 0], 1 - probs[:, 0]))

unique_classes = np.unique(y_classes)
colors = plt.get_cmap("tab10") # Get a colormap
Expand Down

0 comments on commit 971111e

Please sign in to comment.