Skip to content

[Feature Request] Add Seasonality Detection for Time-Series Data #5230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lisahua opened this issue Jun 11, 2020 · 0 comments · Fixed by #5231
Closed

[Feature Request] Add Seasonality Detection for Time-Series Data #5230

lisahua opened this issue Jun 11, 2020 · 0 comments · Fixed by #5231
Assignees
Labels
enhancement New feature or request P2 Priority of the issue for triage purpose: Needs to be fixed at some point.

Comments

@lisahua
Copy link
Contributor

lisahua commented Jun 11, 2020

Feature Description

In time series data, seasonality is the presence of variations that occur at specific regular intervals less than a year, such as weekly, monthly, or quarterly. With the support of seasonality and seasonality decomposition, we can improve a list of operations on time-series data:

  • Anomaly Detection
  • Forcasting
  • and more

We propose to provide

  1. Seasonality Detection Support for Time-Series Data based on fourier analysis. PR 5231
  2. Seasonality Decomposition for Time-Series Data based on STL.
    a. First, we support decomposition with Anomaly Detection PR 5202
    b. Second, separate seasonality decomposition as a individual API as a Transformer

Detail API Proposal

  • DetectSeasonality
        /// <summary>
        /// Obtain the period by adopting techniques of spectral analysis. which is founded by
        /// the fourier analysis. returns -1 means there's no significant period. otherwise, a period
        /// is returned.
        /// </summary>
        /// <param name="catalog">The detect seasonality catalog.</param>
        /// <param name="input">Input DataView.The data is an instance of <see cref="Microsoft.ML.IDataView"/>.</param>
        /// <param name="inputColumnName">Name of column to process. The column data must be <see cref="System.Double"/>.</param>
        /// <param name="seasonalityWindowSize">An upper bound on the largest relevant seasonality in the input time-series.
        /// When set to -1, use the whole input to fit model, when set to a positive integer, use this number as batch size.
        /// Default value is -1.</param>
        /// <returns>The detected period if seasonality period exists, otherwise return -1.</returns>
        public static int DetectSeasonality(this AnomalyDetectionCatalog catalog, IDataView input, string inputColumnName, int seasonalityWindowSize = -1)
  • Seasonality Decompose
    Add two optional parameters to existing DetectEntireAnomalyBySrCnn API:
    -- period: Seasonality Period (either from user or auto-detected by the DetectSeasonality API.
    -- deseasonalityMode: Median, Average, STL.
public static IDataView DetectEntireAnomalyBySrCnn(
  this AnomalyDetectionCatalog catalog,
  IDataView input, string outputColumnName, 
  string inputColumnName,
  double threshold = 0.3, 
   int batchSize = 1024, 
   double sensitivity = 99, 
   SrCnnDetectMode detectMode = SrCnnDetectMode.AnomalyOnly, 
   int period = 0, 
   SrCnnDeseasonalityMode deseasonalityMode = SrCnnDeseasonalityMode.Stl)
@mstfbl mstfbl added enhancement New feature or request P2 Priority of the issue for triage purpose: Needs to be fixed at some point. labels Jun 11, 2020
@mstfbl mstfbl linked a pull request Jun 11, 2020 that will close this issue
4 tasks
@ghost ghost locked as resolved and limited conversation to collaborators Mar 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request P2 Priority of the issue for triage purpose: Needs to be fixed at some point.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants