Skip to content

Commit d58d57c

Browse files
authored
Merge pull request #48 from rastala/master
Update notebooks with new version
2 parents 216aa8b + b3cc1b6 commit d58d57c

File tree

56 files changed

+3588
-1609
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+3588
-1609
lines changed

01.getting-started/01.train-within-notebook/01.train-within-notebook.ipynb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,6 @@
527527
"\n",
528528
"myenv = CondaDependencies()\n",
529529
"myenv.add_conda_package(\"scikit-learn\")\n",
530-
"myenv.add_pip_package(\"pynacl==1.2.1\")\n",
531530
"print(myenv.serialize_to_string())\n",
532531
"\n",
533532
"with open(\"myenv.yml\",\"w\") as f:\n",
@@ -789,6 +788,11 @@
789788
}
790789
],
791790
"metadata": {
791+
"authors": [
792+
{
793+
"name": "roastala"
794+
}
795+
],
792796
"kernelspec": {
793797
"display_name": "Python 3.6",
794798
"language": "python",

01.getting-started/02.train-on-local/02.train-on-local.ipynb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@
218218
"run_config_system_managed = RunConfiguration()\n",
219219
"\n",
220220
"run_config_system_managed.environment.python.user_managed_dependencies = False\n",
221-
"run_config_system_managed.prepare_environment = True\n",
221+
"run_config_system_managed.auto_prepare_environment = True\n",
222222
"\n",
223223
"# Specify conda dependencies with scikit-learn\n",
224224
"cd = CondaDependencies.create(conda_packages=['scikit-learn'])\n",
@@ -297,7 +297,7 @@
297297
"run_config_docker = RunConfiguration()\n",
298298
"\n",
299299
"run_config_docker.environment.python.user_managed_dependencies = False\n",
300-
"run_config_docker.prepare_environment = True\n",
300+
"run_config_docker.auto_prepare_environment = True\n",
301301
"run_config_docker.environment.docker.enabled = True\n",
302302
"run_config_docker.environment.docker.base_image = azureml.core.runconfig.DEFAULT_CPU_IMAGE\n",
303303
"\n",
@@ -442,6 +442,11 @@
442442
}
443443
],
444444
"metadata": {
445+
"authors": [
446+
{
447+
"name": "roastala"
448+
}
449+
],
445450
"kernelspec": {
446451
"display_name": "Python 3.6",
447452
"language": "python",

01.getting-started/02.train-on-local/train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
X, y = load_diabetes(return_X_y=True)
1717

18-
run = Run.get_submitted_run()
18+
run = Run.get_context()
1919

2020
X_train, X_test, y_train, y_test = train_test_split(X, y,
2121
test_size=0.2,

01.getting-started/03.train-on-aci/03.train-on-aci.ipynb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,11 @@
261261
}
262262
],
263263
"metadata": {
264+
"authors": [
265+
{
266+
"name": "roastala"
267+
}
268+
],
264269
"kernelspec": {
265270
"display_name": "Python 3.6",
266271
"language": "python",

01.getting-started/03.train-on-aci/train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
X, y = load_diabetes(return_X_y=True)
1616

17-
run = Run.get_submitted_run()
17+
run = Run.get_context()
1818

1919
X_train, X_test, y_train, y_test = train_test_split(X, y,
2020
test_size=0.2,

01.getting-started/04.train-on-remote-vm/04.train-on-remote-vm.ipynb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
"metadata": {},
159159
"outputs": [],
160160
"source": [
161-
"ds.upload_files(['./feeatures.npy', './labels.npy'], target_path='diabetes', overwrite=True)"
161+
"ds.upload_files(['./features.npy', './labels.npy'], target_path='diabetes', overwrite=True)"
162162
]
163163
},
164164
{
@@ -394,7 +394,7 @@
394394
]
395395
},
396396
{
397-
"cell_type": "raw",
397+
"cell_type": "markdown",
398398
"metadata": {},
399399
"source": [
400400
"You can choose to SSH into the VM and install Azure ML SDK, and any other missing dependencies, in that Python environment. For demonstration purposes, we simply are going to create another script `train2.py` that doesn't have azureml dependencies, and submit it instead."
@@ -407,6 +407,7 @@
407407
"outputs": [],
408408
"source": [
409409
"%%writefile $script_folder/train2.py\n",
410+
"\n",
410411
"print('####################################')\n",
411412
"print('Hello World (without Azure ML SDK)!')\n",
412413
"print('####################################')"
@@ -592,6 +593,11 @@
592593
}
593594
],
594595
"metadata": {
596+
"authors": [
597+
{
598+
"name": "haining"
599+
}
600+
],
595601
"kernelspec": {
596602
"display_name": "Python 3.6",
597603
"language": "python",
@@ -612,4 +618,4 @@
612618
},
613619
"nbformat": 4,
614620
"nbformat_minor": 2
615-
}
621+
}

01.getting-started/04.train-on-remote-vm/train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
X = np.load(os.path.join(args.data_folder, 'features.npy'))
2525
y = np.load(os.path.join(args.data_folder, 'labels.npy'))
2626

27-
run = Run.get_submitted_run()
27+
run = Run.get_context()
2828

2929
X_train, X_test, y_train, y_test = train_test_split(
3030
X, y, test_size=0.2, random_state=0)

01.getting-started/05.train-in-spark/05.train-in-spark.ipynb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,11 @@
303303
}
304304
],
305305
"metadata": {
306+
"authors": [
307+
{
308+
"name": "aashishb"
309+
}
310+
],
306311
"kernelspec": {
307312
"display_name": "Python 3.6",
308313
"language": "python",

01.getting-started/05.train-in-spark/train-spark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from azureml.core.run import Run
1919

2020
# initialize logger
21-
run = Run.get_submitted_run()
21+
run = Run.get_context()
2222

2323
# start Spark session
2424
spark = pyspark.sql.SparkSession.builder.appName('Iris').getOrCreate()

01.getting-started/10.register-model-create-image-deploy-service/10.register-model-create-image-deploy-service.ipynb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@
206206
"from azureml.core.conda_dependencies import CondaDependencies \n",
207207
"\n",
208208
"myenv = CondaDependencies.create(conda_packages=['numpy','scikit-learn'])\n",
209-
"myenv.add_pip_package(\"pynacl==1.2.1\")\n",
210209
"\n",
211210
"with open(\"myenv.yml\",\"w\") as f:\n",
212211
" f.write(myenv.serialize_to_string())"
@@ -398,6 +397,11 @@
398397
}
399398
],
400399
"metadata": {
400+
"authors": [
401+
{
402+
"name": "raymondl"
403+
}
404+
],
401405
"kernelspec": {
402406
"display_name": "Python 3.6",
403407
"language": "python",

0 commit comments

Comments
 (0)