Skip to content

API Reference parrot_tools.seasonaldetection

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.seasonaldetection

View source

SeasonalDetectionTool for detecting stationarity in time series data using ADF and KPSS tests.

FEAT-423: matplotlib/seaborn replaced with altair. Visualizations are saved as Vega-Lite JSON spec files (.json) instead of matplotlib-rendered PNGs. ACF/PACF plots (previously statsmodels.graphics.tsaplots.plot_acf/ plot_pacf, which are matplotlib-only) are rebuilt from the underlying statsmodels.tsa.stattools.acf/pacf values as altair bar charts with a 95% confidence band.

Alias AbstractTool

Re-exported from parrot_tools.abstract.AbstractTool.

Class SeasonalDetectionArgs

Arguments schema for SeasonalDetectionTool.

Fields:

Field Type Default Description
dataframe Any Pandas DataFrame containing the time series data
title str Title for the analysis report
time_column str Name of the column containing time series data (dates/timestamps)
value_column str Name of the column containing the values to analyze for stationarity
confidence_level float 0.05 Significance level for statistical tests (default: 0.05 for 95% confidence)
maxlag Optional[int] None Maximum lag for ADF test. If None, automatically determined
regression str 'c' Regression type for ADF test: 'c' (constant), 'ct' (constant+trend), 'ctt' (constant+trend+trend^2), 'n' (no constant)
nlags Optional[int] None Number of lags for KPSS test. If None, automatically determined
generate_plots bool True Whether to generate visualization plots
perform_decomposition bool True Whether to perform seasonal decomposition analysis
remove_trend bool False Whether to test stationarity after detrending the data
filename Optional[str] None Optional filename prefix for saving plots (without extension)

Method SeasonalDetectionArgs.validate_confidence_level

validate_confidence_level(v)

Parameter Type Default Description
v

Method SeasonalDetectionArgs.validate_regression

validate_regression(v)

Parameter Type Default Description
v

Class SeasonalDetectionTool

Tool for detecting stationarity and seasonality in time series data.

This tool performs comprehensive stationarity analysis using:

  • Augmented Dickey-Fuller (ADF) test
  • Kwiatkowski-Phillips-Schmidt-Shin (KPSS) test
  • Visual inspection through plots
  • Optional seasonal decomposition
  • Trend removal and re-testing

The tool helps determine if a time series is stationary (suitable for many time series models) or non-stationary (requiring differencing or detrending).

Parameter Type Default Description
**kwargs {}

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally