MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / build

Method build

codeclash/analysis/metrics/elo.py:214–224  ·  view source on GitHub ↗
(self, log_dir: Path)

Source from the content-addressed store, hash-verified

212 # Convert to unique names and sorted pair when updating matrix
213 unique_names = [self._get_unique_model_name(m) for m in models]
214 sorted_pair = self._get_sorted_pair(unique_names[0], unique_names[1])
215
216 if unique_names[0] == sorted_pair[0]:
217 self.win_matrix[game_name][sorted_pair][0] += p1_score
218 self.win_matrix[game_name][sorted_pair][1] += p2_score
219 self._samples[game_name][sorted_pair].append((p1_score, p2_score))
220 else:
221 self.win_matrix[game_name][sorted_pair][0] += p2_score
222 self.win_matrix[game_name][sorted_pair][1] += p1_score
223 self._samples[game_name][sorted_pair].append((p2_score, p1_score))
224
225 def build(self, log_dir: Path) -> None:
226 for metadata_path in tqdm(list(log_dir.rglob("metadata.json"))):
227 try:

Callers 3

runMethod · 0.95
runMethod · 0.95
elo.pyFile · 0.80

Calls 2

_process_tournamentMethod · 0.95

Tested by

no test coverage detected