Skip to content

Commit 59fcb54

Browse files
committed
update samples from Release-42 as a part of SDK release
1 parent e0ea99a commit 59fcb54

File tree

8 files changed

+193
-246
lines changed

8 files changed

+193
-246
lines changed

how-to-use-azureml/automated-machine-learning/forecasting-beer-remote/auto-ml-forecasting-beer-remote.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ dependencies:
44
- py-xgboost<=0.80
55
- pip:
66
- azureml-sdk
7+
- numpy==1.16.2
78
- azureml-train-automl
89
- azureml-widgets
910
- matplotlib

how-to-use-azureml/automated-machine-learning/forecasting-bike-share/auto-ml-forecasting-bike-share.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ dependencies:
44
- py-xgboost<=0.80
55
- pip:
66
- azureml-sdk
7+
- numpy==1.16.2
78
- azureml-train-automl
89
- azureml-widgets
910
- matplotlib

how-to-use-azureml/automated-machine-learning/forecasting-energy-demand/auto-ml-forecasting-energy-demand.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: auto-ml-forecasting-energy-demand
22
dependencies:
33
- pip:
44
- azureml-sdk
5+
- numpy==1.16.2
56
- azureml-train-automl
67
- azureml-widgets
78
- matplotlib

how-to-use-azureml/automated-machine-learning/forecasting-high-frequency/auto-ml-forecasting-function.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@
701701
"metadata": {
702702
"authors": [
703703
{
704-
"name": "erwright, nirovins"
704+
"name": "erwright"
705705
}
706706
],
707707
"category": "tutorial",

how-to-use-azureml/automated-machine-learning/forecasting-high-frequency/auto-ml-forecasting-function.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ dependencies:
44
- py-xgboost<=0.80
55
- pip:
66
- azureml-sdk
7+
- numpy==1.16.2
78
- azureml-train-automl
89
- azureml-widgets
910
- matplotlib

how-to-use-azureml/automated-machine-learning/forecasting-orange-juice-sales/auto-ml-forecasting-orange-juice-sales.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ dependencies:
44
- py-xgboost<=0.80
55
- pip:
66
- azureml-sdk
7+
- numpy==1.16.2
78
- pandas==0.23.4
89
- azureml-train-automl
910
- azureml-widgets

tutorials/image-classification-mnist-data/img-classification-part1-training.ipynb

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
"\n",
3131
"## Prerequisites\n",
3232
"\n",
33-
"See prerequisites in the [Azure Machine Learning documentation](https://docs.microsoft.com/azure/machine-learning/service/tutorial-train-models-with-aml#prerequisites)."
33+
"See prerequisites in the [Azure Machine Learning documentation](https://docs.microsoft.com/azure/machine-learning/service/tutorial-train-models-with-aml#prerequisites).\n",
34+
"\n",
35+
"On the computer running this notebook, conda install matplotlib, numpy, scikit-learn=0.22.1"
3436
]
3537
},
3638
{
@@ -309,7 +311,7 @@
309311
"import glob\n",
310312
"\n",
311313
"from sklearn.linear_model import LogisticRegression\n",
312-
"from sklearn.externals import joblib\n",
314+
"import joblib\n",
313315
"\n",
314316
"from azureml.core import Run\n",
315317
"from utils import load_data\n",
@@ -397,15 +399,20 @@
397399
"source": [
398400
"### Create an estimator\n",
399401
"\n",
400-
"An estimator object is used to submit the run. Azure Machine Learning has pre-configured estimators for common machine learning frameworks, as well as generic Estimator. Create SKLearn estimator for scikit-learn model, by specifying\n",
402+
"An estimator object is used to submit the run. Azure Machine Learning has pre-configured estimators for common machine learning frameworks, as well as generic Estimator. Create an estimator by specifying\n",
401403
"\n",
402404
"* The name of the estimator object, `est`\n",
403405
"* The directory that contains your scripts. All the files in this directory are uploaded into the cluster nodes for execution. \n",
404406
"* The compute target. In this case you will use the AmlCompute you created\n",
405407
"* The training script name, train.py\n",
406-
"* Parameters required from the training script \n",
408+
"* An environment that contains the libraries needed to run the script\n",
409+
"* Parameters required from the training script. \n",
410+
"\n",
411+
"In this tutorial, the target is AmlCompute. All files in the script folder are uploaded into the cluster nodes for execution. The data_folder is set to use the dataset.\n",
412+
"\n",
413+
"First, create the environment that contains: the scikit-learn library, azureml-dataprep required for accessing the dataset, and azureml-defaults which contains the dependencies for logging metrics. The azureml-defaults also contains the dependencies required for deploying the model as a web service later in the part 2 of the tutorial.\n",
407414
"\n",
408-
"In this tutorial, the target is AmlCompute. All files in the script folder are uploaded into the cluster nodes for execution. The data_folder is set to use the dataset."
415+
"Once the environment is defined, register it with the Workspace to re-use it in part 2 of the tutorial."
409416
]
410417
},
411418
{
@@ -418,10 +425,20 @@
418425
"from azureml.core.conda_dependencies import CondaDependencies\n",
419426
"\n",
420427
"# to install required packages\n",
421-
"env = Environment('my_env')\n",
422-
"cd = CondaDependencies.create(pip_packages=['azureml-sdk','scikit-learn==0.22.1','azureml-dataprep[pandas,fuse]>=1.1.14'])\n",
428+
"env = Environment('tutorial-env')\n",
429+
"cd = CondaDependencies.create(pip_packages=['azureml-dataprep[pandas,fuse]>=1.1.14', 'azureml-defaults'], conda_packages = ['scikit-learn==0.22.1'])\n",
423430
"\n",
424-
"env.python.conda_dependencies = cd"
431+
"env.python.conda_dependencies = cd\n",
432+
"\n",
433+
"# Register environment to re-use later\n",
434+
"env.register(workspace = ws)"
435+
]
436+
},
437+
{
438+
"cell_type": "markdown",
439+
"metadata": {},
440+
"source": [
441+
"Then, create the estimator by specifying the training script, compute target and environment."
425442
]
426443
},
427444
{
@@ -434,15 +451,15 @@
434451
},
435452
"outputs": [],
436453
"source": [
437-
"from azureml.train.sklearn import SKLearn\n",
454+
"from azureml.train.estimator import Estimator\n",
438455
"\n",
439456
"script_params = {\n",
440457
" # to mount files referenced by mnist dataset\n",
441458
" '--data-folder': mnist_file_dataset.as_named_input('mnist_opendataset').as_mount(),\n",
442459
" '--regularization': 0.5\n",
443460
"}\n",
444461
"\n",
445-
"est = SKLearn(source_directory=script_folder,\n",
462+
"est = Estimator(source_directory=script_folder,\n",
446463
" script_params=script_params,\n",
447464
" compute_target=compute_target,\n",
448465
" environment_definition=env,\n",
@@ -667,7 +684,7 @@
667684
"name": "python",
668685
"nbconvert_exporter": "python",
669686
"pygments_lexer": "ipython3",
670-
"version": "3.6.9"
687+
"version": "3.7.6"
671688
},
672689
"msauthor": "roastala"
673690
},

0 commit comments

Comments
 (0)