update optimal retention and parameters tooltip

This commit is contained in:
Jarrett Ye 2024-04-17 20:43:14 +08:00
parent a1fa865bb2
commit 32fdc5c1c3
2 changed files with 17 additions and 18 deletions

View file

@ -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 The latter is quite rare, so unless you've used the former option, you probably don't need to adjust
this setting. this setting.
deck-config-weights-tooltip = deck-config-weights-tooltip =
FSRS parameters affect how cards are scheduled. Anki will start with default parameters. Once FSRS parameters affect how cards are scheduled. Anki will start with default parameters. You can use
you've accumulated 1000+ reviews, you can use the option below to optimize the parameters to best the option below to optimize the parameters to best match your performance in decks using this preset.
match your performance in decks using this preset.
deck-config-reschedule-cards-on-change-tooltip = deck-config-reschedule-cards-on-change-tooltip =
Affects the entire collection, and is not saved. 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. 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. 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 = 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, You can use the Optimize button to analyze your review history, and automatically generate parameters that are
and automatically generate parameters that are optimal for your memory and the content you're studying. optimal for your memory and the content you're studying. If you have decks that vary wildly in difficulty, it
If you have decks that vary wildly in difficulty, it is recommended to assign them separate presets, as is recommended to assign them separate presets, as the parameters for easy decks and hard decks will be different.
the parameters for easy decks and hard decks will be different. There is no need to optimize your parameters There is no need to optimize your parameters frequently - once every few months is sufficient.
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 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 optionally adjust the search before calculating the parameters, if you'd like to alter which cards are used for
optimizing the parameters. optimizing the parameters.
deck-config-compute-optimal-retention-tooltip2 = deck-config-compute-optimal-retention-tooltip2 =
This tool assumes that youre starting with 0 learned cards, and will attempt to find the desired retention This tool assumes that youre starting with 0 learned cards, and will attempt to find the desired retention value
value that will lead to the most material learnt, in the least amount of time. This number can be used as a that will lead to the most material learnt, in the least amount of time. To accurately simulate your learning process,
reference when deciding what to set your desired retention to. You may wish to choose a higher desired retention, this feature requires a minimum of 400+ reviews. The calculated number can serve as a reference when deciding what to
if youre willing to trade more study time for a greater recall rate. Setting your desired retention lower than set your desired retention to. You may wish to choose a higher desired retention, if youre willing to trade more study
the minimum is not recommended, as it will lead to more work without benefit. 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-please-save-your-changes-first = Please save your changes first.
deck-config-a-100-day-interval = deck-config-a-100-day-interval =
{ $days -> { $days ->

View file

@ -79,6 +79,11 @@ impl Collection {
&mut self, &mut self,
revlogs: Vec<RevlogEntry>, revlogs: Vec<RevlogEntry>,
) -> Result<OptimalRetentionParameters> { ) -> Result<OptimalRetentionParameters> {
if revlogs.len() < 400 {
return Err(AnkiError::FsrsInsufficientReviews {
count: revlogs.len(),
});
}
let first_rating_count = revlogs let first_rating_count = revlogs
.iter() .iter()
.group_by(|r| r.cid) .group_by(|r| r.cid)
@ -108,11 +113,6 @@ impl Collection {
.filter(|r| r.review_kind == RevlogReviewKind::Review && r.button_chosen != 1) .filter(|r| r.review_kind == RevlogReviewKind::Review && r.button_chosen != 1)
.counts_by(|r| r.button_chosen); .counts_by(|r| r.button_chosen);
let total_reviews = review_rating_count.values().sum::<usize>(); let total_reviews = review_rating_count.values().sum::<usize>();
if total_reviews < 400 {
return Err(AnkiError::FsrsInsufficientReviews {
count: total_reviews,
});
}
let review_rating_prob = if total_reviews as f64 > 0.0 { let review_rating_prob = if total_reviews as f64 > 0.0 {
let mut arr = [0.0; 3]; let mut arr = [0.0; 3];
review_rating_count review_rating_count