Skip to content

Commit

Permalink
Fix to empty predictions
Browse files Browse the repository at this point in the history
  • Loading branch information
swansonk14 committed Aug 28, 2020
1 parent 3b480d4 commit 74fba47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chemprop/train/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def evaluate_predictions(preds: List[List[float]],
metric_to_func = {metric: get_metric_func(metric) for metric in metrics}

if len(preds) == 0:
raise ValueError('Length of predictions is zero.')
return {metric: [float('nan')] * num_tasks for metric in metrics}

# Filter out empty targets
# valid_preds and valid_targets have shape (num_tasks, data_size)
Expand Down

0 comments on commit 74fba47

Please sign in to comment.