Prompts for Machine Learning and AI Development

15 ready-to-use ChatGPT prompts for machine learning and AI development. Fill in the bracketed fields, paste into ChatGPT, and go.

Engineering · 15 prompts

01

Build a Customer Feedback Classifier with Label Quality and Evaluation Discipline

Develop a scikit-learn workflow for customer feedback classification that accounts for noisy labels, class imbalance, and evaluation criteria tied to the downstream use case.

You’ll needdataset contextlabel qualityevaluation goalclass balancebusiness use caseconstraints
Prompt
You are a senior machine learning engineer.

Produce code or a code scaffold for a customer feedback classification workflow.

Context:
- Goal or feature: [goal]
- Stack or language: [stack]
- Inputs and outputs: [inputs and outputs]
- Constraints: [constraints]
- Existing code context: [existing context]
- Integration points or surrounding system: [integration points]
- Acceptance criteria or edge cases: [acceptance criteria]

Instructions:
1. Make the key implementation decisions first, then write code that is correct, readable, and idiomatic for the stated stack.
2. Default to realistic production patterns for common tasks instead of toy scaffolds.
3. Include only the structure that materially helps maintainability, testing, or integration.
4. Explicitly address the failure modes that actually break this in production: noisy or inconsistently applied labels treated as ground truth with no label-quality review step, class imbalance handled by accuracy alone which looks great while missing the minority class entirely, an evaluation metric chosen without connecting it to the actual business cost of a false positive versus false negative, and a train/test split done without checking for near-duplicate feedback entries leaking across the split.
5. Include validation guidance such as test cases, failure modes, or manual verification steps.
6. Avoid filler placeholders, fake environment variables, and pseudo-code unless the user explicitly wants a sketch.

Output format:
- Implementation approach
- Code
- Validation and test cases (including label-quality and leakage checks)
- Integration notes and assumptions

Missing information policy:
Ask up to 2 concise questions only if the language, framework, integration point, or required behavior is unclear. Otherwise proceed with assumptions.

Quality bar:
- Prefer working simplicity with production realism.
- Avoid placeholder-heavy pseudo-code unless necessary.
- Name the specific failure modes above rather than generic edge-case language.
- Cover meaningful edge cases instead of only the happy path.
02

Build a Text Preprocessing Pipeline for NLP Training with Reproducible Cleaning Rules

Generate a Python preprocessing pipeline for NLP training that handles normalization, token-level cleanup, and reproducible transformation choices for the target model family.

You’ll needtext sourcelanguagemodel typepreprocessing needsnoise patternsconstraints
Prompt
You are a senior machine learning engineer.

Produce code or a code scaffold for a text preprocessing pipeline for NLP training.

Context:
- Goal or feature: [goal]
- Stack or language: [stack]
- Inputs and outputs: [inputs and outputs]
- Constraints: [constraints]
- Existing code context: [existing context]
- Integration points or surrounding system: [integration points]
- Acceptance criteria or edge cases: [acceptance criteria]

Instructions:
1. Make the key implementation decisions first, then write code that is correct, readable, and idiomatic for the stated stack.
2. Default to realistic production patterns for common tasks instead of toy scaffolds.
3. Include only the structure that materially helps maintainability, testing, or integration.
4. Explicitly address the failure modes that actually break this in production: cleaning rules like lowercasing or stemming applied uniformly regardless of what the downstream model actually needs, silently destroying signal a transformer-based model would have used, no versioning of the preprocessing rules themselves so a later model can't be reproduced against the exact pipeline that trained an earlier one, tokenization that breaks on non-ASCII or mixed-language text with no defined fallback, and cleaning steps applied inconsistently between train and inference paths, causing train-serve skew.
5. Include validation guidance such as test cases, failure modes, or manual verification steps.
6. Avoid filler placeholders, fake environment variables, and pseudo-code unless the user explicitly wants a sketch.

Output format:
- Implementation approach
- Code
- Validation and test cases (including train/inference consistency checks)
- Integration notes and assumptions

Missing information policy:
Ask up to 2 concise questions only if the language, framework, integration point, or required behavior is unclear. Otherwise proceed with assumptions.

Quality bar:
- Prefer working simplicity with production realism.
- Avoid placeholder-heavy pseudo-code unless necessary.
- Name the specific failure modes above rather than generic edge-case language.
- Cover meaningful edge cases instead of only the happy path.
03

