Pattern Detection

DenseAD

Intelligent pattern-based anomaly detection with severity classification. Learns normal behavior patterns and identifies subtle deviations.

What is DenseAD?

DenseAD is a pattern-based anomaly detector that uses density estimation to identify unusual data points. It automatically learns what "normal" looks like from your historical data and flags points that don't fit the pattern.

Unlike threshold-based detection, DenseAD captures complex patternsincluding rolling statistics, z-scores, lag features, and seasonal components. This makes it excellent at catching anomalies that simple thresholds would miss.

Each anomaly comes with a severity classification (low, medium, high, critical) based on how unusual the pattern is. This helps prioritize investigation efforts.

How It Works

1
Feature Engineering
Extract rolling stats, z-scores, lags, seasonal features
2
Density Estimation
Identify points in low-density regions (unusual patterns)
3
Post-Processing
Filter noise with valley threshold and contiguous requirements
4
Severity Classification
Assign low/medium/high/critical based on magnitude

Severity Classification

Low

Score: 30-50

Minor deviation from normal patterns. Worth monitoring but typically not actionable.

Medium

Score: 50-70

Notable deviation that warrants investigation. May indicate emerging issues.

High

Score: 70-85

Significant anomaly requiring attention. Likely indicates a real problem.

Critical

Score: 85+

Extreme deviation requiring immediate action. Major incident likely.

Features

Automatic Feature Engineering

Extracts rolling statistics, z-scores, lag features, and seasonal patterns automatically. No manual feature selection required.

Contamination Tuning

Set the expected proportion of anomalies in your data. Lower values = fewer, more certain anomalies. Higher values = more sensitive detection.

Contiguous Filtering

Require N consecutive anomalies to confirm an incident. Reduces noise from isolated spikes that don't indicate real problems.

Valley Threshold

Filter out low-volume metrics from detection. Prevents false positives from naturally noisy low-traffic periods.

Magnitude Metrics

Get detailed magnitude information: raw score, normalized score, z-score deviation, percentage deviation, and expected value.

Ultra-Low Latency

Detection runs locally without calling external APIs (unlike PulseAD). Sub-100ms response times for real-time monitoring.

Code Examples

detect.py
from gradientcast import GradientCastDenseAD

ad = GradientCastDenseAD(api_key="your-api-key")

# Need 25+ data points for feature engineering
data = [
    {"timestamp": "01/01/2025, 12:00 AM", "value": 1500000},
    {"timestamp": "01/01/2025, 01:00 AM", "value": 1520000},
    # ... more historical points ...
    {"timestamp": "01/02/2025, 01:00 AM", "value": 100000},  # Anomaly!
]

result = ad.detect(data)

if result.has_anomaly:
    print(f"Alert: {result.alert_severity}")
    for point in result.anomalies:
        print(f"  {point.timestamp}: {point.value}")
        print(f"  Severity: {point.magnitude.severity}")

Best For

  • Complex patterns that thresholds miss
  • Metrics with natural variance
  • Severity-based alerting workflows
  • Multi-feature pattern analysis
  • IoT and sensor monitoring
  • Behavioral anomaly detection

DenseAD vs PulseAD

FeatureDenseADPulseAD
Detection MethodPattern-based densityForecast-based deviation
Best ForComplex pattern anomaliesSudden drops/spikes
ThresholdsLearned (contamination rate)Explicit (you configure)
Severity LevelsLow/Medium/High/CriticalBinary (anomaly/not)
Data Requirements25+ points10+ points
LatencyVery low (no FM call)Lower (uses FM)

Ready for intelligent anomaly detection?

Get your API key and start detecting patterns in minutes.