Add Confidence Levels
Configure confidence levels to control anomaly detection sensitivity.
Overview
Configure the confidence levels for historical anomaly detection. By default, any values that lie outside the 99% confidence interval are labeled as anomalies.
Adjusting the confidence level using the level parameter allows you to modify how many anomalies the system detects.
• Increasing the level(closer to 100) decreases the number of anomalies.
• Decreasing the level(closer to 0) increases the number of anomalies.
You can set any numeric value between 0 and 100 (including decimals) for the level parameter.
Key Concepts
Confidence Interval
The range of values within which a certain percentage of anomalies are expected to fall.
A 99% interval (the default) means there is only a 1% chance of data lying outside this range.
API Key
An authentication token (often stored in your environment) that grants secure access to Nixtla’s services.
Azure AI Models
If using Azure AI endpoints, you can specify different models (e.g., azureai
) for anomaly detection.
Step-by-Step Instructions
Install and Import
Make sure Nixtla is installed along with any required libraries such as pandas
.
Initialize the Client
Provide your Nixtla API key here if not already set in your environment variables.
(Optional) Use an Azure AI Endpoint
Read Your Data
Load the time series data you want to analyze for anomalies.
Detect Anomalies
Adjust the level
to your desired confidence interval (0–100).
Visualize Results
Generate a plot showing which time points were flagged as anomalies.
Below is an example of the console logs you might see during anomaly detection:
Example Output
Anomalies detected with a 70% confidence interval
Available Models
Learn More
To explore more in-depth tutorials and examples, see the Anomaly Detection Tutorial in the Nixtla documentation.