Skip to content

Commit

Permalink
handle edgecase
Browse files Browse the repository at this point in the history
  • Loading branch information
KasunAmare committed Dec 8, 2023
1 parent fa41f65 commit ad8f403
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/triage/component/postmodeling/report_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,9 @@ def _pairwise_list_comparison_single_fold(self, threshold_type, threshold, train
entities_1 = set(df1.entity_id)
entities_2 = set(df2.entity_id)

if (len(entities_1) == 0 or len(entities_2)) == 0:
logging.error('No prediction saved for the models!')

inter = entities_1.intersection(entities_2)
un = entities_1.union(entities_2)
results['jaccard'].loc[model_group_pair[1], model_group_pair[0]] = len(inter)/len(un)
Expand Down

0 comments on commit ad8f403

Please sign in to comment.