AutoMLV2 — sagemaker 2.247.0 documentation (original) (raw)

A class for SageMaker AutoML V2 Jobs.

class sagemaker.automl.automlv2.AutoMLTabularConfig(target_attribute_name, algorithms_config=None, feature_specification_s3_uri=None, generate_candidate_definitions_only=None, mode=None, problem_type=None, sample_weight_attribute_name=None, max_candidates=None, max_runtime_per_training_job_in_seconds=None, max_total_job_runtime_in_seconds=None)

Bases: object

Configuration of a tabular problem.

Parameters:

target_attribute_name_: str_

algorithms_config_: List[str] | None_ = None

feature_specification_s3_uri_: str | None_ = None

generate_candidate_definitions_only_: bool | None_ = None

mode_: str | None_ = None

problem_type_: str | None_ = None

sample_weight_attribute_name_: str | None_ = None

max_candidates_: int | None_ = None

max_runtime_per_training_job_in_seconds_: int | None_ = None

max_total_job_runtime_in_seconds_: int | None_ = None

classmethod from_response_dict(api_problem_type_config)

Convert the API response to the native object.

Parameters:

api_problem_type_config (dict) –

to_request_dict()

Convert the native object to the API request format.

class sagemaker.automl.automlv2.AutoMLImageClassificationConfig(max_candidates=None, max_runtime_per_training_job_in_seconds=None, max_total_job_runtime_in_seconds=None)

Bases: object

Configuration of an image classification problem.

Parameters:

max_candidates_: int | None_ = None

max_runtime_per_training_job_in_seconds_: int | None_ = None

max_total_job_runtime_in_seconds_: int | None_ = None

classmethod from_response_dict(api_problem_type_config)

Convert the API response to the native object.

Parameters:

api_problem_type_config (dict) –

to_request_dict()

Convert the native object to the API request format.

class sagemaker.automl.automlv2.AutoMLTextClassificationConfig(content_column, target_label_column, max_candidates=None, max_runtime_per_training_job_in_seconds=None, max_total_job_runtime_in_seconds=None)

Bases: object

Configuration of a text classification problem.

Parameters:

content_column_: str_

target_label_column_: str_

max_candidates_: int | None_ = None

max_runtime_per_training_job_in_seconds_: int | None_ = None

max_total_job_runtime_in_seconds_: int | None_ = None

classmethod from_response_dict(api_problem_type_config)

Convert the API response to the native object.

Parameters:

api_problem_type_config (dict) –

to_request_dict()

Convert the native object to the API request format.

class sagemaker.automl.automlv2.AutoMLTextGenerationConfig(base_model_name=None, accept_eula=None, text_generation_hyper_params=None, max_candidates=None, max_runtime_per_training_job_in_seconds=None, max_total_job_runtime_in_seconds=None)

Bases: object

Configuration of a text generation problem.

Parameters:

base_model_name_: str | None_ = None

accept_eula_: bool | None_ = None

text_generation_hyper_params_: Dict[str, str] | None_ = None

max_candidates_: int | None_ = None

max_runtime_per_training_job_in_seconds_: int | None_ = None

max_total_job_runtime_in_seconds_: int | None_ = None

classmethod from_response_dict(api_problem_type_config)

Convert the API response to the native object.

Parameters:

api_problem_type_config (dict) –

to_request_dict()

Convert the native object to the API request format.

class sagemaker.automl.automlv2.AutoMLTimeSeriesForecastingConfig(forecast_frequency, forecast_horizon, item_identifier_attribute_name, target_attribute_name, timestamp_attribute_name, grouping_attribute_names=None, feature_specification_s3_uri=None, forecast_quantiles=None, holiday_config=None, aggregation=None, filling=None, max_candidates=None, max_runtime_per_training_job_in_seconds=None, max_total_job_runtime_in_seconds=None)

Bases: object

Configuration of a time series forecasting problem.

Parameters:

forecast_frequency_: str_

forecast_horizon_: int_

item_identifier_attribute_name_: str_

target_attribute_name_: str_

timestamp_attribute_name_: str_

grouping_attribute_names_: List[str] | None_ = None

feature_specification_s3_uri_: str | None_ = None

forecast_quantiles_: List[str] | None_ = None

holiday_config_: List[str] | None_ = None

aggregation_: Dict[str, str] | None_ = None

filling_: Dict[str, str] | None_ = None

max_candidates_: int | None_ = None

max_runtime_per_training_job_in_seconds_: int | None_ = None

max_total_job_runtime_in_seconds_: int | None_ = None

classmethod from_response_dict(api_problem_type_config)

Convert the API response to the native object.

Parameters:

api_problem_type_config (dict) –

to_request_dict()

Convert the native object to the API request format.

class sagemaker.automl.automlv2.AutoMLDataChannel(s3_data_type, s3_uri, channel_type=None, compression_type=None, content_type=None)

