0

I'm trying to create an AWS machine learning model in Python BOTO:

import boto3
from boto3.session import Session
import uuid

session = Session(aws_access_key_id='...', aws_secret_access_key='...', region_name='us-west-1')
client = session.client('machinelearning')

response = client.create_ml_model(
    MLModelId=str(uuid.uuid4()),
    MLModelName='banking',
    MLModelType='BINARY',
    TrainingDataSourceId='...',
)

However, I'm getting the following error:

botocore.exceptions.EndpointConnectionError: Could not connect to the endpoint URL: "https://machinelearning.us-west-1.amazonaws.com/"

I don't believe the region_name is the problem. Could this be a permission problem?

1 Answer 1

3

Actually the region is the issue. Amazon Machine Learning is only available currently in the Virginia and Ireland regions as per documentation

enter image description here

Sign up to request clarification or add additional context in comments.

2 Comments

To add on to this, you can get a list of the regions known to be supported by a service at the time of your version of botocore's release. Docs. Be aware that you will need to update your client to get updates to this list even though you will be able to use new regions without updating.
Wow thanks, I never would have realized. Seems like the error message should mention that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.