Build an Object Detection Model with TensorFlow and a Pretrained Backbone

Create a deep learning setup for object detection using TensorFlow and a pretrained model like YOLO.

You’ll needdataset typeclass counttraining constraintsdeployment goal
Prompt
You are a senior machine learning engineer.

Produce code or a code scaffold for an object detection model using TensorFlow and a pretrained backbone.

Context:
- Goal or feature: [goal]
- Stack or language: [stack]
- Inputs and outputs: [inputs and outputs]
- Constraints: [constraints]
- Existing code context: [existing context]
- Integration points or surrounding system: [integration points]
- Acceptance criteria or edge cases: [acceptance criteria]

Instructions:
1. Make the key implementation decisions first, then write code that is correct, readable, and idiomatic for the stated stack.
2. Default to realistic production patterns for common tasks instead of toy scaffolds.
3. Include only the structure that materially helps maintainability, testing, or integration.
4. Explicitly address the failure modes that actually break this in production: a pretrained backbone fine-tuned with a learning rate too high for transfer learning, destroying the pretrained features instead of adapting them, class imbalance across object categories in the training set left unaddressed so rare classes never get detected, no validation on images representative of the actual deployment conditions like lighting or camera angle, and evaluation reported only as mAP with no inspection of the specific failure cases behind it.
5. Include validation guidance such as test cases, failure modes, or manual verification steps.
6. Avoid filler placeholders, fake environment variables, and pseudo-code unless the user explicitly wants a sketch.

Output format:
- Implementation approach
- Code
- Validation and test cases (including deployment-condition validation)
- Integration notes and assumptions

Missing information policy:
Ask up to 2 concise questions only if the language, framework, integration point, or required behavior is unclear. Otherwise proceed with assumptions.

Quality bar:
- Prefer working simplicity with production realism.
- Avoid placeholder-heavy pseudo-code unless necessary.
- Name the specific failure modes above rather than generic edge-case language.
- Cover meaningful edge cases instead of only the happy path.
04

Plan a Collaborative Filtering Recommendation Project

Design a project for implementing a recommendation system with collaborative filtering.

You’ll needdataset typeuser-item signalsevaluation goalconstraints
Prompt
You are a senior machine learning and ai development architect creating a plan for a real engineering initiative.

Create a plan for the task below.

Context:
- Goal: [goal]
- Stack or environment: [stack]
- Current system or baseline: [current system]
- Constraints such as security, latency, budget, or staffing: [constraints]
- Scale, complexity, or production expectations: [scale]
- Risks, current issues, or dependencies: [risks]

Instructions:
1. Recommend a practical technical approach and explain why it fits the context.
2. Break the work into sensible phases, components, or rollout stages.
3. Explicitly address the failure modes that actually derail this kind of initiative: collaborative filtering chosen without checking whether there's enough interaction data to make it viable, leaving new users and items with no meaningful recommendations, evaluation done with an offline metric that doesn't correlate with the actual business outcome like engagement or revenue, no cold-start strategy defined for users or items with sparse history, and no plan for how the system will be monitored or retrained as user behavior shifts over time.
4. Include validation, rollback, migration, or monitoring considerations where relevant.
5. Keep the plan realistic for the stated context and avoid architecture theater.

Output format:
- Plan overview
- Recommended approach and tradeoffs
- Implementation phases or rollout path
- Risks, dependencies, and validation checks
- Main assumptions or open questions

Missing information policy:
Ask up to 2 concise questions only if the goal or environment is unclear. Otherwise proceed with assumptions.

Quality bar:
- Make the plan executable.
- Avoid overengineering.
- Name the specific failure modes above rather than generic risk language.
- Show how the plan would survive real deployment pressure.
05

Automate SVM Hyperparameter Tuning with Search Boundaries and Metric Tradeoffs

Write a Python workflow for SVM hyperparameter tuning that chooses sane search space boundaries, cross-validation strategy, and evaluation metrics instead of brute-force defaults.

You’ll needdataset contextmetricsearch scopefeature scaling approachruntime constraintsconstraints
Prompt
You are a senior machine learning engineer.

Produce code or a code scaffold for an SVM hyperparameter tuning workflow with GridSearchCV.

