MCPcopy Create free account
hub / github.com/zai-org/CodeGeeX / estimator

Function estimator

codegeex/benchmark/metric.py:36–42  ·  view source on GitHub ↗

Calculates 1 - comb(n - c, k) / comb(n, k).

(n: int, c: int, k: int)

Source from the content-addressed store, hash-verified

34 """
35
36 def estimator(n: int, c: int, k: int) -> float:
37 """
38 Calculates 1 - comb(n - c, k) / comb(n, k).
39 """
40 if n - c < k:
41 return 1.0
42 return 1.0 - np.prod(1.0 - k / np.arange(n - c + 1, n + 1))
43
44 if isinstance(num_samples, int):
45 num_samples_it = itertools.repeat(num_samples, len(num_correct))

Callers 1

estimate_pass_at_kFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected