l3kn / org-fc

Spaced Repetition System for Emacs org-mode
https://www.leonrische.me/fc/index.html
GNU General Public License v3.0
258 stars 31 forks source link

[Feature request] Reschedule all positions forward/backward by N days #90

Open cashpw opened 1 year ago

cashpw commented 1 year ago

This would be a utility function -- inside or outside of Emacs -- which reschedules all positions forward or backward by N days. Similar to the Postpone card's review Anki add-on.

l3kn commented 1 year ago

Re-scheduling is one downside of a spacing algorithm based on due-dates, as the algorithm works best when cards are reviewed immediately / shortly after they are due.

E.g. if a new card has an interval of one day and is rescheduled by 7 days, yet still reviewed correctly after 7 days, it's new interval would still be based on the original interval of one day.

I've spent a long time researching alternative scheduling algorithms that compute a “recall probability” based the review history of a card. https://github.com/fasiha/ebisu seems like the most promising such algorithm but I don't think it's stable enough yet.

cashpw commented 1 year ago

That's a fascinating read! What are you looking for when determining stability?

l3kn commented 1 year ago

This issue seems most relevant: https://github.com/fasiha/ebisu/issues/43

Implementing an older version of the ebisu algorithm in EmacsLisp took a lot of effort and on the side of org-fc a lot is missing for supporting different spacing algorithms.

While I believe that there are many benefits to a recall-probability based algorithm, currently I don't want to put a lot of effort into something that might require a lot of changes in the future. Sadly there doesn't seem to be much public research in this area either.

fasiha commented 1 year ago

Implementing an older version of the ebisu algorithm in EmacsLisp took a lot of effort

Ebisu author here 👋! Is an elisp implementation of Ebisu (even an older version of Ebisu) available online? I looked in this repo but nothing jumped out.

(I have an RFC for a new version of Ebisu in https://github.com/fasiha/ebisu/issues/58 that is designed to address the issue you raised but it's probably several weeks away from release, and even then would be quite untested. But just in case you're interested, I'd of course very much welcome org-fc's perspective!)

l3kn commented 1 year ago

Hi @fasiha, happy to have you here!

I never uploaded the code because I only tried it on a different private spaced repetition project.

Hopefully this link works: https://gist.github.com/l3kn/45b7119e1aaa685997c5ff5078b4acd7 From the timestamps of my local files it looks like this was based of a mix of the Python and JS code for ebisu from April 2021. I can't remember exactly how far I got with it but it seems to pass tests against a test.json file as long as the epsilon used for comparison after updates is rather large (4e-3).

To avoid the initial implementation burden, interacting with a python wrapper script to rank a selection of org-fc cards would be a viable alternative. This leaves two big tasks on the side of org-fc, supporting alternative spacing algorithms and potentially migrating cards between these algorithms.

Org-fc keeps a history of all reviews (timestamp + forgot/hard/good/easy rating) so the parameters of a new algorithm can be computed from the past reviews of a card.

I'll try to run my history of 200k reviews against https://github.com/fasiha/ebisu-likelihood-analysis/blob/main/ebisu3.py. Probability theory is not my strong suite so if you're interested, I can contact you when it comes to interpreting the results.

fasiha commented 1 year ago

@l3kn wow, your elisp implementation is lovely, although I did a lot of Clojure back in the day, I'm still struck by the flair of seeing the math in s-exprs 😄

I'll try to run my history of 200k reviews

That sounds really, really interesting! In case it's at all helpful, I made a wrapper script that shows you how to load flashcards from Anki and run them against Ebisu v3, see the discussion at https://github.com/fasiha/ebisu-likelihood-analysis/#ebisu-v3-and-stan For your case, much of this will be unnecessary but having a worked example might be useful because I realized the Python code needs "elapsed time" in units of hours and I don't think I've made that clear, in the variable names or in docstrings 🙇

Applying a probability-based algorithm like this to a bunch of real-world data is useful in that, we can use likelihood analysis to compare it against other probability-based algorithms, or even the same algorithm by tweaking its parameters. Basically you sum up the "surprise" at each data point, and the algorithm that averages the least surprise over your dataset is "the best".

However, it's not obvious how to compare something like Ebisu (or any of the other probability-based SRS that you've probably seen) versus Anki or org-fc 😅 other than as a sanity check to make sure Ebisu et al. are doing something reasonable.