nerdexam
Microsoft

DP-100 · Question #500

You are a data scientist working for a hotel booking website company. You use the Azure Machine Learning service to train a model that identifies fraudulent transactions. You must deploy the model as

The correct answer is C. Load the model and use it to predict labels from input data.. The Azure ML online endpoint scoring script must load the model and return real-time predictions by implementing init() and run() functions.

Train and deploy models

Question

You are a data scientist working for a hotel booking website company. You use the Azure Machine Learning service to train a model that identifies fraudulent transactions. You must deploy the model as an Azure Machine Learning online endpoint by using the Azure Machine Learning Python SDK v2. The deployed model must return real-time predictions of fraud based on transaction data input. You need to create the script that is specified as the scoring_script parameter for the CodeConfiguration class used to deploy the model. What should the entry script do?

Options

  • ARegister the model with appropriate tags and properties.
  • BCreate a Conda environment for the online endpoint compute and install the necessary Python
  • CLoad the model and use it to predict labels from input data.
  • DStart a node on the inference cluster where the model is deployed.
  • ESpecify the number of cores and the amount of memory required for the online endpoint compute.

How the community answered

(62 responses)
  • B
    3% (2)
  • C
    90% (56)
  • D
    2% (1)
  • E
    5% (3)

Why each option

The Azure ML online endpoint scoring script must load the model and return real-time predictions by implementing init() and run() functions.

ARegister the model with appropriate tags and properties.

Model registration is a one-time SDK operation performed before deployment and is not a responsibility of the scoring script.

BCreate a Conda environment for the online endpoint compute and install the necessary Python

Creating a conda environment is handled through a separate Environment object supplied to the deployment configuration, not within the scoring script itself.

CLoad the model and use it to predict labels from input data.Correct

An Azure ML scoring script must implement two required functions: init(), which runs at endpoint startup to load the trained model from the model path into memory, and run(data), which receives each inference request's input data, passes it to the loaded model, and returns the predictions. This structure is mandated by the CodeConfiguration class so the online endpoint can serve real-time requests.

DStart a node on the inference cluster where the model is deployed.

Starting inference cluster nodes is managed automatically by Azure ML infrastructure and is not controlled by the scoring script.

ESpecify the number of cores and the amount of memory required for the online endpoint compute.

Compute resource requirements such as cores and memory are set in the deployment resource configuration, not in the scoring script.

Concept tested: Azure ML online endpoint scoring script init and run function requirements

Source: https://learn.microsoft.com/en-us/azure/machine-learning/how-to-deploy-online-endpoints

Topics

#Azure Machine Learning#Model Deployment#Online Endpoints#Scoring Script

Community Discussion

No community discussion yet for this question.

Full DP-100 Practice