From 32fdc5c1c3aea38461bef8fb31c28bcefd9d4190 Mon Sep 17 00:00:00 2001 From: Jarrett Ye Date: Wed, 17 Apr 2024 20:43:14 +0800 Subject: [PATCH] update optimal retention and parameters tooltip --- ftl/core/deck-config.ftl | 25 ++++++++++++------------- rslib/src/scheduler/fsrs/retention.rs | 10 +++++----- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/ftl/core/deck-config.ftl b/ftl/core/deck-config.ftl index ba54214c2..ccbd3342b 100644 --- a/ftl/core/deck-config.ftl +++ b/ftl/core/deck-config.ftl @@ -395,9 +395,8 @@ deck-config-historical-retention-tooltip = The latter is quite rare, so unless you've used the former option, you probably don't need to adjust this setting. deck-config-weights-tooltip = - FSRS parameters affect how cards are scheduled. Anki will start with default parameters. Once - you've accumulated 1000+ reviews, you can use the option below to optimize the parameters to best - match your performance in decks using this preset. + FSRS parameters affect how cards are scheduled. Anki will start with default parameters. You can use + the option below to optimize the parameters to best match your performance in decks using this preset. deck-config-reschedule-cards-on-change-tooltip = Affects the entire collection, and is not saved. @@ -415,21 +414,21 @@ deck-config-ignore-before-tooltip = If set, reviews before the provided date will be ignored when optimizing & evaluating FSRS parameters. This can be useful if you imported someone else's scheduling data, or have changed the way you use the answer buttons. deck-config-compute-optimal-weights-tooltip = - Once you've done 1000+ reviews in Anki, you can use the Optimize button to analyze your review history, - and automatically generate parameters that are optimal for your memory and the content you're studying. - If you have decks that vary wildly in difficulty, it is recommended to assign them separate presets, as - the parameters for easy decks and hard decks will be different. There is no need to optimize your parameters - frequently - once every few months is sufficient. + You can use the Optimize button to analyze your review history, and automatically generate parameters that are + optimal for your memory and the content you're studying. If you have decks that vary wildly in difficulty, it + is recommended to assign them separate presets, as the parameters for easy decks and hard decks will be different. + There is no need to optimize your parameters frequently - once every few months is sufficient. By default, parameters will be calculated from the review history of all decks using the current preset. You can optionally adjust the search before calculating the parameters, if you'd like to alter which cards are used for optimizing the parameters. deck-config-compute-optimal-retention-tooltip2 = - This tool assumes that you’re starting with 0 learned cards, and will attempt to find the desired retention - value that will lead to the most material learnt, in the least amount of time. This number can be used as a - reference when deciding what to set your desired retention to. You may wish to choose a higher desired retention, - if you’re willing to trade more study time for a greater recall rate. Setting your desired retention lower than - the minimum is not recommended, as it will lead to more work without benefit. + This tool assumes that you’re starting with 0 learned cards, and will attempt to find the desired retention value + that will lead to the most material learnt, in the least amount of time. To accurately simulate your learning process, + this feature requires a minimum of 400+ reviews. The calculated number can serve as a reference when deciding what to + set your desired retention to. You may wish to choose a higher desired retention, if you’re willing to trade more study + time for a greater recall rate. Setting your desired retention lower than the minimum is not recommended, as it will + lead to more work without benefit. deck-config-please-save-your-changes-first = Please save your changes first. deck-config-a-100-day-interval = { $days -> diff --git a/rslib/src/scheduler/fsrs/retention.rs b/rslib/src/scheduler/fsrs/retention.rs index 9f9f6c44e..07602a09c 100644 --- a/rslib/src/scheduler/fsrs/retention.rs +++ b/rslib/src/scheduler/fsrs/retention.rs @@ -79,6 +79,11 @@ impl Collection { &mut self, revlogs: Vec, ) -> Result { + if revlogs.len() < 400 { + return Err(AnkiError::FsrsInsufficientReviews { + count: revlogs.len(), + }); + } let first_rating_count = revlogs .iter() .group_by(|r| r.cid) @@ -108,11 +113,6 @@ impl Collection { .filter(|r| r.review_kind == RevlogReviewKind::Review && r.button_chosen != 1) .counts_by(|r| r.button_chosen); let total_reviews = review_rating_count.values().sum::(); - if total_reviews < 400 { - return Err(AnkiError::FsrsInsufficientReviews { - count: total_reviews, - }); - } let review_rating_prob = if total_reviews as f64 > 0.0 { let mut arr = [0.0; 3]; review_rating_count