Introduction
The way we make decisions in today's world is changing. A very large proportion of our decisions—from choosing which movie to watch, which song to listen to, which item to buy, or which restaurant to visit—all rely upon recommendations and ratings generated by analytics. As decision makers continue to use more of such analytics to make decisions, they themselves become data points for further improvements, and as their own custom needs for decision making continue to be met, they also keep using these analytical models frequently.
The change in consumer behavior has also influenced the way companies develop strategies to target consumers. With the increased digitization of data, greater availability of data sources, and lower storage and processing costs, firms can now crunch large volumes of increasingly granular data with the help of various data science techniques and leverage it to create complex models, perform sophisticated tasks, and derive valuable consumer insights with higher accuracy. It is because of this dramatic increase in data and computing power, and the advancement in techniques to use this data through data science algorithms, that the McKinsey Global Institute calls our age the Age of Analytics.
Several industry leaders are already using data science to make better decisions and to improve their marketing analytics. Google and Amazon have been making targeted recommendations catering to the preferences of their users from their very early years. Predictive data science algorithms tasked with generating leads from marketing campaigns at Dell reportedly converted 50% of the final leads, whereas those generated through traditional methods had a conversion rate of only 17%. Price surges on Uber for non-pass holders during rush hour also reportedly had massive positive effects on the company's profits. In fact, it was recently discovered that price management initiatives based on an evaluation of customer lifetime value tended to increase business margins by 2%–7% over a 12-month period and resulted in a 200%–350% ROI in general.
Although using data science principles in marketing analytics is a proven cost-effective, efficient way for a lot of companies to observe a customer's journey and provide a more customized experience, multiple reports suggest that it is not being used to its full potential. There is a wide gap between the possible and actual usage of these techniques by firms. This book aims to bridge that gap, and covers an array of useful techniques involving everything data science can do in terms of marketing strategies and decision-making in marketing. By the end of the book, you should be able to successfully create and manage an end-to-end marketing analytics pipeline in Python, segment customers based on the data provided, predict their lifetime value, and model their decision-making behavior on your own using data science techniques.
This chapter introduces you to cleaning and preparing data—the first step in any data-centric pipeline. Raw data coming from external sources cannot generally be used directly; it needs to be structured, filtered, combined, analyzed, and observed before it can be used for any further analyses. In this chapter, we will explore how to get the right data in the right attributes, manipulate rows and columns, and apply transformations to data. This is essential because, otherwise, we will be passing incorrect data to the pipeline, thereby making it a classic example of garbage in, garbage out.