Code Monkey home page Code Monkey logo

purchase_prediction's Introduction

Purchase Prediction

Predicting Customer Transactions and Calculating Price Elasticities by Segment

Installation

  • Python 3.7.3
  • Libraries: pandas, NumPy, Matplotlib, Seaborn, scikit-learn

File Descriptions

Dataset and its legend can be found in data folder.

pickle folder contains the results of customer segmentation (StandardScaler, PCA, KMeans).

The analysis can be found as Jupyter Notebook here:

Project Description

In this project, I analyzed purchase behavior of 500 customers that bought 5 different brands of chocolate candy bars in a physical FMCG store during 2 years. In total, they made 58,693 transactions, captured through the loyalty cards they used at checkout.

Based on the results of customer segmentation, I answered the following business questions:

  • Will a customer buy a product from a particular product category when they enter the shop?
  • How does demand for the product change with the given change in price?

To answer these questions, I first built a statistical model using Logistic Regression that estimates purchase probability for each customer at each shopping trip. Then I calculated price elasticity of purchase probability with/without promotions and for different segments.

Results

Results Fewer Opportunities segment is the most price sensitive compared to other segments. The price elasticity cruve for Fewer Opportunities goes steep downwards, meaning that with increase in price, customers of this segment become more elastic much faster. The tipping point between elasticity and inelasticity for Fewer Opportunities segment is 1.27 USD.

There is no much support for the original hypothesis that Career Focused group might endure higher prices. It turned out that Well-Off segment is less elastic when it comes to price increases than Career Focused segment. So we might try increasing prices for Brand 4 that is primarily bought by Well-Off segment.

According to analysis, customers are less price sensitive to price changes when there are promotional activities. If the product has a regular price of 1.30 USD (i.e. without promotion), its purchase probability is elastic. However, if the product costs 1.50 USD and its price is reduced to 1.30 USD during promotion, the purchase probability is still inelastic at this price point.

Acknowledgement

This project is part of "Customer Analytics" course by 365DataScience

However, I modified and streamlined some code, e.g. by writing functions to automatically calculate and plot price elasticities.

purchase_prediction's People

Contributors

k-bosko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.