exam questions

Exam DP-100 All Questions

View all questions & answers for the DP-100 exam

Exam DP-100 topic 5 question 2 discussion

Actual exam question from Microsoft's DP-100
Question #: 2
Topic #: 5
[All DP-100 Questions]

HOTSPOT -
You write code to retrieve an experiment that is run from your Azure Machine Learning workspace.
The run used the model interpretation support in Azure Machine Learning to generate and upload a model explanation.
Business managers in your organization want to see the importance of the features in the model.
You need to print out the model features and their relative importance in an output that looks similar to the following.

How should you complete the code? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
jiglesia22
Highly Voted 2 years, 7 months ago
The correct answer is: 1. client = ExplanationClient.from_run_id() (from_run requires just one parameter and three are being passed here) 2. explanation = client.download_model_explanation() 3. explanation.get_feature_importance_dict() As dev2dev pointed out: https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/machine-learning/how-to-machine-learning-interpretability-automl.md Check out in addition: https://docs.microsoft.com/es-es/python/api/azureml-interpret/azureml.interpret.explanationclient?view=azure-ml-py
upvoted 50 times
...
rishi_ram
Highly Voted 2 years, 4 months ago
client = ExplanationClient.from_run_id()# as run_id is passed as parmaeter explanation = client.download_model_explanation()# as it is mentioned in question it has #been uploaded feature_importances = explanation .get_feature_importance_dict()
upvoted 8 times
SnowCheetah
2 years, 4 months ago
https://docs.microsoft.com/en-us/python/api/azureml-interpret/azureml.interpret.explanationclient?view=azure-ml-py#from-run-id-workspace--experiment-name--run-id- for more detail how to use explaination module
upvoted 1 times
...
...
phdykd
Most Recent 8 months, 1 week ago
client = ExplanationClient.from_run_id(workspace=ws, experiment_name=experiment.experiment_name, run_id=run.id) explanation = client.download_model_explanation() feature_importances = explanation.get_feature_importance_dict()
upvoted 1 times
...
therealola
1 year, 4 months ago
On exam 18-06-22
upvoted 1 times
...
kkkk_jjjj
1 year, 7 months ago
on exam 18/03/2022
upvoted 3 times
...
JoshuaXu
1 year, 11 months ago
on Exam 6 Nov 2021, the variable should be "client" in the first statement. However, the exam gives exactly the same typo.
upvoted 2 times
...
azurecert2021
2 years, 4 months ago
after reading all the comments there is confusion in from_run and froun_run_id (correct answer)so if you follow the below link ExplanationClient.from_run(run) , it is expecting only 1 parameter and it is used to get an Explanation Client and upload the explanation whereas from_run_id is expecting 3 parameter and used to download the explanation from azureml.contrib.interpret.explanation.explanation_client import ExplanationClient client = ExplanationClient.from_run_id(workspace=ws, experiment_name=experiment.experiment_name, run_id=run.id) explanation = client.download_model_explanation() feature_importances = explanation.get_feature_importance_dict()
upvoted 5 times
...
Q95
2 years, 5 months ago
Agree with other posters' answers. Link for reference: https://docs.microsoft.com/en-us/learn/modules/explain-machine-learning-models-with-azure-machine-learning/4-create-explanations (Viewing the explanation section)
upvoted 2 times
...
htiwari
2 years, 5 months ago
from azureml.interpret import ExplanationClient # Get the feature explanations client = ExplanationClient.from_run(run) engineered_explanations = client.download_model_explanation() feature_importances = engineered_explanations.get_feature_importance_dict() # Overall feature importance print('Feature\tImportance') for key, value in feature_importances.items(): print(key, '\t', value)
upvoted 1 times
...
BilJon
2 years, 7 months ago
from_run_id(workspace, experiment_name, run_id)
upvoted 3 times
...
BilJon
2 years, 7 months ago
Correct answer: from azureml.interpret import ExplanationClient # Get the feature explanations client = ExplanationClient.from_run(run) engineered_explanations = client.download_model_explanation() feature_importances = engineered_explanations.get_feature_importance_dict()
upvoted 4 times
anjurad
2 years, 6 months ago
I upvoted incorrectly - the code is correct, but it look at the arguments in the associated question brackets - https://docs.microsoft.com/en-us/python/api/azureml-interpret/azureml.interpret.explanationclient?view=azure-ml-py#from-run-id-workspace--experiment-name--run-id-
upvoted 2 times
...
...
stonefl
2 years, 7 months ago
client = ExplanationClient.from_run_id(workspace=ws, experiment_name=experiment.experiment_name, run_id=run.id) explanation = client.download_model_explanation() feature_importances = explanation.get_feature_importance_dict()
upvoted 4 times
...
kty
2 years, 7 months ago
The correct answer is : client = ExplanationClient.from_run(run) explanation = client.download_model_explanation() feature_importances = explanation .get_feature_importance_dict()
upvoted 1 times
kty
2 years, 7 months ago
sorry, it is from_run_id() client = ExplanationClient.from_run_id() explanation = client.download_model_explanation() feature_importances = explanation .get_feature_importance_dict()
upvoted 6 times
...
...
dev2dev
2 years, 7 months ago
1 and 2 should be corrected Full example here: https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/machine-learning/how-to-machine-learning-interpretability-automl.md from azureml.interpret import ExplanationClient client = ExplanationClient.from_run(best_run) raw_explanations = client.download_model_explanation(raw=True) print(raw_explanations.get_feature_importance_dict())
upvoted 3 times
bruce
2 years, 6 months ago
It should be Run_id since the arguments for the first line has run_id instead of run.
upvoted 1 times
...
...
Anty85
2 years, 7 months ago
1. from_run() 2. client.download_model_explanation() 3. explanation.get_feature_importance_dict()
upvoted 2 times
...
OmarF
2 years, 7 months ago
I think this solution is not correct the correct one is: 1. client = ExplanationClient.from_run_id() 2. explanation = client.download_model_explanation() 3. explanation.get_feature_importance_dict()
upvoted 1 times
...
ImogenW
2 years, 7 months ago
I think this is incorrect, 1 should be client = Explanation.from_run_id() 2. explanation = client.download_model_explanation() 3. explanation.get_feature_importance_dict()
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago