I have to manually upload the training data label CSV and click on 'train' to train the model. I want to automate all these preferably with python.
2 Answers
1
votes
You can use the google-cloud-automl to automate this with Python. For example:
from google.cloud import automl_v1beta1
client = automl_v1beta1.AutoMlClient()
parent = client.location_path('[PROJECT]', '[LOCATION]')
# Create the dataset
dataset = {} . # TODO: Initialize `dataset`
response = client.create_dataset(parent, dataset)
# Create the model
model = {} # TODO: Initialize `model`
response = client.create_model(parent, model)
def callback(operation_future):
result = operation_future.result() # Handle result
response.add_done_callback(callback)
metadata = response.metadata()