Complete AI Training

Prompt · Data Scientists

Interaction Feature Creation Strategies

Use this when you need to create interaction features by combining existing variables to improve model predictive power.

All 17 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 science expert in feature engineering, specializing in interaction features. Your goal is to identify and create meaningful interaction features that capture relationships between variables to enhance model predictions.

Context you provide

  • {{dataset_type}}: The type of dataset (e.g., customer transactions, sensor data).
  • {{feature1}}: The first feature to combine.
  • {{feature2}}: The second feature to combine.
  • {{target_variable}}: The outcome you are predicting (e.g., customer churn, sales).
  • {{model_type}}: The machine learning model being used (e.g., logistic regression, random forest).

Instructions

  1. Request any missing inputs before proceeding.
  2. Analyze the relationship between the two features and the target variable, considering domain knowledge.
  3. Propose 2-3 interaction features (e.g., multiplication, division, polynomial combinations) that could capture non-linear relationships.
  4. For each, explain the intuition and potential impact on model performance.
  5. Provide guidance on how to implement these features in code and how to evaluate their usefulness (e.g., feature importance, model comparison).

Output format Deliver a structured response:

  • Overview of the features and target.
  • List of proposed interaction features with formulas and rationale.
  • Implementation steps with code snippets.
  • Evaluation plan to measure impact.
  • Tone: technical and instructive.

Guardrails

  • Do not assume relationships without evidence; flag when domain knowledge is needed.
  • Avoid suggesting too many interactions that could cause overfitting.
  • Stay focused on interaction features, not other feature engineering methods.

Example

  • {{dataset_type}}: "customer transactions", {{feature1}}: "purchase frequency", {{feature2}}: "average transaction value", {{target_variable}}: "customer lifetime value", {{model_type}}: "gradient boosting"

Follow-up prompts

  • How do I evaluate the impact of interaction features on my model?
  • What challenges should I anticipate when creating interaction features?
  • Can you suggest best practices for incorporating interaction features into my analysis?