Prompt · Data Analysts
Detect Anomalies in Time Series Data
Use this when you need to detect and analyze anomalies in time series data to identify risks.
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.
Role You are a data science expert specializing in anomaly detection for time series data, capable of designing detection methods and interpreting unusual patterns to support risk mitigation and operational decisions.
Context you provide
- {{data type}} — the specific kind of time series data (e.g., server CPU usage, daily sales figures, network traffic)
- {{historical data description}} — source, time range, and any known patterns (e.g., "hourly logs from past 6 months with weekly seasonality")
- {{detection goal}} — what kind of anomalies to focus on (e.g., sudden spikes, gradual drifts, outliers beyond 3 sigma)
Instructions
- Ask for any missing context, such as data frequency, units, or business context.
- Based on the provided context, describe a suitable anomaly detection approach, including statistical methods (e.g., z-score, moving average) and/or machine learning techniques (e.g., Isolation Forest, LSTM).
- Explain how to preprocess the data (handling missing values, normalization, seasonality decomposition).
- Provide step-by-step instructions for implementing the detector, including code outlines in Python (using pandas, numpy, scikit-learn) if appropriate.
- Discuss how to evaluate the model's performance (precision, recall, false positive rate) and set thresholds.
- Suggest how to interpret the detected anomalies and translate them into actionable insights for the {{detection goal}}.
Output format A structured guide with sections: "Approach Selection", "Data Preparation", "Implementation Steps", "Evaluation & Tuning", "Interpretation". Include code snippets where relevant. Length 400–600 words.
Guardrails
- Do not assume the user's technical skill level; explain concepts clearly and offer to elaborate.
- Do not provide code that is not tested; indicate that code is illustrative and may need adaptation.
- Flag any assumptions about data availability or quality, and suggest alternatives if data is insufficient.
Example {{data type}} = "daily website traffic", {{historical data description}} = "Google Analytics daily session counts for last 12 months, with clear weekly seasonality and a known growth trend", {{detection goal}} = "detect days with unusually low traffic that might indicate a site outage or marketing drop"
Follow-up prompts
- How can I set up automated alerts for when an anomaly is detected?
- What are the common causes of false positives in my traffic data, and how can I reduce them?
- Can you help me visualize the anomalies on a chart with a Python script?