Update a Model with Feedback

After you add feedback images to the correct classes in the dataset, you retrain the dataset to incorporate the new data into the model.

You have two options:

  • Create a new model—Train the dataset using the feedback images and generate a new model. This method creates a model with a new model ID.

  • Update an existing model—Train the dataset using the feedback images and update an existing model. When you update a model it maintains the model ID, so if you’re using that model ID in production code, you don’t need to update it.

To create a model with the dataset feedback, you call the /train resource and pass in the dataset ID as you normally would, but you also pass in this request parameter:

"trainParams": {"withFeedback" : true}

The withFeedback parameter specifies that the training operation use the feedback examples to create the model. This cURL call trains a dataset and uses the feedback examples.

This command has double quotes and escaped double quotes around withFeedback to run on Windows. You might need to reformat it to run on another OS. For more information, see Train a Dataset.

The response looks as you would expect from any training call. The trainParams field shows that the training uses feedback examples.

If you want to update an existing model with the feedback in the dataset and keep the model ID, you can call the /retrain resource and pass in this request parameter.

"trainParams": {"withFeedback" : true}

This approach is useful when you have a model in production and you want to maintain the model ID. This cURL call trains the dataset associated with the specified model, uses the feedback examples, and updates the model.

This command has double quotes and escaped double quotes around withFeedback to run on Windows. You might need to reformat it to run on another OS. For more information, see Retrain a Dataset.

The response looks as you would expect from any training call. The only difference is that this response contains the same modelId that was passed in. The trainParams field shows that the retraining uses feedback examples.