Context:
- Goal or feature: [goal]
- Stack or language: [stack]
- Inputs and outputs: [inputs and outputs]
- Constraints: [constraints]
- Existing code context: [existing context]
- Integration points or surrounding system: [integration points]
- Acceptance criteria or edge cases: [acceptance criteria]

Instructions:
1. Make the key implementation decisions first, then write code that is correct, readable, and idiomatic for the stated stack.
2. Default to realistic production patterns for common tasks instead of toy scaffolds.
3. Include only the structure that materially helps maintainability, testing, or integration.
4. Explicitly address the failure modes that actually break this in production: search space bounds chosen arbitrarily instead of scaled to the actual data characteristics, cross-validation folds not stratified for an imbalanced target so some folds have almost no minority-class examples, no separate held-out test set kept apart from the grid search, so reported performance is optimistic, and feature scaling applied after rather than within the cross-validation loop, leaking information across folds.
5. Include validation guidance such as test cases, failure modes, or manual verification steps.
6. Avoid filler placeholders, fake environment variables, and pseudo-code unless the user explicitly wants a sketch.

Output format:
- Implementation approach
- Code
- Validation and test cases (including held-out test set)
- Integration notes and assumptions

Missing information policy:
Ask up to 2 concise questions only if the language, framework, integration point, or required behavior is unclear. Otherwise proceed with assumptions.

Quality bar:
- Prefer working simplicity with production realism.
- Avoid placeholder-heavy pseudo-code unless necessary.
- Name the specific failure modes above rather than generic edge-case language.
- Cover meaningful edge cases instead of only the happy path.
06

Handle Imbalanced Classification Data with SMOTE and Leakage-Safe Evaluation

Write a script for handling class imbalance with SMOTE while preserving leakage-safe train-test boundaries and comparing against simpler alternatives like class weighting.

You’ll needdataset contextimbalance levelmodel typeevaluation goalbusiness cost of errors
Prompt
You are a senior machine learning engineer.

Produce code or a code scaffold for a SMOTE-based imbalanced classification workflow.

Context:
- Goal or feature: [goal]
- Stack or language: [stack]
- Inputs and outputs: [inputs and outputs]
- Constraints: [constraints]
- Existing code context: [existing context]
- Integration points or surrounding system: [integration points]
- Acceptance criteria or edge cases: [acceptance criteria]

Instructions:
1. Make the key implementation decisions first, then write code that is correct, readable, and idiomatic for the stated stack.
2. Default to realistic production patterns for common tasks instead of toy scaffolds.
3. Include only the structure that materially helps maintainability, testing, or integration.
4. Explicitly address the failure modes that actually break this in production: SMOTE applied before the train-test split instead of only within the training fold, leaking synthetic information into the test set and inflating reported performance, synthetic samples generated without checking that the feature space is continuous enough for interpolation to make sense, no comparison against simpler alternatives like class weighting to justify the added complexity, and evaluation reported only on accuracy instead of metrics that reflect the actual imbalance.
5. Include validation guidance such as test cases, failure modes, or manual verification steps.
6. Avoid filler placeholders, fake environment variables, and pseudo-code unless the user explicitly wants a sketch.

Output format:
- Implementation approach
- Code
- Validation and test cases (including leakage-safe SMOTE application)
- Integration notes and assumptions

Missing information policy:
Ask up to 2 concise questions only if the language, framework, integration point, or required behavior is unclear. Otherwise proceed with assumptions.

Quality bar:
- Prefer working simplicity with production realism.
- Avoid placeholder-heavy pseudo-code unless necessary.
- Name the specific failure modes above rather than generic edge-case language.
- Cover meaningful edge cases instead of only the happy path.
07

Design a K-Means Segmentation Workflow with Cluster Validation and Business Use Boundaries

Design a k-means segmentation workflow with feature preparation, cluster-count validation, interpretation limits, and the business decisions the segments should or should not drive.

You’ll needdataset contextfeature setsegmentation goalcluster validation needsstakeholder use caseconstraints
Prompt
You are a senior machine learning engineer advising on a real implementation rather than teaching a generic tutorial.

Help with the engineering task below.

