fit_predict_proba¶
- TabularCloudPredictor.fit_predict_proba(train_data: str | Path | DataFrame, test_data: str | Path | DataFrame, *, predictor_init_args: dict[str, Any], predictor_fit_args: dict[str, Any] | None = None, include_predict: bool = True, framework_version: str = '1.6', instance_type: str = 'ml.m5.2xlarge', wait: bool = True, predictions_path: str | None = None, backend_overrides: dict[str, dict[str, Any]] | None = None, **kwargs: Unpack[TrainingJobKwargs]) tuple[Series, DataFrame | Series] | DataFrame | Series | None[source]¶
Fit and predict probabilities in a single SageMaker training job.
Same as
fit_predict(), but returns class probabilities. For regression, the “probabilities” are identical to the predictions.- Parameters:
train_data (str | pathlib.Path | pd.DataFrame) – Training data, as a
pd.DataFrameor local/S3 path to a data file.test_data (str | pathlib.Path | pd.DataFrame) – Data to predict on, as a
pd.DataFrameor local/S3 path to a data file. Must contain every feature column present intrain_data.predictor_init_args (dict) – Arguments forwarded to
TabularPredictor(), e.g.{"label": "target"}.predictor_fit_args (dict | None, default = None) – Additional fit args forwarded to
TabularPredictor.fit(). Must NOT containtrain_dataortuning_data.include_predict (bool, default = True) – Whether to also return the predictions. The job always computes both, so this adds no cost.
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.instance_type (str, default = "ml.m5.2xlarge") – Instance type of the training job.
wait (bool, default = True) – Whether to block until the job completes. If
False, returnsNoneonce the job is launched.predictions_path (str | None, default = None) – S3 URL of the predictions file, ending in
.csvor.parquet. Defaults to{cloud_output_path}/{job_name}/predictions.csv.
- Returns:
tuple[pd.Series, pd.DataFrame | pd.Series] | pd.DataFrame | pd.Series | None –
(prediction, predict_probability)ifinclude_predict=True, otherwisepredict_probability. ReturnsNoneifwait=False; fetch them later withget_fit_predict_proba_results().- Other Parameters:
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}}}
job_name (str | None, default = None) – Name of the training job. Defaults to a unique name with prefix
ag-cloud-tabular.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 = 86400) – Maximum training job runtime in seconds. Defaults to 24 hours.
SageMaker API
CreateTrainingJob: trains the predictor and predicts in the same job on
instance_type. Predictions are written topredictions_path.