fit¶
- TabularCloudPredictor.fit(train_data: str | Path | DataFrame | None = None, *, tuning_data: str | Path | DataFrame | None = None, predictor_init_args: dict[str, Any], predictor_fit_args: dict[str, Any] | None = None, image_column: str | None = None, leaderboard: bool = True, framework_version: str = '1.6', job_name: str | None = None, instance_type: str = 'ml.m5.2xlarge', instance_count: int | str = 'auto', volume_size: int = 100, custom_image_uri: str | None = None, timeout: int = 86400, wait: bool = True, backend_overrides: dict[str, dict[str, Any]] | None = None, **kwargs) CloudPredictor¶
Fit the predictor in a SageMaker training job.
- Parameters:
train_data (str | pathlib.Path | pd.DataFrame) – Training data, as a
pd.DataFrameor local/S3 path to a data file.tuning_data (str | pathlib.Path | pd.DataFrame | None, default = None) – Optional tuning data.
predictor_init_args (dict) – Arguments forwarded to the underlying predictor’s constructor, e.g.
{"label": "target"}.predictor_fit_args (dict | None, default = None) – Additional fit args forwarded to the underlying predictor’s
fit(). Must NOT containtrain_dataortuning_data— pass those as explicit arguments above.leaderboard (bool, default = True) – Whether to save the leaderboard in the output artifact, so that
leaderboard()can read it.framework_version (str, optional) – AutoGluon version, e.g.
"1.6". Training uses the official AutoGluon DLC image for this version. Ignored ifcustom_image_uriis set.job_name (str | None, default = None) – Name of the training job. If
None, a unique name with prefixag-cloud-<predictor_type>is generated.instance_type (str, default = "ml.m5.2xlarge") – Instance type of the training job.
instance_count (int | str, default = "auto") – Number of training instances. Only single-instance training is supported, so this is always 1.
volume_size (int, default = 100) – Size in GB of the EBS volume that stores the training data and model artifacts.
custom_image_uri (str | None, default = None) – Custom training container image URI. If set,
framework_versionis ignored.timeout (int, default = 24*60*60) – Maximum training job runtime in seconds.
wait (bool, default = True) – Whether to block until the job completes. If
False, returns once the job is launched; useget_fit_job_status()to poll it.backend_overrides (dict[str, dict[str, Any]] | None, default = None) –
Raw SageMaker request fields for settings without a dedicated argument.
Keys: request names from the SageMaker API section below.
Values: request fields in PascalCase, as in the SageMaker API and boto3. Deep-merged over the request built by AutoGluon-Cloud; lists and other non-dict values replace the generated ones.
Example:
{"CreateTrainingJob": {"RetryStrategy": {"MaximumRetryAttempts": 2}}}
- Returns:
CloudPredictor – The fitted predictor (
self).
SageMaker API
CreateTrainingJob: trains the predictor on
instance_countxinstance_typeand writes the artifact tocloud_output_path.