Skip to content

Commit 9b701eb

Browse files
committed
updates to automl tutorial
1 parent 758b0ee commit 9b701eb

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

tutorials/03.auto-train-models.ipynb

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"source": [
1616
"# Tutorial: Train a classification model with automated machine learning\n",
1717
"\n",
18-
"In this tutorial, you'll learn how to generate a machine learning model using automated machine learning (automated ML). Azure Machine Learning can perform data preprocessing, algorithm selection and hyperparameter selection in an automated way for you. The final model can then be deployed following the workflow in the [Deploy a model](02.deploy-models.ipynb) tutorial.\n",
18+
"In this tutorial, you'll learn how to generate a machine learning model using automated machine learning (automated ML). Azure Machine Learning can perform algorithm selection and hyperparameter selection in an automated way for you. The final model can then be deployed following the workflow in the [Deploy a model](02.deploy-models.ipynb) tutorial.\n",
1919
"\n",
2020
"[flow diagram](./imgs/flow2.png)\n",
2121
"\n",
@@ -133,8 +133,8 @@
133133
"digits = datasets.load_digits()\n",
134134
"\n",
135135
"# Exclude the first 100 rows from training so that they can be used for test.\n",
136-
"X_digits = digits.data[100:,:]\n",
137-
"y_digits = digits.target[100:]"
136+
"X_train = digits.data[100:,:]\n",
137+
"y_train = digits.target[100:]"
138138
]
139139
},
140140
{
@@ -155,13 +155,13 @@
155155
"count = 0\n",
156156
"sample_size = 30\n",
157157
"plt.figure(figsize = (16, 6))\n",
158-
"for i in np.random.permutation(X_digits.shape[0])[:sample_size]:\n",
158+
"for i in np.random.permutation(X_train.shape[0])[:sample_size]:\n",
159159
" count = count + 1\n",
160160
" plt.subplot(1, sample_size, count)\n",
161161
" plt.axhline('')\n",
162162
" plt.axvline('')\n",
163-
" plt.text(x = 2, y = -2, s = y_digits[i], fontsize = 18)\n",
164-
" plt.imshow(X_digits[i].reshape(8, 8), cmap = plt.cm.Greys)\n",
163+
" plt.text(x = 2, y = -2, s = y_train[i], fontsize = 18)\n",
164+
" plt.imshow(X_train[i].reshape(8, 8), cmap = plt.cm.Greys)\n",
165165
"plt.show()"
166166
]
167167
},
@@ -187,8 +187,7 @@
187187
"|**max_time_sec**|12,000|Time limit in seconds for each iteration|\n",
188188
"|**iterations**|20|Number of iterations. In each iteration, the model trains with the data with a specific pipeline|\n",
189189
"|**n_cross_validations**|3|Number of cross validation splits|\n",
190-
"|**preprocess**|False| *True/False* Enables experiment to perform preprocessing on the input. Preprocessing handles *missing data*, and performs some common *feature extraction*|\n",
191-
"|**exit_score**|0.995|*double* value indicating the target for *primary_metric*. Once the target is surpassed the run terminates|\n",
190+
"|**exit_score**|0.9985|*double* value indicating the target for *primary_metric*. Once the target is surpassed the run terminates|\n",
192191
"|**blacklist_algos**|['kNN','LinearSVM']|*Array* of *strings* indicating algorithms to ignore.\n"
193192
]
194193
},
@@ -210,11 +209,10 @@
210209
" max_time_sec = 12000,\n",
211210
" iterations = 20,\n",
212211
" n_cross_validations = 3,\n",
213-
" preprocess = False,\n",
214212
" exit_score = 0.9985,\n",
215213
" blacklist_algos = ['kNN','LinearSVM'],\n",
216-
" X = X_digits,\n",
217-
" y = y_digits,\n",
214+
" X = X_train,\n",
215+
" y = y_train,\n",
218216
" path=project_folder)"
219217
]
220218
},
@@ -351,8 +349,10 @@
351349
"source": [
352350
"# find 30 random samples from test set\n",
353351
"n = 30\n",
354-
"sample_indices = np.random.permutation(X_digits.shape[0])[0:n]\n",
355-
"test_samples = X_digits[sample_indices]\n",
352+
"X_test = digits.data[:100, :]\n",
353+
"y_test = digits.target[:100]\n",
354+
"sample_indices = np.random.permutation(X_test.shape[0])[0:n]\n",
355+
"test_samples = X_test[sample_indices]\n",
356356
"\n",
357357
"\n",
358358
"# predict using the model\n",
@@ -368,11 +368,11 @@
368368
" plt.axvline('')\n",
369369
" \n",
370370
" # use different color for misclassified sample\n",
371-
" font_color = 'red' if y_digits[s] != result[i] else 'black'\n",
372-
" clr_map = plt.cm.gray if y_digits[s] != result[i] else plt.cm.Greys\n",
371+
" font_color = 'red' if y_test[s] != result[i] else 'black'\n",
372+
" clr_map = plt.cm.gray if y_test[s] != result[i] else plt.cm.Greys\n",
373373
" \n",
374374
" plt.text(x = 2, y = -2, s = result[i], fontsize = 18, color = font_color)\n",
375-
" plt.imshow(X_digits[s].reshape(8, 8), cmap = clr_map)\n",
375+
" plt.imshow(X_test[s].reshape(8, 8), cmap = clr_map)\n",
376376
" \n",
377377
" i = i + 1\n",
378378
"plt.show()"
@@ -393,7 +393,7 @@
393393
"> * Review training results\n",
394394
"> * Register the best model\n",
395395
"\n",
396-
"Learn more about [how to configure settings for automatic training]() or [how to use automatic training on a remote resource]()."
396+
"Learn more about [how to configure settings for automatic training](https://aka.ms/aml-how-configure-auto) or [how to use automatic training on a remote resource](https://aka.ms/aml-how-to-auto-remote)."
397397
]
398398
}
399399
],

0 commit comments

Comments
 (0)