You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# pip install "ebisu>=3rc"
# pip install attrs
import ebisu
# create an Ebisu model when the student has learned this flashcard
model = ebisu.initModel(
firstHalflife=10, lastHalflife=10e3, firstWeight=0.9, numAtoms=5, initialAlphaBeta=2.0)
# at some point later, ask Ebisu for this flashcard's recall probability
timeSinceLastReview = 20
probabilityRecall = ebisu.predictRecall(model, timeSinceLastReview)
print("probabilityRecall =", probabilityRecall)
# administer a quiz, then update the model, overwriting the old one
timeSinceLastReview = 20.1
model = ebisu.updateRecall(model, successes=1, total=1,
elapsedTime=timeSinceLastReview)
# that's a binary quiz. You can also do a binomial quiz:
model = ebisu.updateRecall(model, successes=1, total=2,
elapsedTime=timeSinceLastReview)
# you can also do fuzzy-binary quizzes, see Ebisu v2 docs
model = ebisu.updateRecall(model, successes=0.85,
total=1, elapsedTime=timeSinceLastReview, q0=0.1)
# how long do we expect it to take for recall to drop to 50%?
print(ebisu.modelToPercentileDecay(model, 0.5))
# how long till recall drops to 80%?
print(ebisu.modelToPercentileDecay(model, 0.8))
# sometimes the model is just too hard or too easy. There's an ad hoc backdoor to rescaling it:
# new halflife = 0.25 * old halflife
easierModel = ebisu.rescaleHalflife(model, 0.25)
# new halflife = 4 * old halflife
harderModel = ebisu.rescaleHalflife(model, 4)
The text was updated successfully, but these errors were encountered:
Yah this is fine, predictRecall is returning log-probability. For real probability, pass in logDomain=False:
print([
ebisu.predictRecall(model, timeSinceLastReview), # what you haveebisu.predictRecall(model, timeSinceLastReview, logDomain=False), # ask for linear domain2**ebisu.predictRecall(model, timeSinceLastReview) # do the exponential yourself
])
# -1.5234768228692503 0.34784661272006395 0.34784661272006395
Output:
probabilityRecall = -1.5234768228692503
28.509940322512662
8.099971706104066
Source:
The text was updated successfully, but these errors were encountered: