Display median interval in Stats instead of mean

Median is better suited than mean for reporting skewed data.
This commit is contained in:
user1823 2025-04-06 14:51:12 +05:30 committed by GitHub
parent ccab18b7ba
commit 595c255ca3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -168,12 +168,12 @@ export function prepareIntervalData(
dispatch("search", { query }); dispatch("search", { query });
} }
const meanInterval = Math.round(mean(allIntervals) ?? 0); const medianInterval = Math.round(quantile(allIntervals, 0.5) ?? 0);
const meanIntervalString = timeSpan(meanInterval * 86400, false); const medianIntervalString = timeSpan(medianInterval * 86400, false);
const tableData = [ const tableData = [
{ {
label: fsrs ? tr.statisticsAverageStability() : tr.statisticsAverageInterval(), label: fsrs ? tr.statisticsMedianStability() : tr.statisticsMedianInterval(),
value: meanIntervalString, value: medianIntervalString,
}, },
]; ];