forked from nthacker/aml-demos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
7,016 additions
and
0 deletions.
There are no files selected for viewing
532 changes: 532 additions & 0 deletions
532
Connected Car Demo/.ipynb_checkpoints/devintersection-aml-demo-checkpoint.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"name":"AML service - Connected Car Demo","id":"connected-car","created":"12/6/2018 12:42:23 AM +00:00","modified":"12/6/2018 12:42:23 AM +00:00","lastBackedUp":"","accessed":"12/6/2018 12:42:23 AM +00:00","clonedFrom":"99bdf672a9944a63bc0333b369cd37eb","cloneCount":0,"gitRepositoryUrl":null,"public":"True","starCount":0,"setupSteps":[]} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"subscription_id": "2a779d6f-0806-4359-a6e8-f1fd57bb5dd7", | ||
"resource_group": "devintersection-2018-aml-demo", | ||
"workspace_name": "devintersection-workspace" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"metadata": { | ||
"collapsed": true, | ||
"trusted": false | ||
}, | ||
"cell_type": "code", | ||
"source": "", | ||
"execution_count": null, | ||
"outputs": [] | ||
}, | ||
{ | ||
"metadata": { | ||
"trusted": true | ||
}, | ||
"cell_type": "code", | ||
"source": "from azureml.core import Workspace\n\nsubscription_id = '2a779d6f-0806-4359-a6e8-f1fd57bb5dd7' \nresource_group = 'devintersection-2018-aml-demo'\nworkspace_name = 'devintersection-workspace'\n\ntry:\n ws = Workspace(subscription_id = subscription_id, resource_group = resource_group, workspace_name = workspace_name)\n ws.write_config()\n print('Library configuration succeeded')\nexcept:\n print('Workspace not found')", | ||
"execution_count": 1, | ||
"outputs": [ | ||
{ | ||
"output_type": "stream", | ||
"text": "Wrote the config file config.json to: /home/nbuser/library/aml_config/config.json\nLibrary configuration succeeded\n", | ||
"name": "stdout" | ||
} | ||
] | ||
}, | ||
{ | ||
"metadata": { | ||
"trusted": true | ||
}, | ||
"cell_type": "code", | ||
"source": "from azureml.core.compute import ComputeTarget, AmlCompute\nfrom azureml.core.compute_target import ComputeTargetException\n\n# choose a name for your cluster\ncluster_name = \"cpucluster\"\n\ntry:\n compute_target = ComputeTarget(workspace=ws, name=cluster_name)\n print('Found existing compute target.')\nexcept ComputeTargetException:\n print('Creating a new compute target...')\n compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_D12_V2',\n max_nodes=4)\n\n # create the cluster\n compute_target = ComputeTarget.create(ws, cluster_name, compute_config)\n\n compute_target.wait_for_completion(show_output=True)\n\n# Use the 'status' property to get a detailed status for the current AmlCompute. \nprint(compute_target.status.serialize())", | ||
"execution_count": 2, | ||
"outputs": [ | ||
{ | ||
"output_type": "stream", | ||
"text": "Creating a new compute target...\nCreating.\nAmlCompute wait for completion finished\nMinimum number of nodes requested have been provisioned\n{'allocationState': 'steady', 'allocationStateTransitionTime': '2018-12-04T18:13:30.463000+00:00', 'creationTime': '2018-12-04T18:13:10.187000+00:00', 'currentNodeCount': 0, 'errors': None, 'nodeStateCounts': {'idleNodeCount': 0, 'leavingNodeCount': 0, 'preparingNodeCount': 0, 'runningNodeCount': 0, 'unusableNodeCount': 0}, 'provisioningState': 'succeeded', 'provisioningStateTransitionTime': '2018-12-04T18:13:29.797000+00:00', 'scaleSettings': {'manual': None, 'autoScale': {'maximumNodeCount': 4, 'minimumNodeCount': 0, 'initialNodeCount': 0}}, 'vmPriority': 'dedicated', 'vmSize': 'STANDARD_D12_V2'}\n", | ||
"name": "stdout" | ||
} | ||
] | ||
}, | ||
{ | ||
"metadata": { | ||
"trusted": true | ||
}, | ||
"cell_type": "code", | ||
"source": "aks_cluster_name = 'my-aks-cluster' \nresource_id = '/subscriptions/2a779d6f-0806-4359-a6e8-f1fd57bb5dd7/resourceGroups/devintersection-2018-aml-demo/providers/Microsoft.BatchAI/workspaces/devintersection-workspace/clusters/cpucluster1c848275bca'\n\n", | ||
"execution_count": 3, | ||
"outputs": [] | ||
}, | ||
{ | ||
"metadata": { | ||
"trusted": true | ||
}, | ||
"cell_type": "code", | ||
"source": "from azureml.core.compute import AksCompute, ComputeTarget\n\ntry:\n # attach to existing cluster\n #aks_target = AksCompute.attach(workspace=ws, name=aks_cluster_name, resource_id=resource_id)\n \n aks_target = AksCompute.attach_configuration(resource_group,aks_cluster_name)\n \n print('Found existing compute target.')\nexcept ComputeTargetException:\n print('Creating a new compute target...')\n \n # Use the default configuration (can also provide parameters to customize)\n prov_config = AksCompute.provisioning_configuration()\n \n # Create the cluster\n aks_target = ComputeTarget.create(workspace = ws, \n name = aks_cluster_name, \n provisioning_configuration = prov_config)\n \n aks_target.wait_for_completion(True)", | ||
"execution_count": 6, | ||
"outputs": [ | ||
{ | ||
"output_type": "stream", | ||
"text": "Found existing compute target.\n", | ||
"name": "stdout" | ||
} | ||
] | ||
}, | ||
{ | ||
"metadata": { | ||
"trusted": true | ||
}, | ||
"cell_type": "code", | ||
"source": "import os\nprint(os.getcwd())", | ||
"execution_count": 8, | ||
"outputs": [ | ||
{ | ||
"output_type": "stream", | ||
"text": "/home/nbuser/library\n", | ||
"name": "stdout" | ||
} | ||
] | ||
}, | ||
{ | ||
"metadata": { | ||
"trusted": true | ||
}, | ||
"cell_type": "code", | ||
"source": "", | ||
"execution_count": null, | ||
"outputs": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"name": "python36", | ||
"display_name": "Python 3.6", | ||
"language": "python" | ||
}, | ||
"language_info": { | ||
"mimetype": "text/x-python", | ||
"nbconvert_exporter": "python", | ||
"name": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.6.6", | ||
"file_extension": ".py", | ||
"codemirror_mode": { | ||
"version": 3, | ||
"name": "ipython" | ||
} | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Binary file added
BIN
+519 Bytes
Connected Car Demo/automl-regression/__pycache__/get_data.cpython-36.pyc
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
import pandas as pd | ||
import numpy as np | ||
|
||
def get_data(): | ||
|
||
data = pd.read_csv("https://devintersection.blob.core.windows.net/data/simulated-data.csv") | ||
|
||
X = data.iloc[:,4:72] | ||
Y = np.empty(data.shape[0], dtype=object) | ||
Y[:] = data.iloc[:,0].tolist() | ||
|
||
return { "X" : X, "y" : Y } |
Oops, something went wrong.