Skip to content

Commit

Permalink
More explicit warning if weights passed but not used in loss calc
Browse files Browse the repository at this point in the history
  • Loading branch information
danielarifmurphy committed May 1, 2024
1 parent 9cb1401 commit 5af3462
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,6 @@ def calculate_loss(loss_function, observed, predicted, sample_weights=None):
else:
if sample_weights is not None:
warnings.warn(
f"Loss function {loss_function.__name__} does not take sample weights. Calculating unweighted loss."
f"Loss function `{loss_function.__name__}` does not have `sample_weight` argument. Calculating unweighted loss."
)
return loss_function(observed, predicted)

0 comments on commit 5af3462

Please sign in to comment.