Context:
- Goal or task: [goal]
- Stack or environment: [stack]
- Current system or surrounding architecture: [current system]
- Constraints such as security, performance, cost, or compatibility: [constraints]
- Scale, criticality, or production expectations: [criticality]
- Specific questions, failure points, or uncertainty: [pain points]
- Success criteria or desired outcome: [success criteria]

Instructions:
1. Explain the approach in the order the team should actually execute it.
2. Tailor the guidance to the stated stack, constraints, and production expectations.
3. Turn the task into concrete technical decisions, not generic setup advice.
4. Explicitly address the failure modes that actually break this in production: cluster count chosen arbitrarily instead of validated with a method like silhouette score or elbow analysis, features left unscaled so a high-magnitude field dominates the distance calculation, clusters treated as if they have inherent business meaning without validating that against actual stakeholder use cases, and no re-validation plan for when the underlying customer population shifts and the clusters no longer reflect reality.
5. Include validation, rollback, review, or monitoring checkpoints where they materially reduce implementation risk.
6. If important context is missing, make explicit assumptions and continue.

Output format:
- Feature preparation and scaling decisions
- Cluster-count validation method
- Business-use validation of resulting clusters
- Re-validation plan as the population shifts
- Main assumptions and risks

Missing information policy:
Ask up to 2 concise questions only if the stack, required outcome, or operational context is unclear. Otherwise proceed with assumptions.

Quality bar:
- Be concrete and operational.
- Prefer implementation judgment over theory.
- Name the specific failure modes above rather than generic best-practices language.
- Make the advice usable by a team shipping real work.
08

Build an LSTM Sentiment Analysis Workflow with Sequence and Evaluation Decisions

Develop an LSTM-based sentiment analysis workflow in Keras that covers tokenization, sequence handling, model regularization, and realistic evaluation beyond headline accuracy.

You’ll needdataset typelabel qualitysequence lengthclass balancedeployment goalconstraints
Prompt
You are a senior machine learning engineer.

Produce code or a code scaffold for an LSTM sentiment analysis workflow in Keras.

Context:
- Goal or feature: [goal]
- Stack or language: [stack]
- Inputs and outputs: [inputs and outputs]
- Constraints: [constraints]
- Existing code context: [existing context]
- Integration points or surrounding system: [integration points]
- Acceptance criteria or edge cases: [acceptance criteria]

Instructions:
1. Make the key implementation decisions first, then write code that is correct, readable, and idiomatic for the stated stack.
2. Default to realistic production patterns for common tasks instead of toy scaffolds.
3. Include only the structure that materially helps maintainability, testing, or integration.
4. Explicitly address the failure modes that actually break this in production: sequence length truncation chosen without checking what fraction of real inputs actually get cut off and lose meaning, class imbalance in sentiment labels left unaddressed while headline accuracy looks fine, no regularization or early stopping so the model overfits to the training vocabulary and generalizes poorly, and evaluation done only on accuracy with no inspection of which specific examples the model gets wrong.
5. Include validation guidance such as test cases, failure modes, or manual verification steps.
6. Avoid filler placeholders, fake environment variables, and pseudo-code unless the user explicitly wants a sketch.

Output format:
- Implementation approach
- Code
- Validation and test cases (including truncation-impact and error inspection)
- Integration notes and assumptions

Missing information policy:
Ask up to 2 concise questions only if the language, framework, integration point, or required behavior is unclear. Otherwise proceed with assumptions.

Quality bar:
- Prefer working simplicity with production realism.
- Avoid placeholder-heavy pseudo-code unless necessary.
- Name the specific failure modes above rather than generic edge-case language.
- Cover meaningful edge cases instead of only the happy path.
09

Build an ARIMA Sales Forecasting Workflow with Diagnostics and Forecast Limits

Create an ARIMA sales forecasting workflow in Python that covers stationarity, seasonality, residual checks, and the boundaries of what the forecast should be trusted for.

You’ll needtime series contextforecast horizonseasonalitydecision use casedata granularityconstraints
Prompt
You are a senior machine learning engineer.

Produce code or a code scaffold for an ARIMA sales forecasting workflow.

Context:
- Goal or feature: [goal]
- Stack or language: [stack]
- Inputs and outputs: [inputs and outputs]
- Constraints: [constraints]
- Existing code context: [existing context]
- Integration points or surrounding system: [integration points]
- Acceptance criteria or edge cases: [acceptance criteria]

