Skip to content

Writing an automl script

geekjr edited this page Apr 17, 2021 · 1 revision

With quickai, it is extremely easy to write an automl script to automatically experiment with different models. In this example, we will write an automl script that will experiment with VGG16 vs. EfficientNetB0 on the same dataset that we used in the Getting Started with Image Classification tutorial. First, follow the instructions in that tutorial to download the data. Once that is done, create a new file called automl_cars.py. In that file, add the following import

from quickai import ImageClassification

Next, we will create a list with the model codes for the models we want to experiment with:

models = ["vgg16", "eb0"]

Now, we will write a for loop that will iterate over that list and train for each model in that list, and then save it:

for model in models:
    ImageClassification(model, "./train", f"cars{model}", epochs=1, graph=False)

Once you run that file, after the training is done, you will see 2 model files in the same directory as the Python script. That is how you write an automl script using quickai.

Clone this wiki locally