Skip to content

Task creation not supported? #294

Closed
Closed

Description

@joaquinvanschoren

I tried to create a task via the Python API like this:

task = oml.tasks.OpenMLTask(
            task_type = 'Supervised Classification', 
            data_set_id = 602,
            target_name = 'class', 
            estimation_procedure_type = 'crossvalidation', 
            estimation_parameters = {'number_folds': '10',
                                     'number_repeats': '1',
                                     'percentage': '',
                                     'stratified_sampling': 'true'})

But I'm getting:

TypeError: __init__() missing 5 required positional arguments: 'task_id', 'task_type_id', 'data_splits_url', 'evaluation_measure', and 'cost_matrix'

None of these make sense for creating a new simple task with cross-validation. Why are they require. Setting them to None also doesn't help, since 'task_id' needs to be a number.

Am I missing something?

Activity

  1. mfeurer commented on Aug 15, 2017

    @mfeurer
    Collaborator

    Local task creation is not implemented. Therefore, all required attributes need to be specified. If we wanted to implement this, I think we'd need to go a different way, though. Something like create_task_on_OpenML, which is aware of all different kinds of parameters that can be passed.

  2. joaquinvanschoren commented on Aug 15, 2017

    @joaquinvanschoren
    ContributorAuthor

    Sure, but if I write create_task_on_OpenML, I want to do that based on the OpenMLTask object, no? Right now I cannot make a task object if the task_id isn't already known.

    How do I proceed?

  3. mfeurer commented on Aug 15, 2017

    @mfeurer
    Collaborator

    I'm not sure what you want to achieve.

  4. joaquinvanschoren commented on Aug 15, 2017

    @joaquinvanschoren
    ContributorAuthor
  5. joaquinvanschoren commented on Aug 15, 2017

    @joaquinvanschoren
    ContributorAuthor
  6. mfeurer commented on Aug 15, 2017

    @mfeurer
    Collaborator

    Okay, your use case makes sense. The reason why this isn't supported in the python API is because no one needed this feature so far.

    And yes, using the REST API without creating a task object is basically what I wanted to say.

  7. joaquinvanschoren commented on Aug 15, 2017

    @joaquinvanschoren
    ContributorAuthor
  8. mfeurer commented on Aug 15, 2017

    @mfeurer
    Collaborator

    Yep, you're right. My proposal would make the API cluttered and hard to understand. Creating a task object to upload would be way easier and consistent with the rest of the API. Thanks for pointing that out.

  9. joaquinvanschoren commented on Aug 15, 2017

    @joaquinvanschoren
    ContributorAuthor
  10. joaquinvanschoren commented on Aug 16, 2017

    @joaquinvanschoren
    ContributorAuthor
  11. janvanrijn commented on Aug 16, 2017

    @janvanrijn
    Member
  12. joaquinvanschoren commented on Aug 16, 2017

    @joaquinvanschoren
    ContributorAuthor
  13. janvanrijn commented on Aug 16, 2017

    @janvanrijn
    Member
  14. joaquinvanschoren commented on Aug 16, 2017

    @joaquinvanschoren
    ContributorAuthor
  15. mfeurer commented on Apr 29, 2019

    @mfeurer
    Collaborator

    We recently merged task upload via #607. Documentation still missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions