Back to labs main.

Calmcode Labs Presents


This post contains demo's that will only render nicely on a desktop.

When teaching data science it's very useful to demonstrate the interaction between data and a machine learning model. To get a feeling for this interaction it helps to see the effect of a model when it is applied to different datasets.

That's why we created a widget that allows you to literally draw data. It's a very natural way to create datasets in different shapes and it should be a great tool while teaching. We're hosting the widgets below, but we'd also like to announce a python package that you can use from jupyter.


The widget below allows you to draw a lines.


This next one alloes you to draw a scatter chart.


Having this available from a website is nice, but it can be even nicer to have this available from a jupyter notebook. That's why we've also created the datadata python package.

You can install it via pip.

python -m pip install drawdata

Once installed you can directly use it from the notebook.

from drawdata import draw_line, draw_scatter, draw_histogram


Once you've drawn a plot you can copy the dataset into your clipboard and read it in with pandas.

import pandas as pd


Closing Thoughts

Drawing is an intuitive ability for many. Not only does it help understanding, it even invites play. We hope that being able to draw your own data will also allow you to more quickly understand how machine learning algorithms might come to predictions.

You might even be able to turn it into a game! Can you create a dataset that will fool a machine learning algorithm? Just sayin', it's a meaningful exercise.

Back to labs main.