GithubHelp home page GithubHelp logo

Comments (2)

dennisbader avatar dennisbader commented on June 2, 2024

Hi @Allena101, yes, the covariates will be generated when calling fit and predict.

At the moment, there is no built-in encoder for the holidays generation. We could add this at some point though.

I'd suggest to add the holidays before using the models.

If you don't have any covariates available, you can use darts.utils.timeseries_generation.holidays_timeseries to generate a new time series with the holidays (it can also extend further into the future than you input series with add_length).

from darts.datasets import AirPassengersDataset
from darts.utils.timeseries_generation import holidays_timeseries

series = AirPassengersDataset().load()
forecast_horizon = 24

future_covariates = holidays_timeseries(
    series, 
    country_code="US", 
    add_length=forecast_horizon
)

Or if you already have a future_covariates (or past_covariates) series, you can directly add them:

from darts.datasets import AirPassengersDataset
from darts.utils.timeseries_generation import holidays_timeseries

covariates = AirPassengersDataset().load()
covariates = covariates.add_holidays(country_code="US")

from darts.

Allena101 avatar Allena101 commented on June 2, 2024

Hi @Allena101, yes, the covariates will be generated when calling fit and predict.

At the moment, there is no built-in encoder for the holidays generation. We could add this at some point though.

I'd suggest to add the holidays before using the models.

If you don't have any covariates available, you can use darts.utils.timeseries_generation.holidays_timeseries to generate a new time series with the holidays (it can also extend further into the future than you input series with add_length).

from darts.datasets import AirPassengersDataset
from darts.utils.timeseries_generation import holidays_timeseries

series = AirPassengersDataset().load()
forecast_horizon = 24

future_covariates = holidays_timeseries(
    series, 
    country_code="US", 
    add_length=forecast_horizon
)

Or if you already have a future_covariates (or past_covariates) series, you can directly add them:

from darts.datasets import AirPassengersDataset
from darts.utils.timeseries_generation import holidays_timeseries

covariates = AirPassengersDataset().load()
covariates = covariates.add_holidays(country_code="US")

thanks for the answer Dennis!

this still works well since its so easy to just add the holidays to your existing past_covariates!

from darts.

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.