From 9cb1401b8edec80a63e5344c797739ab97f44be7 Mon Sep 17 00:00:00 2001 From: danielarifmurphy <48385579+danielarifmurphy@users.noreply.github.com> Date: Wed, 1 May 2024 11:17:15 +0000 Subject: [PATCH] Avoid ambiguous truth values --- .../dalex/model_explanations/_variable_importance/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/dalex/dalex/model_explanations/_variable_importance/utils.py b/python/dalex/dalex/model_explanations/_variable_importance/utils.py index 2a147e28..f92431a6 100644 --- a/python/dalex/dalex/model_explanations/_variable_importance/utils.py +++ b/python/dalex/dalex/model_explanations/_variable_importance/utils.py @@ -95,7 +95,7 @@ def calculate_loss(loss_function, observed, predicted, sample_weights=None): if supports_weight: return loss_function(observed, predicted, sample_weight=sample_weights) else: - if sample_weights: + if sample_weights is not None: warnings.warn( f"Loss function {loss_function.__name__} does not take sample weights. Calculating unweighted loss." )