Coder Social home page Coder Social logo

time series indexer about mlens HOT 3 CLOSED

flennerhag avatar flennerhag commented on May 14, 2024 1
time series indexer

from mlens.

Comments (3)

flennerhag avatar flennerhag commented on May 14, 2024 1

Agree. A make_indexer function would be a great utility to convert any list of train-test splits of fold generator into a mlens compatible indexer. Actually think the mlens.index code base (in 0.2.0) already has the base code needed for that, worth looking into!

Come think of it, the time series indexer is quite straightforward to implement as the folds are contiguous:

# Params
require: burn_in
require: window_size
require: test_size

start_index = 0
stop_index = burn_in
stop = False
while not stop:
    start_index += window_size  # if moving window
    stop_index += window_size

    if stop_index + test_size >= X.shape[0]:
        stop = True
        # Something here to grab the last obs in the final fold

    train_index = (start_index, stop_index)
    test_index = (stop_index, stop_index + test_size)  # test_size might not always be 1?

    yield train_index, test_index

or something like it maybe.

from mlens.

JoshuaC3 avatar JoshuaC3 commented on May 14, 2024

This would be great.

In addition, it would be useful to add in a base training size e.g. 3 (of the 6 "folds"). This better mimics many real life scenarios where you have a good amount of training data with an expanding window.

fold train obs test obs
0 0, 1, 2, 3 4
1 0, 1, 2, 3, 4 5
2 0, 1, 2, 3, 4, 5 6

It would also be useful to include a moving window size, e.g. 4 (on 6 folds)

fold train obs test obs
0 0, 1, 2, 3 4
1 1, 2, 3, 4 5
2 2, 3, 4, 5 6

Ultimately, this could all be achieved by allowing a user to define their own indices for the train-test-split.

from mlens.

flennerhag avatar flennerhag commented on May 14, 2024

Resolved in #95.

from mlens.

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.