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_gbanddisk_gb(required), andgpu_count,gpu_type(one oflist_gpu_options; any other is a 400),use_spot(train on cheaper spot capacity, which can be reclaimed) andspot_fallback(withuse_spot:True, the default, falls back to on-demand when no spot is available;Falsewaits for spot). There is no default.dataset(str | None, optional): The training data: a code/data volume id (fromdatasets), ans3://path, or thes3Patha dataset upload URL answered. Give this,data_source_idoraddon_id.data_source_id, addon_id(str | None, optional): Train straight from a data source or an add-on, withread: 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 optionalfilter(or a MongoDBpipeline), or aquery(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 (seedataset_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,multimodalortimeseries(the platform's default istabular).predictor_type(str | None, optional):auto,BinaryClassifier,MultiClassifierorRegressor.preset(str | None, optional): The AutoGluon preset:medium_quality(the platform's default),good_quality,high_quality,best_qualityoroptimize_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 isaccuracy).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 jobmodel_selection,ensemble,data_handling,training,hpo,model_hyperparametersandcustom; for a time series jobtimeseries(prediction_length,freq,id_column,timestamp_column, ...); for a multimodal jobmultimodal(text_columns,image_columns,backbone, ...). The REST API reference lists every key. A job records them asadvanced_config.model_hyperparametersfixes values for a family (hpothen searches only its other hyperparameters); leave it out to train with AutoGluon's defaults, whichhpotunes.
Returns
AutoMLJob: The created job.
Raises
ValidationError: A required field or its hardware is missing, or not exactly one ofoutput_volume_idandoutput_volume_namewas 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 (fromdatasets).file(str | None, optional): Specific file key within the volume. Optional when the volume contains exactly one data file.
dataset_download_link
dataset_download_link(job_id: str) -> DownloadLink
Return a signed link (5 minutes) to the dataset file an AutoML job trained on.
dataset_files
dataset_files(dataset_id: str) -> AutoMLDatasetFiles
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).
Parameters
dataset_id(str): The dataset volume id (fromdatasets).
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 and the experiment runs it created.
Stops the job if it is running and deletes its stored model and artifacts, its staged dataset (unless another job trains on it), and the experiment runs the job created: its run and one run per model it trained, with their metrics and artifacts. Runs you logged yourself are kept, even ones nested under the job's run. This cannot be undone.
deploy_best_model
deploy_best_model(job_id: str, *, registry_name: str | None = None, description: str | None = None) -> AutoMLPublished
Publish the best model of a completed AutoML job to the model registry and serve it.
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.registry_name(str | None, optional): The model's name in the registry; the job's name when omitted.description(str | None, optional): The model's description; one naming the job when omitted.
download_dataset
download_dataset(job_id: str, dst_path: str | os.PathLike[str] | None = None) -> str
Download the dataset file an AutoML job trained on; return where it was saved.
The file is the one it staged: an uploaded file, or a feature service job's entity/label file. A job that read a volume or a data source staged none.
It comes straight from storage through a signed link
(dataset_download_link), written to disk as it arrives.
dst_path is a file, or a folder to save it in (default: its name, in
the current folder).
Parameters
job_id(str): The AutoML job ID.dst_path(str | os.PathLike | None, optional): Where to save it.
job_logs
job_logs(job_id: str, *, lines: int | None = None, since: str | None = None) -> AutoMLLogs
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) -> AutoMLJobMetrics
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) -> AutoMLJobStatus
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[AutoMLJobSummary]
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 pandasDataFrame(written as CSV).filename(str | None, optional): Override the stored file name (defaults to the basename, ordataset.csvfor a DataFrame).content_type(str, optional): MIME type of the upload (defaulttext/csv).
Returns
str: Thes3_pathof the uploaded dataset.