Train and execute custom Python model
note
For details of AutoML SDK configuration, refer to AutoML SDK introduction and 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 instructions on importing the model to Control Tower, refer to Import model customized with AutoML SDK.