Example #1
0
def test_learning_tracker_graph_context_manager_xxxc_handle():

    lt = LearningTracker(epoch=datetime.now())
    moments = lt.range_for(curve=1, stop=43, day_step_size=0.5)
    predictions = [lt.recollect_scalar(moment, curve=1) for moment in moments]

    with lt.graphs(stop=43,
                   filename='results/lt_content_xxxc_handle.pdf',
                   control_handle=True) as ch:
        ch.plot(moments, predictions, color='xkcd:azure')
Example #2
0
def test_learning_tracker_graph_context_manager_rfec_handle():

    lt = LearningTracker(epoch=datetime.now())
    moments = lt.range_for(curve=1, stop=43, day_step_size=0.5)
    predictions = [lt.recollect_scalar(moment, curve=1) for moment in moments]

    with lt.graphs(stop=43,
                   filename='results/lt_content_rfec_handle.pdf',
                   control_handle=True,
                   reference_handle=True,
                   feedback_handle=True,
                   error_handle=True) as (rh, fh, eh, ch):
        rh.plot(moments, predictions, color='xkcd:azure')
        fh.plot(moments, predictions, color='xkcd:azure')
        eh.plot(moments, predictions, color='xkcd:red')
        ch.plot(moments, predictions, color='xkcd:azure')
Example #3
0
def test_learning_tracker_broken_two_handle_graph():

    lt = LearningTracker(epoch=datetime.now())

    # give our learning tracker some feedback
    for d, r in zip(
        [0, 0.8, 1.75, 3.02, 4.8, 7.33],
        [0.40, 0.44, 0.64, 0.76, 0.83, 0.89],
    ):
        lt.learned(result=r, when=d)

    with lt.graphs(stop=43,
                   show=True,
                   control_handle=True,
                   reference_handle=True,
                   filename='results/context_manager_two_handles.svg') as (rh,
                                                                           ch):

        r_m = lt.reference.range_for(curve=3, stop=43, day_step_size=0.5)
        r_p = [lt.reference.predict_result(moment, curve=3) for moment in r_m]
        rh.plot(r_m, r_p, color='xkcd:ruby')
        c_m = lt.range_for(curve=1, stop=43, day_step_size=0.5)
        c_p = [lt.predict_result(moment, curve=1) for moment in c_m]
        ch.plot(c_m, c_p, color='xkcd:azure')
Example #4
0
def test_learning_tracker_graph_context_manager_xxxx_handle():

    lt = LearningTracker(epoch=datetime.now())
    with lt.graphs(stop=43, filename='results/lt_content_xxxx_handle.pdf'):
        pass