MCPcopy Create free account
hub / github.com/RingBDStack/GDAP / compute_f1

Method compute_f1

evaluation.py:152–163  ·  view source on GitHub ↗
(self, prefix='')

Source from the content-addressed store, hash-verified

150 return a / b
151
152 def compute_f1(self, prefix=''):
153 tp = self.tp
154 pred_num = self.pred_num
155 gold_num = self.gold_num
156 p, r = self.safe_div(tp, pred_num), self.safe_div(tp, gold_num)
157 return {prefix + 'tp': tp,
158 prefix + 'gold': gold_num,
159 prefix + 'pred': pred_num,
160 prefix + 'P': p * 100,
161 prefix + 'R': r * 100,
162 prefix + 'F1': self.safe_div(2 * p * r, p + r) * 100
163 }
164
165 def count_instance(self, gold_list, pred_list, verbose=False, text=None):
166 if verbose:

Callers 1

mainFunction · 0.95

Calls 1

safe_divMethod · 0.95

Tested by

no test coverage detected