run
openml._api.resources.run
#
RunV1API
#
RunV1API(http: HTTPClient, minio: MinIOClient)
Bases: ResourceV1API, RunAPI
Source code in openml/_api/resources/base/base.py
delete
#
Delete a resource using the V1 API.
| PARAMETER | DESCRIPTION |
|---|---|
resource_id
|
Identifier of the resource to delete.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type is not supported for deletion. |
OpenMLNotAuthorizedError
|
If the user is not permitted to delete the resource. |
OpenMLServerError
|
If deletion fails for an unknown reason. |
OpenMLServerException
|
For other server-side errors. |
Source code in openml/_api/resources/base/versions.py
get
#
get(run_id: int, *, reset_cache: bool = False) -> OpenMLRun
Fetch a single run from the OpenML server.
| PARAMETER | DESCRIPTION |
|---|---|
run_id
|
The ID of the run to fetch.
TYPE:
|
reset_cache
|
Whether to reset the cache.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
OpenMLRun
|
The run object with all details populated. |
| RAISES | DESCRIPTION |
|---|---|
OpenMLServerException
|
If the run does not exist or server error occurs. |
Source code in openml/_api/resources/run.py
list
#
list(limit: int, offset: int, *, ids: list[int] | None = None, task: list[int] | None = None, setup: list[int] | None = None, flow: list[int] | None = None, uploader: list[int] | None = None, study: int | None = None, tag: str | None = None, display_errors: bool = False, task_type: TaskType | int | None = None) -> DataFrame
List runs from the OpenML server with optional filtering.
| PARAMETER | DESCRIPTION |
|---|---|
limit
|
Maximum number of runs to return.
TYPE:
|
offset
|
Starting position for pagination.
TYPE:
|
ids
|
List of run IDs to filter by.
TYPE:
|
task
|
List of task IDs to filter by.
TYPE:
|
setup
|
List of setup IDs to filter by.
TYPE:
|
flow
|
List of flow IDs to filter by.
TYPE:
|
uploader
|
List of uploader user IDs to filter by.
TYPE:
|
study
|
Study ID to filter by.
TYPE:
|
tag
|
Tag to filter by.
TYPE:
|
display_errors
|
If True, include runs with error messages.
TYPE:
|
task_type
|
Task type ID to filter by.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DataFrame
|
DataFrame with columns: run_id, task_id, setup_id, flow_id, uploader, task_type, upload_time, error_message. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the server response is invalid or malformed. |
Source code in openml/_api/resources/run.py
publish
#
Publish a new resource using the V1 API.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
API endpoint path for the upload.
TYPE:
|
files
|
Files to upload as part of the request payload.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
Identifier of the newly created resource. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the server response does not contain a valid resource ID. |
OpenMLServerException
|
If the server returns an error during upload. |
Source code in openml/_api/resources/base/versions.py
tag
#
Add a tag to a resource using the V1 API.
| PARAMETER | DESCRIPTION |
|---|---|
resource_id
|
Identifier of the resource to tag.
TYPE:
|
tag
|
Tag to associate with the resource.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list of str
|
Updated list of tags assigned to the resource. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type does not support tagging. |
OpenMLServerException
|
If the server returns an error. |
Source code in openml/_api/resources/base/versions.py
untag
#
Remove a tag from a resource using the V1 API.
| PARAMETER | DESCRIPTION |
|---|---|
resource_id
|
Identifier of the resource to untag.
TYPE:
|
tag
|
Tag to remove from the resource.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list of str
|
Updated list of tags assigned to the resource. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type does not support tagging. |
OpenMLServerException
|
If the server returns an error. |
Source code in openml/_api/resources/base/versions.py
RunV2API
#
RunV2API(http: HTTPClient, minio: MinIOClient)
Bases: ResourceV2API, RunAPI
V2 API resource for runs. Currently read-only until V2 server supports POST.
Source code in openml/_api/resources/base/base.py
get
#
get(run_id: int, *, reset_cache: bool = False) -> OpenMLRun
Fetch a single run from the V2 server.
| PARAMETER | DESCRIPTION |
|---|---|
run_id
|
The ID of the run to fetch.
TYPE:
|
reset_cache
|
Whether to reset the cache.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
OpenMLRun
|
The run object. |
| RAISES | DESCRIPTION |
|---|---|
OpenMLNotSupportedError
|
V2 server API not yet available for this operation. |
Source code in openml/_api/resources/run.py
list
#
list(limit: int, offset: int, *, ids: list[int] | None = None, task: list[int] | None = None, setup: list[int] | None = None, flow: list[int] | None = None, uploader: list[int] | None = None, study: int | None = None, tag: str | None = None, display_errors: bool = False, task_type: TaskType | int | None = None) -> DataFrame
List runs from the V2 server.
| RAISES | DESCRIPTION |
|---|---|
OpenMLNotSupportedError
|
V2 server API not yet available for this operation. |