MCPcopy Create free account
hub / github.com/openai/plugins / quantile

Function quantile

plugins/plugin-eval/src/core/baseline.js:27–34  ·  view source on GitHub ↗
(values, percentile)

Source from the content-addressed store, hash-verified

25let cachedBaseline = null;
26
27function quantile(values, percentile) {
28 if (values.length === 0) {
29 return 0;
30 }
31 const sorted = [...values].sort((left, right) => left - right);
32 const index = Math.min(sorted.length - 1, Math.max(0, Math.floor((sorted.length - 1) * percentile)));
33 return sorted[index];
34}
35
36function summarizeSamples(samples) {
37 if (samples.length < 4) {

Callers 1

summarizeSamplesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected