diff --git a/README.md b/README.md index b0c13f1b654..96df2e7082f 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ The following tables present the means and the 99% confidence intervals. The bes | FSRS-5 | 19 | 0.346±0.0031 | 0.0709±0.00086 | **0.700±0.0017** | | FSRS-rs | 19 | 0.347±0.0031 | 0.0722±0.00087 | 0.696±0.0017 | | FSRS-4.5 | 17 | 0.352±0.0032 | 0.0743±0.00089 | 0.688±0.0017 | -| FSRS v4 | 17 | 0.362±0.0034 | 0.0841±0.00100 | 0.685±0.0017 | +| FSRS v4 | 17 | 0.362±0.0034 | 0.084±0.0010 | 0.685±0.0017 | | DASH | 9 | 0.358±0.0031 | 0.0846±0.00096 | 0.632±0.0018 | | DASH[ACT-R] | 5 | 0.362±0.0033 | 0.086±0.0011 | 0.627±0.0019 | | FSRS-5 (only pretrain) | 4 | 0.360±0.0033 | 0.0861±0.00091 | 0.693±0.0017 | diff --git a/evaluate.py b/evaluate.py index eb7212973bf..d4207082993 100644 --- a/evaluate.py +++ b/evaluate.py @@ -15,7 +15,20 @@ def num_lead_zeros(x): decimals = n_lead_zeros_CI + CI_sigdigs rounded_CI = round(CI, decimals) rounded_value = round(value, decimals - 1) - return str(f"{rounded_value:.{decimals - 1}f}"), str(f"{rounded_CI:.{decimals}f}") + if n_lead_zeros_CI > num_lead_zeros(rounded_CI): + return str(f"{round(value, decimals - 2):.{decimals - 2}f}"), str(f"{round(CI, decimals - 1):.{decimals - 1}f}") + else: + return str(f"{rounded_value:.{decimals - 1}f}"), str(f"{rounded_CI:.{decimals}f}") + + +# tests to ensure that sigdigs is working as intended +value = 0.084111111 +CI = 0.0010011111 +assert sigdig(value, CI) == ('0.084', '0.0010') + +value = 0.084111111 +CI = 0.000999999999 +assert sigdig(value, CI) == ('0.084', '0.0010') def confidence_interval(values, sizes):