Skip to content

Commit 228cf79

Browse files
Merge branch 'u/xiaoyun/03' of https://github.com/LittleLittleCloud/csharp-notebooks into u/xiaoyun/03
2 parents 531ebcc + 72ba18a commit 228cf79

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

machine-learning/03-Training and AutoML.ipynb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@
5959
"metadata": {},
6060
"source": [
6161
"## Example 1: Linear regression\n",
62-
"In the below section, we are going to show the difference of trainers via a simple linear regression task, we firstly fit the linear dataset with `SDCA`, a linear trainer. And then with `LightGbm`, a tree-base non-linear trainer. And compare their performance on test dataset. The code below does\n",
63-
"- Create linear dataset and split it into train/test part\n",
64-
"- Create pipelines using `SDCA` and `LightGbm`\n",
65-
"- Train both `SDCA` and `LightGbm` on linear trainset, and evaluate them on testset."
62+
"In the below section, we are going to show the difference of trainers via a linear regression task. First, we fit the linear dataset with the linear trainer, `SDCA`. Then we git the linear dataset with `LightGbm`, a tree-base non-linear trainer. Their performance is evaluated against a test dataset. The code below:\n",
63+
"- Creates a linear dataset and splits it into train/test sets\n",
64+
"- Create training pipelines using `SDCA` and `LightGbm`\n",
65+
"- Trains both `SDCA` and `LightGbm` on the linear training set, and evaluates them on the test set."
6666
]
6767
},
6868
{
@@ -161,7 +161,7 @@
161161
"metadata": {},
162162
"source": [
163163
"## Create linear dataset\n",
164-
"The code below artifacts linear dataset with a random residual, and loaded it as train/test `DataFrame`"
164+
"The code below creates a linear dataset with a random residual. The dataset is loaded into train and test DataFrames"
165165
]
166166
},
167167
{
@@ -203,7 +203,7 @@
203203
"metadata": {},
204204
"source": [
205205
"## Construct pipeline\n",
206-
"The code below shows how to construct pipelines for both `SDCA` and `LightGbm`. The `Concatenate` transformer is necessary because it transfer a `single` column into `Vector<single>` type, which is the accepted feature type for both `SDCA` and `LightGbm` regressor."
206+
"The code below shows how to construct training pipelines for both `SDCA` and `LightGbm`. The `Concatenate` transformer is required to convert a `single` column into `Vector<single>` type, which is the expected feature type for both `SDCA` and `LightGbm` regressor."
207207
]
208208
},
209209
{
@@ -230,7 +230,7 @@
230230
"metadata": {},
231231
"source": [
232232
"## Train and evaluate model\n",
233-
"The code below first trains `sdcaPipeline` and `lgbmPipeline` which are created above, then evaluate their performance on test dataset by calcuate `Root Mean Square Loss` between predicted and truth value. We can see that `SDCA` has better performance with a significant lower `Root Mean Square Loss` comparing with `LightGbm`, even it's a simple, linear model. This is because the training dataset is also linear, so `SDCA` can fit the dataset better than `LightGbm`."
233+
"The code below first trains `sdcaPipeline` and `lgbmPipeline` which are created above, then evaluate their performance on test dataset by calculating `Root Mean Square Loss` between predicted and actual value. `SDCA` has better performance with a significantly lower `Root Mean Square Loss` compared to `LightGbm` even though it's a simpler linear model. This is because the training dataset is also linear, so `SDCA` can fit the dataset better than `LightGbm`."
234234
]
235235
},
236236
{
@@ -281,15 +281,15 @@
281281
"metadata": {},
282282
"source": [
283283
"## Example 2: Non-linear regression on LightGbm.\n",
284-
"This example is to show the importance of hyper-parameter optimization. We will first create a non-linear dataset and two pipelines. One pipeline has `LightGbm` with `numberOfLeaves` set to 10, the other's set to 1000. Then train both pipelines with the same train dataset and Comparing their training performance by evaluating them on the same test dataset."
284+
"This example shows the importance of hyper-parameter optimization. First we create a non-linear dataset and two pipelines. One pipeline has `LightGbm` with `numberOfLeaves` set to `10`, the other's set to `1000`. Both pipelines are trained with the same training dataset and their training performance is evaluated on the same test dataset."
285285
]
286286
},
287287
{
288288
"cell_type": "markdown",
289289
"metadata": {},
290290
"source": [
291291
"## Create non-linear dataset\n",
292-
"The code below artifacts non-linear dataset with a random residual, and loaded it as train/test `DataFrame`"
292+
"The code below creates a non-linear dataset with a random residual. The dataset is loaded into train and test DataFrames"
293293
]
294294
},
295295
{
@@ -331,7 +331,7 @@
331331
"metadata": {},
332332
"source": [
333333
"## Construct pipeline\n",
334-
"The code below shows how to construct pipelines for `LightGbm` with different hyper parameters. The `Concatenate` transformer is necessary because it transfer a `single` column into `Vector<single>` type, which is the accepted feature type for `LightGbm` regressor."
334+
"The code below shows how to construct training pipelines for `LightGbm` with different hyper-parameters. The `Concatenate` transformer is required because it converts a `single` column into `Vector<single>` type, which is the expected feature type for the `LightGbm` trainer."
335335
]
336336
},
337337
{
@@ -358,7 +358,7 @@
358358
"metadata": {},
359359
"source": [
360360
"## Train and evaluate model\n",
361-
"The code below first trains `smallLgbmPipeline` and `largeLgbmPipeline` which are created above, then evaluate their performance on test dataset by calcuate `Root Mean Square Loss` between predicted and truth value. We can see that large lgbm has better performance with a lower rmse."
361+
"The code below first trains `smallLgbmPipeline` and `largeLgbmPipeline` which are created above, then evaluates their performance on the test dataset by calculating the `Root Mean Square Loss` between predicted and actual value. The model created by `largeLgbmPipeline` has better performance with a lower RMSE."
362362
]
363363
},
364364
{
@@ -400,9 +400,9 @@
400400
"metadata": {},
401401
"source": [
402402
"## Use AutoML to simplify hyper-parameter optimization.\n",
403-
"Hyper-parameter optimization is tedious while important, and it's also something that can be done automatically. Using built-in `AutoMLExperiment` can greatly simplify hpo process. `AutoMLExperiment` applies the latest research from MSR so it can conduct swift, accurate and thorough hyper-parameter optimization in a limited time budget.\n",
403+
"Hyper-parameter optimization is an important process with lots of trial and error. This process can be automated and simplified using the built-in `AutoMLExperiment`. `AutoMLExperiment` applies the latest research from Microsoft Research to conduct a swift, accurate and thorough hyper-parameter optimization given a limited time budget.\n",
404404
"\n",
405-
"The code below shows how to use `AutoMLExperiment` for hpo and explore a better configuration for `LightGbm` on the non-linear dataset used in Example 2."
405+
"The code below shows how to use `AutoMLExperiment` for HPO to explore a better configuration for `LightGbm` on the non-linear dataset used in Example 2."
406406
]
407407
},
408408
{

0 commit comments

Comments
 (0)