Client
Note
The client supports password and token based authentication, such as local, PAM, LDAP, and OpenID. Certificate based authentication such as Mutual TLS is not currently supported by the client.
API Reference:
-
class
Client
Connect to and interact with a Driverless AI server.
Parameters: - address (
str
) – full URL of the Driverless AI server to connect to - username (
Optional
[str
]) – username for authentication on the Driverless AI server - password (
Optional
[str
]) – password for authentication on the Driverless AI server - token_provider (
Optional
[Callable
[[],str
]]) – callable that provides an authentication token, if provided, will ignoreusername
andpassword
values - verify (
Union
[bool
,str
]) – when using https on the Driverless AI server, setting this to False will disable SSL certificates verification. A path to cert(s) can also be passed to verify, see: https://requests.readthedocs.io/en/master/user/advanced/#ssl-cert-verification - backend_version_override (
Optional
[str
]) – version of client backend to use, overrides Driverless AI server version detection. Specify"latest"
to get the most recent backend supported. In most cases the user should rely on Driverless AI server version detection and leave this as the defaultNone
.
Examples:
### Connect with username and password dai = driverlessai.Client( address='http://localhost:12345', username='py', password='py' ) ### Connect with token (assumes the Driverless AI server is configured ### to allow clients to authenticate through tokens) # 1) setup a token provider with a refresh token from the Driverless AI web UI token_provider = driverlessai.token_providers.OAuth2TokenProvider( refresh_token="eyJhbGciOiJIUzI1N...", client_id="python_client", token_endpoint_url="https://keycloak-server/auth/realms/..." token_introspection_url="https://keycloak-server/auth/realms/..." ) # 2) use the token provider to get authorization to connect to the # Driverless AI server dai = driverlessai.Client( address="https://localhost:12345", token_provider=token_provider.ensure_fresh_token )
-
property
autoviz
: driverlessai._autoviz.AutoViz Interact with dataset visualizations on the Driverless AI server.
Return type: AutoViz
-
property
connectors
: driverlessai._datasets.Connectors Interact with connectors on the Driverless AI server.
Return type: Connectors
-
property
datasets
: driverlessai._datasets.Datasets Interact with datasets on the Driverless AI server.
Return type: Datasets
-
property
experiments
: driverlessai._experiments.Experiments Interact with experiments on the Driverless AI server.
Return type: Experiments
-
property
mli
: driverlessai._mli.MLI Interact with experiment interpretations on the Driverless AI server.
Return type: MLI
-
property
projects
: driverlessai._projects.Projects Interact with projects on the Driverless AI server.
Return type: Projects
- address (
Interact with Server Entities
The following attributes of a connected client allow you to interact with entities such as datasets or experiments on the Driverless AI server.
AutoViz
The autoviz
attribute of a connected client provides methods to create, get, and list dataset visualizations on the Driverless AI server.
API Reference:
-
class
AutoViz
Interact with dataset visualizations on the Driverless AI server.
-
create
(dataset: Dataset) Visualization Create a dataset visualization on the Driverless AI server.
Parameters: dataset ( Dataset
) – Dataset objectReturn type: Visualization
-
create_async
(dataset: Dataset) Visualization Launch creation of a dataset visualization on the Driverless AI server.
Parameters: dataset ( Dataset
) – Dataset objectReturn type: Visualization
-
get
(key: str) Visualization Get a Visualization object corresponding to a dataset visualization on the Driverless AI server.
Parameters: key ( str
) – Driverless AI server’s unique ID for the visualizationReturn type: Visualization
-
gui
() Hyperlink Get full URL for the AutoViz page on the Driverless AI server.
Return type: Hyperlink
-
list
(start_index: int = 0, count: Optional[int] = None) Sequence[Visualization] Return list of dataset Visualization objects.
Parameters: - start_index (
int
) – index on Driverless AI server of first visualization in list - count (
Optional
[int
]) – number of visualizations to request from the Driverless AI server
Return type: Sequence
[Visualization
]- start_index (
-
Connectors
The connectors
attribute of a connected client currently gives you a method to list connectors that have been enabled on the Driverless AI server.
Connectors are strings that designate a method to get data into the server:
upload
: standard upload featurefile
: local file system/server file systemhdfs
: Hadoop file system, remember to configure the HDFS config folder path and keytab on the serverdtap
: Blue Data Tap file system, remember to configure DTap on the servers3
: Amazon S3, optionally configure secret and access key on the servergcs
: Google Cloud Storage, remember to configure gcs_path_to_service_account_json on the servergbq
: Google Big Query, remember to configure gcs_path_to_service_account_json on the serverminio
: Minio Cloud Storage, remember to configure secret and access key on the serversnow
: Snowflake Data Warehouse, remember to configure Snowflake credentials on the server (account name, username, password)kdb
: KDB+ Time Series Database, remember to configure KDB credentials on the server (hostname and port, optionally: username, password, classpath, and jvm_args)azrbs
: Azure Blob Storage, remember to configure Azure credentials on the server (account name, account key)jdbc
: JDBC Connectorhive
: Hive Connectorrecipe_file
: custom recipe file uploadrecipe_url
: custom recipe upload via url
These strings can be passed as the data_source
argument for the dataset create functions.
Data sources are exposed in the form of the file systems, and each file system is prefixed by a unique prefix. For example:
- To reference data on S3, use
s3://
. - To reference data on HDFS, use the prefix
hdfs://
. - To reference data on Azure Blob Store, use
https://<storage_name>.blob.core.windows.net
. - To reference data on BlueData Datatap, use
dtap://
. - To reference data on Google BigQuery, make sure you know the Google BigQuery dataset and the table that you want to query. Use a standard SQL query to ingest data.
- To reference data on Google Cloud Storage, use
gs://
. - To reference data on kdb+, use the hostname and the port
http://<kdb_server>:<port>
. - To reference data on Minio, use
http://<endpoint_url>
. - To reference data on Snowflake, use a standard SQL query to ingest data.
- To access a SQL database via JDBC, use a SQL query with the syntax associated with your database.
Advanced Connectors
Advanced connectors require a data_source_config
argument for the dataset create functions.
The following connectors are considered advanced:
Google Big Query:
config = {
'gbq_dataset_name': <required>,
'gbq_bucket_name': <required>,
'gbq_location': <optional> # Specify a location/region to use with the GBQ connector.
'gbq_project': <optional> # Specify a project to use with the GBQ connector.
}
Note
Driverless AI’s connection to Google Big Query will inherit the top-level directory from the service JSON file. So if a dataset named “my-dataset” is in a top-level directory named “dai-gbq”, then the value for the dataset ID input field would be “my-dataset” and not “dai-gbq:my-dataset”.
Note
gbq_location
is only supported in Driverless AI server versions >= 1.10.1.
Note
gbq_project
is only supported in Driverless AI server versions >= 1.9.3.
Hive:
config = {
'hive_conf_path': <optional>, # Path to hadoop configuration directory.
'hive_auth_type': <optional>, # Type of authentication to use, can be [noauth, keytab, keytabimpersonation].
'hive_keytab_path': <optional>, # Path to keytab if using keytab authentication.
'hive_principal_user': <optional>, # User ID authorized by keytab to make queries.
'hive_default_config': <optional> # Name of database configuration in config.toml to use. If provided, will ignore all other optional arguments, and will take them directly from config.toml.
}
JDBC:
config = {
'jdbc_username': <required>,
'jdbc_password': <required>,
'jdbc_url': <optional>, # JDBC connection url. Requires jdbc_jar and jdbc_driver to be provided.
'jdbc_jar': <optional>, # Path to JDBC driver jar. Requires jdbc_url and jdbc_driver to be provided.
'jdbc_driver': <optional>, # Classpath of JDBC driver. Requires jdbc_jar and jdbc_url to be provided.
'jdbc_default_config': <optional>, # Name of database configuration in config.toml to use. If provided, will ignore jdbc_jar, jdbc_url, jdbc_driver values.
'id_column': <optional> # Name of id column in dataset. Specify this field when making large data queries.
}
Note
Due to resource sharing within Driverless AI, the JDBC Connector is only allocated a relatively small amount of memory. When making large queries, the ID column is used to partition the data into manageable portions. This ensures that the maximum memory allocation is not exceeded. If a query that is larger than the maximum memory allocation is made without specifying an ID column, the query will not complete successfully.
Snowflake:
config = {
'snowflake_database': <required>,
'snowflake_warehouse': <required>,
'snowflake_schema': <required>,
'snowflake_region': <optional>,
'snowflake_role': <optional>,
'snowflake_formatting': <optional>, # Additional arguments for formatting the output SQL query to csv file. See snowflake documentation for "Create File Format".
'snowflake_username': <optional>,
'snowflake_password': <optional>
'snowflake_account': <optional>
}
Note
snowflake_username
and snowflake_password
are only supported in Driverless AI server versions >= 1.8.7.
For other Driverless AI server versions, credentials must be specified in config.toml.
Note
snowflake_account
is only supported in Driverless AI server versions >= 1.10.2.
API Reference:
Datasets
The datasets
attribute of a connected client provides methods to create, get, and list datasets on the Driverless AI server.
API Reference:
-
class
Datasets
Interact with datasets on the Driverless AI server.
-
create
(data: Union[str, pandas.DataFrame], data_source: str = 'upload', data_source_config: Dict[str, str] = None, force: bool = False, name: str = None) Dataset Create a dataset on the Driverless AI server and return a Dataset object corresponding to the created dataset.
Parameters: - data (
Union
[str
,ForwardRef
]) – path to data file(s) or folder, a Pandas DataFrame, or query string for SQL based data sources - data_source (
str
) – name of connector to use for data transfer (usedriverlessai.connectors.list()
to see configured names) - data_source_config (
Dict
[str
,str
]) – dictionary of configuration options for advanced connectors - force (
bool
) – create new dataset even if dataset with same name already exists - name (
str
) – dataset name on the Driverless AI server
Examples:
ds = dai.datasets.create( data='s3://h2o-public-test-data/smalldata/iris/iris.csv', data_source='s3' )
Return type: Dataset - data (
-
create_async
(data: Union[str, pandas.DataFrame], data_source: str = 'upload', data_source_config: Dict[str, str] = None, force: bool = False, name: str = None) DatasetJob Launch creation of a dataset on the Driverless AI server and return a DatasetJob object to track the status.
Parameters: - data (
Union
[str
,ForwardRef
]) – path to data file(s) or folder, a Pandas DataFrame, or query string for SQL based data sources - data_source (
str
) – name of connector to use for data transfer (usedriverlessai.connectors.list()
to see configured names) - data_source_config (
Dict
[str
,str
]) – dictionary of configuration options for advanced connectors - force (
bool
) – create new dataset even if dataset with same name already exists - name (
str
) – dataset name on the Driverless AI server
Examples:
ds = dai.datasets.create_async( data='s3://h2o-public-test-data/smalldata/iris/iris.csv', data_source='s3' )
Return type: DatasetJob - data (
-
get
(key: str) Dataset Get a Dataset object corresponding to a dataset on the Driverless AI server. If the dataset only exists on H2O.ai Storage, it will be imported to the server first.
Parameters: key ( str
) – Driverless AI server’s unique ID for the datasetExamples:
# Use the UUID of the dataset to retrieve the dataset object key = 'e7de8630-dbfb-11ea-9f69-0242ac110002' ds = dai.datasets.get(key=key)
Return type: Dataset
-
gui
() Hyperlink Get full URL for the user’s datasets page on Driverless AI server.
Examples:
dai.datasets.gui()
Return type: Hyperlink
-
list
(start_index: int = 0, count: Optional[int] = None) Sequence[Dataset] List of Dataset objects available to the user.
Parameters: - start_index (
int
) – index on Driverless AI server of first dataset to list - count (
Optional
[int
]) – max number of datasets to request from the Driverless AI server
Examples:
dai.datasets.list(start_index=10, count=5)
Return type: Sequence
[Dataset
]- start_index (
-
Experiments
API Reference:
-
class
Experiments
Interact with experiments on the Driverless AI server.
-
create
(train_dataset: Dataset, target_column: Optional[str], task: str, force: bool = False, name: Optional[str] = None, **kwargs: Any) Experiment Launch an experiment on the Driverless AI server and wait for it to complete before returning.
Parameters: - train_dataset (
Dataset
) – Dataset object - target_column (
Optional
[str
]) – name of column intrain_dataset
(ignored iftask
is'unsupervised'
) - task (
str
) – one of'regression'
,'classification'
, or'unsupervised'
- force (
bool
) – create new experiment even if experiment with same name already exists - name (
Optional
[str
]) – display name for experiment
Keyword Arguments: - accuracy (int) – accuracy setting [1-10]
- time (int) – time setting [1-10]
- interpretability (int) – interpretability setting [1-10]
- scorer (Union[str,ScorerRecipe]) – metric to optimize for
- models (Union[str,ModelRecipe]) – limit experiment to these models
- transformers (Union[str,TransformerRecipe]) – limit experiment to these transformers
- validation_dataset (Dataset) – Dataset object
- test_dataset (Dataset) – Dataset object
- weight_column (str) – name of column in
train_dataset
- fold_column (str) – name of column in
train_dataset
- time_column (str) – name of column in
train_dataset
, containing time ordering for timeseries problems - time_groups_columns (List[str]) – list of column names, contributing to time ordering
- unavailable_at_prediction_time_columns (List[str]) – list of column names, which won’t be present at prediction time (server versions >= 1.8.1)
- drop_columns (List[str]) – list of column names to be dropped
- enable_gpus (bool) – allow GPU usage in experiment
- reproducible (bool) – set experiment to be reproducible
- time_period_in_seconds (int) – the length of the time period in seconds, used in timeseries problems
- num_prediction_periods (int) – timeseries forecast horizon in time period units
- num_gap_periods (int) – number of time periods after which forecast starts
- config_overrides (str) – Driverless AI config overrides in TOML string format
Note
Any expert setting can also be passed as a
kwarg
. To search possible expert settings for your server version, useexperiments.search_expert_settings(search_term)
.Return type: Experiment
- train_dataset (
-
create_async
(train_dataset: Dataset, target_column: Optional[str], task: str, force: bool = False, name: Optional[str] = None, **kwargs: Any) Experiment Launch an experiment on the Driverless AI server and return an Experiment object to track the experiment status.
Parameters: - train_dataset (
Dataset
) – Dataset object - target_column (
Optional
[str
]) – name of column intrain_dataset
(ignored iftask
is'unsupervised'
) - task (
str
) – one of'regression'
,'classification'
, or'unsupervised'
- force (
bool
) – create new experiment even if experiment with same name already exists - name (
Optional
[str
]) – display name for experiment
Keyword Arguments: - accuracy (int) – accuracy setting [1-10]
- time (int) – time setting [1-10]
- interpretability (int) – interpretability setting [1-10]
- scorer (Union[str,ScorerRecipe]) – metric to optimize for
- models (Union[str,ModelRecipe]) – limit experiment to these models
- transformers (Union[str,TransformerRecipe]) – limit experiment to these transformers
- validation_dataset (Dataset) – Dataset object
- test_dataset (Dataset) – Dataset object
- weight_column (str) – name of column in
train_dataset
- fold_column (str) – name of column in
train_dataset
- time_column (str) – name of column in
train_dataset
, containing time ordering for timeseries problems - time_groups_columns (List[str]) – list of column names, contributing to time ordering
- unavailable_at_prediction_time_columns (List[str]) – list of column names, which won’t be present at prediction time (server versions >= 1.8.1)
- drop_columns (List[str]) – list of column names to be dropped
- enable_gpus (bool) – allow GPU usage in experiment
- reproducible (bool) – set experiment to be reproducible
- time_period_in_seconds (int) – the length of the time period in seconds, used in timeseries problems
- num_prediction_periods (int) – timeseries forecast horizon in time period units
- num_gap_periods (int) – number of time periods after which forecast starts
- config_overrides (str) – Driverless AI config overrides in TOML string format
Note
Any expert setting can also be passed as a
kwarg
. To search possible expert settings for your server version, useexperiments.search_expert_settings(search_term)
.Return type: Experiment
- train_dataset (
-
get
(key: str) Experiment Get an Experiment object corresponding to an experiment on the Driverless AI server. If the experiment only exists on H2O.ai Storage, it will be imported to the server first.
Parameters: key ( str
) – Driverless AI server’s unique ID for the experimentReturn type: Experiment
-
gui
() Hyperlink Get full URL for the experiments page on the Driverless AI server.
Return type: Hyperlink
-
import_dai_file
(path: str) Experiment Import a dai file to the Driverless AI server and return a corresponding Experiment object.
Return type: Experiment
-
leaderboard
(train_dataset: Dataset, target_column: Optional[str], task: str, force: bool = False, name: Optional[str] = None, **kwargs: Any) Project Launch an experiment leaderboard on the Driverless AI server and return a project object to track experiment statuses. Requires server version >= 1.9.0.
Parameters: - train_dataset (
Dataset
) – Dataset object - target_column (
Optional
[str
]) – name of column intrain_dataset
(ignored iftask
is'unsupervised'
) - task (
str
) – one of'regression'
,'classification'
, or'unsupervised'
- force (
bool
) – create new project even if project with same name already exists - name (
Optional
[str
]) – display name for project
Keyword Arguments: - accuracy (int) – accuracy setting [1-10]
- time (int) – time setting [1-10]
- interpretability (int) – interpretability setting [1-10]
- scorer (Union[str,ScorerRecipe]) – metric to optimize for
- models (Union[str,ModelRecipe]) – limit experiment to these models
- transformers (Union[str,TransformerRecipe]) – limit experiment to these transformers
- validation_dataset (Dataset) – Dataset object
- test_dataset (Dataset) – Dataset object
- weight_column (str) – name of column in
train_dataset
- fold_column (str) – name of column in
train_dataset
- time_column (str) – name of column in
train_dataset
, containing time ordering for timeseries problems - time_groups_columns (List[str]) – list of column names, contributing to time ordering
- unavailable_at_prediction_time_columns (List[str]) – list of column names, which won’t be present at prediction time (server versions >= 1.8.1)
- drop_columns (List[str]) – list of column names to be dropped
- enable_gpus (bool) – allow GPU usage in experiment
- reproducible (bool) – set experiment to be reproducible
- time_period_in_seconds (int) – the length of the time period in seconds, used in timeseries problems
- num_prediction_periods (int) – timeseries forecast horizon in time period units
- num_gap_periods (int) – number of time periods after which forecast starts
- config_overrides (str) – Driverless AI config overrides in TOML string format
Note
Any expert setting can also be passed as a
kwarg
. To search possible expert settings for your server version, useexperiments.search_expert_settings(search_term)
.Return type: Project
- train_dataset (
-
list
(start_index: int = 0, count: Optional[int] = None) Sequence[Experiment] List of Experiment objects available to the user.
Parameters: - start_index (
int
) – index on Driverless AI server of first experiment in list - count (
Optional
[int
]) – number of experiments to request from the Driverless AI server
Return type: Sequence
[Experiment
]- start_index (
-
preview
(train_dataset: Dataset, target_column: Optional[str], task: str, force: Optional[bool] = None, name: Optional[str] = None, **kwargs: Any) None Print a preview of experiment for the given settings.
Parameters: - train_dataset (
Dataset
) – Dataset object - target_column (
Optional
[str
]) – name of column intrain_dataset
(ignored iftask
is'unsupervised'
) - task (
str
) – one of'regression'
,'classification'
, or'unsupervised'
- force (
Optional
[bool
]) – ignored (preview
accepts the same arguments ascreate
) - name (
Optional
[str
]) – ignored (preview
accepts the same arguments ascreate
)
Keyword Arguments: - accuracy (int) – accuracy setting [1-10]
- time (int) – time setting [1-10]
- interpretability (int) – interpretability setting [1-10]
- scorer (Union[str,ScorerRecipe]) – metric to optimize for
- models (Union[str,ModelRecipe]) – limit experiment to these models
- transformers (Union[str,TransformerRecipe]) – limit experiment to these transformers
- validation_dataset (Dataset) – Dataset object
- test_dataset (Dataset) – Dataset object
- weight_column (str) – name of column in
train_dataset
- fold_column (str) – name of column in
train_dataset
- time_column (str) – name of column in
train_dataset
, containing time ordering for timeseries problems - time_groups_columns (List[str]) – list of column names, contributing to time ordering
- unavailable_at_prediction_time_columns (List[str]) – list of column names, which won’t be present at prediction time (server versions >= 1.8.1)
- drop_columns (List[str]) – list of column names to be dropped
- enable_gpus (bool) – allow GPU usage in experiment
- reproducible (bool) – set experiment to be reproducible
- time_period_in_seconds (int) – the length of the time period in seconds, used in timeseries problems
- num_prediction_periods (int) – timeseries forecast horizon in time period units
- num_gap_periods (int) – number of time periods after which forecast starts
- config_overrides (str) – Driverless AI config overrides in TOML string format
Note
Any expert setting can also be passed as a
kwarg
. To search possible expert settings for your server version, useexperiments.search_expert_settings(search_term)
.Return type: None
- train_dataset (
-
search_expert_settings
(search_term: str, show_description: bool = False) None Search expert settings and print results. Useful when looking for kwargs to use when creating experiments.
Parameters: - search_term (
str
) – term to search for (case insensitive) - show_description (
bool
) – include description in results
Return type: None
- search_term (
-
MLI
API Reference:
-
class
MLI
Interact with MLI interpretations on the Driverless AI server.
-
create
(experiment: Optional[Experiment] = None, dataset: Optional[Dataset] = None, name: Optional[str] = None, force: bool = False, **kwargs: Any) Interpretation Create a MLI interpretation on the Driverless AI server and return a Interpretation object corresponding to the created interpretation.
Parameters: - experiment (
Optional
[Experiment
]) – experiment to interpret, will use training dataset ifdataset
not specified - dataset (
Optional
[Dataset
]) – dataset to use for interpretation (if dataset includes target and prediction columns, then an experiment is not needed) - name (
Optional
[str
]) – display name for the interpretation - force (
bool
) – create new interpretation even if interpretation with same name already exists
Keyword Arguments: - explainers (List[ExplainerRecipe]) – list of explainer recipe objects
- test_dataset (Dataset) – Dataset object (timeseries only)
- target_column (str) – name of column in
dataset
- prediction_column (str) – name of column in
dataset
- weight_column (str) – name of column in
dataset
- drop_columns (List[str]) – names of columns in
dataset
Note
Any expert setting can also be passed as a
kwarg
. To search possible expert settings for your server version, usemli.search_expert_settings(search_term)
.Return type: Interpretation
- experiment (
-
create_async
(experiment: Optional[Experiment] = None, dataset: Optional[Dataset] = None, name: Optional[str] = None, force: bool = False, **kwargs: Any) Interpretation Launch creation of a MLI interpretation on the Driverless AI server and return an Interpretation object to track the status.
Parameters: - experiment (
Optional
[Experiment
]) – experiment to interpret, will use training dataset ifdataset
not specified - dataset (
Optional
[Dataset
]) – dataset to use for interpretation (if dataset includes target and prediction columns, then an experiment is not needed) - name (
Optional
[str
]) – display name for the interpretation - force (
bool
) – create new interpretation even if interpretation with same name already exists
Keyword Arguments: - explainers (List[ExplainerRecipe]) – list of explainer recipe objects (server versions >= 1.9.1)
- test_dataset (Dataset) – Dataset object (timeseries only)
- target_column (str) – name of column in
dataset
- prediction_column (str) – name of column in
dataset
- weight_column (str) – name of column in
dataset
- drop_columns (List[str]) – names of columns in
dataset
Note
Any expert setting can also be passed as a
kwarg
. To search possible expert settings for your server version, usemli.search_expert_settings(search_term)
.Return type: Interpretation
- experiment (
-
gui
() Hyperlink Print full URL for the user’s MLI page on Driverless AI server.
Return type: Hyperlink
-
property
iid
: driverlessai._mli.IIDMethods Retrieve IID interpretations.
Return type: IIDMethods
-
search_expert_settings
(search_term: str, show_description: bool = False) None Search expert settings and print results. Useful when looking for kwargs to use when creating interpretations.
Parameters: - search_term (
str
) – term to search for (case insensitive) - show_description (
bool
) – include description in results
Return type: None
- search_term (
-
property
timeseries
: driverlessai._mli.TimeseriesMethods Retrieve timeseries interpretations.
Return type: TimeseriesMethods
-
Interpretation Retrieval Methods
-
class
IIDMethods
-
get
(key: str) Interpretation Get an Interpretation object corresponding to a MLI interpretation on the Driverless AI server.
Parameters: key ( str
) – Driverless AI server’s unique ID for the MLI interpretationReturn type: Interpretation
-
list
(start_index: int = 0, count: Optional[int] = None) Sequence[Interpretation] List of Interpretation objects available to the user.
Parameters: - start_index (
int
) – index on Driverless AI server of first interpretation to list - count (
Optional
[int
]) – max number of interpretations to request from the Driverless AI server
Return type: Sequence
[Interpretation
]- start_index (
-
-
class
TimeseriesMethods
-
get
(key: str) Interpretation Get an Interpretation object corresponding to a MLI interpretation on the Driverless AI server.
Parameters: key ( str
) – Driverless AI server’s unique ID for the MLI interpretationReturn type: Interpretation
-
list
(start_index: int = 0, count: Optional[int] = None) Sequence[Interpretation] List of Interpretation objects available to the user.
Parameters: - start_index (
int
) – index on Driverless AI server of first interpretation to list - count (
Optional
[int
]) – max number of interpretations to request from the Driverless AI server
Return type: Sequence
[Interpretation
]- start_index (
-
Projects
API Reference:
-
class
Projects
Interact with projects on the Driverless AI server.
-
create
(name: str, description: Optional[str] = None, force: bool = False) Project Create a project on the Driverless AI server.
Parameters: - name (
str
) – display name for project - description (
Optional
[str
]) – description of project - force (
bool
) – create new project even if project with same name already exists
Return type: - name (
-
get
(key: str) Project Get a Project object corresponding to a project on the Driverless AI server.
Parameters: key ( str
) – Driverless AI server’s unique ID for the projectReturn type: Project
-
gui
() Hyperlink Get full URL for the projects page on the Driverless AI server.
Return type: Hyperlink
-
list
(start_index: int = 0, count: Optional[int] = None) Sequence[Project] List of Project objects available to the user.
Parameters: - start_index (
int
) – index on Driverless AI server of first project in list - count (
Optional
[int
]) – number of projects to request from the Driverless AI server
Return type: Sequence
[Project
]- start_index (
-
Recipes
API Reference:
-
class
Recipes
Create and interact with recipes on the Driverless AI server.
-
create
(recipe: str) None Create a recipe on the Driverless AI server.
Parameters: recipe ( str
) – path to recipe or url for recipeExamples:
dai.recipes.create( recipe='https://github.com/h2oai/driverlessai-recipes/blob/master/scorers/regression/explained_variance.py' )
Return type: None
-
create_async
(recipe: str) RecipeJob Launch creation of a recipe on the Driverless AI server.
Parameters: recipe ( str
) – path to recipe or url for recipeExamples:
dai.recipes.create_async( recipe='https://github.com/h2oai/driverlessai-recipes/blob/master/scorers/regression/explained_variance.py' )
Return type: RecipeJob
-
property
explainers
: driverlessai._recipes.ExplainerRecipes See explainer recipes on the Driverless AI server.
Return type: ExplainerRecipes
-
property
models
: driverlessai._recipes.ModelRecipes See model recipes on the Driverless AI server.
Return type: ModelRecipes
-
property
scorers
: driverlessai._recipes.ScorerRecipes See scorer recipes on the Driverless AI server.
Return type: ScorerRecipes
-
property
transformers
: driverlessai._recipes.TransformerRecipes See transformer recipes on the Driverless AI server.
Return type: TransformerRecipes
-
-
class
ExplainerRecipes
Interact with explainer recipes on the Driverless AI server.
Examples:
# Get list of names of all explainers [e.name for e in dai.recipes.explainers.list()]
-
list
() Sequence[ExplainerRecipe] Return list of explainer recipe objects.
Examples:
dai.recipes.explainer.list()
Return type: Sequence
[ExplainerRecipe
]
-
-
class
ModelRecipes
Interact with model recipes on the Driverless AI server.
Examples:
# Get list of all custom models [m for m in dai.recipes.models.list() if m.is_custom] # Get list of names of all models [m.name for m in dai.recipes.models.list()]
-
list
() Sequence[ModelRecipe] Return list of model recipe objects.
Examples:
dai.recipes.models.list()
Return type: Sequence
[ModelRecipe
]
-
-
class
ScorerRecipes
Interact with scorer recipes on the Driverless AI server.
Examples:
# Retrieve a list of binomial scorers [s for s in dai.recipes.scorers.list() if s.for_binomial] # Retrieve a list of multiclass scorers [s for s in dai.recipes.scorers.list() if s.for_multiclass] # Retrieve a list of regression scorers [s for s in dai.recipes.scorers.list() if s.for_regression] # Get list of all custom scorers [s for s in dai.recipes.scorers.list() if s.is_custom] # Get list of names of all scorers [s.name for s in dai.recipes.scorers.list()] # Get list of descriptions for all scorers [s.description for s in dai.recipes.scorers.list()]
-
list
() Sequence[ScorerRecipe] Return list of scorer recipe objects.
Examples:
dai.recipes.scorers.list()
Return type: Sequence
[ScorerRecipe
]
-
-
class
TransformerRecipes
Interact with transformer recipes on the Driverless AI server.
Examples:
# Get list of all custom transformers [m for m in dai.recipes.transformers.list() if m.is_custom] # Get list of names of all transformers [m.name for m in dai.recipes.transformers.list()]
-
list
() Sequence[TransformerRecipe] Return list of transformer recipe objects.
Examples:
dai.recipes.transformers.list()
Return type: Sequence
[TransformerRecipe
]
-
Get Information about the Server
The following attribute of a connected client allows you to get information about the Driverless AI server.
Server
API Reference:
-
class
Server
Get information about the Driverless AI server.
Examples:
# Connect to the DAI server dai = driverlessai.Client( address='http://localhost:12345', username='py', password='py' ) dai.server.address dai.server.username dai.server.version
-
property
address
: str URL of the Driverless AI server connected to.
Return type: str
-
docs
(search: Optional[str] = None) Hyperlink Get link to documentation on the Driverless AI server.
Parameters: search ( Optional
[str
]) – if search terms are supplied, the link will go to documentation search resultsExample:
# Search the DAI docs for "licenses" dai.server.docs(search='licenses')
Return type: Hyperlink
-
gui
() Hyperlink Get full URL for the Driverless AI server.
Examples:
dai.server.gui()
Return type: Hyperlink
-
property
license
: driverlessai._server.License Get information about the license on the Driverless AI server.
Return type: License
-
property
storage_enabled
: bool Whether the Driverless AI server is connected to H2O.ai Storage.
Return type: bool
-
property
username
: str Current user connected as to a Driverless AI server.
Return type: str
-
property
version
: str Version of Driverless AI server currently connected to.
Return type: str
-
property