0

i'm using API to load my data and make prediction. I have seen documentation to train model using code (https://learn.microsoft.com/en-us/azure/cognitive-services/Custom-Vision-Service/python-tutorial) but I can't figure how to chose training time of my model using the API?

edit: curently i'm importing data using code, training model using azure portal, and making prediction with code

edit2: more info about global process i'm using Azure congitive service to do an image classification task, multiclass (images can belong to only 1 label).

akhetos
  • 686
  • 1
  • 10
  • 31
  • Please elaborate on the point when you say "how to chose training time of my model using the API" What do you want to achieve it here... – Mohit Verma Jan 07 '20 at 08:55
  • In the tutorial in the part "Train the classifier and publish" the author train his classifier. But in azure portal we can choose to train the classifier from 1 hours to 24 hours (and we pay depending the training time). I want to be able to choose to train my classifier for, for example, 3hours – akhetos Jan 07 '20 at 09:00
  • Sure let me take a look and get back. – Mohit Verma Jan 07 '20 at 09:01

1 Answers1

1

Basically to queue project for training, you have to use below API :

POST {Endpoint}/customvision/v3.0/training/projects/{projectId}/train?trainingType={trainingType}&reservedBudgetInHours={reservedBudgetInHours}&forceTrain={forceTrain}&notificationEmailAddress={notificationEmailAddress}

trainingType should be advanced in case if you want to give hours for computing and you have to provide reservedBudgetInHours in number for computing hours.

trainingType string The type of training to use to train the project (default: Regular).

reservedBudgetInHours The number of hours reserved as budget for training (if applicable).

Additional reference:

https://learn.microsoft.com/en-us/rest/api/cognitiveservices/customvisiontraining/trainproject/trainproject

If you are looking for a way to do it using SDK , then you have to use following method:

train_project(project_id, training_type=None, reserved_budget_in_hours=0, force_train=False, notification_email_address=None, custom_headers=None, raw=False, **operation_config)

Reference:

https://learn.microsoft.com/en-us/python/api/azure-cognitiveservices-vision-customvision/azure.cognitiveservices.vision.customvision.training.custom_vision_training_client.customvisiontrainingclient?view=azure-python#train-project-project-id--training-type-none--reserved-budget-in-hours-0--force-train-false--notification-email-address-none--custom-headers-none--raw-false----operation-config-

Hope it helps.

Mohit Verma
  • 5,140
  • 2
  • 12
  • 27