diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2019-07-31 16:28:31 +0100 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2019-07-31 16:28:31 +0100 |
| commit | 1fd0dd8b28bac19431a8c577ee78ea655882ad82 (patch) | |
| tree | 5345d5070a8a472b50538f05349a27751ef87ffa /app/main | |
| parent | Add demo data to repo (diff) | |
| download | AnnotateChange-1fd0dd8b28bac19431a8c577ee78ea655882ad82.tar.gz AnnotateChange-1fd0dd8b28bac19431a8c577ee78ea655882ad82.zip | |
Add support for multidimensional datasets
Diffstat (limited to 'app/main')
| -rw-r--r-- | app/main/demo.py | 31 | ||||
| -rw-r--r-- | app/main/routes.py | 5 |
2 files changed, 35 insertions, 1 deletions
diff --git a/app/main/demo.py b/app/main/demo.py index afb7f61..2edae04 100644 --- a/app/main/demo.py +++ b/app/main/demo.py @@ -252,6 +252,32 @@ DEMO_DATA = { ) }, }, + 8: { + "dataset": {"name": "demo_800"}, + "learn": { + "text": markdown.markdown( + textwrap.dedent( + """ + In practice time series datasets are not just one + dimensional, but can be multidimensional too. A change + point in such a time series does not necessarily occur in + all dimensions simultaneously. It is therefore important to + evaluate the behaviour of each dimension individually, as + well as in relation to the others.""" + ) + ) + }, + "annotate": {"text": RUBRIC}, + "evaluate": { + "text": markdown.markdown( + textwrap.dedent( + """ + In this example of a multidimensional time series, the + change only occurred in a single dimension.""" + ) + ) + }, + }, } @@ -373,13 +399,16 @@ def demo_annotate(demo_id): "error", ) return redirect(url_for("main.index")) + chart_data = load_data_for_chart(dataset.name, dataset.md5sum) + is_multi = len(chart_data["chart_data"]["values"]) > 1 return render_template( "annotate/index.html", title="Introduction – %i" % demo_id, data=chart_data, rubric=demo_data["text"], identifier=demo_id, + is_multi=is_multi, ) @@ -398,6 +427,7 @@ def demo_evaluate(demo_id, phase_id, form): name=DEMO_DATA[demo_id]["dataset"]["name"] ).first() chart_data = load_data_for_chart(dataset.name, dataset.md5sum) + is_multi = len(chart_data["chart_data"]["values"]) > 1 true_changepoints = get_demo_true_cps(dataset.name) if true_changepoints is None: flash( @@ -415,6 +445,7 @@ def demo_evaluate(demo_id, phase_id, form): annotations_true=annotations_true, text=demo_data["text"], form=form, + is_multi=is_multi ) diff --git a/app/main/routes.py b/app/main/routes.py index ad78f27..02ec7c9 100644 --- a/app/main/routes.py +++ b/app/main/routes.py @@ -18,7 +18,8 @@ logger = logging.getLogger(__name__) RUBRIC = """ Please mark the point(s) in the time series where an <b>abrupt change</b> in the behaviour of the series occurs. The goal is to define segments of the time - series that are separated by places where these abrupt changes occur. + series that are separated by places where these abrupt changes occur. Recall + that it is also possible for there to be no such changes. <br> """ @@ -112,10 +113,12 @@ def annotate(task_id): flash( "An internal error occurred loading this dataset, the admin has been notified. Please try again later. We apologise for the inconvenience." ) + is_multi = len(data["chart_data"]["values"]) > 1 return render_template( "annotate/index.html", title=task.dataset.name.title(), identifier=task.id, data=data, rubric=RUBRIC, + is_multi=is_multi, ) |
