Skip to content

New evaluation listing call that includes hyperparameters #737

Closed

Description

@joaquinvanschoren

Currently, if one wants to download all hyperparameters and evaluations of a specific flow, they need to first download the list of evaluations (fast), and then download runs one by one to get the hyperparameters (slow).

This is a problem for the current Frontend, plus it also complicates downloading meta-data from the server (last time I tried this it worked but took a very long time).

Since this is such a common use case, should we add an API call for that? Basically something
returning something like:

{
  "evaluations": {
    "evaluation": [
      {
        "run_id": "1",
        "task_id": "68",
        "flow_id": "61",
        "function": "area_under_roc_curve",
        "upload_time": "2014-04-06 23:30:40",
        "value": "0.839359",
        "array_data": "[0,0.99113,0.898048,0.874862,0.791282,0.807343,0.820674]",
        "setup_parameters": "parameter": [
            {
              "full_name": "weka.JRip(1)_F",
              "parameter_name": "F",
              "value": "3"
            },
           {
             "full_name": "weka.JRip(1)_N",
             "parameter_name": "N",
             "value": "2.0"
           },
           ...]
      }

Different options:

  • Add it as an option return_setups=true to the current evaluation list call. It would only work if there is a specific flow and function, otherwise return an error.
  • Add it as a new call `list_evaluations_and_setup(flow_id,function)
  • Use the current setup/id call, but that has the same issue that you need to ask for the setups one by one, plus the evaluation list does not return the setup id.

Thoughts?

Activity

  1. joaquinvanschoren commented on Jul 9, 2019

    @joaquinvanschoren
    ContributorAuthor

    In the meeting today Jan argued to not do this in the REST API but to download the evaluations and setup separately and merge them.

    This could done (e.g. in python) by:

    • listing all evaluations of a given flow
    • listing all setups of a given flow
    • merging both tables based on the setup ID
  2. janvanrijn commented on Jul 9, 2019

    @janvanrijn
    Member

    This function could be implemented in Python API. A more elaborate and useful version of this is available in the openml-python-contrib package and wrapped in the sklearn-bot.

  3. joaquinvanschoren commented on Jul 9, 2019

    @joaquinvanschoren
    ContributorAuthor

    I agree that this is a lot more powerful.

    For the frontend, we just need something really simple and quick to generate an overview plot like this one: https://www.openml.org/f/65, ideally without any other dependencies.

  4. joaquinvanschoren commented on Jul 9, 2019

    @joaquinvanschoren
    ContributorAuthor

    Small observation about the evaluation list. Example: https://www.openml.org/api/v1/xml/setup/list/flow/65

    The flow_id and flow name is repeated with every hyperparameter instead of once with the setup.
    Would it make sense to only output these once to speed up the I/O?

  5. janvanrijn commented on Jul 9, 2019

    @janvanrijn
    Member

    Hyper parameter flow id != flow id, because of subflows

  6. joaquinvanschoren commented on Jul 9, 2019

    @joaquinvanschoren
    ContributorAuthor

    I created the documentation for the setup list (working backwards from the API code):
    https://www.openml.org/api_docs#!/setup/get_setup_list_filters

    Please check.

  7. self-assigned this
    on Jul 12, 2019
  8. added a commit that references this issue on Aug 5, 2019
  9. mfeurer commented on Aug 5, 2019

    @mfeurer
    Collaborator

    @PGijsbers @sahithyaravi1493 is this closed by #747?

  10. PGijsbers commented on Aug 5, 2019

    @PGijsbers
    Collaborator

    I wasn't sure. The added function kind of allows this, but how parameters are specified might not be ideal.

    >>> openml.evaluations.list_evaluations_setups(function="predictive_accuracy",flow=[8817], task=[24], size=20, sort_order='desc', output_format='dataframe')
         run_id  task_id  setup_id  flow_id                                          flow_name  ...          upload_time value values array_data                                         parameters
    0   9613569       24   7542955     8817  sklearn.pipeline.Pipeline(columntransformer=sk...  ...  2018-10-20 01:20:08   1.0   None       None  [(axis, 0), (copy, true), (missing_values, "Na...
    1   9613663       24   7543049     8817  sklearn.pipeline.Pipeline(columntransformer=sk...  ...  2018-10-20 01:26:03   1.0   None       None  [(axis, 0), (copy, true), (missing_values, "Na...
    2   9613779       24   7543165     8817  sklearn.pipeline.Pipeline(columntransformer=sk...  ...  2018-10-20 01:38:29   1.0   None       None  [(axis, 0), (copy, true), (missing_values, "Na...
    3   9613926       24   7543312     8817  sklearn.pipeline.Pipeline(columntransformer=sk...  ...  2018-10-20 01:52:28   1.0   None       None  [(axis, 0), (copy, true), (missing_values, "Na...
    4   9614767       24   7544153     8817  sklearn.pipeline.Pipeline(columntransformer=sk...  ...  2018-10-20 03:59:07   1.0   None       None  [(axis, 0), (copy, true), (missing_values, "Na...
    5   9615113       24   7544499     8817  sklearn.pipeline.Pipeline(columntransformer=sk...  ...  2018-10-20 04:00:06   1.0   None       None  [(axis, 0), (copy, true), (missing_values, "Na...
    6   9615786       24   7545172     8817  sklearn.pipeline.Pipeline(columntransformer=sk...  ...  2018-10-20 04:02:11   1.0   None       None  [(axis, 0), (copy, true), (missing_values, "Na...
    7   9615797       24   7545183     8817  sklearn.pipeline.Pipeline(columntransformer=sk...  ...  2018-10-20 04:02:13   1.0   None       None  [(axis, 0), (copy, true), (missing_values, "Na...
    8   9615875       24   7545261     8817  sklearn.pipeline.Pipeline(columntransformer=sk...  ...  2018-10-20 04:02:25   1.0   None       None  [(axis, 0), (copy, true), (missing_values, "Na...
    9   9616027       24   7545413     8817  sklearn.pipeline.Pipeline(columntransformer=sk...  ...  2018-10-20 04:02:52   1.0   None       None  [(axis, 0), (copy, true), (missing_values, "Na...
    10  9616371       24   7545757     8817  sklearn.pipeline.Pipeline(columntransformer=sk...  ...  2018-10-20 04:03:37   1.0   None       None  [(axis, 0), (copy, true), (missing_values, "Na...
    11  9616433       24   7545819     8817  sklearn.pipeline.Pipeline(columntransformer=sk...  ...  2018-10-20 04:03:45   1.0   None       None  [(axis, 0), (copy, true), (missing_values, "Na...
    12  9616584       24   7545970     8817  sklearn.pipeline.Pipeline(columntransformer=sk...  ...  2018-10-20 04:04:01   1.0   None       None  [(axis, 0), (copy, true), (missing_values, "Na...
    13  9616737       24   7546123     8817  sklearn.pipeline.Pipeline(columntransformer=sk...  ...  2018-10-20 04:04:20   1.0   None       None  [(axis, 0), (copy, true), (missing_values, "Na...
    14  9616947       24   7546335     8817  sklearn.pipeline.Pipeline(columntransformer=sk...  ...  2018-10-20 04:04:48   1.0   None       None  [(axis, 0), (copy, true), (missing_values, "Na...
    15  9617149       24   7546535     8817  sklearn.pipeline.Pipeline(columntransformer=sk...  ...  2018-10-20 04:05:19   1.0   None       None  [(axis, 0), (copy, true), (missing_values, "Na...
    16  9617161       24   7546547     8817  sklearn.pipeline.Pipeline(columntransformer=sk...  ...  2018-10-20 04:05:20   1.0   None       None  [(axis, 0), (copy, true), (missing_values, "Na...
    17  9617302       24   7546689     8817  sklearn.pipeline.Pipeline(columntransformer=sk...  ...  2018-10-20 04:05:43   1.0   None       None  [(axis, 0), (copy, true), (missing_values, "Na...
    18  9617313       24   7546699     8817  sklearn.pipeline.Pipeline(columntransformer=sk...  ...  2018-10-20 04:05:44   1.0   None       None  [(axis, 0), (copy, true), (missing_values, "Na...
    19  9617488       24   7546874     8817  sklearn.pipeline.Pipeline(columntransformer=sk...  ...  2018-10-20 04:06:12   1.0   None       None  [(axis, 0), (copy, true), (missing_values, "Na...
    

    Ideally I think we'd like to also see

    • separate columns if only one flow is specified (?)
    • prepend the parameter names with a flow name (so we can distinguish subflows)

    But perhaps @joaquinvanschoren is best to judge if it should be closed?

  11. joaquinvanschoren commented on Aug 12, 2019

    @joaquinvanschoren
    ContributorAuthor

    OK, I see two good solutions:

    • Return a dictionary in the parameters column, using the hyperparameter name as key, or maybe first key by flow ID and then by hyperparameter name:
      {1: {hp1: value, hp2: value},
      2: {hp1: value, hp2: value}}
    • In case there is only one flow, just build columns for every hyperparameter. That would however be less predicable behavior. We can't really do this for large number of flows, since it would get very high dimensional and very sparse? Or, we would have to require that this call only allows one flow id.

    @PGijsbers what do you think?

  12. PGijsbers commented on Aug 12, 2019

    @PGijsbers
    Collaborator

    I think the first would be a good default, with the second being allowed through an optional argument if exactly one flow is specified? (e.g. parameter_values_in_separate_columns, which raises a ValueError if it is set to True with more than one flow)

    I think the one column per hyperparameter will be a common use-case when only a single flow is retrieved (e.g. in studies that study hyperparameter importance of a flow).

  13. mfeurer commented on Aug 19, 2019

    @mfeurer
    Collaborator

    Additional request for this issue: we need an example on how to use this API call.

  14. joaquinvanschoren commented on Aug 20, 2019

    @joaquinvanschoren
    ContributorAuthor

    It looks like the setup API does not allow us to see the structure of subflows:
    https://www.openml.org/api/v1/setup/1

    You could have many complex nested subflows but there is no information about which flow is a child of which parent.

  15. added a commit that references this issue on Sep 2, 2019
  16. mfeurer commented on Sep 13, 2019

    @mfeurer
    Collaborator

    @joaquinvanschoren @PGijsbers is this solved via #772?

  17. PGijsbers commented on Sep 16, 2019

    @PGijsbers
    Collaborator

    Yes, good catch. Sorry I did not close the issue on merge.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions