1 Answer
- Newest
- Most votes
- Most comments
0
Hi there,
The documentation is correct, the error you are getting is most likely because you are using an older version of boto3 which has not yet implemented all of the features for create_auto_ml_job_v2
. Please ensure that boto3 is updated to version 1.28.2
by running the following command in a new cell in your notebook & then restart the kernel:
!pip install boto3==1.28.2
I have tested this with one of our sample notebooks and got the AutoML job to start without issue, see the sample code provided below:
input_data_config = [
{
"DataSource": {
"S3DataSource": {
"S3DataType": "S3Prefix",
"S3Uri": "s3://{}/{}/train".format(bucket, prefix),
}
},
}
]
job_config = {
'TabularJobConfig': {
'CandidateGenerationConfig': {
'AlgorithmsConfig': [
{
'AutoMLAlgorithms': [
'xgboost','lightgbm'
]
},
]
},
"TargetAttributeName": target,
"Mode": "ENSEMBLING",
}
}
output_data_config = {"S3OutputPath": "s3://{}/{}/output".format(bucket, prefix)}
from time import gmtime, strftime, sleep
import boto3
timestamp_suffix = strftime("%Y%m%d-%H-%M", gmtime())
auto_ml_job_name = "automl-housing-" + timestamp_suffix
print("AutoMLJobName: " + auto_ml_job_name)
client = boto3.client("sagemaker")
client.create_auto_ml_job_v2(
AutoMLJobName=auto_ml_job_name,
AutoMLJobInputDataConfig=input_data_config,
OutputDataConfig=output_data_config,
AutoMLProblemTypeConfig=job_config,
# Uncomment to automatically deploy an endpoint
# ModelDeployConfig={
#'AutoGenerateEndpointName': True,
#'EndpointName': 'autopilot-DEMO-housing-' + timestamp_suffix
# },
RoleArn=role,
)
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated a year ago