Bases: object

Class to represnt the datasource which will be used for mode training.

Parameters:

s3_data_type_: str_

s3_uri_: str_

channel_type_: str | None_ = None

compression_type_: str | None_ = None

content_type_: str | None_ = None

classmethod from_response_dict(data_channel)

Convert the API response to the native object.

Parameters:

data_channel (dict) –

to_request_dict()

Convert the native object to the API request format.

class sagemaker.automl.automlv2.LocalAutoMLDataChannel(data_type, path, channel_type=None, compression_type=None, content_type=None)

Bases: object

Class to represnt a local datasource which will be uploaded to S3.

Parameters:

data_type_: str_

path_: str_

channel_type_: str | None_ = None

compression_type_: str | None_ = None

content_type_: str | None_ = None

class sagemaker.automl.automlv2.AutoMLV2(problem_config, base_job_name=None, output_path=None, job_objective=None, validation_fraction=None, auto_generate_endpoint_name=None, endpoint_name=None, output_kms_key=None, role=None, volume_kms_key=None, encrypt_inter_container_traffic=None, vpc_config=None, tags=None, sagemaker_session=None)

Bases: object

A class for creating and interacting with SageMaker AutoMLV2 jobs.

Initialize an AutoMLV2 object.

Parameters:

Returns:

AutoMLV2 object.

classmethod from_auto_ml(auto_ml)

Create an AutoMLV2 object from an AutoML object.

This method maps AutoML properties into an AutoMLV2 object, so you can create AutoMLV2 jobs from the existing AutoML objects.

Parameters:

auto_ml (sagemaker.automl.automl.AutoML) – An AutoML object from which an AutoMLV2 object will be created.

Return type:

AutoMLV2

fit(inputs, wait=True, logs=True, job_name=None)

Create an AutoML Job with the input dataset.

Parameters:

classmethod attach(auto_ml_job_name, sagemaker_session=None)

Attach to an existing AutoML job.

Creates and returns a AutoML bound to an existing automl job.

Parameters:

Returns:

A AutoMLV2 instance with the attached automl job.

Return type:

sagemaker.automl.AutoML

describe_auto_ml_job(job_name=None)

Returns the job description of an AutoML job for the given job name.

Parameters:

job_name (str) – The name of the AutoML job to describe. If None, will use object’s latest_auto_ml_job name.

Returns:

A dictionary response with the AutoML Job description.

Return type:

dict

best_candidate(job_name=None)

Returns the best candidate of an AutoML job for a given name.

Parameters:

job_name (str) – The name of the AutoML job. If None, object’s _current_auto_ml_job_name will be used.

Returns:

A dictionary with information of the best candidate.

Return type:

dict

list_candidates(job_name=None, status_equals=None, candidate_name=None, candidate_arn=None, sort_order=None, sort_by=None, max_results=None)

Returns the list of candidates of an AutoML job for a given name.

Parameters:

Returns:

A list of dictionaries with candidates information.

Return type:

list

create_model(name, sagemaker_session=None, candidate=None, vpc_config=None, enable_network_isolation=False, model_kms_key=None, predictor_cls=None, inference_response_keys=None)

Creates a model from a given candidate or the best candidate from the job.

Parameters:

Returns:

PipelineModel object.

deploy(initial_instance_count, instance_type, serializer=None, deserializer=None, candidate=None, sagemaker_session=None, name=None, endpoint_name=None, tags=None, wait=True, vpc_config=None, enable_network_isolation=False, model_kms_key=None, predictor_cls=None, inference_response_keys=None, volume_size=None, model_data_download_timeout=None, container_startup_health_check_timeout=None)

Deploy a candidate to a SageMaker Inference Pipeline.

Parameters:

Returns:

If predictor_cls is specified, the invocation of self.predictor_cls on the created endpoint name. Otherwise, None.

Return type:

Optional[Callable[[string, sagemaker.session.Session], Any]]

classmethod validate_and_update_inference_response(inference_containers, inference_response_keys)

Validates the requested inference keys and updates response content.

On validation, also updates the inference containers to emit appropriate response content in the inference response.

Parameters:

Raises:

ValueError – if one or more of inference_response_keys are unsupported by the model

class sagemaker.automl.automlv2.AutoMLJobV2(sagemaker_session, job_name, inputs)

Bases: _Job

A class for interacting with CreateAutoMLJobV2 API.

Placeholder docstring

classmethod start_new(auto_ml, inputs)

Create a new Amazon SageMaker AutoMLV2 job from auto_ml_v2 object.

Parameters:

Returns:

Constructed object that captures all information about the started AutoMLV2 job.

Return type:

sagemaker.automl.AutoMLJobV2

describe()

Returns a response from the DescribeAutoMLJobV2 API call.

wait(logs=True)

Wait for the AutoML job to finish.

Parameters:

logs (bool) – indicate whether to output logs.