Skip to content

Commit 72e78e4

Browse files
committed
update based on feedback
1 parent 5055489 commit 72e78e4

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

articles/machine-learning/tutorial-convert-ml-experiment-to-production.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ In this tutorial, you learn how to:
2525

2626
- Generate the [MLOpsPython template](https://github.com/microsoft/MLOpsPython/generate)
2727
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. You can find these notebooks at [https://github.com/microsoft/MLOpsPython/tree/master/experimentation](https://github.com/microsoft/MLOpsPython/tree/master/experimentation).
28-
- Install nbconvert. Follow only the installation instructions under section __Installing nbconvert__ 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.
2929

3030
## Remove all nonessential code
3131

@@ -342,13 +342,13 @@ Third, related functions need to be merged into Python files to better help code
342342

343343
### Create Python file for the Diabetes Ridge Regression Training notebook
344344

345-
Convert your notebook to an executable script by running the following statement in a command prompt, which uses the nbconvert package and the path of `experimentation/Diabetes Ridge Regression Training.ipynb`:
345+
Convert your notebook to an executable script by running the following statement in a command prompt, which uses the `nbconvert` package and the path of `experimentation/Diabetes Ridge Regression Training.ipynb`:
346346

347347
```
348348
jupyter nbconvert -- to script "Diabetes Ridge Regression Training.ipynb" –output train
349349
```
350350

351-
Once the notebook has been converted to `train.py`, remove any unwanted the comments. Replace the call to `main()` at the end of the file with a conditional invocation
351+
Once the notebook has been converted to `train.py`, remove any unwanted comments. Replace the call to `main()` at the end of the file with a conditional invocation like the following code:
352352

353353
```python
354354
if __name__ == '__main__':
@@ -430,13 +430,13 @@ The `train_aml.py` file found in the `diabetes_regression/training` directory in
430430

431431
### Create Python file for the Diabetes Ridge Regression Scoring notebook
432432

433-
Covert your notebook to an executable script by running the following statement in a command prompt that which uses the nbconvert package and the path of `experimentation/Diabetes Ridge Regression Scoring.ipynb`:
433+
Covert your notebook to an executable script by running the following statement in a command prompt that which uses the `nbconvert` package and the path of `experimentation/Diabetes Ridge Regression Scoring.ipynb`:
434434

435435
```
436436
jupyter nbconvert -- to script "Diabetes Ridge Regression Scoring.ipynb" –output score
437437
```
438438

439-
Once the notebook has been converted to `score.py`, remove all the comments. Your `score.py` file should look like the following code:
439+
Once the notebook has been converted to `score.py`, remove any unwanted comments. Your `score.py` file should look like the following code:
440440

441441
```python
442442
import json
@@ -463,7 +463,7 @@ prediction = run(test_row, request_header)
463463
print("Test result: ", prediction)
464464
```
465465

466-
The `train_model` function needs modification to instantiate a global variable model so that it's visible throughout the script. Add the following statement at the beginning of the `init` function:
466+
The `model` variable needs to be global so that it's visible throughout the script. Add the following statement at the beginning of the `init` function:
467467

468468
```python
469469
global model
@@ -511,7 +511,7 @@ def test_train_model():
511511

512512
# Assert
513513
preds = reg_model.predict([[1], [2]])
514-
np.testing.assert_equal(preds, [9.93939393939394, 9.03030303030303])
514+
np.testing.assert_almost_equal(preds, [9.93939393939394, 9.03030303030303])
515515
```
516516

517517
## Next steps

0 commit comments

Comments
 (0)