Skip to main content
Version: 10.3.1

Train and execute custom Python model

note

For details of AutoML SDK configuration, refer to the Get started with AutoML SDK section.

Train model

To train a custom Python model, follow the steps below:

  1. Configure paths in ModelTrainingRunner and run it. If you don't want to implement cross validation for Python models, in the training configuration, add the testSetDir parameter.

  2. Specify any additional files for model execution in the resources parameter of LocalTrainingConfiguration as shown below:

    LocalTrainingConfiguration configuration = LocalTrainingConfiguration.builder()
    .id(modelId)
    .inputDir(trainingSet)
    .outputDir(outputDirPath)
    .testSetDir(testSetDirPath)
    .resource("models", resourcesDirPath) //add this parameter if you have some additional resources for model execution
    .parameters(parameters)
    .build();

Execute model

Configure the paths to the input, trained model, and output directories in the ModelExecutionRunner class and run the model.

Import model to Control Tower

For importing models to Control Tower, use the following instructions:

TROUBLESHOOTING

In case you have issues when running a Python model, read the Issues related to incorrect Python configuration guide.