Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run_model_on_task: make avoid_duplicate_runs=False the default #1143

Open
joaquinvanschoren opened this issue Jun 24, 2022 · 5 comments
Open

Comments

@joaquinvanschoren
Copy link
Contributor

Description

run_model_on_task has an option to avoid running experiments that already exist on OpenML, called avoid_duplicate_runs. This, however, requires an API key. It is currently the default, meaning that people can't try out this function without setting their API key.
This creates an unnecessary obstacle, especially for beginners who don't know that the avoid_duplicate_runs option can be switched off.

Steps/Code to Reproduce

from sklearn import ensemble
from openml import tasks, runs

clf = ensemble.RandomForestClassifier()
task = tasks.get_task(3954)
run = runs.run_model_on_task(clf, task)

Expected Results

The model should just run. The user may have no intention to upload the run to OpenML later.

Actual Results

An API key error is thrown

Versions

Linux-5.4.188+-x86_64-with-Ubuntu-18.04-bionic
Python 3.7.13 (default, Apr 24 2022, 01:04:09)
[GCC 7.5.0]
NumPy 1.21.6
SciPy 1.4.1
Scikit-Learn 1.0.2
OpenML 0.12.2

@joaquinvanschoren joaquinvanschoren added the Good First Issue Issues suitable for people new to contributing to openml-python! label Jun 24, 2022
@PGijsbers
Copy link
Collaborator

I had a closer look, and the problem is actually a post request which should have been a get request:

"flow/exists", "post", data={"name": name, "external_version": external_version},

With that fixed, you can run above code without an API key configured while still having the avoid_duplicate_runs functionality (at the cost of some additional server roundtrips to check if the run exists).

So now the question becomes, should we still prefer to have it turned off by default regardless?

@PGijsbers PGijsbers added Requires Feedback and removed Good First Issue Issues suitable for people new to contributing to openml-python! labels Jun 27, 2022
@PGijsbers
Copy link
Collaborator

Also @mfeurer

@mfeurer
Copy link
Collaborator

mfeurer commented Jun 27, 2022

That's an interesting question - maybe we can move this flag to the upload/publish function instead? It will serve the same purpose, but slightly improve the user experience as users can still run things without having to worry about duplicate runs.

@PGijsbers
Copy link
Collaborator

The idea of having it here is that the user may avoid unnecessary computation since they can identify there's a duplicate before running the experiment and download the results instead (not so much avoiding duplicates on the server, or so I thought).

@mfeurer
Copy link
Collaborator

mfeurer commented Jul 5, 2022

Interesting, I thought it's to avoid duplicate stuff on the server. @joaquinvanschoren would you still like to remove that flag now that @PGijsbers has found a workaround?

@PGijsbers PGijsbers added this to the 0.13 milestone Nov 17, 2022
PGijsbers added a commit that referenced this issue Nov 28, 2022
Fixes #1143. This change means that runs results will by default not
be fetched from the server, but computed locally. The benefit is
that the operation no longer requires an API key or internet connection
by default.
@mfeurer mfeurer modified the milestones: 0.13.1, 0.14.0 Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants