#调度 #闪卡 #ebisu

ebirsu

闪卡测验调度

3个不稳定版本

0.2.0 2023年8月17日
0.1.1 2023年7月23日
0.1.0 2022年11月26日

#7#闪卡

GPL-3.0-or-later

26KB
478

Ebisu v3闪卡测验调度库的Rust端口。此库使用rust-GSL,这是GSL的Rust绑定。为了使用此库需要安装GSL库

使用示例

// Initialize the model with the first argument representing the half-life of the recall.
// It is 10 units of time (minutes, hours, days, etc.), meaning after 10 units of time have
// passed the probability of recall is 0.5. The second argument specifies how much boost to
// apply after a successful update.
let mut model = Model::from_priors(Gamma::new(1.0, 0.1)?, Gamma::new(4.5, 3.0)?)?;
// Updates the recall with a quiz that took place 2 units of time after the creaton of the
// model where the user had 2 correct responses out of 3.
model.update_recall(
    Quiz::new(
        2.0,
        Outcome::Binomial {
            successes: 2,
            total: 3,
        },
    )?,
    Default::default(),
    Default::default(),
);
// Updates the recall with a quiz that took place 1 unit of time after the last update where the
// user had 1 correct response out of 1.
model.update_recall(
    Quiz::new(
        1.0,
        Outcome::Binomial {
            successes: 1,
            total: 1,
        },
    )?,
    Default::default(),
    Default::default(),
);
// Updates the recall with a quiz that took place 1 unit of time after the last update where the
// user responded correctly 70% of the time.
model.update_recall(
    Quiz::new(2.5, Outcome::Noisy(0.7))?,
    Default::default(),
    Default::default(),
);
// Updates the recall to be more accurate. This can be called as often as needed, even after
// every quiz update, but it is a more expensive operation.
model.update_recall_history(Default::default());
let recall_probability = model.predict_recall_ln(3.0).exp();

依赖项

~73MB
~1M SLoC