I had an idea for a new stats panel and before starting in to work on it, I wanted to seek some advice. Specifically I would like input on whether my idea should be an addon or if I should build it into the application. I’m a bit torn because I believe it would be broadly useful to the majority of people who use anki, but it also takes a small amount of background knowledge to interpret and would be somewhat computationally taxing.
Specifically my idea is to have a “rate of change” graph for the various card categories like “young” and “mature.” Specifically this would make it easier to determine what the correct number of new cards a day would be. (Ie: if young cards are consistently increasing, then you have too many new cards, if they are consistently decreasing, then you could take on more cards.) You can sortof do this buy feel or by hand already, but I believe it would be super helpful to have a long term graph for this and it will make a slowly worsening problem more obvious.
It would be computationally taxing because you’d need to back calculate how many cards of the desired type there are for every day. The naive approach to this would scale horrendously and do bad things to the stats panel of decks that have large numbers of cards, but it could probably be sped up a lot with some clever dynamic programming or just cacheing the values. Additionally, if the standard time frame is 1 week instead of the customary 30 days, that should also help keep load times down.
So, what do you think? Should this just be a plugin, or should I develop it for the main application? (And probably also ankidroid. I’d want to have it on my phone too)
I am leaning towards building it into the application and submitting a PR for it.
I realized the way I was thinking about the algorithm was kinda backwards and it isn’t really that computationally intense. Absolute worst case growth rate I could think of is around O(n^3) (if the user fails every card every day, consistently adds cards every day and is always looking at the entire history), but the realistic situation would be closer to O(n) or maybe O(nlogn) or O(n^2) (user adds a few cards every day (linear time), only used a fixed time period (constant time), and only fails cards around 10-20% of the time (linear-ish time)). It’ll still get fairly slow for enormous decks, but the rate at which it’ll grow isn’t too insane.
For changes to the Stats window – especially something with the computational impact of what you’re describing – you should really wait until you’ve gotten some response about your idea before doing the work. See: anki/docs/contributing.md at main · ankitects/anki · GitHub
Beyond whether it is possible or reasonable – there needs to be some consideration of whether it would be useful to enough users, and easy enough to understand, that it is worth ladening the Stats window with it for everyone.
If you want to make it as an add-on, that’s certainly up to you. But you should at least take a look at what is already offered in Search Stats Extended. Perhaps there’s already something there that will meet your needs. You should also reach out to that dev and see if he is interested in adding your idea to that add-on (which he does pretty often).
For me, let’s say I have limited time a day so I set maximal reviews a day and new cards belongs to this limit. I study the same time every day and I don’t care how much new cards are there.
Another person adds few new cards let’s say once per two weeks as he is studying at school and he needs to learn them quickly, so all new cards are loaded at once and he has bigger workload these days.