Train and execute custom Python model
note
For details of AutoML SDK configuration, refer to AutoML SDK workflow.
Train model
To train a custom Python model, follow the steps below:
Configure paths in
ModelTrainingRunnerand run it. If you don't want to implement cross-validation for Python models, in the training configuration, add thetestSetDirparameter.Specify any additional files for model execution in the
resourcesparameter ofLocalTrainingConfigurationas 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.