fasiha / ebisu

Public-domain Python library for flashcard quiz scheduling using Bayesian statistics. (JavaScript, Java, Dart, and other ports available!)
https://fasiha.github.io/ebisu
The Unlicense
314 stars 32 forks source link

predictRecallMedian fails #6

Closed fasiha closed 5 years ago

fasiha commented 5 years ago

Via https://github.com/rkern/ebisu/blob/7658e866c011e70a454b10c7290e486c11899ab8/EbisuGB1.ipynb courtesy of @rkern:

import ebisu
model0 = (4.0, 4.0, 1.0)
model1 = ebisu.updateRecall(model0, False, 1.0)
model2 = ebisu.updateRecall(model1, True, 0.01)
print(ebisu.alternate.predictRecallMedian(model2, 1.0, .05)) # prints 0.0

This is because predictRecallMedian is using a very general equation and finding its root. Wolfram Alpha can simplify the expression to a single incomplete Beta function, which should work much better.

rkern commented 5 years ago

You should be able to use scipy.special.betaincinv() to solve that directly.