08.06.2015 Views

Building Machine Learning Systems with Python - Richert, Coelho

Building Machine Learning Systems with Python - Richert, Coelho

Building Machine Learning Systems with Python - Richert, Coelho

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 1<br />

Our first (tiny) machine learning<br />

application<br />

Let us get our hands dirty and have a look at our hypothetical web startup, MLAAS,<br />

which sells the service of providing machine learning algorithms via HTTP. With<br />

the increasing success of our company, the demand for better infrastructure also<br />

increases to serve all incoming web requests successfully. We don't want to allocate<br />

too many resources as that would be too costly. On the other hand, we will lose<br />

money if we have not reserved enough resources for serving all incoming requests.<br />

The question now is, when will we hit the limit of our current infrastructure, which<br />

we estimated being 100,000 requests per hour. We would like to know in advance<br />

when we have to request additional servers in the cloud to serve all the incoming<br />

requests successfully <strong>with</strong>out paying for unused ones.<br />

Reading in the data<br />

We have collected the web stats for the last month and aggregated them in ch01/<br />

data/web_traffic.tsv (tsv because it contains tab separated values). They are<br />

stored as the number of hits per hour. Each line contains consecutive hours and the<br />

number of web hits in that hour.<br />

The first few lines look like the following:<br />

[ 19 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!