AzureVision (version 1.0.2)

train_model: Create, retrieve, rename and delete a model iteration

Description

Create, retrieve, rename and delete a model iteration

Usage

train_model(project, training_method = c("quick", "advanced"),
  max_time = 1, force = FALSE, email = NULL, wait = (training_method ==
  "quick"))

list_models(project, as = c("ids", "list"))

get_model(project, iteration = NULL)

rename_model(model, name, ...)

delete_model(object, ...)

# S3 method for customvision_project delete_model(object, iteration = NULL, confirm = TRUE, ...)

# S3 method for customvision_model delete_model(object, confirm = TRUE, ...)

Arguments

project

A Custom Vision project.

training_method

The training method to use. The default "quick" is faster but may be less accurate. The "advanced" method is slower but produces better results.

max_time

For advanced training, the maximum training time in hours.

force

For advanced training, whether to refit the model even if the data has not changed since the last iteration.

email

For advanced training, an email address to notify when the training is complete.

wait

whether to wait until training is complete (or the maximum training time has elapsed) before returning.

as

For list_models, the format in which to return results: as a named vector of model iteration IDs, or a list of model objects.

iteration

For get_model and delete_model.customvision_project, either the iteration name or ID.

model

A Custom Vision model.

name

For rename_model, the new name for the model.

...

Arguments passed to lower-level functions.

object

For the delete_model method, a Custom Vision project or model, as appropriate.

confirm

For the delete_model methods, whether to ask for confirmation first.

Value

For train_model, get_model and rename_model, an object of class customvision_model which is a handle to the iteration.

For list_models, based on the as argument: as="ids" returns a named vector of model iteration IDs, while as="list" returns a list of model objects.

Details

Training a Custom Vision model results in a model iteration. Each iteration is based on the current set of images uploaded to the endpoint. Successive model iterations trained on different image sets do not overwrite previous ones.

You must have at least 5 images per tag for a classification project, and 15 images per tag for an object detection project, before you can train a model.

By default, AzureVision will use the latest model iteration for actions such as prediction, showing performance statistics, and so on. You can list the model iterations with list_models, and retrieve a specific iteration by passing the iteration ID to get_model.

See Also

show_model, show_training_performance, publish_model

Examples

Run this code
# NOT RUN {
endp <- customvision_training_endpoint(url="endpoint_url", key="key")
myproj <- get_project(endp, "myproject")

train_model(myproj)
train_model(myproj, method="advanced", force=TRUE, email="me@example.com")

list_models(myproj)

mod <- get_model(myproj)
rename(mod, "mymodel")
mod <- get_model(myproj, "mymodel")

delete_model(mod)

# }

Run the code above in your browser using DataCamp Workspace