Data Analysis
Time Series Analysis
This endpoint allows users to upload a file containing time series data and perform various analyses, including aggregation, trend tests, decomposition, and optional graph generation.
Endpoint: POST /time-series-analysis
Request Parameters
File Upload
file
(required): The file containing the time series data to be processed. Supported formats include CSV, Excel, etc.
Time Column
time_column
(required): The name of the column containing the time-related data (e.g., "date", "timestamp").
Resampling Interval
interval
(optional): The frequency at which to resample the data. The options are:"hourly"
"daily"
"weekly"
"monthly"
"yearly"
Default is"daily"
.
Aggregation Functions
aggregation_func
(optional): Comma-separated list of aggregation functions to apply to the time series data. Default is["mean"]
. Available options:sum
,mean
,median
,min
,max
,count
,std
.
Columns to Analyze
columns_to_analyze
(optional): A comma-separated list of columns to analyze. If omitted, all numeric columns will be analyzed.
Trend Tests
trend_tests
(optional): Comma-separated list of trend tests to apply. Default is["adfuller"]
. Available options:adfuller
,kpss
.
Decomposition
decomposition
(optional): Boolean indicating whether to decompose the time series data into trend, seasonal, and residual components. Default isfalse
.
Decomposition Model
decomposition_model
(optional): The decomposition model to use. Available options:additive
,multiplicative
. Default is"additive"
.
Graphs
include_graphs
(optional): Boolean to specify if graphs should be included in the response. Default isfalse
.graph_types
(optional): Comma-separated list of graph types to include. Default is["line"]
. Available options:line
,decomposition
,acf
,pacf
,rolling_mean
.
Example Request
Analysis Components
- Aggregation: Aggregates the time series data based on the selected aggregation functions (e.g., mean, sum, median).
- Trend Tests: Applies statistical tests like Augmented Dickey-Fuller (
adfuller
) and Kwiatkowski-Phillips-Schmidt-Shin (kpss
) to detect trends in the data. - Decomposition: Decomposes the time series data into its trend, seasonal, and residual components.
- Graphs: Optionally generates graphs such as line charts, decomposition components, autocorrelation function (ACF), partial autocorrelation function (PACF), and rolling mean.