Skip to content

Commit

Permalink
sort bins for evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-huber committed Oct 15, 2024
1 parent f15934c commit 345cf0d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ms2deepscore/models/loss_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ def bin_dependent_losses(predictions,
"""
if predictions.shape != true_values.shape:
raise ValueError("Expected true values and predictions to have the same shape")

# Make sure bins are sorted
ref_score_bins = sorted(ref_score_bins, key=lambda x: x[0])

bin_content = []
losses = {"bin": []}
for loss_type in loss_types:
Expand Down

0 comments on commit 345cf0d

Please sign in to comment.