Skip to content

Built classifiers and regressors with machine learning technics to provide insights for Starbucks.

Notifications You must be signed in to change notification settings

tylerzhang77/Starbucks-Offer-Analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Starbucks-Offer-Analysis

Blog post

You can read the final report with this link: https://medium.com/@tylerzhang77/insights-about-starbucks-offers-38a004d34eeb

Introduction

This data set contains simulated data that mimics customer behavior on the Starbucks rewards mobile app. Once every few days, Starbucks sends out an offer to users of the mobile app. An offer can be merely an advertisement for a drink or an actual offer such as a discount or BOGO (buy one get one free). Some users might not receive any offer during certain weeks.

Not all users receive the same offer, and that is the challenge to solve with this data set.

Every offer has a validity period before the offer expires. As an example, a BOGO offer might be valid for only 5 days. You'll see in the data set that informational offers have a validity period even though these ads are merely providing information about a product; for example, if an informational offer has 7 days of validity, you can assume the customer is feeling the influence of the offer for 7 days after receiving the advertisement.

Transactional data will be given showing user purchases made on the app including the timestamp of purchase and the amount of money spent on a purchase. This transactional data also has a record for each offer that a user receives as well as a record for when a user actually views the offer. There are also records for when a user completes an offer.

Keep in mind as well that someone using the app might make a purchase through the app without having received an offer or seen an offer.

Note

To give an example, a user could receive a discount offer buy 10 dollars get 2 off on Monday. The offer is valid for 10 days from receipt. If the customer accumulates at least 10 dollars in purchases during the validity period, the customer completes the offer.

However, there are a few things to watch out for in this data set. Customers do not opt into the offers that they receive; in other words, a user can receive an offer, never actually view the offer, and still complete the offer. For example, a user might receive the "buy 10 dollars get 2 dollars off offer", but the user never opens the offer during the 10 day validity period. The customer spends 15 dollars during those ten days. There will be an offer completion record in the data set; however, the customer was not influenced by the offer because the customer never viewed the offer.

Research question

  • Find demographic traits of customers who completed the offer.

  • Build a classifier to find customers who will complete an offer.

  • Build a model to predict the profit for each completed offer.

Dataset Overview

  • The program used to create the data simulates how people make purchasing decisions and how those decisions are influenced by promotional offers.
  • Each person in the simulation has some hidden traits that influence their purchasing patterns and are associated with their observable traits. People produce various events, including receiving offers, opening offers, and making purchases.
  • As a simplification, there are no explicit products to track. Only the amounts of each transaction or offer are recorded.
  • There are three types of offers that can be sent: buy-one-get-one (BOGO), discount, and informational. In a BOGO offer, a user needs to spend a certain amount to get a reward equal to that threshold amount. In a discount, a user gains a reward equal to a fraction of the amount spent. In an informational offer, there is no reward, but neither is there a requisite amount that the user is expected to spend. Offers can be delivered via multiple channels.
  • The basic task is to use the data to identify which groups of people are most responsive to each type of offer, and how best to present each type of offer.

Data Dictionary

profile.json

Rewards program users (17000 users x 5 fields)

  • gender: (categorical) M, F, O, or null
  • age: (numeric) missing value encoded as 118
  • id: (string/hash)
  • became_member_on: (date) format YYYY/MM/DD
  • income: (numeric)

portfolio.json

Offers sent during 30-day test period (10 offers x 6 fields)

  • reward: (numeric) money awarded for the amount spent
  • channels: (list) web, email, mobile, social
  • difficulty: (numeric) money required to be spent to receive reward
  • duration: (numeric) time for offer to be open, in days
  • offer_type: (string) bogo, discount, informational
  • id: (string/hash)

transcript.json

Event log (306648 events x 4 fields)

  • person: (string/hash)
  • event: (string) offer received, offer viewed, transaction, offer completed
  • value: (dictionary) different values depending on event type
  • offer id: (string/hash) not associated with any "transaction"
  • amount: (numeric) money spent in "transaction"
  • reward: (numeric) money gained from "offer completed"
  • time: (numeric) hours after start of test

Conclusions

The project is challenging regarding the data preprocessing work. I managed to realize couple things below:

  • Developed a classifier that could determine if a customer is going to complete an offer with demographic data and offer information.

  • Developed a predictor that could predict how much Starbucks could earn with a complete offer based on user and offer information.

  • Provided key insights about customers who completed an offer and offers that have potential.

Acknowledgement

Many thanks to the Udacity community to provide this nice project.

About

Built classifiers and regressors with machine learning technics to provide insights for Starbucks.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published