Giter Site home page Giter Site logo

Comments (8)

mfeurer avatar mfeurer commented on August 26, 2024

Hm, ideally we would like an iterator regardless of the resampling strategy, right? Then we could do something like:

for train_indices, test_indices in task.iter_splits():
    ...

Additionaly to that, finding the number of folds and repeats seems like a good idea.

from openml-python.

joaquinvanschoren avatar joaquinvanschoren commented on August 26, 2024

Yes, that sounds even better!

from openml-python.

mfeurer avatar mfeurer commented on August 26, 2024

I just created a new feature branch and added this feature with commit 9329070

@PG-TUe can you please check whether this helps you? I can then merge it to develop and you can rebase your branch.

from openml-python.

PGijsbers avatar PGijsbers commented on August 26, 2024

Will try today/tomorrow (most likely tomorrow), and report back. Thanks.

from openml-python.

PGijsbers avatar PGijsbers commented on August 26, 2024

I've been looking at the code, and while the iteration over repeats and folds works well, there is one issue. As far as I can tell, there is still no way to find the number of repeats and folds from just the task object. This in turn gives issues, because using task.iterate_splits(), you don't know when the next split is actually a new fold of the same repeat, or a new fold of a new repeat. Of course, it is very important to know on which repeat/fold specifically your results were obtained for your experiments (and the predictions file).

So, the new code is fine, but additionally we would need a way to retrieve the number of repeats and folds from the task directly, before it is of any use.

Of course, I might have missed something, and perhaps it is possible to see the number of repeats and folds without accessing the split object. If so, please point me in the right direction ;)

from openml-python.

PGijsbers avatar PGijsbers commented on August 26, 2024

I got around to doing it myself (commit). Iterating over all folds and repeats together as one can still be done:

task.iterate_all_splits()

However, to more easily use repeats and folds, you can now also do:

for rep in task.iterate_repeats():
    for fold in rep:
        train, test = fold

Of course, you can instead use for train, test in rep directly as well.

from openml-python.

mfeurer avatar mfeurer commented on August 26, 2024

Looks great. Can this be closed?

from openml-python.

PGijsbers avatar PGijsbers commented on August 26, 2024

In that case, yes. Issue closed.

from openml-python.

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.