Instructions:
1. Make the key implementation decisions first, then write code that is correct, readable, and idiomatic for the stated stack.
2. Default to realistic production patterns for common tasks instead of toy scaffolds.
3. Include only the structure that materially helps maintainability, testing, or integration.
4. Explicitly address the failure modes that actually break this in production: stationarity never actually tested before fitting, producing a model that looks reasonable but violates its own assumptions, seasonality present in the data but not explicitly modeled, leaving systematic error in every forecast, residual diagnostics skipped so autocorrelation in the errors goes unnoticed, and the forecast's uncertainty interval not reported, letting a point estimate be treated as a guarantee.
5. Include validation guidance such as test cases, failure modes, or manual verification steps.
6. Avoid filler placeholders, fake environment variables, and pseudo-code unless the user explicitly wants a sketch.

Output format:
- Implementation approach
- Code
- Validation and test cases (including stationarity and residual diagnostics)
- Integration notes and assumptions

Missing information policy:
Ask up to 2 concise questions only if the language, framework, integration point, or required behavior is unclear. Otherwise proceed with assumptions.

Quality bar:
- Prefer working simplicity with production realism.
- Avoid placeholder-heavy pseudo-code unless necessary.
- Name the specific failure modes above rather than generic edge-case language.
- Cover meaningful edge cases instead of only the happy path.
10

Evaluate a Classification Model with Precision, Recall, F1, and Threshold Context

Write a Python evaluation workflow for classification models that computes precision, recall, and F1 while making threshold and class-balance tradeoffs visible.

You’ll needpredictions formatclassification setuplabel mappingclass balancedecision threshold needsconstraints
Prompt
You are a senior machine learning engineer.

Produce code or a code scaffold for a classification model evaluation workflow with precision, recall, and F1.

Context:
- Goal or feature: [goal]
- Stack or language: [stack]
- Inputs and outputs: [inputs and outputs]
- Constraints: [constraints]
- Existing code context: [existing context]
- Integration points or surrounding system: [integration points]
- Acceptance criteria or edge cases: [acceptance criteria]

Instructions:
1. Make the key implementation decisions first, then write code that is correct, readable, and idiomatic for the stated stack.
2. Default to realistic production patterns for common tasks instead of toy scaffolds.
3. Include only the structure that materially helps maintainability, testing, or integration.
4. Explicitly address the failure modes that actually break this in production: precision, recall, and F1 computed at a default 0.5 threshold with no check of whether that threshold actually matches the business decision being made, macro versus weighted averaging chosen without understanding which one hides minority-class performance, a single aggregate score reported with no per-class breakdown that would reveal a model failing on the class that matters most, and metrics computed on a test set that isn't actually representative of production class balance.
5. Include validation guidance such as test cases, failure modes, or manual verification steps.
6. Avoid filler placeholders, fake environment variables, and pseudo-code unless the user explicitly wants a sketch.

Output format:
- Implementation approach
- Code
- Validation and test cases (including per-class breakdown)
- Integration notes and assumptions

Missing information policy:
Ask up to 2 concise questions only if the language, framework, integration point, or required behavior is unclear. Otherwise proceed with assumptions.

Quality bar:
- Prefer working simplicity with production realism.
- Avoid placeholder-heavy pseudo-code unless necessary.
- Name the specific failure modes above rather than generic edge-case language.
- Cover meaningful edge cases instead of only the happy path.
11

Set Up an Automated Machine Learning Pipeline

Set up an automated pipeline for preprocessing, training, evaluation, and repeatable iteration.

You’ll needdataset flowmodel typepipeline goalsconstraints
Prompt
You are a senior machine learning and ai development architect creating a plan for a real engineering initiative.

Create a plan for the task below.

Context:
- Goal: [goal]
- Stack or environment: [stack]
- Current system or baseline: [current system]
- Constraints such as security, latency, budget, or staffing: [constraints]
- Scale, complexity, or production expectations: [scale]
- Risks, current issues, or dependencies: [risks]

