I’m getting the following warning whenever I run
compute() on either the
/home/aclifton/anaconda3/envs/rffp/lib/python3.9/site-packages/sklearn/metrics/_classification.py:1318: UndefinedMetricWarning: Recall is ill-defined and being set to 0.0 in labels with no true samples. Use `zero_division` parameter to control this behavior. _warn_prf(average, modifier, msg_start, len(result))
It looks like it’s coming from the metrics defined in sci-kit learn (recall for example). I tried to set
zero_division=0 but got the following error:
Traceback (most recent call last): File "/home/aclifton/rf_fp/run_training.py", line 278, in <module> tmp_metric_result = rffp_data.metrics[metric].compute(average='macro', zero_division=0) File "/home/aclifton/anaconda3/envs/rffp/lib/python3.9/site-packages/datasets/metric.py", line 430, in compute output = self._compute(**inputs, **compute_kwargs) TypeError: _compute() got an unexpected keyword argument 'zero_division'
I know it’s only a warning and shouldn’t affect the output of my evaluation loop, but I was curious if there were a way to suppress the warning using
zero_division keyword as indicated in the sklearn documentation?
Thanks in advance for your help!