question

GuidoSalimbeni-7096 avatar image
0 Votes"
GuidoSalimbeni-7096 asked virenrawat-8150 answered

Why would I need to register a machine learning model with azure endpoint?

Hi,
It appears to me that the types of models that can be registered using the azure SDK should come from sklearn, Keras, etc and be converted into a pickle file and after registration, you can send the request to the endpoint.

I can think of a very limited number of cases where you just want to create a backend system that only returns the model prediction. In most cases, the backend of a front end application would take care of all the calculations and sometimes also decide which models to run and maybe combine the results before sending the output to the frontend. For this reason, you might want to implement the complex logic in rest API such as Flask. In this case, why would I call another endpoint from the flask application to run the model, instead of simply loading the pickle file in the flask project?

What are the cases where you are registering with Azure endpointst and actually using the endpoints to make a prediction in azure from you trained model? Are you limited to specific libraries to create the pickles? what if you need to process the input before making the predictions?

thanks

azure-machine-learning
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

GiftA-MSFT avatar image
0 Votes"
GiftA-MSFT answered GiftA-MSFT commented

Hi, registering a model creates a logical container for the one or more files that make up your model. In addition to the content of the model file itself, a registered model also stores model metadata, including model description, tags, and framework information, that is useful when managing and deploying the model in your workspace. For example, with tags you can categorize your models and apply filters when listing models in your workspace. After registration, you can then download or deploy the registered model and receive all the files and metadata that were registered. The following sample shows how to register a model specifying tags and a description. The following sample shows how to register a model specifying framework, input and output datasets, and resource configuration.


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Dear @GifA-MSFT,
thank you for the answer, however is still not clear to me when would you use it as an alternative to a Rest API:

example: imagine the following logic: 3 inputs in the request: {isCEO : yes/no, age: float, location: categorical} if isCEO is yes return null, if isCEO is no return the output of a regression model over the 2 other inputs.

1) One can think of a Flask API that check the isCEO with an if statement and then run or not run a prediction with the pickle file of the regression model.
2) If I have registered the model in azure what would be the options in this example?

3) you mentioned that registering a model creates a logical container for the one or more file that make up your model? if in the above example the if statement was in a different file, how would you register all the component of the application (the if statement and the regression model)?

0 Votes 0 ·
GiftA-MSFT avatar image GiftA-MSFT GuidoSalimbeni-7096 ·

It seems you're looking for a way to trigger your pipeline based on a condition correct? If so, consider using services such as Logic Apps to implement logic for running your pipeline. A registered model simply stores model metadata that is useful when managing and deploying the model in your workspace (not necessarily components to an application). The following sample shows how to register a model specifying framework, input and output datasets, and resource configuration.


0 Votes 0 ·
GuidoSalimbeni-7096 avatar image
0 Votes"
GuidoSalimbeni-7096 answered

Dear @GifA-MSFT,
thank you for the answer, however is still not clear to me when would you use it as an alternative to a Rest API:

example: imagine the following logic: 3 inputs in the request: {isCEO : yes/no, age: float, location: categorical} if isCEO is yes return null, if isCEO is no return the output of a regression model over the 2 other inputs.

1) One can think of a Flask API that check the isCEO with an if statement and then run or not run a prediction with the pickle file of the regression model.
2) If I have registered the model in azure what would be the options in this example?

3) you mentioned that registering a model creates a logical container for the one or more file that make up your model? if in the above example the if statement was in a different file, how would you register all the component of the application (the if statement and the regression model)?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

virenrawat-8150 avatar image
0 Votes"
virenrawat-8150 answered

As an example of machine learning components that are needed for a deployed service, they are:

  • Model files (for example, Pytorch files) that define the implementation of the model You wish to deploy


  • Execution code runs within the service to analyze inputs and apply the model.

You can use Azure Machine Learnings to deploy the model and the code to be updated, but the code can remain the same. As we define "registering the model,” the process of uploading a model separate from code is referred to as that.

You register a model, and it is uploaded to the cloud (in the default account for your workspace) and then mounted to the same compute where your web service is running.


Ensure that only models that you create or that you obtain from a trustworthy source are used. There have been security vulnerabilities discovered in a number of popular formats for serialized models. It is also possible for models to be intentionally built with the intention of generating inaccurate or biased results.
It is important to realize that the computing target you choose to host your model will influence the cost and availability of the endpoint. Choose an appropriate compute target from the table below.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.