Skip to content

Train and host MindsDB models

The following section explaines how to train and host models using Amazon SageMaker console.

Create Train Job

Follow the steps below to successfully start a train job and use MindsDB to create the models: 1. Open the Amazon SageMaker console at

  1. From the left panel choose Create Training Job and provide the following information
  2. Job name
  3. IAM role - it’s best if you provide AmazonSageMakeFullAccess IAM policy
  4. Algorithm source - Your own algorithm container in ECR

  5. Provide container ECR path

  6. Container - the ECR registry Image URI that we have pushed
  7. Input mode - File

  8. Resource configuration - leave the default instance type and count

  9. Hyperparameters - MindsDB requires to_predict column name, so it knows which column we want to predict, e.g.

  10. Key - to_predict
  11. Value - Class(the column in diabetes dataset)

  12. Input data configuration

  13. Channel name - training
  14. Data source - s3
  15. S3 location - path to the s3 bucket where the dataset is located

7.Output data configuration - path to the s3 where the models will be saved

Model creation

Create model and add the required settings: 1. Model name - must be unique

  1. IAM role - it’s best if you provide AmazonSageMakeFullAccess IAM policy

  2. Container input options

  3. Provide model artifacts and inference image location
  4. Use a single model
  5. Location of the inference code -
  6. Location of model artifacts - path to model.tar.gz inside s3 bucket.

Endpoint configuration

In the endpoint configuration, add the models to deploy, and the hardware requirements:

  1. Endpoint configuration name.
  2. Add model - select the previously created model.
  3. Choose Create endpoint configuration.

Create endpoint

The last step is to create endpoint and provide endpoint configuration that specify which models to deploy and the requirements:

  1. Endpoint name.
  2. Attach endpoint configuration - select the previously created endpoint configuration.
  3. Choose Create endpoint.

After finishing the above steps, SageMaker will create a new instance and start the inference code.