Skip to content

Conversation

@LennartPurucker
Copy link
Contributor

This addresses #1144 and might be a solution for the issue.

It is important to note that the representation already included a "Result" field and thus could have reported results in the printout. However, this only happens if the evaluation of the run is filled.

This implementation now also covers locally computed results. The locally computed results are only shown if no task/run-specific results already exist.

Example

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, avoid_duplicate_runs=False)
print(run)

Old Output:

OpenML Run
==========
Uploader Name: None
Metric.......: None
Run ID.......: None
Task ID......: 3954
Task Type....: None
Task URL.....: https://www.openml.org/t/3954
Flow ID......: None
Flow Name....: sklearn.ensemble._forest.RandomForestClassifier
Flow URL.....: https://www.openml.org/f/None
Setup ID.....: None
Setup String.: Python_3.7.13. Sklearn_1.0.2. NumPy_1.21.6. SciPy_1.4.1.
Dataset ID...: 1120
Dataset URL..: https://www.openml.org/d/1120

New Output (ignore the difference in Setup String):

OpenML Run
==========
Uploader Name...................: None
Metric..........................: None
Local Result - Accuracy (+- STD): 0.8790 +- 0.0054
Local Runtime - ms (+- STD).....: 9662.5000 +- 2621.0648
Run ID..........................: None
Task ID.........................: 3954
Task Type.......................: None
Task URL........................: https://www.openml.org/t/3954
Flow ID.........................: None
Flow Name.......................: sklearn.ensemble._forest.RandomForestClassifier
Flow URL........................: https://www.openml.org/f/None
Setup ID........................: None
Setup String....................: Python_3.9.10. Sklearn_1.2.1. NumPy_1.23.5. SciPy_1.10.0.
Dataset ID......................: 1120
Dataset URL.....................: https://www.openml.org/d/1120

Test

I am not sure if we need to write a test for this. I did not find any tests for the representation so far.

LennartPurucker and others added 17 commits February 22, 2023 12:12
Co-authored-by: Matthias Feurer <[email protected]>
Co-authored-by: Matthias Feurer <[email protected]>
* Try Ubunte 20.04 for Python 3.6

* use old ubuntu for python 3.6
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 1 to 2.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](docker/setup-buildx-action@v1...v2)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Update run.py

* Update run.py

updated description to not contain duplicate information.

* Update run.py
LennartPurucker and others added 4 commits February 24, 2023 18:13
* Refactor if-statements

* Add explicit names to conditional expression

* Add 'dependencies' to better mimic OpenMLFlow
* Install custom numpy version for specific combination of Python3.8 and numpy

* Debug output

* Change syntax

* move to coverage action v3

* Remove test output
@mfeurer
Copy link
Collaborator

mfeurer commented Mar 1, 2023

Before merging this, could you please have a look at the pre-commit? That one is currently failing.

@LennartPurucker
Copy link
Contributor Author

I fixed the doc string for the run that was malformed as a result of another PR. The pre-commit should work now.

Copy link
Collaborator

@mfeurer mfeurer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the remaining failures are due to the test server this looks ready to merge for me.

@mfeurer mfeurer merged commit ce82fd5 into openml:develop Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants