GithubHelp home page GithubHelp logo

Is there a way to create a blank TimeSeries object that you can append (concatenate or stack) to similar to list appending? about darts HOT 2 CLOSED

gvas7 avatar gvas7 commented on June 16, 2024
Is there a way to create a blank TimeSeries object that you can append (concatenate or stack) to similar to list appending?

from darts.

Comments (2)

madtoinou avatar madtoinou commented on June 16, 2024 1

Hi @gvas7,

I am assuming that the covariates you want to include in your optuna trial are actually columns/components of a single multivariate TimeSeries (hence, a unique and shared time index) and not distinct Timeseries with different time indexes.

You can simply use the __getitem__() operator to extracts the components you want to use for a given trial with:

# ts_covs is the master TimeSeries containing all the covariates, select_covariates is a list of strings
future_covariates = ts_covs[selected_covariates]

If the covariates are stored in separate ts with exactly the same time index and you want to use the stack method, you can use the snippet below. However, this is approach is not recommended because you will recreate a new TimeSeries at each iteration.

trial_ts = None
# select_covariates is a list of univariate TimeSeries where all the TimeSeries have the exact same time index
for cov in selected_covariates:
    if trial_ts is None:
        trial_ts = cov
    else:
        trial_ts = trial_ts.stack(cov)

from darts.

gvas7 avatar gvas7 commented on June 16, 2024

So simple and I overthought it. Thank you for taking time to explain this and the first example is what I wanted to do and does exactly what I wanted. As your package gets more popular, more people like me will show up asking questions like this one :(

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.