Skip to main content

AI Spike Detector (TS)

The AI Spike Detector (TS) activity detects sudden spikes in a time series using the IID Spike Detection algorithm and writes detection results to an output staging table.

Purpose

Use the AI Spike Detector (TS) activity to:

  • Find sudden, isolated spikes in a time series (as opposed to sustained anomalies)
  • Flag data entry errors or one-off unusual events in transaction data
  • Distinguish between genuine trend changes and transient outliers

Difference from AI Anomaly Detector (TS)

FeatureAI Anomaly Detector (TS)AI Spike Detector (TS)
AlgorithmSR-CNN (entire series)IID Spike Detection
DetectsSustained anomalies, trend breaksSudden isolated spikes
OutputAnomaly + confidence boundsAlert + score + p-value
Best forContextual pattern breaksPoint outliers

Algorithm

Uses ML.NET DetectIidSpike with 95% confidence and a p-value history length of rowCount / 4. The IID algorithm assumes that in the absence of a spike, values are independently and identically distributed.

Configuration

Input Staging Table

The staging table containing the time series.

Sort Column

The column used to sort the series into time order.

Output Staging Table

The staging table where detection results are written.

Transforms

Pre-processing pipeline. Use Convert Type to ensure the value column is Single (float) type.

Train Model step settings:

SettingDescription
Forecasted ColumnThe name of the column containing the time series values to analyse

Row Filter (optional)

Filter the input data before processing.

Output Schema

ColumnDescription
IndexRow number (0-based)
Alert1 if a spike is detected, 0 otherwise
ScoreThe spike score for this point
P-Valuep-value for the spike test — lower values indicate stronger evidence of a spike
<SortColumn>The sort column value, carried through from input

The first 5 rows with spike flags are logged to the workflow run log.

Usage Notes

  • Confidence is fixed at 95%. P-value history length is automatically set to rowCount / 4.
  • The IID assumption means the algorithm works best on de-trended or de-seasonalised data. If the series has a strong trend, consider using AI Anomaly Detector (TS) instead.
  • Rows where Alert = 1 are the detected spikes.

Best Practices

  • Use a Row Filter if the staging table contains multiple series — each run should analyse one continuous series.
  • For trend-heavy series, apply AI Anomaly Detector (TS) which uses SR-CNN and handles trend context.
  • Review P-Value alongside Alert — a very low p-value gives higher confidence that the spike is genuine.
Needs Review

Confidence (95%) and history length (rowCount / 4) are currently hardcoded. Confirm whether these should be exposed as configurable settings.

JSON Reference

{
"discriminator": "TimeSeriesSpikeDetectionBySrCnnWorkflowActivity",
"activityId": "<uuid>",
"name": "AI Spike Detector (TS)",
"positionX": 0,
"positionY": 0,
"advanceRule": 2,
"inputStagingTable": "StagingTimeSeries",
"outputStagingTable": "StagingSpikes",
"fsoPath": "",
"mode": 0,
"transforms": [],
"filter": null,
"sortColumnName": "Period",
"inputColumnName": "Value",
"outputColumnName": "IsSpike"
}
PropertyTypeDescription
inputStagingTablestringCorresponds to the Input Staging Table field. The staging table containing the time series.
outputStagingTablestringCorresponds to the Output Staging Table field. The staging table where spike detection results are written.
fsoPathstringFile system path. Not used by this activity but present as an inherited field.
modeinteger0 = TrainModel, 1 = RunModel. Not applicable — this activity processes in a single pass.
transformsarrayCorresponds to the Transforms editor. Array of transform objects for pre-processing.
filterobject | nullCorresponds to the Row Filter field. An optional filter applied to input rows before processing. null means no filter.
sortColumnNamestringCorresponds to the Sort Column field. Column used to sort the series into time order.
inputColumnNamestringCorresponds to the Forecasted Column setting. The column containing the time series values to analyse.
outputColumnNamestringColumn name used internally for the output spike vector. Default: "IsSpike".