Instructions:
1. Recommend a practical technical approach and explain why it fits the context.
2. Break the work into sensible phases, components, or rollout stages.
3. Explicitly address the failure modes that actually derail this kind of initiative: pipeline stages that aren't actually reproducible because they depend on manual steps or an untracked environment, no versioning of data, code, and model together, making it impossible to reproduce a specific past result, retraining triggered on a fixed schedule with no check for whether the model actually needs it, and no rollback plan if an automatically retrained model performs worse than the one it replaces.
4. Include validation, rollback, migration, or monitoring considerations where relevant.
5. Keep the plan realistic for the stated context and avoid architecture theater.

Output format:
- Plan overview
- Recommended approach and tradeoffs
- Implementation phases or rollout path
- Risks, dependencies, and validation checks
- Main assumptions or open questions

Missing information policy:
Ask up to 2 concise questions only if the goal or environment is unclear. Otherwise proceed with assumptions.

Quality bar:
- Make the plan executable.
- Avoid overengineering.
- Name the specific failure modes above rather than generic risk language.
- Show how the plan would survive real deployment pressure.
12

Design a PyTorch Image Classification Workflow with Dataset, Error, and Deployment Review

Design a PyTorch image classification workflow with dataset assumptions, model selection, training discipline, error analysis, and deployment-oriented evaluation.

You’ll needdataset typelabel qualitymodel complexityerror tolerancedeployment goalconstraints
Prompt
You are a senior machine learning engineer advising on a real implementation rather than teaching a generic tutorial.

Help with the engineering task below.

Context:
- Goal or task: [goal]
- Stack or environment: [stack]
- Current system or surrounding architecture: [current system]
- Constraints such as security, performance, cost, or compatibility: [constraints]
- Scale, criticality, or production expectations: [criticality]
- Specific questions, failure points, or uncertainty: [pain points]
- Success criteria or desired outcome: [success criteria]

Instructions:
1. Explain the approach in the order the team should actually execute it.
2. Tailor the guidance to the stated stack, constraints, and production expectations.
3. Turn the task into concrete technical decisions, not generic setup advice.
4. Explicitly address the failure modes that actually break this in production: training data assumptions like class balance and image quality never explicitly stated or checked before training starts, model complexity chosen without regard for the dataset size available, leading to overfitting on a small dataset, error analysis skipped in favor of reporting only aggregate accuracy, and deployment-oriented evaluation such as inference latency or memory footprint never considered until after the model is already built.
5. Include validation, rollback, review, or monitoring checkpoints where they materially reduce implementation risk.
6. If important context is missing, make explicit assumptions and continue.

Output format:
- Dataset assumptions and checks before training
- Model complexity matched to dataset size
- Error analysis beyond aggregate accuracy
- Deployment-oriented evaluation (latency, memory)
- Main assumptions and risks

Missing information policy:
Ask up to 2 concise questions only if the stack, required outcome, or operational context is unclear. Otherwise proceed with assumptions.

Quality bar:
- Be concrete and operational.
- Prefer implementation judgment over theory.
- Name the specific failure modes above rather than generic best-practices language.
- Make the advice usable by a team shipping real work.
13

Plan a Chatbot Project with Rasa NLU

Plan a chatbot implementation with Rasa NLU, dialogue handling, and deployment constraints in mind.

You’ll needuse caseintent scopedeployment needsconstraints
Prompt
You are a senior machine learning and ai development architect creating a plan for a real engineering initiative.

Create a plan for the task below.

Context:
- Goal: [goal]
- Stack or environment: [stack]
- Current system or baseline: [current system]
- Constraints such as security, latency, budget, or staffing: [constraints]
- Scale, complexity, or production expectations: [scale]
- Risks, current issues, or dependencies: [risks]

Instructions:
1. Recommend a practical technical approach and explain why it fits the context.
2. Break the work into sensible phases, components, or rollout stages.
3. Explicitly address the failure modes that actually derail this kind of initiative: intent scope defined too broadly upfront, leading to overlapping intents that are hard for the NLU model to distinguish, no fallback or escalation path defined for when the bot doesn't understand a message, testing done only on scripted happy-path conversations instead of real user phrasing variance, and no plan for how the bot's understanding will be improved over time from actual conversation logs.
4. Include validation, rollback, migration, or monitoring considerations where relevant.
5. Keep the plan realistic for the stated context and avoid architecture theater.

Output format:
- Plan overview
- Recommended approach and tradeoffs
- Implementation phases or rollout path
- Risks, dependencies, and validation checks
- Main assumptions or open questions

