Better approximate average retention/ease/difficulty

Our average calculation is based on pre-binned values, so it's not
entirely accurate, but using the midpoint of the bin brings us closer.
In the future we can solve this by calculating it on the Rust end instead.
This commit is contained in:
Damien Elmes 2023-12-12 15:07:08 +10:00
parent ea0a9e13b7
commit a55d708a10
3 changed files with 3 additions and 3 deletions

View file

@ -101,7 +101,7 @@ export function prepareData(
const tableData = [
{
label: tr.statisticsAverageDifficulty(),
value: xTickFormat(sum(Array.from(allEases.entries()).map(([k, v]) => k * v)) / total),
value: xTickFormat(sum(Array.from(allEases.entries()).map(([k, v]) => (k + 2.5) * v)) / total),
},
];

View file

@ -106,7 +106,7 @@ export function prepareData(
const tableData = [
{
label: tr.statisticsAverageEase(),
value: xTickFormat(sum(Array.from(allEases.entries()).map(([k, v]) => k * v)) / total),
value: xTickFormat(sum(Array.from(allEases.entries()).map(([k, v]) => (k + 2.5) * v)) / total),
},
];

View file

@ -101,7 +101,7 @@ export function prepareData(
const tableData = [
{
label: tr.statisticsAverageRetrievability(),
value: xTickFormat(sum(Array.from(allEases.entries()).map(([k, v]) => k * v)) / total),
value: xTickFormat(sum(Array.from(allEases.entries()).map(([k, v]) => (k + 2.5) * v)) / total),
},
];