MCPcopy Create free account
hub / github.com/csskit/csskit / detectOutliers

Function detectOutliers

website/script/benchmarks.js:993–1007  ·  view source on GitHub ↗
(values, threshold = 3)

Source from the content-addressed store, hash-verified

991}
992
993function detectOutliers(values, threshold = 3) {
994 if (values.length < 3) return { outliers: [], normal: values };
995
996 const sorted = [...values].sort((a, b) => a - b);
997 const q1 = sorted[Math.floor(sorted.length * 0.25)];
998 const q3 = sorted[Math.floor(sorted.length * 0.75)];
999 const iqr = q3 - q1;
1000 const lowerBound = q1 - threshold * iqr;
1001 const upperBound = q3 + threshold * iqr;
1002
1003 const outliers = values.filter((v) => v < lowerBound || v > upperBound);
1004 const normal = values.filter((v) => v >= lowerBound && v <= upperBound);
1005
1006 return { outliers, normal };
1007}
1008
1009function createCriterionGroupChart(
1010 entries,

Callers 4

createTimeChartFunction · 0.85
createCompressionChartFunction · 0.85
createThroughputChartFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected