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)
| Feature | AI Anomaly Detector (TS) | AI Spike Detector (TS) |
|---|---|---|
| Algorithm | SR-CNN (entire series) | IID Spike Detection |
| Detects | Sustained anomalies, trend breaks | Sudden isolated spikes |
| Output | Anomaly + confidence bounds | Alert + score + p-value |
| Best for | Contextual pattern breaks | Point 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:
| Setting | Description |
|---|---|
| Forecasted Column | The name of the column containing the time series values to analyse |
Row Filter (optional)
Filter the input data before processing.
Output Schema
| Column | Description |
|---|---|
Index | Row number (0-based) |
Alert | 1 if a spike is detected, 0 otherwise |
Score | The spike score for this point |
P-Value | p-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 = 1are 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-ValuealongsideAlert— a very low p-value gives higher confidence that the spike is genuine.
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"
}
| Property | Type | Description |
|---|---|---|
inputStagingTable | string | Corresponds to the Input Staging Table field. The staging table containing the time series. |
outputStagingTable | string | Corresponds to the Output Staging Table field. The staging table where spike detection results are written. |
fsoPath | string | File system path. Not used by this activity but present as an inherited field. |
mode | integer | 0 = TrainModel, 1 = RunModel. Not applicable — this activity processes in a single pass. |
transforms | array | Corresponds to the Transforms editor. Array of transform objects for pre-processing. |
filter | object | null | Corresponds to the Row Filter field. An optional filter applied to input rows before processing. null means no filter. |
sortColumnName | string | Corresponds to the Sort Column field. Column used to sort the series into time order. |
inputColumnName | string | Corresponds to the Forecasted Column setting. The column containing the time series values to analyse. |
outputColumnName | string | Column name used internally for the output spike vector. Default: "IsSpike". |