You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/machine-learning/tutorial-convert-ml-experiment-to-production.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,11 +25,11 @@ In this tutorial, you learn how to:
25
25
26
26
- Generate the [MLOpsPython template](https://github.com/microsoft/MLOpsPython/generate)
27
27
and use the `experimentation/Diabetes Ridge Regression Training.ipynb` and `experimentation/Diabetes Ridge Regression Scoring.ipynb` notebooks. These notebooks are used as an example of converting from experimentation to production.
28
-
- Install nbconvert. Follow only the installation instructions under the Installing nbconvert section on the [Installation](https://nbconvert.readthedocs.io/en/latest/install.html) page.
28
+
- Install nbconvert. Follow only the installation instructions under section __Installing nbconvert__ on the [Installation](https://nbconvert.readthedocs.io/en/latest/install.html) page.
29
29
30
30
## Remove all nonessential code
31
31
32
-
Some code written during experimentation is only intended for exploratory purposes. Therefore, the first step to convert experimental code into production code is to remove this nonessential code. Removing nonessential code will also make the code more maintainable. In this section, you'll remove code from the Diabetes Ridge Regression Training notebook. The statements printing the shape of `X` and `y` and the cell calling `features.describe` are just for data exploration and can be removed. After removing nonessential code, `experimentation/Diabetes Ridge Regression Training.ipynb` should look like the following code without markdown:
32
+
Some code written during experimentation is only intended for exploratory purposes. Therefore, the first step to convert experimental code into production code is to remove this nonessential code. Removing nonessential code will also make the code more maintainable. In this section, you'll remove code from the `experimentation/Diabetes Ridge Regression Training.ipynb` notebook. The statements printing the shape of `X` and `y` and the cell calling `features.describe` are just for data exploration and can be removed. After removing nonessential code, `experimentation/Diabetes Ridge Regression Training.ipynb` should look like the following code without markdown:
33
33
34
34
```python
35
35
from sklearn.datasets import load_diabetes
@@ -86,7 +86,8 @@ Once the `train_model` function is created, replace the code under the headings
86
86
```python
87
87
reg = train_model(data, alpha)
88
88
```
89
-
The previous statement calls the `train_model` function passing the `data` and `alpha` parameters and returns the model
89
+
90
+
The previous statement calls the `train_model` function passing the `data` and `alpha` parameters and returns the model.
90
91
91
92
In `experimentation/Diabetes Ridge Regression Training.ipynb`, complete the following steps:
92
93
@@ -180,7 +181,7 @@ init()
180
181
181
182
In `experimentation/Diabetes Ridge Regression Scoring.ipynb`, complete the following steps:
182
183
183
-
1. Create a new function called `run`, which takes raw_data and request_headers as parameters and returns a dictionary of results as follows:
184
+
1. Create a new function called `run`, which takes `raw_data` and `request_headers` as parameters and returns a dictionary of results as follows:
184
185
185
186
```python
186
187
{"result": result.tolist()}
@@ -348,7 +349,7 @@ A unit test usually contains three main actions:
348
349
- Act on an object
349
350
- Assert what is expected
350
351
351
-
A common condition for `train_model` is when `data` and an `alpha` value are passed. The expected result is that the `Ridge.train` and `Ridge.predict` functions should be called. Since machine learning training methods are usually not fast-running, the call to `Ridge.train` will be mocked. Because the return value of `Ridge.train` is a mocked object, we'll also mock `Ridge.predict`. The unit test for `train_model` testing the passing of `data` and an `alpha` value with the expected result of `Ridge.train` and `Ridge.predict` functions being called using mocking and the Pytest framework should look like the following code:
352
+
A common condition for `train_model` is when `data` and an `alpha` value are passed. The expected result is that the `Ridge.train` and `Ridge.predict` functions should be called. Since machine learning training methods are often not fast-running, the call to `Ridge.train` will be mocked. Because the return value of `Ridge.train` is a mocked object, we'll also mock `Ridge.predict`. The unit test for `train_model` testing the passing of `data` and an `alpha` value with the expected result of `Ridge.train` and `Ridge.predict` functions being called using mocking and the Pytest framework should look like the following code:
0 commit comments