I spent most of my time this week experimenting with time series prediction using recurrent neural networks (RNN). And damn, it was shocking how good is AI now and how easy some frameworks make it to use!
But before being able to make predictions based on data, one must be able to understand them. And since human is way better to understand something it can picture, I needed a visualization framework.
What is more apparent between these two representations.
This one ?
Or this one?
The second one is way easier to interpret and understand. And the more data you got, the more pronounced the difference becomes. For instance, this graph allows you to visualize the High, Low, and closing price at a given date in the blink of an eye :
Ok, so what now? Well, if you have done a bit of data science before, you might have noticed that nearly everyone uses Matplotlib to visualize their data. For fancy graphs, some use Seaborn. These two libraries have one thing in common: They produce static figures.
At first, I didn't think that it was a problem, but the more I experimented with my dataset, the more I found myself asking the same two questions over and over:
- What is the exact value at this place in the graph?
- What would the data look like if I change just this parameter (then, I proceed to change it repeatedly for 20 minutes...)
My requirements have become evident. I needed a plotting library that could produce interactive figures inside a Jupyter notebook (or, in my case, a Google Colab environment). As a side note, if you don't know Google Colab, please take a look. Basically, it's a free Jupyter notebook environment with GPU enabled machines!
Anyway, after looking for the perfect library, I found the best one ever: Plotly. It offers two main components.
A core API to create complex and interactive figures like this one :
As a bonus, you can export them as an image or a standalone HTML that one can embed (for instance, in a blog article!).
And a more programmatic API called Dash to build simple user interfaces allowing you to manipulate parameters in real-time!
I was very impressed, and the API is consistent and straightforward. Thanks to this free and open-source library, my data visualization is prettier than ever!