MCPcopy Create free account
hub / github.com/FlyingFeather/DEA-SQL / eval_where

Function eval_where

single_eval.py:131–148  ·  view source on GitHub ↗
(pred, label)

Source from the content-addressed store, hash-verified

129
130
131def eval_where(pred, label):
132 pred_conds = [unit for unit in pred['where'][::2]]
133 label_conds = [unit for unit in label['where'][::2]]
134 label_wo_agg = [unit[2] for unit in label_conds]
135 pred_total = len(pred_conds)
136 label_total = len(label_conds)
137 cnt = 0
138 cnt_wo_agg = 0
139
140 for unit in pred_conds:
141 if unit in label_conds:
142 cnt += 1
143 label_conds.remove(unit)
144 if unit[2] in label_wo_agg:
145 cnt_wo_agg += 1
146 label_wo_agg.remove(unit[2])
147
148 return label_total, pred_total, cnt, cnt_wo_agg
149
150
151def eval_group(pred, label):

Callers 1

eval_partial_matchMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected