From the Console to Consumers
Links to later posts in this series:
- Working with Financial Data
- Calling the PyData Stack from a Backend
- Development, Staging, and Production
- Angular 2 for Data Science
A lot of great data science happens in interactive IPython sessions or Jupyter notebooks, allowing for quick analysis and communication of results. However, turning notebooks or Python scripts into web applications can be a daunting task and often leads to great tools getting buried. This series of blog posts will address the gap between homespun data analysis tools and consumer-facing web applications. When a data scientist identifies a consumer-oriented service, this workflow can bring the service to the consumer.
What Are We Building?
We turn to the world of finance for this project because it contains many examples of consumer-facing services that are backed primarily by data analysis. We will take a couple of Python scripts that optimize a user’s stock portfolio and turn them into an interactive web application. Each post in this series will stand alone conceptually, so feel free to skip around. However, be sure to
git checkout the correct branch on GitHub before following along.
In short, we want to set up a sleek frontend web application that can make API calls to the PyData stack, which will crunch data for us and spit back a response. The finished application will eventually be hosted at stocks.coshx.com, and you can follow the development on the project’s GitHub repository. This application takes a list of stocks, start and end dates, and an initial investment amount as inputs and returns the optimal allocation of each stock and a plot of the optimal portfolio’s performance.
- The Backend: Under the hood, our application will pull data in from Quandl, calculate statistics on the data using numpy, and optimize stock allocations using
Each Friday for the next four weeks, I will roll out a new post in the series. As they are finished, a link will go live on this page.
- Working with Financial Data: This post introduces the common difficulties of analyzing financial data and gives an overview of our approach to portfolio optimization.
- Calling the PyData Stack from a Backend: Here we describe how to set up a backend server to handle web requests asynchronously and call our Python scripts using Tornado.
- Development, Staging, and Production: Here we transition from backend development to setting up a staging server before continuing with frontend development.
- Angular 2 for Data Science: We will introduce a general approach to frontend web development and then dive in with the specifics of Angular 2 with TypeScript.
I am a lab scientist turned data scientist who is interested in machine learning and software development. After writing endless scripts that I couldn’t share easily with others, I wanted to create a streamlined workflow for developing consumer-facing software that hinges on data analysis.