{"id":28391607,"url":"https://github.com/rohithay/customer-segmentation","last_synced_at":"2025-07-26T11:08:01.238Z","repository":{"id":193848056,"uuid":"429797221","full_name":"rohithay/Customer-Segmentation","owner":"rohithay","description":"Clean and Apply RFM technique to rank and group clusters to identify the best customers and perform targeted marketing campaigns, using real online transaction data","archived":false,"fork":false,"pushed_at":"2022-08-07T17:57:41.000Z","size":332,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-31T20:12:06.479Z","etag":null,"topics":["data-cleaning","data-science","data-visualization","datetime","marketing-analytics","pandas","python3","user-segmentation"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rohithay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-11-19T12:55:00.000Z","updated_at":"2024-01-02T07:22:04.000Z","dependencies_parsed_at":"2023-09-10T12:31:23.478Z","dependency_job_id":null,"html_url":"https://github.com/rohithay/Customer-Segmentation","commit_stats":null,"previous_names":["yrohitha/customer-segmentation","rohithay/customer-segmentation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rohithay/Customer-Segmentation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohithay%2FCustomer-Segmentation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohithay%2FCustomer-Segmentation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohithay%2FCustomer-Segmentation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohithay%2FCustomer-Segmentation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rohithay","download_url":"https://codeload.github.com/rohithay/Customer-Segmentation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohithay%2FCustomer-Segmentation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261955832,"owners_count":23235962,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-cleaning","data-science","data-visualization","datetime","marketing-analytics","pandas","python3","user-segmentation"],"created_at":"2025-05-31T09:42:49.120Z","updated_at":"2025-06-25T21:31:00.155Z","avatar_url":"https://github.com/rohithay.png","language":"Jupyter Notebook","readme":"## Customer-Segmentation\n\n#### Clean and Apply RFM technique to rank and group clusters to identify the best customers and perform targeted marketing campaigns, using real online transaction data\n\n\n### Description\n\n**Apply RFM technique to derive our business goals!** \n\n#### Marketing Technique: Using RFM (Recency, Frequency, Monetary) Marketing model\n* **Recency** : last time customer made a purchase, more likely to repeat than a old customer\n* **Frequency** : how many times a customer made a purchase, who purchases often is likely to come back\n* **Monetary Value** : amount of money a customer has spent within that timeframe, large purchases likely to return than a customer who spends less\n\n#### Business Benefits:\n  1. Personalization: By creating effective customer segments, you can create relevant, personalized offers.\n  2. Improve Conversion Rates: Personalized offers will yield higher conversion rates because your customers are engaging with products they care about.\n\n#### Challenges:  \n\n- [x] Working with a skewed Probability distribution \n- [x] Making good sense of Marketing Knowledge\n\n\n### Install Setup\n\nThis project requires **Python 2.7** and the following Python libraries installed:\n\n- [numpy](http://www.numpy.org/)\n- [pandas](http://pandas.pydata.org)\n- [matplotlib](http://matplotlib.org/)\n- [scikit-learn](http://scikit-learn.org/stable/)\n- [datetime](https://docs.python.org/3/library/datetime.html)\n- [seaborn](https://seaborn.pydata.org)\n- [squarify](https://pypi.org/project/squarify/)\n\nYou will also need to have software installed to run and execute a [Jupyter Notebook](http://ipython.org/notebook.html)\n\nIf you do not have Python installed yet, it is highly recommended that you install the [Anaconda](http://continuum.io/downloads) distribution of Python, which already has the above packages and more included. Make sure that you select the Python 2.7 installer and not the Python 3.x installer.\n\n\n### Code\n\nTemplate code is provided in the notebook `retail-customer-data-segmentation.ipynb` \n[Jupyter Notebook](https://github.com/YRohitha/Customer-Segmentation/blob/main/scripts/retail-customer-data-segmentation.ipynb) file.\n\n\n### Run\n\nIn a terminal or command window, navigate to the top-level project directory (that contains this README) and run one of the following commands:\n\n```bash\njupyter notebook retail-customer-data-segmentation.ipynb.ipynb\n```\nor\n```bash\nipython notebook retail-customer-data-segmentation.ipynb.ipynb\n```\nThis will open the Jupyter Notebook software and project file in your web browser.\n\n\n### Data\n\nThe dataset used in this project will be included as `retail_data.csv`. This dataset is sourced from public domain and contains the following attributes:\n\n**Description**\n\nThis Online Retail II data set contains all the transactions occurring for a UK-based and registered, non-store online retail between 01/12/2009 and 09/12/2011.The company mainly sells unique all-occasion gift-ware. Many customers of the company are wholesalers.\n\n**Features**\n- `Invoice` : A 6-digit integral number uniquely assigned to each transaction. If this code starts with the letter 'c', it indicates a cancellation.\n- `StockCode` : Product (item) code. A 5-digit integral number uniquely assigned to each distinct product.\n- `Description` : Product (item) name.\n- `Quantity` : The quantities of each product (item) per transaction.\n- `InvoiceDate` : Invoice date and time. The day and time when a transaction was generated.\n- `Price` : Unit price. Product price per unit in sterling (Â£).\n- `Customer ID` : Customer number. A 5-digit integral number uniquely assigned to each customer.\n- `Country` : Country name. The name of the country where a customer resides.\n\n**Transformed Features**\n- `most_recent_txn` : date of their most recent transaction\n- `num_orders` : number of transactions they’ve made within a consistent time frame (a year will work best)\n- `total_revenue` : total amount they’ve spent during that same timeframe.\n\n**Target Variable**\n- `user_segment`: Customer Segment (111, X1X, XX1, X13, X14, 14X, 44X)\n\n* `111`: **Core or Best Customers** : Focus on loyalty programs and new product introductions. Proven to have a higher willingness to pay, so don't use discount pricing to generate incremental sales. Instead, focus on value added offers through product recommendations based on previous purchases\n\n* `X1X`: **Loyal Customers** : Loyalty programs are effective for these repeat visitors. Advocacy programs and reviews are also common X1X strategies. Lastly, consider rewarding these customers with Free Shipping or other like benefits.\n\n* `XX1`: **Whales or Highest Paying Customers** : These customers have demonstrated a high willingness to pay. Consider premium offers, subscription tiers, luxury products, or value add cross/up-sells to increase AOV. Don't waste margin on discounts\n\n* `X13` OR `X14`: **Promising - Faithful customers** : You've already succeeded in creating loyalty. Focus on increasing monetization through product recommendations based on past purchases and incentives tied to spending thresholds (pegged to your store AOV).\n\n* `14X`: **Rookies - Your Newest Customers** : Most customers never graduate to loyal. Having clear strategies in place for first time buyers such as triggered welcome emails will pay dividends.\n\n* `44X`: **Slipping - Once Loyal, Now Gone** : Customers leave for a variety of reasons. Depending on your situation price deals, new product launches, or other retention strategies.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohithay%2Fcustomer-segmentation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frohithay%2Fcustomer-segmentation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohithay%2Fcustomer-segmentation/lists"}