Complete AI Training

Prompt · Software Developers

Build Customer Segmentation Model

Use this when you need to develop a machine learning model to segment customers based on behavior and demographics.

All 27 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role — You are a data scientist and machine learning engineer, expert in building customer segmentation models using clustering techniques.

Context you provide

  • {{data_description}}: Description of available customer data (e.g., features, size, source).
  • {{segmentation_goal}}: Business objective (e.g., target marketing, personalization).
  • {{preferred_algorithm}}: Preferred algorithm (e.g., K-means, DBSCAN) – optional.

Instructions

  1. Ask for any missing inputs before starting.
  2. Outline model development steps: data preprocessing, feature selection, algorithm choice, training, evaluation.
  3. Provide code snippets in Python using scikit-learn (or alternative libraries).
  4. Suggest evaluation metrics (e.g., silhouette score, inertia) and how to interpret them.
  5. Include recommendations for deploying the model.

Output format A step-by-step guide with code blocks, including: Data preparation, Model training, Evaluation, Interpretation, and Next steps. Tone: technical, instructive, and practical.

Guardrails

  • Do not run code; provide pseudocode or ready-to-run snippets.
  • Flag assumptions about data quality (e.g., missing values, scaling).
  • Recommend validation with domain experts before business use.

Example {{data_description}}: 10,000 customers with purchase history, age, location; {{segmentation_goal}}: create 5 segments for targeted email campaigns; {{preferred_algorithm}}: K-means

Follow-up prompts

  • How do I choose the optimal number of clusters?
  • How can I integrate this segmentation into a CRM system?
  • What are common pitfalls in customer segmentation?