Skip to main content

ChatGPT Prompt to Choose the Right Machine Learning Model

Map task type, dataset shape, latency, and team experience to ranked ML model recommendations, a baseline to start from, and framework starter code.

Fill in the placeholders

Edit the values, then copy your finished prompt.

Your Prompt
prompt.txt
I need to build a binary classification model for predicting customer churn for a SaaS platform.

Data details:
- Dataset size: 500K rows, 50 features
- Features: mix of numerical (usage metrics), categorical (plan type), temporal (login patterns)
- Label distribution: imbalanced (5% positive/churn)
- Data quality issues: 15% missing values in some features, potential label noise

Constraints:
- Inference latency: under 50ms per prediction
- Infrastructure: AWS SageMaker, no GPUs for inference
- Team ML experience: intermediate (comfortable with scikit-learn, learning deep learning)
- Timeline: 4 weeks to MVP

Provide:
1. **Top 3 model recommendations** ranked by fit, with pros/cons for each
2. **Baseline model** — simplest model to start with and expected performance
3. **Feature engineering** suggestions specific to this problem
4. **Training strategy** — cross-validation approach, hyperparameter tuning, early stopping
5. **Evaluation metrics** — primary and secondary metrics, with threshold for production readiness
6. **Common pitfalls** for this type of problem
7. **Scaling path** — how to improve the model iteratively
8. **Code starter** — scikit-learn + XGBoost code for the recommended baseline model

Be practical — recommend what actually works in production, not just what's trendy.

What this prompt does

This prompt takes the seven concrete variables that actually determine model fit — task type, dataset size, feature composition, label distribution, latency budget, infrastructure, and team experience — and uses them to drive a structured recommendation rather than a generic "try XGBoost" answer. The [label_distribution] and [data_issues] fields are what separate useful output from textbook advice: they force the model to reason about class imbalance, missing-value strategies, and data leakage before it ever suggests an architecture.

The template produces a ranked shortlist of three models, a deliberate baseline, feature engineering direction, a training and tuning strategy, evaluation thresholds, known pitfalls, and a code scaffold — all in one pass. That last point matters: you do not need to run eight separate conversations to get from problem statement to working code skeleton.

When to use it

  • You are starting a new supervised learning project and need to justify your model choice to stakeholders before spending sprint time on experiments.
  • Your dataset is in an unusual shape — very wide (1000+ features, few rows), heavily imbalanced, or has categorical columns with high cardinality — and you want guidance specific to that shape.
  • A previous model is underperforming in production and you want a structured audit of whether the architecture choice was the problem.
  • You are an ML engineer onboarding a new team member and want a concrete starting point with documented trade-offs.
  • You need to match a latency constraint (sub-50ms inference on CPU) and want model options ranked by that constraint alongside accuracy.
  • You are deciding between training from scratch versus fine-tuning a pretrained model and want the trade-off written out explicitly.

Example output

For [ml_task_type]: binary classification, [business_problem]: churn prediction for a SaaS product, [dataset_size]: 80,000 rows, [label_distribution]: 8% positive (churned):

Top 3 recommendations:
1. LightGBM (primary) — handles imbalance via scale_pos_weight, fast iteration,
   interpretable via SHAP. Con: needs careful max_depth tuning to avoid overfit
   on low-signal behavioral features.
2. Logistic Regression (with L2) — useful calibration baseline; probabilities
   are reliable out-of-the-box for threshold tuning. Con: misses feature interactions.
3. CatBoost — strong on mixed categorical/numeric without extensive preprocessing.
   Con: slower training, higher memory footprint than LGBM.

Baseline: Logistic Regression on top-10 features by mutual information.
Expected AUC: 0.72-0.76. Use this to benchmark everything else.

Primary metric: ROC-AUC. Secondary: Precision-Recall AUC (more informative
under 8% positive rate). Production threshold: PR-AUC > 0.42 before ship.

Common pitfall: leaking post-churn activity features (e.g. last_login computed
after label window closes). Audit feature timestamps against label cutoff.

Pro tips

  • Fill [data_issues] honestly. If you write "none," you will get a generic answer. Writing "15% nulls in usage columns, two features with train/test distribution shift" unlocks specific imputation and drift-detection advice that changes the training strategy.
  • Set [latency_requirement] in milliseconds, not words. "Fast" means nothing. "Less than 30ms p99 on a single CPU core" eliminates ensemble methods and tree-boosting and steers the output toward linear models or quantized neural nets.
  • Use [team_experience] to control complexity. "Junior team, no MLOps infra" should produce a simpler pipeline recommendation than "senior team, Kubeflow available." The prompt respects this — do not downplay it to seem more capable.
  • Run the baseline code first, always. The prompt outputs a code starter for the baseline model. Run that before touching the top recommendation. If the baseline hits your metric threshold, you are done — ship it.
  • Pair this with a data profiling step. Before filling [label_distribution] and [data_issues], run df.describe(), df.isnull().sum(), and a quick value-count on your target column. Five minutes of profiling makes every field more accurate and the output significantly more actionable.

Frequently Asked Questions

Does this prompt work for deep learning tasks like image classification or NLP, or only tabular ML?
It works for any ML task type you name in [ml_task_type]. For image classification or text classification the recommendations shift accordingly — the prompt will suggest CNNs, vision transformers, or fine-tuned language models rather than tree ensembles. The key is being specific: write 'multi-label text classification' or 'image segmentation,' not just 'deep learning problem.' The [framework] variable in the code starter also matters here — specify PyTorch or TensorFlow to get usable scaffolding.
What should I put in [label_distribution] if I have a multi-class problem with 12 classes?
Write the actual class frequencies, or at minimum note whether it is balanced or imbalanced and by how much. For example: '12 classes, roughly balanced except class 7 is 40% of samples.' This is the field that triggers advice about class-weighted loss functions, stratified sampling in cross-validation, and confusion-matrix-based evaluation rather than macro accuracy — all of which change significantly between balanced and skewed multi-class problems.
The prompt asks for [infrastructure] — how specific do I need to be?
As specific as possible, because it determines what model families are even viable. 'Single EC2 t3.medium, no GPU, must run inference as a REST endpoint' rules out large neural nets entirely and steers toward ONNX-exported tree models or small linear models. Contrast with 'GCP Vertex AI with A100 access' where the advice changes completely. If you are still deciding on infrastructure, say so — the output will then include infrastructure cost estimates as part of the trade-off analysis.
Engr Mejba Ahmed

Need this built for real?

Engr Mejba Ahmed

AI Developer · Software Engineer

I'm Mejba — I design and ship production AI systems, automations, and full-stack apps. If you want this turned into a working solution for your team, let's talk.

More in AI & Machine Learning Prompts

Engr Mejba Ahmed

Engr Mejba Ahmed

AI assistant · trained on my work

👋

Hey there!

Quick Actions

WhatsApp Direct line to me

Chat on WhatsApp

+880 1723 741224 · Replies within the hour on working days

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

mejba.13@gmail.com

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support