MCPcopy Create free account
hub / github.com/SalesforceAIResearch/perfcodegen / estimator

Method estimator

src/evaluate.py:389–395  ·  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

387 """
388
389 def estimator(n: int, c: int, k: int) -> float:
390 """
391 Calculates 1 - comb(n - c, k) / comb(n, k).
392 """
393 if n - c < k:
394 return 1.0
395 return 1.0 - np.prod(1.0 - k / np.arange(n - c + 1, n + 1))
396
397 if isinstance(num_samples, int):
398 num_samples_it = itertools.repeat(num_samples, len(num_correct))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected