Skip to content

Commit e774ab4

Browse files
committed
acrolinx fixes
1 parent 553fb76 commit e774ab4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ In `experimentation/Diabetes Ridge Regression Training.ipynb`, complete the foll
7676

7777
Move the code under the heading *Training Model on Training Set* into the `train_model` function and modify it to return the `reg_model` object. Remove the `args` dictionary, the values will come from the `args` parameter.
7878

79-
1. Create a function called `get_model_metrics` which takes parameters `reg_model` and `data`, and evaluates the model then returns a dictionary of metrics for the trained model.
79+
1. Create a function called `get_model_metrics`, which takes parameters `reg_model` and `data`, and evaluates the model then returns a dictionary of metrics for the trained model.
8080

8181
Move the code under the *Validate Model on Validation Set* heading into the `get_model_metrics` function and modify it to return the `metrics` object.
8282

@@ -164,7 +164,7 @@ def main():
164164
joblib.dump(value=reg, filename=model_name)
165165
```
166166

167-
At this stage there should be no code remaining in the notebook that is not in a function, other than import statements in the first cell.
167+
At this stage, there should be no code remaining in the notebook that isn't in a function, other than import statements in the first cell.
168168

169169
Add a statement that calls the `main` function.
170170

@@ -470,7 +470,7 @@ def init():
470470

471471
## Create unit tests for each Python file
472472

473-
Fourth, unit tests need to be created for each Python file, which protects code against functional regressions and makes it easier to maintain. In this section, you'll be creating unit tests for the functions in `train.py`.
473+
Fourth, create unit tests for your Python functions. Unit tests protect code against functional regressions and make it easier to maintain. In this section, you'll be creating unit tests for the functions in `train.py`.
474474

475475
`train.py` contains multiple functions, but we'll only create a single unit test for the `train_model` function using the Pytest framework in this tutorial. Pytest isn't the only Python unit testing framework, but it's one of the most commonly used. For more information, visit [Pytest](https://pytest.org).
476476

@@ -480,8 +480,7 @@ A unit test usually contains three main actions:
480480
- Act on an object
481481
- Assert what is expected
482482

483-
The unit test will call `train_model` with some hard coded data and arguments, and validate that `train_model` acted as expected by using the resulting trained model to make a prediction and comparing that prediction to an expected value.
484-
If this test starts failing it could mean that the parameters are no longer being applied correctly, or that the correct object is no longer being returned.
483+
The unit test will call `train_model` with some hard-coded data and arguments, and validate that `train_model` acted as expected by using the resulting trained model to make a prediction and comparing that prediction to an expected value.
485484

486485
```python
487486
import numpy as np

0 commit comments

Comments
 (0)