This project implements user segmentation and prediction for Amazon customers by applying clustering and classification techniques on user data. The segmentation model groups users into meaningful clusters based on their behavior and demographics, while the classification model predicts the segment of a new user based on their input features.
The application provides an interactive web interface built with Gradio to input user details, predict their segment, and display targeted marketing strategies tailored to each segment.
🌐 Live Output : Open App
- Segmentation: Groups Amazon users into 4 distinct clusters based on behavioral data.
- Classification: Predicts the segment of a new user from input features.
- Provides actionable marketing strategies for each segment.
- User-friendly, real-time interactive UI using Gradio.
- Easy to run locally or deploy on cloud platforms.
-
Clustering: Performed using a clustering algorithm (e.g., KMeans) on user behavior data.
-
Classification: Trained model to assign users to one of the clusters based on their features.
-
Input features include:
- Age
- Income
- Rating (0-100)
- Gender
-
Derived features:
- Income per Age
- Behavior Score (Income × Rating)
-
The classification model and scaler are saved as
.savfiles usingpickle.
-
Python 3.7+
-
Python packages:
pip install gradio scikit-learn pandas numpy
app.py— Gradio app interface and prediction logic.cluster_classifier.sav— Saved classification model.scaler.sav— Saved feature scaler.
-
Place the model and scaler files alongside
app.py. -
Install dependencies.
-
Run:
python app.py
-
Open the local URL provided by Gradio in your browser.
Deploy on platforms like:
- Hugging Face Spaces (free and easy for Gradio apps)
- Heroku
- Any cloud server supporting Python apps
Input user details such as Age, Income, Rating (0-100), and Gender. The app predicts their segment and presents a marketing strategy customized for that segment.
-
Young High Spenders Focus on premium offers, influencer marketing, and loyalty rewards.
-
Mid-Age Budget Seekers Promote discounts, budgeting aids, and seasonal sales.
-
Valuable Loyalists Engage with personalized messaging, VIP perks, and feedback.
-
Low-Value Users Boost engagement via tutorials, entry-level offers, and support.
- Incorporate more features like engagement scores.
- Visualize user input relative to cluster centroids.
- Enable dynamic clustering on updated data.
- Containerize for easier deployment and scaling.
This project is licensed under the MIT License.
You are free to use, modify, and distribute this project with proper attribution.
- Name: Abinaya Goud
- GitHub: https://github.com/abinayagoudjandhyala