Chapter 6. Predictive Analytics in R and Python

The team at Big Bonanza Warehouse is running into some problems with sales forecasting, and the VP of Sales has turned to Duane, who works as a Sales and Distribution Analyst, for some help. About once per quarter they gather their data and send it to an outside company that performs some magic on it. The result is a forecast of all their products for the upcoming quarters, but they’ve found that the forecast being generated for them is too generic (based on quarters) and often woefully inaccurate. Couldn’t they get something that would help them understand what sales might be next week? To put it succinctly, they want a forecast of sales of their top-selling products by week.

Duane has some ideas. Having worked with his company’s data scientists Greg and Paul, he knows a little bit about data science. Sales of a product over a period is a time-series1 problem. They have enough historical data to attempt to look for patterns. This is not pure forecasting, but pattern detection. It is something that the sales team could use, rather than their gut feelings. Duane decides to use a bit of predictive analytics. With the right set of R or Python tools and some up-front knowledge of predictive analytics, Duane won’t need to spend months of time paying expensive consultants to build massive data lakes. He can get his hands dirty and find answers.

There are many slippery terms in data science (including data science itself!), but predictive ...

Get Practical Data Science with SAP now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.