Exclude suspended prompts in statistics
John Smith

John Smith commited on 2023-89 18:08:33
Showing 1 changed files, with 6 additions and 4 deletions.


The "s" option now generates histograms only based on non-suspended
prompts, which helps to exclude distortive and semi-irrelevant outliers.
... ...
@@ -389,11 +389,12 @@ local actions = {
389 389
                 for _, pr in ipairs(card) do
390 390
                     if not qs or (pr.text:find(qs) or pr.ans:find(qs)) then
391 391
                         rtc = true
392
-                        table.insert(expdeck, pr)
393 392
                         tsc = tsc + pr.succ
394 393
                         tfc = tfc + pr.fail
395 394
                         if pr.delay < 0 then
396 395
                             spc = spc + 1
396
+                        else
397
+                            table.insert(expdeck, pr)
397 398
                         end
398 399
                     end
399 400
                 end
... ...
@@ -409,11 +410,11 @@ local actions = {
409 410
             end
410 411
             io.write(string.format(
411 412
                 "%s%s has %d cards and %d total prompts\n",
412
-                deckfname, qfn, tcc, #expdeck
413
+                deckfname, qfn, tcc, #expdeck + spc
413 414
             ))
414 415
             io.write(string.format(
415 416
                 "(average %.2f prompts per card, %d/%.1f%% prompts suspended).\n",
416
-                #expdeck / tcc, spc, 100 * spc / #expdeck
417
+                (#expdeck + spc) / tcc, spc, 100 * spc / (#expdeck + spc)
417 418
             ))
418 419
             io.write(string.format(
419 420
                 "The deck's prompts have been reviewed a total of %d times\n",
... ...
@@ -421,8 +422,9 @@ local actions = {
421 422
             ))
422 423
             io.write(string.format(
423 424
                 "(average %.2f reviews per prompt), overall retention %.2f%%.\n",
424
-                (tsc + tfc) / #expdeck, 100 * tsc / (tsc + tfc)
425
+                (tsc + tfc) / (#expdeck + spc), 100 * tsc / (tsc + tfc)
425 426
             ))
427
+            io.write("All further data excludes suspended prompts.\n")
426 428
             io.write("\nEase\n" .. histogram(expdeck, 1.0, 3.3, 0.1, function(pr) return pr.ease end, 0.03))
427 429
             io.write("\nLog2-delay (seconds)\n" .. histogram(expdeck, 15, 28, 0.5, function(pr) return math.log(pr.delay, 2) end, 0.1))
428 430
             io.write("\nDelay-last review ratio\n" .. histogram(expdeck, 0, 2, 0.1, function(pr) return (os.time() - pr.time) / pr.delay end, 0.1))
429 431