antoinecarme / pyaf

PyAF is an Open Source Python library for Automatic Time Series Forecasting built on top of popular pydata modules.
BSD 3-Clause "New" or "Revised" License
459 stars 72 forks source link

Add a periodicity test collection #52

Closed antoinecarme closed 7 years ago

antoinecarme commented 7 years ago

PyAF automatically detects periodic and seasonal patterns by analyzing trend residues.

Need some collection of automatic tests for periodicity analysis.

sample test : use an artificial dataset with a periodic pattern.

antoinecarme commented 7 years ago

Added a test collection under the dirfectory tests/periodicities, each test is performed on a generic dataset of size N, with a time frequency of freq and a periodic pattern of a given length.

To summarize, the code generation is the follwoing :


def generate_all():

    lCycles = [ 5 , 7 , 12 , 15, 24, 30 , 60, 120, 360];
    lFreqs = [('S' , 'Second'),
              ('T', 'Minute'),
              ('H' , 'Hour'),
              ('BH', 'Business_Hour'),
              ('D' , 'Day'),
              ('B', 'Business_Day'),
              ('W' , 'Week'),
              ('SM', 'Semi_Month'),
              ('M' , 'Month')]

    for cyc in lCycles:
        for freq in lFreqs:
            lRows = [25, 50, 100, 200, 400, 1600, 3200];
            if(freq[0] == 'W'):
                lRows = [25, 50, 100, 200, 400, 1600];
            if(freq[0] == 'SM'):
                lRows = [25, 50, 100, 200, 400];
            if(freq[0] == 'M'):
                lRows = [25, 50, 100, 200, 400];
            for nbrows in lRows:
                gen_file(cyc , freq, nbrows);
antoinecarme commented 7 years ago

The collection contains a total of about 540 individual scripts/models.