GSoC 2021 Time series and regression plots Final Report

Utkarsh Maheshwari
4 min readAug 20, 2021

--

An end to the amazing journey of GSoC. The skills and practices I learnt in GSoC of 10 weeks are far greater than what I would have learned individually. The experience is very precious. I am glad that I participated in ArviZ, NumFOCUS. I owe Ravin, Ari and Oriol for being amazing mentors, guiding me throughout the program. It was impossible to complete the project in the given time without them.

This blog is my farewell to the GSoC but definitely not to ArviZ and Open-Source in general. I loved making meaningful contributions to the open-source. PR’s #1727 and #1747 summarizes my work done. I added 2 plots, plot_lm and plot_ts. The first one is covered in #1727 and the next one in #1747. The project workflow in both the plots was as follows. I have taken an example of plot_lm to make describe the workflow.

  1. Started with a high-level design: Discussed the user API function with the mentors and other community members. Discussion includes input variable names, accepted datatypes, accepted values and other input details. Also showed a sample output visualization. Once it was approved, I moved on to opening this PR. This Github Gist for plot_lm and this colab notebook for plot_lm shows the design and some discussions related to it. The design process took an initial week.
  2. Submitted a prototype: The mentioned PR’s was earlier a prototype, which gradually became ready to be merged. This step is basically implementing the design decision made in the previous step. In addition to the user API, backend functions are also added. As ArviZ uses 2 backends, artist functions for both of them were added. This step took another week.
  3. Improved it according to reviews: In this step, mentors review your code to provide feedback and improvement tips. Learned the best code practices in this step. Ideally, improving never ends. It is important to maintain the added code after it is merged to keep it bug-free. I aim to provide support after GSoC. This step was a bit lengthy and complex and thus took 2 weeks.
  4. Tested the functionality: Added tests using pytest. Aimed and achieved to cover all of the added functionality under tests. Similar to step 2, added tests for both of the backends. Also, solved some simple to complex bugs that arise while testing. This step took another week.
  5. Added examples: Examples are added to the docstring as well as to the examples folder. Please check out the files changed tab to know more about this step. This step was quick, took only half a week.
  6. Added documentation: If you want to know how to use plot_lm, checkout out this blog. However, if you want to go on a low level to know the working in detail, I would suggest taking a look over the docstring in ArviZ docs and probably follow the comments sequentially. Another week was consumed in this step.

Here is the plot showing one of several features of plot_lm .

And here is a plot showing the proposed output of plot_ts :

I was successfully able to generate the last plot shown in this figure that is the overall time series. However, due to time constraints, plotting components is left to be done. I aim to complete it post-GSoC.

Pull Requests opened during and before GSoC to solve small bugs:

https://github.com/arviz-devs/arviz/pull/1707
https://github.com/arviz-devs/arviz/pull/1727

https://github.com/arviz-devs/arviz/pull/1717

https://github.com/arviz-devs/arviz/pull/1710

https://github.com/arviz-devs/arviz/pull/1586

https://github.com/arviz-devs/arviz/pull/1550

https://github.com/arviz-devs/arviz/pull/1541

https://github.com/arviz-devs/arviz/pull/1525

Post GSoC:

  1. I aim to provide support for the added functions, solve bugs that users may face while using the plots.
  2. Complete the plot_ts for bokeh backend and add components plots.
  3. Write a blog for newcomers to Bayesian modelling and ArviZ.
  4. Later, will contribute to adding more functionality according to the roadmap decided by the community.

Please see the docstring in ArviZ docs for a more detailed explanation of the user API and feel free to open issue tickets if you face any difficulties. I’ll be more than happy to help!

Thank you!
Hope this blog was helpful.

--

--