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, dataset: str, target_column: str, dataset_file: Optional[str] = None, feature_columns: Optional[Sequence[str]] = None, problem_type: str = "tabular", predictor_type: str = "auto", preset: str = "medium_quality", time_limit: int = 600, metric: str = "accuracy", hardware: Optional[Mapping[str, Any]] = None, environment_id: Optional[str] = None, advanced: Optional[Mapping[str, Any]] = None) -> AutoMLJob

Create a new AutoML training job from a project dataset.

Datasets are not uploaded by the SDK. They are S3-backed project volumes, either uploaded through the UI or attached to a project. Reference one by its volume id (from datasets()), or pass an s3:// path or a URL directly.

Args: name: Job name. dataset: Dataset reference: a project volume id (from datasets()), an s3:// path, or a URL. target_column: The column to predict. dataset_file: File key within the volume, when it holds more than one data file (see dataset_files()). feature_columns: Subset of columns to use as features (default: all non-target columns). problem_type: Data modality: tabular (default), multimodal, or timeseries. predictor_type: auto (default, AutoGluon infers), BinaryClassifier, MultiClassifier, or Regressor. preset: AutoGluon quality preset (default medium_quality). time_limit: Training time limit in seconds (default 600). metric: Optimization metric (default accuracy). hardware: Pod sizing {cpu_count, memory_gb, disk_gb, gpu_count}. Defaults to cpu_count=4, memory_gb=16, disk_gb=20, gpu_count=0. environment_id: Training environment id; "custom" (default) or an existing environment id. advanced: Free-form advanced AutoGluon settings.

# Pick a project dataset, inspect its columns, then train.
datasets = client.automl.datasets()["datasets"]
dataset_id = datasets[0]["_id"]
columns = client.automl.dataset_columns(dataset_id)

job = client.automl.create_job(
name="churn-automl",
dataset=dataset_id,
target_column=columns[-1],
preset="best_quality",
time_limit=1800,
)

datasets

datasets() -> Dict[str, Any]

List available project datasets (S3-backed volumes) for AutoML. Returns {"datasets": [...], "projects": [...]}; each dataset has an _id, name, s3Location, format, and sizeGB.

dataset_files

dataset_files(dataset_id: str) -> List[Dict[str, Any]]

List the data files inside a project dataset volume. A volume is a directory; use this to find the file to train on, then pass its key as dataset_file to create_job.

dataset_columns

dataset_columns(dataset_id: str, *, file: Optional[str] = None) -> List[str]

Get the column headers of a dataset file in a project volume (to choose the target and feature columns). file is optional when the volume holds exactly one data file.

upload_dataset

upload_dataset(file: Union[str, Any], *, filename: Optional[str] = None, content_type: str = "text/csv") -> str

Upload a local 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 path to train on.

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

import pandas as pd

df = pd.read_csv("titanic.csv")
s3_path = client.automl.upload_dataset(df, filename="titanic.csv")
job = client.automl.create_job(
name="titanic-automl",
dataset=s3_path,
target_column="Survived",
)

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]

Deploy the best model from a completed AutoML job.

Args: job_id: The AutoML job ID. **kwargs: Additional deployment parameters.

job_metrics

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

Get a job's training metrics, leaderboard, and best model. Returns { metrics, leaderboard, best_model, trial_count }.

m = client.automl.job_metrics(job.id)
print(m["best_model"], m["leaderboard"])

job_logs

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

Get AutoML job logs.

Args: job_id: The AutoML job ID. lines: Number of log lines to return. since: ISO date string; return logs since this time.

list_jobs

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

List AutoML jobs with pagination and filtering.

Args: status: Filter by job status. search: Search by name or description. limit: 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) -> Dict[str, Any]

Stop a running AutoML job.