flow
openml.flows.flow
#
OpenMLFlow
#
OpenMLFlow(name: str, description: str, model: object, components: dict, parameters: dict, parameters_meta_info: dict, external_version: str, tags: list, language: str, dependencies: str, class_name: str | None = None, custom_name: str | None = None, binary_url: str | None = None, binary_format: str | None = None, binary_md5: str | None = None, uploader: str | None = None, upload_date: str | None = None, flow_id: int | None = None, extension: Extension | None = None, version: str | None = None)
Bases: OpenMLBase
OpenML Flow. Stores machine learning models.
Flows should not be generated manually, but by the function
:meth:openml.flows.create_flow_from_model. Using this helper function
ensures that all relevant fields are filled in.
Implements openml.implementation.upload.xsd
<https://github.com/openml/openml/blob/master/openml_OS/views/pages/api_new/v1/xsd/
openml.implementation.upload.xsd>_.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Name of the flow. Is used together with the attribute
TYPE:
|
description
|
Human-readable description of the flow (free text).
TYPE:
|
model
|
ML model which is described by this flow.
TYPE:
|
components
|
Mapping from component identifier to an OpenMLFlow object. Components are usually subfunctions of an algorithm (e.g. kernels), base learners in ensemble algorithms (decision tree in adaboost) or building blocks of a machine learning pipeline. Components are modeled as independent flows and can be shared between flows (different pipelines can use the same components).
TYPE:
|
parameters
|
Mapping from parameter name to the parameter default value. The
parameter default value must be of type
TYPE:
|
parameters_meta_info
|
Mapping from parameter name to
TYPE:
|
external_version
|
Version number of the software the flow is implemented in. Is used
together with the attribute
TYPE:
|
tags
|
List of tags. Created on the server by other API calls.
TYPE:
|
language
|
Natural language the flow is described in (not the programming language).
TYPE:
|
dependencies
|
A list of dependencies necessary to run the flow. This field should contain all libraries the flow depends on. To allow reproducibility it should also specify the exact version numbers.
TYPE:
|
class_name
|
The development language name of the class which is described by this flow.
TYPE:
|
custom_name
|
Custom name of the flow given by the owner.
TYPE:
|
binary_url
|
Url from which the binary can be downloaded. Added by the server. Ignored when uploaded manually. Will not be used by the python API because binaries aren't compatible across machines.
TYPE:
|
binary_format
|
Format in which the binary code was uploaded. Will not be used by the python API because binaries aren't compatible across machines.
TYPE:
|
binary_md5
|
MD5 checksum to check if the binary code was correctly downloaded. Will not be used by the python API because binaries aren't compatible across machines.
TYPE:
|
uploader
|
OpenML user ID of the uploader. Filled in by the server.
TYPE:
|
upload_date
|
Date the flow was uploaded. Filled in by the server.
TYPE:
|
flow_id
|
Flow ID. Assigned by the server.
TYPE:
|
extension
|
The extension for a flow (e.g., sklearn).
TYPE:
|
version
|
OpenML version of the flow. Assigned by the server.
TYPE:
|
Source code in openml/flows/flow.py
openml_url
property
#
The URL of the object on the server, if it was uploaded, else None.
from_filesystem
classmethod
#
from_filesystem(input_directory: str | Path) -> OpenMLFlow
Read a flow from an XML in input_directory on the filesystem.
Source code in openml/flows/flow.py
get_structure
#
Returns for each sub-component of the flow the path of identifiers that should be traversed to reach this component. The resulting dict maps a key (identifying a flow by either its id, name or fullname) to the parameter prefix.
| PARAMETER | DESCRIPTION |
|---|---|
key_item
|
The flow attribute that will be used to identify flows in the structure. Allowed values {flow_id, name}
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict[str, List[str]]
|
The flow structure |
Source code in openml/flows/flow.py
get_subflow
#
get_subflow(structure: list[str]) -> OpenMLFlow
Returns a subflow from the tree of dependencies.
| PARAMETER | DESCRIPTION |
|---|---|
structure
|
A list of strings, indicating the location of the subflow
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
OpenMLFlow
|
The OpenMLFlow that corresponds to the structure |
Source code in openml/flows/flow.py
open_in_browser
#
Opens the OpenML web page corresponding to this object in your default browser.
Source code in openml/base.py
publish
#
publish(raise_error_if_exists: bool = False) -> OpenMLFlow
Publish this flow to OpenML server.
Raises a PyOpenMLError if the flow exists on the server, but
self.flow_id does not match the server known flow id.
| PARAMETER | DESCRIPTION |
|---|---|
raise_error_if_exists
|
If True, raise PyOpenMLError if the flow exists on the server. If False, update the local flow to match the server flow.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
self
|
TYPE:
|
Source code in openml/flows/flow.py
push_tag
#
Annotates this entity with a tag on the server.
| PARAMETER | DESCRIPTION |
|---|---|
tag
|
Tag to attach to the flow.
TYPE:
|
remove_tag
#
Removes a tag from this entity on the server.
| PARAMETER | DESCRIPTION |
|---|---|
tag
|
Tag to attach to the flow.
TYPE:
|
to_filesystem
#
Write a flow to the filesystem as XML to output_directory.
Source code in openml/flows/flow.py
url_for_id
classmethod
#
Return the OpenML URL for the object of the class entity with the given id.