Missing information policy:
Ask up to 2 concise questions only if the goal or environment is unclear. Otherwise proceed with assumptions.

Quality bar:
- Make the plan executable.
- Avoid overengineering.
- Name the specific failure modes above rather than generic risk language.
- Show how the plan would survive real deployment pressure.
14

Build a Content-Based Recommendation Engine with Ranking Logic and Metadata Quality Checks

Develop a content-based recommendation engine that turns item metadata and user preference signals into a usable ranking flow with similarity, filtering, and fallback logic.

You’ll needitem metadatauser preference signalsranking goalcold-start behaviorconstraints
Prompt
You are a senior machine learning engineer.

Produce code or a code scaffold for a content-based recommendation engine.

Context:
- Goal or feature: [goal]
- Stack or language: [stack]
- Inputs and outputs: [inputs and outputs]
- Constraints: [constraints]
- Existing code context: [existing context]
- Integration points or surrounding system: [integration points]
- Acceptance criteria or edge cases: [acceptance criteria]

Instructions:
1. Make the key implementation decisions first, then write code that is correct, readable, and idiomatic for the stated stack.
2. Default to realistic production patterns for common tasks instead of toy scaffolds.
3. Include only the structure that materially helps maintainability, testing, or integration.
4. Explicitly address the failure modes that actually break this in production: item similarity computed from metadata fields with no normalization, letting one high-cardinality field dominate the similarity score, no cold-start handling for new items or users with little to no interaction history, ranking logic never evaluated against an actual relevance metric, only against similarity scores themselves, and no diversity or filtering safeguard, so recommendations collapse into near-duplicates of whatever the user already engaged with.
5. Include validation guidance such as test cases, failure modes, or manual verification steps.
6. Avoid filler placeholders, fake environment variables, and pseudo-code unless the user explicitly wants a sketch.

Output format:
- Implementation approach
- Code
- Validation and test cases (including cold-start and diversity checks)
- Integration notes and assumptions

Missing information policy:
Ask up to 2 concise questions only if the language, framework, integration point, or required behavior is unclear. Otherwise proceed with assumptions.

Quality bar:
- Prefer working simplicity with production realism.
- Avoid placeholder-heavy pseudo-code unless necessary.
- Name the specific failure modes above rather than generic edge-case language.
- Cover meaningful edge cases instead of only the happy path.
15

Visualize Random Forest Feature Importance with SHAP

Write a Python function that visualizes random forest feature importance using SHAP values.

You’ll needmodel objectfeature setvisualization goalconstraints
Prompt
You are a senior machine learning engineer.

Produce code or a code scaffold for a random forest feature importance visualization using SHAP.

Context:
- Goal or feature: [goal]
- Stack or language: [stack]
- Inputs and outputs: [inputs and outputs]
- Constraints: [constraints]
- Existing code context: [existing context]
- Integration points or surrounding system: [integration points]
- Acceptance criteria or edge cases: [acceptance criteria]

Instructions:
1. Make the key implementation decisions first, then write code that is correct, readable, and idiomatic for the stated stack.
2. Default to realistic production patterns for common tasks instead of toy scaffolds.
3. Include only the structure that materially helps maintainability, testing, or integration.
4. Explicitly address the failure modes that actually break this in production: SHAP values computed on a random forest without accounting for correlated features, which can distort attributed importance, a visualization built for global feature importance only, hiding cases where a feature matters a lot for a specific subgroup but not on average, computation performed on the full dataset instead of a representative sample, making it prohibitively slow at real dataset sizes, and no check that the underlying model is actually well-calibrated before treating its SHAP explanations as trustworthy.
5. Include validation guidance such as test cases, failure modes, or manual verification steps.
6. Avoid filler placeholders, fake environment variables, and pseudo-code unless the user explicitly wants a sketch.

Output format:
- Implementation approach
- Code
- Validation and test cases (including correlated-feature and subgroup checks)
- Integration notes and assumptions

Missing information policy:
Ask up to 2 concise questions only if the language, framework, integration point, or required behavior is unclear. Otherwise proceed with assumptions.

Quality bar:
- Prefer working simplicity with production realism.
- Avoid placeholder-heavy pseudo-code unless necessary.
- Name the specific failure modes above rather than generic edge-case language.
- Cover meaningful edge cases instead of only the happy path.