exam questions

Exam DP-100 All Questions

View all questions & answers for the DP-100 exam

Exam DP-100 topic 3 question 106 discussion

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

You have a Jupyter Notebook that contains Python code that is used to train a model.
You must create a Python script for the production deployment. The solution must minimize code maintenance.
Which two actions should you perform? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.

  • A. Refactor the Jupyter Notebook code into functions
  • B. Save each function to a separate Python file
  • C. Define a main() function in the Python script
  • D. Remove all comments and functions from the Python script
Show Suggested Answer Hide Answer
Suggested Answer: AC 🗳️
C: Python main function is a starting point of any program. When the program is run, the python interpreter runs the code sequentially. Main function is executed only when it is run as a Python program.
A: Refactoring, code style and testing
The first step is to modularise the notebook into a reasonable folder structure, this effectively means to convert files from .ipynb format to .py format, ensure each script has a clear distinct purpose and organise these files in a coherent way.

Once the project is nicely structured we can tidy up or refactor the code.
Reference:
https://www.guru99.com/learn-python-main-function-with-examples-understand-main.html https://towardsdatascience.com/from-jupyter-notebook-to-deployment-a-straightforward-example-1838c203a437

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
evangelist
6 days, 13 hours ago
Selected Answer: AC
given answers are correct
upvoted 1 times
...
Kakusaif
1 year, 8 months ago
correct - official MS reference is here - https://learn.microsoft.com/en-us/azure/machine-learning/v1/how-to-convert-ml-experiment-to-production
upvoted 2 times
...
chevyli
1 year, 9 months ago
Seems correct
upvoted 1 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