Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wordvault] Use recall rate instead of lapses, refactor stats code structure #508

Closed

Conversation

BenMusch
Copy link
Contributor

@BenMusch BenMusch commented Jan 13, 2025

Closes #504

  • Use recall % instead of times forgotten
  • In achieving that, refactored the inline display of card statistics to be shared between PreviousCard and Statistics
  • That cluttered the root src/frontend directory a bit, so refactored to add a stats top-level dir:
    • Renamed CardStats component to StatisticsPage
    • CardRecallStats component contains just the recall rate/scheduling stats
  • Minor: added ./date_string utility function to share between a couple components

No strong opinion on any of these refactors to feel free to request some (or all) of them get dropped from this PR

@@ -0,0 +1,18 @@
export type ParsedFsrsCardStats = {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we can get this type def from the back-end codegen, but based on how things were being implement right now I assume not

showTime = false,
}: CardRecallStatsProps) {
// The first time a card is incorrectly answered is not logged as a
// lapse, so we exclude that from the calculation of recall rate.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not entirely true. If you answer it incorrectly after getting it right the very first time you see it, that counts as a lapse. If you answer it incorrectly the first time, and then answer it correctly the second time, you have no lapses. So subtracting 1 always is not quite right.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh I see, in that case I don't think we can get to recall % without a back-end change as well, right? probably not worth the effort then relative to other tasks I was gonna take a look at

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I don't think we can get recall % without keeping track of the actual number of times the question has been answered wrong. The best way I can think of getting this is from the log array that gets stored with each question, and just counting the incorrect entries. Or we can cache that number in that JSON blob too. But probably not worth it for right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looping back, how certain are you that this is correct?

If you answer it incorrectly the first time, and then answer it correctly the second time, you have no lapses

I'm pretty certain I have a non-zero number of cards I've never gotten right that show Times forgotten: {times seen - 1}

@domino14
Copy link
Owner

domino14 commented Jan 14, 2025 via email

@BenMusch
Copy link
Contributor Author

Gotcha, I think the scheduler seems to update Lapses basically unconditionally any time the Again rating is assigned https://github.com/open-spaced-repetition/go-fsrs/blob/main/scheduler_longterm.go#L80 (this is done in both schedulers), but my go parsing is not very good so I could be missing something

@domino14
Copy link
Owner

That code is actually very difficult for me to read and I don't know why they structured it that way. All I know is based on stepping through it with a debugger, and watching the behavior of it. Somehow it avoids incrementing the number of lapses the very first time that it gets asked and marked wrong. Probably the card is in a different "state" and some other branch executes.

@BenMusch
Copy link
Contributor Author

sg! I'll close this PR for now and switch my go-learning efforts to the short-term scheduler config

@BenMusch BenMusch closed this Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[wordvault] "Times seen" seems to include the most recent time you saw a card, "times forgotten" does not
2 participants