py-fsrs icon indicating copy to clipboard operation
py-fsrs copied to clipboard

Cards are moved to Review too quickly

Open geomags3 opened this issue 5 months ago • 3 comments

Hi,

Thanks so much for the great algorithm and implementation—it's really cool!

I’d like to use it in my app, but I’ve noticed an issue. It moves new cards to "Review" and increases the Due time too quickly. When I compared it to my Anki app with the same settings, the results were quite different:

image

Anki app:

  1. Added a new card
  2. Again (<1m), Hard (<6m), Good (<10m), Easy ( 7d) -> Again
  3. Again (<1m), Hard (<6m), Good (<10m), Easy ( 2d) -> Hard
  4. Again (<1m), Hard (<6m), Good (<10m), Easy ( 2d) -> Good
  5. Again (<1m), Hard (<10m), Good (<1d), Easy ( 2d) -> Hard
  6. Again (<1m), Hard (<10m), Good (<1d), Easy ( 2d) -> Easy
  7. Moved to Review

py-fsrs script

test_w = (
    0.5614,
    1.2546,
    3.5878,
    7.9731,
    5.1043,
    1.1303,
    0.8230,
    0.0465,
    1.6290,
    0.1350,
    1.0045,
    2.1320,
    0.0839,
    0.3204,
    1.3547,
    0.2190,
    2.7849,
    0.4891,  # not used in the Anki app
    0.6468,  # not used in the Anki app
)

f = FSRS(w=test_w)
card = Card()
now = datetime.now(timezone.utc)

ratings = (
    Rating.Again,
    Rating.Hard,
    Rating.Good,
    Rating.Hard,
    Rating.Easy,
)

for rating in ratings:
    card, _ = f.review_card(card, rating, now)
    print(f"Rating: `{Rating(rating).name}` -> State: `{State(card.state).name}`,\t+{card.due - now}  Due: {card.due}, Difficulty: {card.difficulty}, Reps: {card.reps}, Lapses: {card.lapses}")
Rating: `Again` -> State: `Learning`,	+0:01:00  Due: 2024-09-20 19:09:43.358569+00:00, Difficulty: 5.1043, Reps: 1, Lapses: 0
Rating: `Hard` -> State: `Learning`,	+0:10:00  Due: 2024-09-20 19:18:43.358569+00:00, Difficulty: 5.698180550000001, Reps: 2, Lapses: 0
Rating: `Good` -> State: `Review`,	+1 day, 0:00:00  Due: 2024-09-21 19:08:43.358569+00:00, Difficulty: 5.479715154425001, Reps: 3, Lapses: 0
Rating: `Hard` -> State: `Review`,	+1 day, 0:00:00  Due: 2024-09-21 19:08:43.358569+00:00, Difficulty: 6.056138899744239, Reps: 4, Lapses: 0
Rating: `Easy` -> State: `Review`,	+3 days, 0:00:00  Due: 2024-09-23 19:08:43.358569+00:00, Difficulty: 5.036297940906132, Reps: 5, Lapses: 0

geomags3 avatar Sep 20 '24 19:09 geomags3