Code Monkey home page Code Monkey logo

Comments (4)

petroniocandido avatar petroniocandido commented on May 27, 2024

The number of lags can be chosen when you employ an high order method, like HOFTS (the standard), IFTS or PWFTS. In that cases you can inform the order (the number of lags) in the constructor using the 'order' parameter and the lag indexes using the 'lags' parameter. The default 'order' is 2 and the default 'lags' is [1,2]. Check the below the model creation for third order and lags 7,14,21:

from pyFTS.data import SONDA
from pyFTS.partitioners import Grid
from pyFTS.models import hofts

train = SONDA.get_data('glo_avg')[:800]
test = SONDA.get_data('glo_avg')[800:1000]

partitioner = Grid.GridPartitioner(data=train, npart=35)

model = hofts.HighOrderFTS(partitioner=partitioner, order=3, lags=[7, 14, 21])

model.fit(train)

print(model)

forecasts = model.predict(test)

from pyfts.

jermaine1ronquillo avatar jermaine1ronquillo commented on May 27, 2024

Thank you for the reply. Based on my understanding if the default order is 2 then I must specify a list with two values of lag. And on the example above the order is 3 that is why the lag has a value of three lags. If the order is 4 or more then lag has four or more values too?
Second question is how do we identify or determine the number of lags per order ( I assume ACF/PACF, but how?)?

Regards,

from pyfts.

petroniocandido avatar petroniocandido commented on May 27, 2024

Hi! You don't need to specify the lags, it is automatically generated as an incremental list. It is the default and it works for the majority of the situations. BUT sometimes there are more significant lags that help to identify complex patterns. In that case you must use the 'lags' parameter. ACF is a good start, but it won't work always, specially for long memory time series. I am currently working on a hyperparameter optimization tool that helps to identify the best lags.

from pyfts.

jermaine1ronquillo avatar jermaine1ronquillo commented on May 27, 2024

Great! My focus at the moment is long time series, I hope the tool will be available soon.

Regards,

from pyfts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.