Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Use an Amazon S3 bucket for input and output

Focus mode
Use an Amazon S3 bucket for input and output - Amazon SageMaker AI

Set up a S3 bucket to upload training datasets and save training output data for your hyperparameter tuning job.

To use a default S3 bucket

Use the following code to specify the default S3 bucket allocated for your SageMaker AI session. prefix is the path within the bucket where SageMaker AI stores the data for the current training job.

sess = sagemaker.Session() bucket = sess.default_bucket() # Set a default S3 bucket prefix = 'DEMO-automatic-model-tuning-xgboost-dm'

To use a specific S3 bucket (Optional)

If you want to use a specific S3 bucket, use the following code and replace the strings to the exact name of the S3 bucket. The name of the bucket must contain sagemaker, and be globally unique. The bucket must be in the same AWS Region as the notebook instance that you use for this example.

bucket = "sagemaker-your-preferred-s3-bucket" sess = sagemaker.Session( default_bucket = bucket )
Note

The name of the bucket doesn't need to contain sagemaker if the IAM role that you use to run the hyperparameter tuning job has a policy that gives the S3FullAccess permission.

Next Step

Download, Prepare, and Upload Training Data

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.