Пример #1
0
def test_reference_prediction_feature():
    start_time = datetime.now()
    hr = SpaceRepetitionReference(epoch=start_time, )

    graph_handle, data_dict = hr.plot_graph(stop=30)
    training_moments_1 = hr.range_for(stop=30, curve=1, day_step_size=0.1)
    results_1 = [
        hr.recollect_scalar(training_moment, curve=1)
        for training_moment in training_moments_1
    ]
    training_moments_2 = hr.range_for(stop=30, curve=2, day_step_size=0.1)
    results_2 = [
        hr.recollect_scalar(training_moment, curve=2)
        for training_moment in training_moments_2
    ]
    training_moments_3 = hr.range_for(stop=30, curve=3, day_step_size=0.1)
    results_3 = [
        hr.recollect_scalar(training_moment, curve=3)
        for training_moment in training_moments_3
    ]
    reference_plot = graph_handle.axarr
    reference_plot.plot(training_moments_1, results_1, color='xkcd:azure')
    reference_plot.plot(training_moments_2, results_2, color='xkcd:darkgreen')
    reference_plot.plot(training_moments_3, results_3, color='xkcd:maroon')
    hr.save_figure("results/space_reference_predictions.pdf")
    graph_handle.close()
Пример #2
0
def test_reference_plot_closing_features():
    start_time = datetime.now()
    hr = SpaceRepetitionReference(epoch=start_time)
    hdl, _ = hr.plot_graph(stop=42)
    hdl.close()
Пример #3
0
def test_reference_graph_too_long():
    hr = SpaceRepetitionReference(epoch=datetime.now())
    hdl, _ = hr.plot_graph(stop=60)
    hr.save_figure("results/space_reference_too_long_plot.pdf")
    hdl.close()