Skip to main content

AutoML

Manage AutoML jobs.

Access it as client.automl on a Strongly client, or the same path on AsyncStrongly with await. All methods exist on both with identical signatures.

Methods​

All methods​

create_job​

create_job(*, name: str, target_column: str, hardware: Mapping[str, Any], dataset: str | None = None, data_source_id: str | None = None, addon_id: str | None = None, read: Mapping[str, str] | None = None, output_volume_id: str | None = None, output_volume_name: str | None = None, dataset_file: str | None = None, feature_columns: Sequence[str] | None = None, problem_type: str | None = None, predictor_type: str | None = None, preset: str | None = None, time_limit: int | None = None, metric: str | None = None, environment_id: str | None = None, advanced: Mapping[str, Any] | None = None) -> AutoMLJob

Create an AutoML training job.

The trained model is written to a shared volume: an existing one (output_volume_id) or a new one the platform creates (output_volume_name). Give exactly one.

Parameters

  • name (str): The job's name.
  • target_column (str): The column to predict.
  • hardware (Mapping[str, Any]): The trainer's sizing: cpu_count, memory_gb and disk_gb (required), and gpu_count, gpu_type (e.g. nvidia-t4), use_spot (train on cheaper spot capacity, which can be reclaimed) and spot_fallback (with use_spot: True, the default, falls back to on-demand when no spot is available; False waits for spot). There is no default.
  • dataset (str | None, optional): The training data: a code/data volume id (from datasets), an s3:// path, or the s3Path a dataset upload URL answered. Give this, data_source_id or addon_id.
  • data_source_id, addon_id (str | None, optional): Train straight from a data source or an add-on, with read: the job reads it directly (it gets the source's connection as an app does), nothing is copied first.
  • read (Mapping[str, str] | None, optional): What to read from the data source or add-on, by its kind: SQL {"table": ..., "schema": ...} or {"query": ...} (read-only); document stores {"collection": ...} with an optional filter (or a MongoDB pipeline), or a query (Couchbase, ArangoDB, SurrealDB); graph {"query": ...}; vector stores {"collection": ...}; spreadsheets {"sheet": ...}; object storage {"object_key": ...} (a CSV, Parquet or JSON file, or a prefix ending in /); Redis {"key_pattern": ...}; Kafka and Pulsar {"topic": ...}. API keys, Memcached, RabbitMQ, SQS, MQTT and Marqo cannot be read.
  • output_volume_id (str | None, optional): The shared volume the trained model is written to.
  • output_volume_name (str | None, optional): The name of a new shared volume to create for the trained model.
  • dataset_file (str | None, optional): The file in the volume's data half to train on, when it holds more than one (see dataset_files).
  • feature_columns (Sequence[str] | None, optional): The columns to use as features; the platform uses every column but the target when not given.
  • problem_type (str | None, optional): tabular, multimodal or timeseries (the platform's default is tabular).
  • predictor_type (str | None, optional): auto, BinaryClassifier, MultiClassifier or Regressor.
  • preset (str | None, optional): The AutoGluon preset: medium_quality (the platform's default), good_quality, high_quality, best_quality or optimize_for_deployment.
  • time_limit (int | None, optional): The training time limit in seconds (the platform's default is 600).
  • metric (str | None, optional): The metric to optimize (the platform's default is accuracy).
  • environment_id (str | None, optional): A saved training environment's id.
  • advanced (Mapping[str, Any] | None, optional): Advanced settings by section (an omitted section keeps its defaults): for a tabular job model_selection, ensemble, data_handling, training, hpo, model_hyperparameters and custom; for a time series job timeseries (prediction_length, freq, id_column, timestamp_column, ...); for a multimodal job multimodal (text_columns, image_columns, backbone, ...). The REST API reference lists every key. A job records them as advanced_config. model_hyperparameters fixes values for a family (hpo then searches only its other hyperparameters); leave it out to train with AutoGluon's defaults, which hpo tunes.

Returns

  • AutoMLJob: The created job.

Raises

  • ValidationError: A required field or its hardware is missing, or not exactly one of output_volume_id and output_volume_name was given.

dataset_columns​

dataset_columns(dataset_id: str, *, file: str | None = None) -> list[str]

Get the column headers of a dataset file in a project volume.

Parameters

  • dataset_id (str): The dataset volume id (from datasets).
  • file (str | None, optional): Specific file key within the volume. Optional when the volume contains exactly one data file.

dataset_files​

dataset_files(dataset_id: str) -> list[dict[str, Any]]

List the data files inside a project dataset volume.

A dataset volume is a directory; this returns the files inside it so you can pick which one to train on (pass its key as dataset_file to create_job).

datasets​

datasets(*, limit: int | None = None) -> SyncPaginator[AutoMLDataset]

List the datasets AutoML can train on, a page at a time as you iterate.

A dataset is a shared code/data volume whose data half holds training files.

delete_job​

delete_job(job_id: str) -> None

Delete an AutoML job.

deploy_best_model​

deploy_best_model(job_id: str, **kwargs) -> dict[str, Any]

Publish the best model of a completed AutoML job to the model registry.

A tabular or multimodal job's model can be published (a multimodal model takes its image inputs as base64 or a data: URL); a timeseries job's is refused (not-publishable).

Parameters

  • job_id (str): The AutoML job ID.
  • **kwargs (Any): registry_name (default: the job's name) and description.

job_logs​

job_logs(job_id: str, *, lines: int | None = None, since: str | None = None) -> dict[str, Any]

Get AutoML job logs.

Parameters

  • job_id (str): The AutoML job ID.
  • lines (int | None, optional): Only the last N lines (the whole log when omitted).
  • since (str | None, optional): ISO 8601 time; only the lines written at or after it.

job_metrics​

job_metrics(job_id: str) -> dict[str, Any]

Get an AutoML job's training metrics, leaderboard, and best model.

Returns the reported metrics block: metrics, leaderboard, best_model, trial_count.

job_status​

job_status(job_id: str) -> dict[str, Any]

Get an AutoML job's lifecycle status, refreshed from its trainer.

Parameters

  • job_id (str): The AutoML job's ID.

list_jobs​

list_jobs(*, status: str | None = None, search: str | None = None, limit: int | None = None) -> SyncPaginator[AutoMLJob]

List AutoML jobs with pagination and filtering.

Parameters

  • status (str | None, optional): Filter by job status.
  • search (str | None, optional): Search by name or description.
  • limit (int | None, optional): Maximum number of items to return (default: all matching items).

retrieve_job​

retrieve_job(job_id: str) -> AutoMLJob

Get a single AutoML job by ID.

stats​

stats() -> AutoMLStats

Get AutoML overview stats.

stop_job​

stop_job(job_id: str) -> AutoMLJob

Stop a running AutoML job; returns the job, cancelled.

upload_dataset​

upload_dataset(file: str | Any, *, filename: str | None = None, content_type: str = "text/csv") -> str

Upload a training dataset and return its S3 path for create_job.

Use this when your data is local (not yet a project volume): it uploads the file straight to the platform's object store and returns the s3_path to pass as dataset to create_job.

Parameters

  • file (str | Any): A path to a data file, or a pandas DataFrame (written as CSV).
  • filename (str | None, optional): Override the stored file name (defaults to the basename, or dataset.csv for a DataFrame).
  • content_type (str, optional): MIME type of the upload (default text/csv).

Returns

  • str: The s3_path of the uploaded dataset.