Skip to content

About

Machine learning system for predicting a customer's next product from historical purchase sequences.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

Next Product Prediction from Customer Behavior Sequences

This project uses machine learning to predict a customer's next product based on their previous purchase behavior. Using the Online Retail dataset, customer transactions are transformed into sequential purchase patterns and used to train a classification model for next-product prediction.

Example Prediction

The model takes a customer's previous and current products as input and predicts the next product in their purchase sequence.

Input: Previous product + Current product
Output: Predicted next product

Overview

This project predicts the next product a customer is likely to purchase based on their previous behavior.

Dataset

  • Online Retail Dataset
  • Contains real-world transaction data of customers

Approach

  1. Cleaned the Online Retail transaction data by handling missing values and returns.
  2. Sorted customer transactions chronologically to preserve purchase behavior.
  3. Created individual purchase sequences for each customer.
  4. Converted sequences into previous-product → current-product → next-product patterns.
  5. Encoded product identifiers into numerical features for machine learning.
  6. Trained a Random Forest Classifier to predict the next product.
  7. Evaluated the model's prediction performance on unseen data.

Model

Random Forest Classifier

  • Input: Previous product + current product
  • Target: Next product in the customer's purchase sequence
  • Task: Multi-class classification
  • Output: Predicted next product

Technologies

  • Python
  • Pandas
  • Scikit-learn
  • Random Forest
  • Machine Learning
  • Data Preprocessing
  • Feature Engineering

Results

  • Accuracy: ~21%
  • Task: Multi-class next-product prediction
  • The problem involves predicting among a large number of possible products, making next-product prediction challenging.

Conclusion

This project demonstrates how customer purchase histories can be transformed into sequential data for next-product prediction. It provides a foundation for building more advanced recommendation systems using richer behavioral features and sequence-based machine learning models.

About

Machine learning system for predicting a customer's next product from historical purchase sequences.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages