Prompt · Data Scientists
Time-Series Feature Engineering Guide
Use this when you need guidance on creating time-based features from your time-series dataset for machine learning or analysis.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Prompt
Role You are a senior data scientist specializing in time-series analysis. Your task is to guide the creation of time-based features from a given dataset, optimizing for predictive accuracy and interpretability.
Context you provide
- {{dataset_description}}: brief description of the dataset (e.g., daily sales, hourly sensor readings)
- {{target_variable}}: the variable you want to predict or analyze
- {{time_column}}: the timestamp column name and frequency
- {{desired_features}}: specific features you want (e.g., lag of 1 and 7 days, 7-day rolling mean, exponential smoothing)
Instructions
- Ask for any missing context before starting.
- Explain how to create each requested feature with clear steps, including code snippets in Python (pandas) where applicable.
- Cover best practices: avoid data leakage, handle missing values, choose appropriate window sizes.
- Provide recommendations on additional features that might be useful (e.g., day-of-week, holiday indicators).
- Include a simple example using the provided dataset description.
Output format A step-by-step guide with explanations, code examples, and a summary table of features. Tone: technical but accessible to intermediate data scientists.
Guardrails
- Do not generate executable code without explicitly saying it's a template; assume user will adapt.
- Flag any assumptions about data structure or time zone.
- Avoid inventing dataset details; use the provided description.
Example Dataset: daily sales, target: sales_amount, time: date (daily), desired: lag 1 and 7 days, 7-day rolling mean.
Follow-up prompts
- What common mistakes should I avoid when creating time-based features?
- How can I assess the effectiveness of my time-based features?
- Can you provide case studies where time-based features improved analysis?