From c086bd69c7e1f9a429a876047a7a2899029c6ef1 Mon Sep 17 00:00:00 2001 From: Colin Versteeg Date: Mon, 29 Apr 2019 16:26:42 -0700 Subject: [PATCH 001/108] Create production-deploy-to-aks-gpu.ipynb Add deploy to aks GPU notebook --- .../production-deploy-to-aks-gpu.ipynb | 407 ++++++++++++++++++ 1 file changed, 407 insertions(+) create mode 100644 how-to-use-azureml/deployment/production-deploy-to-aks-gpu/production-deploy-to-aks-gpu.ipynb diff --git a/how-to-use-azureml/deployment/production-deploy-to-aks-gpu/production-deploy-to-aks-gpu.ipynb b/how-to-use-azureml/deployment/production-deploy-to-aks-gpu/production-deploy-to-aks-gpu.ipynb new file mode 100644 index 00000000..672f92f7 --- /dev/null +++ b/how-to-use-azureml/deployment/production-deploy-to-aks-gpu/production-deploy-to-aks-gpu.ipynb @@ -0,0 +1,407 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) Microsoft Corporation. All rights reserved.\n", + "\n", + "Licensed under the MIT License." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Deploying a web service to Azure Kubernetes Service (AKS)\n", + "This notebook shows the steps for deploying a service: registering a model, creating an image, provisioning a cluster (one time action), and deploying a service to it. \n", + "We then test and delete the service, image and model." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core import Workspace\n", + "from azureml.core.compute import AksCompute, ComputeTarget\n", + "from azureml.core.webservice import Webservice, AksWebservice\n", + "from azureml.core.image import Image\n", + "from azureml.core.model import Model" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import azureml.core\n", + "print(azureml.core.VERSION)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Get workspace\n", + "Load existing workspace from the config file info." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core.workspace import Workspace\n", + "\n", + "ws = Workspace.from_config()\n", + "print(ws.name, ws.resource_group, ws.location, ws.subscription_id, sep = '\\n')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Register the model\n", + "Register an existing trained model, add descirption and tags. Prior to registering the model, you should have a TensorFlow [Saved Model](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/saved_model/README.md) in the `resnet50` directory. You can download a [pretrained resnet50](https://github.com/tensorflow/models/tree/master/official/resnet#pre-trained-model) and unpack it to that directory." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#Register the model\n", + "from azureml.core.model import Model\n", + "model = Model.register(model_path = \"resnet50\", # this points to a local file\n", + " model_name = \"resnet50\", # this is the name the model is registered as\n", + " tags = {'area': \"Image classification\", 'type': \"classification\"},\n", + " description = \"Image classification trained on Imagenet Dataset\",\n", + " workspace = ws)\n", + "\n", + "print(model.name, model.description, model.version)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Create an image\n", + "Create an image using the registered model the script that will load and run the model." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%writefile score.py\n", + "import tensorflow as tf\n", + "import numpy as np\n", + "import ujson\n", + "from azureml.core.model import Model\n", + "from azureml.contrib.services.aml_request import AMLRequest, rawhttp\n", + "from azureml.contrib.services.aml_response import AMLResponse\n", + "\n", + "def init():\n", + " global session\n", + " global input_name\n", + " global output_name\n", + " \n", + " session = tf.Session()\n", + "\n", + " model_path = Model.get_model_path('resnet50')\n", + " model = tf.saved_model.loader.load(session, ['serve'], model_path)\n", + " if len(model.signature_def['serving_default'].inputs) > 1:\n", + " raise ValueError(\"This score.py only supports one input\")\n", + " if len(model.signature_def['serving_default'].outputs) > 1:\n", + " raise ValueError(\"This score.py only supports one input\")\n", + " input_name = [tensor.name for tensor in model.signature_def['serving_default'].inputs.values()][0]\n", + " output_name = [tensor.name for tensor in model.signature_def['serving_default'].outputs.values()][0]\n", + " \n", + "\n", + "@rawhttp\n", + "def run(request):\n", + " if request.method == 'POST':\n", + " reqBody = request.get_data(False)\n", + " resp = score(reqBody)\n", + " return AMLResponse(resp, 200)\n", + " if request.method == 'GET':\n", + " respBody = str.encode(\"GET is not supported\")\n", + " return AMLResponse(respBody, 405)\n", + " return AMLResponse(\"bad request\", 500)\n", + "\n", + "def score(data):\n", + " result = session.run(output_name, {input_name: [data]})\n", + " return ujson.dumps(result[0])\n", + "\n", + "if __name__ == \"__main__\":\n", + " init()\n", + " with open(\"test_image.jpg\", 'rb') as f:\n", + " content = f.read()\n", + " print(score(content))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core.conda_dependencies import CondaDependencies \n", + "\n", + "myenv = CondaDependencies.create(conda_packages=['tensorflow-gpu==1.12.0','numpy','ujson','azureml-contrib-services'])\n", + "\n", + "with open(\"myenv.yml\",\"w\") as f:\n", + " f.write(myenv.serialize_to_string())" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core.image import ContainerImage\n", + "\n", + "image_config = ContainerImage.image_configuration(execution_script = \"score.py\",\n", + " runtime = \"python\",\n", + " conda_file = \"myenv.yml\",\n", + " gpu_enabled = True\n", + " )\n", + "\n", + "image = ContainerImage.create(name = \"GpuImage\",\n", + " # this is the model object\n", + " models = [model],\n", + " image_config = image_config,\n", + " workspace = ws)\n", + "\n", + "image.wait_for_creation(show_output = True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Provision the AKS Cluster\n", + "This is a one time setup. You can reuse this cluster for multiple deployments after it has been created. If you delete the cluster or the resource group that contains it, then you would have to recreate it." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Use the default configuration (can also provide parameters to customize)\n", + "prov_config = AksCompute.provisioning_configuration(vm_size=\"Standard_NC6\")\n", + "\n", + "aks_name = 'my-aks-9' \n", + "# Create the cluster\n", + "aks_target = ComputeTarget.create(workspace = ws, \n", + " name = aks_name, \n", + " provisioning_configuration = prov_config)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Create AKS Cluster in an existing virtual network (optional)\n", + "See code snippet below. Check the documentation [here](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-enable-virtual-network#use-azure-kubernetes-service) for more details." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "'''\n", + "from azureml.core.compute import ComputeTarget, AksCompute\n", + "\n", + "# Create the compute configuration and set virtual network information\n", + "config = AksCompute.provisioning_configuration(vm_size=\"Standard_NC6\", location=\"eastus2\")\n", + "config.vnet_resourcegroup_name = \"mygroup\"\n", + "config.vnet_name = \"mynetwork\"\n", + "config.subnet_name = \"default\"\n", + "config.service_cidr = \"10.0.0.0/16\"\n", + "config.dns_service_ip = \"10.0.0.10\"\n", + "config.docker_bridge_cidr = \"172.17.0.1/16\"\n", + "\n", + "# Create the compute target\n", + "aks_target = ComputeTarget.create(workspace = ws,\n", + " name = \"myaks\",\n", + " provisioning_configuration = config)\n", + "'''" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Enable SSL on the AKS Cluster (optional)\n", + "See code snippet below. Check the documentation [here](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-secure-web-service) for more details" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# provisioning_config = AksCompute.provisioning_configuration(ssl_cert_pem_file=\"cert.pem\", ssl_key_pem_file=\"key.pem\", ssl_cname=\"www.contoso.com\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%time\n", + "aks_target.wait_for_completion(show_output = True)\n", + "print(aks_target.provisioning_state)\n", + "print(aks_target.provisioning_errors)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Optional step: Attach existing AKS cluster\n", + "\n", + "If you have existing AKS cluster in your Azure subscription, you can attach it to the Workspace." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "'''\n", + "# Use the default configuration (can also provide parameters to customize)\n", + "resource_id = '/subscriptions/92c76a2f-0e1c-4216-b65e-abf7a3f34c1e/resourcegroups/raymondsdk0604/providers/Microsoft.ContainerService/managedClusters/my-aks-0605d37425356b7d01'\n", + "\n", + "create_name='my-existing-aks' \n", + "# Create the cluster\n", + "attach_config = AksCompute.attach_configuration(resource_id=resource_id)\n", + "aks_target = ComputeTarget.attach(workspace=ws, name=create_name, attach_configuration=attach_config)\n", + "# Wait for the operation to complete\n", + "aks_target.wait_for_completion(True)\n", + "'''" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Deploy web service to AKS" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#Set the web service configuration (using default here)\n", + "aks_config = AksWebservice.deploy_configuration()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%time\n", + "aks_service_name ='aks-service-1'\n", + "\n", + "aks_service = Webservice.deploy_from_image(workspace = ws, \n", + " name = aks_service_name,\n", + " image = image,\n", + " deployment_config = aks_config,\n", + " deployment_target = aks_target)\n", + "aks_service.wait_for_deployment(show_output = True)\n", + "print(aks_service.state)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Test the web service\n", + "We test the web sevice by passing the test images content." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%time\n", + "import requests\n", + "key1, key2 = aks_service.get_keys()\n", + "\n", + "headers = {'Content-Type':'application/json', 'Authorization': 'Bearer ' + key1}\n", + "test_sampe = open('test_image.jpg', 'rb').read()\n", + "resp = requests.post(aks_service.scoring_uri, test_sample, headers=headers)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Clean up\n", + "Delete the service, image, model and compute target" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%time\n", + "aks_service.delete()\n", + "image.delete()\n", + "model.delete()\n", + "aks_target.delete()" + ] + } + ], + "metadata": { + "authors": [ + { + "name": "aashishb" + } + ], + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.0" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From 6cdbfb87227de93e4f66a9bdf59a1c7823db3da7 Mon Sep 17 00:00:00 2001 From: Ilya Matiach Date: Tue, 30 Apr 2019 17:12:54 -0400 Subject: [PATCH 002/108] updating model explanation notebooks --- how-to-use-azureml/explain-model/README.md | 9 +- ...explain-local-sklearn-classification.ipynb | 243 ---- .../explain-local-sklearn-regression.ipynb | 231 ---- .../regression-sklearn-on-amlcompute.ipynb | 1200 ++++++++--------- ...n-run-history-sklearn-classification.ipynb | 255 ---- ...plain-run-history-sklearn-regression.ipynb | 269 ---- .../explain-sklearn-raw-features.ipynb | 221 --- ...-local-sklearn-binary-classification.ipynb | 258 ++++ ...al-sklearn-multiclass-classification.ipynb | 259 ++++ .../explain-local-sklearn-regression.ipynb | 251 ++++ .../explain-sklearn-raw-features.ipynb | 269 ++++ ...n-run-history-sklearn-classification.ipynb | 255 ++++ ...plain-run-history-sklearn-regression.ipynb | 269 ++++ .../explain-tabular-data.ipynb | 267 ---- 14 files changed, 2164 insertions(+), 2092 deletions(-) delete mode 100644 how-to-use-azureml/explain-model/explain-local-sklearn-classification/explain-local-sklearn-classification.ipynb delete mode 100644 how-to-use-azureml/explain-model/explain-local-sklearn-regression/explain-local-sklearn-regression.ipynb delete mode 100644 how-to-use-azureml/explain-model/explain-run-history-sklearn-classification/explain-run-history-sklearn-classification.ipynb delete mode 100644 how-to-use-azureml/explain-model/explain-run-history-sklearn-regression/explain-run-history-sklearn-regression.ipynb delete mode 100644 how-to-use-azureml/explain-model/explain-sklearn-raw-features/explain-sklearn-raw-features.ipynb create mode 100644 how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-binary-classification.ipynb create mode 100644 how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-multiclass-classification.ipynb create mode 100644 how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-regression.ipynb create mode 100644 how-to-use-azureml/explain-model/explain-tabular-data-raw-features/explain-sklearn-raw-features.ipynb create mode 100644 how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-classification.ipynb create mode 100644 how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-regression.ipynb delete mode 100644 how-to-use-azureml/explain-model/explain-tabular-data/explain-tabular-data.ipynb diff --git a/how-to-use-azureml/explain-model/README.md b/how-to-use-azureml/explain-model/README.md index 1d962136..4fc9147a 100644 --- a/how-to-use-azureml/explain-model/README.md +++ b/how-to-use-azureml/explain-model/README.md @@ -2,10 +2,7 @@ Follow these sample notebooks to learn: -1. [Explain tabular data](explain-tabular-data): Basic example of explaining model trained on tabular data. -2. [Explain local classification](explain-local-sklearn-classification): Explain a scikit-learn classification model. -3. [Explain local regression](explain-local-sklearn-regression): Explain a scikit-learn regression model. +1. [Explain tabular data locally](explain-tabular-data-local): Basic example of explaining model trained on tabular data. 4. [Explain on remote AMLCompute](explain-on-amlcompute): Explain a model on a remote AMLCompute target. -5. [Explain classification using Run History](explain-run-history-sklearn-classification): Explain a scikit-learn classification model with Run History. -6. [Explain regression using Run History](explain-run-history-sklearn-regression): Explain a scikit-learn regression model with Run History. -7. [Explain scikit-learn raw features](explain-sklearn-raw-features): Explain the raw features of a trained scikit-learn model. +5. [Explain tabular data with Run History](explain-tabular-data-run-history): Explain a model with Run History. +7. [Explain raw features](explain-tabular-data-raw-features): Explain the raw features of a trained model. diff --git a/how-to-use-azureml/explain-model/explain-local-sklearn-classification/explain-local-sklearn-classification.ipynb b/how-to-use-azureml/explain-model/explain-local-sklearn-classification/explain-local-sklearn-classification.ipynb deleted file mode 100644 index 44185672..00000000 --- a/how-to-use-azureml/explain-model/explain-local-sklearn-classification/explain-local-sklearn-classification.ipynb +++ /dev/null @@ -1,243 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Breast cancer diagnosis classification with scikit-learn (run model explainer locally)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Copyright (c) Microsoft Corporation. All rights reserved.\n", - "\n", - "Licensed under the MIT License." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Explain a model with the AML explain-model package\n", - "\n", - "1. Train a SVM classification model using Scikit-learn\n", - "2. Run 'explain_model' with full data in local mode, which doesn't contact any Azure services\n", - "3. Run 'explain_model' with summarized data in local mode, which doesn't contact any Azure services" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from sklearn.datasets import load_breast_cancer\n", - "from sklearn import svm\n", - "from azureml.explain.model.tabular_explainer import TabularExplainer" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 1. Run model explainer locally with full data" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Load the breast cancer diagnosis data" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "breast_cancer_data = load_breast_cancer()\n", - "classes = breast_cancer_data.target_names.tolist()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Split data into train and test\n", - "from sklearn.model_selection import train_test_split\n", - "x_train, x_test, y_train, y_test = train_test_split(breast_cancer_data.data, breast_cancer_data.target, test_size=0.2, random_state=0)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Train a SVM classification model, which you want to explain" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "clf = svm.SVC(gamma=0.001, C=100., probability=True)\n", - "model = clf.fit(x_train, y_train)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain predictions on your local machine" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tabular_explainer = TabularExplainer(model, x_train, features=breast_cancer_data.feature_names, classes=classes)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain overall model predictions (global explanation)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Passing in test dataset for evaluation examples - note it must be a representative sample of the original data\n", - "# x_train can be passed as well, but with more examples explanations will take longer although they may be more accurate\n", - "global_explanation = tabular_explainer.explain_global(x_test)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Sorted SHAP values\n", - "print('ranked global importance values: {}'.format(global_explanation.get_ranked_global_values()))\n", - "# Corresponding feature names\n", - "print('ranked global importance names: {}'.format(global_explanation.get_ranked_global_names()))\n", - "# feature ranks (based on original order of features)\n", - "print('global importance rank: {}'.format(global_explanation.global_importance_rank))\n", - "# per class feature names\n", - "print('ranked per class feature names: {}'.format(global_explanation.get_ranked_per_class_names()))\n", - "# per class feature importance values\n", - "print('ranked per class feature values: {}'.format(global_explanation.get_ranked_per_class_values()))" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "dict(zip(global_explanation.get_ranked_global_names(), global_explanation.get_ranked_global_values()))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain overall model predictions as a collection of local (instance-level) explanations" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# feature shap values for all features and all data points in the training data\n", - "print('local importance values: {}'.format(global_explanation.local_importance_values))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain local data points (individual instances)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "local_explanation = tabular_explainer.explain_local(x_test[0,:])" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# local feature importance information\n", - "local_importance_values = local_explanation.local_importance_values\n", - "print('local importance for first instance: {}'.format(local_importance_values[y_test[0]]))" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "print('local importance feature names: {}'.format(list(local_explanation.features)))" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "dict(zip(local_explanation.features, local_explanation.local_importance_values[y_test[0]]))" - ] - } - ], - "metadata": { - "authors": [ - { - "name": "wamartin" - } - ], - "kernelspec": { - "display_name": "Python 3.6", - "language": "python", - "name": "python36" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.8" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} \ No newline at end of file diff --git a/how-to-use-azureml/explain-model/explain-local-sklearn-regression/explain-local-sklearn-regression.ipynb b/how-to-use-azureml/explain-model/explain-local-sklearn-regression/explain-local-sklearn-regression.ipynb deleted file mode 100644 index afcd5a17..00000000 --- a/how-to-use-azureml/explain-model/explain-local-sklearn-regression/explain-local-sklearn-regression.ipynb +++ /dev/null @@ -1,231 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Boston Housing Price Prediction with scikit-learn (run model explainer locally)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Copyright (c) Microsoft Corporation. All rights reserved.\n", - "\n", - "Licensed under the MIT License." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Explain a model with the AML explain-model package\n", - "\n", - "1. Train a GradientBoosting regression model using Scikit-learn\n", - "2. Run 'explain_model' with full dataset in local mode, which doesn't contact any Azure services.\n", - "3. Run 'explain_model' with summarized dataset in local mode, which doesn't contact any Azure services." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from sklearn import datasets\n", - "from sklearn.ensemble import GradientBoostingRegressor\n", - "from azureml.explain.model.tabular_explainer import TabularExplainer" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 1. Run model explainer locally with full data" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Load the Boston house price data" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "boston_data = datasets.load_boston()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Split data into train and test\n", - "from sklearn.model_selection import train_test_split\n", - "x_train, x_test, y_train, y_test = train_test_split(boston_data.data, boston_data.target, test_size=0.2, random_state=0)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Train a GradientBoosting Regression model, which you want to explain" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "clf = GradientBoostingRegressor(n_estimators=100, max_depth=4,\n", - " learning_rate=0.1, loss='huber',\n", - " random_state=1)\n", - "model = clf.fit(x_train, y_train)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain predictions on your local machine" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tabular_explainer = TabularExplainer(model, x_train, features = boston_data.feature_names)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain overall model predictions (global explanation)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Passing in test dataset for evaluation examples - note it must be a representative sample of the original data\n", - "# x_train can be passed as well, but with more examples explanations will take longer although they may be more accurate\n", - "global_explanation = tabular_explainer.explain_global(x_test)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "help(global_explanation)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Sorted SHAP values \n", - "print('ranked global importance values: {}'.format(global_explanation.get_ranked_global_values()))\n", - "# Corresponding feature names\n", - "print('ranked global importance names: {}'.format(global_explanation.get_ranked_global_names()))\n", - "# feature ranks (based on original order of features)\n", - "print('global importance rank: {}'.format(global_explanation.global_importance_rank))" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "dict(zip(global_explanation.get_ranked_global_names(), global_explanation.get_ranked_global_values()))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain overall model predictions as a collection of local (instance-level) explanations" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# feature shap values for all features and all data points in the training data\n", - "print('local importance values: {}'.format(global_explanation.local_importance_values))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain local data points (individual instances)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "local_explanation = tabular_explainer.explain_local(x_test[0,:])" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# local feature importance information\n", - "local_importance_values = local_explanation.local_importance_values\n", - "print('local importance values: {}'.format(local_importance_values))" - ] - } - ], - "metadata": { - "authors": [ - { - "name": "wamartin" - } - ], - "kernelspec": { - "display_name": "Python 3.6", - "language": "python", - "name": "python36" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.8" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} \ No newline at end of file diff --git a/how-to-use-azureml/explain-model/explain-on-amlcompute/regression-sklearn-on-amlcompute.ipynb b/how-to-use-azureml/explain-model/explain-on-amlcompute/regression-sklearn-on-amlcompute.ipynb index f054dd57..d9ccecc1 100644 --- a/how-to-use-azureml/explain-model/explain-on-amlcompute/regression-sklearn-on-amlcompute.ipynb +++ b/how-to-use-azureml/explain-model/explain-on-amlcompute/regression-sklearn-on-amlcompute.ipynb @@ -1,602 +1,602 @@ { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Copyright (c) Microsoft Corporation. All rights reserved.\n", - "\n", - "Licensed under the MIT License." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Train using Azure Machine Learning Compute\n", - "\n", - "* Initialize a Workspace\n", - "* Create an Experiment\n", - "* Introduction to AmlCompute\n", - "* Submit an AmlCompute run in a few different ways\n", - " - Provision as a run based compute target \n", - " - Provision as a persistent compute target (Basic)\n", - " - Provision as a persistent compute target (Advanced)\n", - "* Additional operations to perform on AmlCompute\n", - "* Download model explanation data from the Run History Portal\n", - "* Print the explanation data" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Prerequisites\n", - "Make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Check core SDK version number\n", - "import azureml.core\n", - "\n", - "print(\"SDK version:\", azureml.core.VERSION)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Initialize a Workspace\n", - "\n", - "Initialize a workspace object from persisted configuration" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "tags": [ - "create workspace" - ] - }, - "outputs": [], - "source": [ - "from azureml.core import Workspace\n", - "\n", - "ws = Workspace.from_config()\n", - "print(ws.name, ws.resource_group, ws.location, ws.subscription_id, sep='\\n')" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Create An Experiment\n", - "\n", - "**Experiment** is a logical container in an Azure ML Workspace. It hosts run records which can include run metrics and output artifacts from your experiments." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.core import Experiment\n", - "experiment_name = 'explainer-remote-run-on-amlcompute'\n", - "experiment = Experiment(workspace=ws, name=experiment_name)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Introduction to AmlCompute\n", - "\n", - "Azure Machine Learning Compute is managed compute infrastructure that allows the user to easily create single to multi-node compute of the appropriate VM Family. It is created **within your workspace region** and is a resource that can be used by other users in your workspace. It autoscales by default to the max_nodes, when a job is submitted, and executes in a containerized environment packaging the dependencies as specified by the user. \n", - "\n", - "Since it is managed compute, job scheduling and cluster management are handled internally by Azure Machine Learning service. \n", - "\n", - "For more information on Azure Machine Learning Compute, please read [this article](https://docs.microsoft.com/azure/machine-learning/service/how-to-set-up-training-targets#amlcompute)\n", - "\n", - "If you are an existing BatchAI customer who is migrating to Azure Machine Learning, please read [this article](https://aka.ms/batchai-retirement)\n", - "\n", - "**Note**: As with other Azure services, there are limits on certain resources (for eg. AmlCompute quota) associated with the Azure Machine Learning service. Please read [this article](https://docs.microsoft.com/azure/machine-learning/service/how-to-manage-quotas) on the default limits and how to request more quota.\n", - "\n", - "\n", - "The training script `run_explainer.py` is already created for you. Let's have a look." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Submit an AmlCompute run in a few different ways\n", - "\n", - "First lets check which VM families are available in your region. Azure is a regional service and some specialized SKUs (especially GPUs) are only available in certain regions. Since AmlCompute is created in the region of your workspace, we will use the supported_vms () function to see if the VM family we want to use ('STANDARD_D2_V2') is supported.\n", - "\n", - "You can also pass a different region to check availability and then re-create your workspace in that region through the [configuration notebook](../../../configuration.ipynb)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.core.compute import ComputeTarget, AmlCompute\n", - "\n", - "AmlCompute.supported_vmsizes(workspace=ws)\n", - "# AmlCompute.supported_vmsizes(workspace=ws, location='southcentralus')" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Create project directory\n", - "\n", - "Create a directory that will contain all the necessary code from your local machine that you will need access to on the remote resource. This includes the training script, and any additional files your training script depends on" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import os\n", - "import shutil\n", - "\n", - "project_folder = './explainer-remote-run-on-amlcompute'\n", - "os.makedirs(project_folder, exist_ok=True)\n", - "shutil.copy('run_explainer.py', project_folder)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Provision as a run based compute target\n", - "\n", - "You can provision AmlCompute as a compute target at run-time. In this case, the compute is auto-created for your run, scales up to max_nodes that you specify, and then **deleted automatically** after the run completes." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.core.runconfig import RunConfiguration\n", - "from azureml.core.conda_dependencies import CondaDependencies\n", - "from azureml.core.runconfig import DEFAULT_CPU_IMAGE\n", - "\n", - "# create a new runconfig object\n", - "run_config = RunConfiguration()\n", - "\n", - "# signal that you want to use AmlCompute to execute script.\n", - "run_config.target = \"amlcompute\"\n", - "\n", - "# AmlCompute will be created in the same region as workspace\n", - "# Set vm size for AmlCompute\n", - "run_config.amlcompute.vm_size = 'STANDARD_D2_V2'\n", - "\n", - "# enable Docker \n", - "run_config.environment.docker.enabled = True\n", - "\n", - "# set Docker base image to the default CPU-based image\n", - "run_config.environment.docker.base_image = DEFAULT_CPU_IMAGE\n", - "\n", - "# use conda_dependencies.yml to create a conda environment in the Docker image for execution\n", - "run_config.environment.python.user_managed_dependencies = False\n", - "\n", - "# auto-prepare the Docker image when used for execution (if it is not already prepared)\n", - "run_config.auto_prepare_environment = True\n", - "\n", - "azureml_pip_packages = [\n", - " 'azureml-defaults', 'azureml-contrib-explain-model', 'azureml-core', 'azureml-telemetry',\n", - " 'azureml-explain-model'\n", - "]\n", - "\n", - "# specify CondaDependencies obj\n", - "run_config.environment.python.conda_dependencies = CondaDependencies.create(conda_packages=['scikit-learn'],\n", - " pip_packages=azureml_pip_packages)\n", - "\n", - "# Now submit a run on AmlCompute\n", - "from azureml.core.script_run_config import ScriptRunConfig\n", - "\n", - "script_run_config = ScriptRunConfig(source_directory=project_folder,\n", - " script='run_explainer.py',\n", - " run_config=run_config)\n", - "\n", - "run = experiment.submit(script_run_config)\n", - "\n", - "# Show run details\n", - "run" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Note: if you need to cancel a run, you can follow [these instructions](https://aka.ms/aml-docs-cancel-run)." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "%%time\n", - "# Shows output of the run on stdout.\n", - "run.wait_for_completion(show_output=True)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Provision as a persistent compute target (Basic)\n", - "\n", - "You can provision a persistent AmlCompute resource by simply defining two parameters thanks to smart defaults. By default it autoscales from 0 nodes and provisions dedicated VMs to run your job in a container. This is useful when you want to continously re-use the same target, debug it between jobs or simply share the resource with other users of your workspace.\n", - "\n", - "* `vm_size`: VM family of the nodes provisioned by AmlCompute. Simply choose from the supported_vmsizes() above\n", - "* `max_nodes`: Maximum nodes to autoscale to while running a job on AmlCompute" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.core.compute import ComputeTarget, AmlCompute\n", - "from azureml.core.compute_target import ComputeTargetException\n", - "\n", - "# Choose a name for your CPU cluster\n", - "cpu_cluster_name = \"cpucluster\"\n", - "\n", - "# Verify that cluster does not exist already\n", - "try:\n", - " cpu_cluster = ComputeTarget(workspace=ws, name=cpu_cluster_name)\n", - " print('Found existing cluster, use it.')\n", - "except ComputeTargetException:\n", - " compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_D2_V2',\n", - " max_nodes=4)\n", - " cpu_cluster = ComputeTarget.create(ws, cpu_cluster_name, compute_config)\n", - "\n", - "cpu_cluster.wait_for_completion(show_output=True)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Configure & Run" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.core.runconfig import RunConfiguration\n", - "from azureml.core.conda_dependencies import CondaDependencies\n", - "\n", - "# create a new RunConfig object\n", - "run_config = RunConfiguration(framework=\"python\")\n", - "\n", - "# Set compute target to AmlCompute target created in previous step\n", - "run_config.target = cpu_cluster.name\n", - "\n", - "# enable Docker \n", - "run_config.environment.docker.enabled = True\n", - "\n", - "azureml_pip_packages = [\n", - " 'azureml-defaults', 'azureml-contrib-explain-model', 'azureml-core', 'azureml-telemetry',\n", - " 'azureml-explain-model'\n", - "]\n", - "\n", - "# specify CondaDependencies obj\n", - "run_config.environment.python.conda_dependencies = CondaDependencies.create(conda_packages=['scikit-learn'],\n", - " pip_packages=azureml_pip_packages)\n", - "\n", - "from azureml.core import Run\n", - "from azureml.core import ScriptRunConfig\n", - "\n", - "src = ScriptRunConfig(source_directory=project_folder, \n", - " script='run_explainer.py', \n", - " run_config=run_config) \n", - "run = experiment.submit(config=src)\n", - "run" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "%%time\n", - "# Shows output of the run on stdout.\n", - "run.wait_for_completion(show_output=True)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "run.get_metrics()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Provision as a persistent compute target (Advanced)\n", - "\n", - "You can also specify additional properties or change defaults while provisioning AmlCompute using a more advanced configuration. This is useful when you want a dedicated cluster of 4 nodes (for example you can set the min_nodes and max_nodes to 4), or want the compute to be within an existing VNet in your subscription.\n", - "\n", - "In addition to `vm_size` and `max_nodes`, you can specify:\n", - "* `min_nodes`: Minimum nodes (default 0 nodes) to downscale to while running a job on AmlCompute\n", - "* `vm_priority`: Choose between 'dedicated' (default) and 'lowpriority' VMs when provisioning AmlCompute. Low Priority VMs use Azure's excess capacity and are thus cheaper but risk your run being pre-empted\n", - "* `idle_seconds_before_scaledown`: Idle time (default 120 seconds) to wait after run completion before auto-scaling to min_nodes\n", - "* `vnet_resourcegroup_name`: Resource group of the **existing** VNet within which AmlCompute should be provisioned\n", - "* `vnet_name`: Name of VNet\n", - "* `subnet_name`: Name of SubNet within the VNet" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.core.compute import ComputeTarget, AmlCompute\n", - "from azureml.core.compute_target import ComputeTargetException\n", - "\n", - "# Choose a name for your CPU cluster\n", - "cpu_cluster_name = \"cpucluster\"\n", - "\n", - "# Verify that cluster does not exist already\n", - "try:\n", - " cpu_cluster = ComputeTarget(workspace=ws, name=cpu_cluster_name)\n", - " print('Found existing cluster, use it.')\n", - "except ComputeTargetException:\n", - " compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_D2_V2',\n", - " vm_priority='lowpriority',\n", - " min_nodes=2,\n", - " max_nodes=4,\n", - " idle_seconds_before_scaledown='300',\n", - " vnet_resourcegroup_name='',\n", - " vnet_name='',\n", - " subnet_name='')\n", - " cpu_cluster = ComputeTarget.create(ws, cpu_cluster_name, compute_config)\n", - "\n", - "cpu_cluster.wait_for_completion(show_output=True)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Configure & Run" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.core.runconfig import RunConfiguration\n", - "from azureml.core.conda_dependencies import CondaDependencies\n", - "\n", - "# create a new RunConfig object\n", - "run_config = RunConfiguration(framework=\"python\")\n", - "\n", - "# Set compute target to AmlCompute target created in previous step\n", - "run_config.target = cpu_cluster.name\n", - "\n", - "# enable Docker \n", - "run_config.environment.docker.enabled = True\n", - "\n", - "azureml_pip_packages = [\n", - " 'azureml-defaults', 'azureml-contrib-explain-model', 'azureml-core', 'azureml-telemetry',\n", - " 'azureml-explain-model'\n", - "]\n", - "\n", - "# specify CondaDependencies obj\n", - "run_config.environment.python.conda_dependencies = CondaDependencies.create(conda_packages=['scikit-learn'],\n", - " pip_packages=azureml_pip_packages)\n", - "\n", - "from azureml.core import Run\n", - "from azureml.core import ScriptRunConfig\n", - "\n", - "src = ScriptRunConfig(source_directory=project_folder, \n", - " script='run_explainer.py', \n", - " run_config=run_config) \n", - "run = experiment.submit(config=src)\n", - "run" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "%%time\n", - "# Shows output of the run on stdout.\n", - "run.wait_for_completion(show_output=True)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "run.get_metrics()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.contrib.explain.model.explanation.explanation_client import ExplanationClient\n", - "\n", - "client = ExplanationClient.from_run(run)\n", - "# Get the top k (e.g., 4) most important features with their importance values\n", - "explanation = client.download_model_explanation(top_k=4)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Additional operations to perform on AmlCompute\n", - "\n", - "You can perform more operations on AmlCompute such as updating the node counts or deleting the compute. " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Get_status () gets the latest status of the AmlCompute target\n", - "cpu_cluster.get_status().serialize()\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Update () takes in the min_nodes, max_nodes and idle_seconds_before_scaledown and updates the AmlCompute target\n", - "# cpu_cluster.update(min_nodes=1)\n", - "# cpu_cluster.update(max_nodes=10)\n", - "cpu_cluster.update(idle_seconds_before_scaledown=300)\n", - "# cpu_cluster.update(min_nodes=2, max_nodes=4, idle_seconds_before_scaledown=600)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Delete () is used to deprovision and delete the AmlCompute target. Useful if you want to re-use the compute name \n", - "# 'cpucluster' in this case but use a different VM family for instance.\n", - "\n", - "# cpu_cluster.delete()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Download Model Explanation Data" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.contrib.explain.model.explanation.explanation_client import ExplanationClient\n", - "\n", - "# Get model explanation data\n", - "client = ExplanationClient.from_run(run)\n", - "explanation = client.download_model_explanation()\n", - "local_importance_values = explanation.local_importance_values\n", - "expected_values = explanation.expected_values\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Or you can use the saved run.id to retrive the feature importance values\n", - "client = ExplanationClient.from_run_id(ws, experiment_name, run.id)\n", - "explanation = client.download_model_explanation()\n", - "local_importance_values = explanation.local_importance_values\n", - "expected_values = explanation.expected_values" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Get the top k (e.g., 4) most important features with their importance values\n", - "explanation = client.download_model_explanation(top_k=4)\n", - "global_importance_values = explanation.get_ranked_global_values()\n", - "global_importance_names = explanation.get_ranked_global_names()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "print('global importance values: {}'.format(global_importance_values))\n", - "print('global importance names: {}'.format(global_importance_names))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Success!\n", - "Great, you are ready to move on to the remaining notebooks." - ] - } - ], - "metadata": { - "authors": [ - { - "name": "wamartin" - } - ], - "kernelspec": { - "display_name": "Python 3.6", - "language": "python", - "name": "python36" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.8" - } + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) Microsoft Corporation. All rights reserved.\n", + "\n", + "Licensed under the MIT License." + ] }, - "nbformat": 4, - "nbformat_minor": 2 -} \ No newline at end of file + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Train using Azure Machine Learning Compute\n", + "\n", + "* Initialize a Workspace\n", + "* Create an Experiment\n", + "* Introduction to AmlCompute\n", + "* Submit an AmlCompute run in a few different ways\n", + " - Provision as a run based compute target \n", + " - Provision as a persistent compute target (Basic)\n", + " - Provision as a persistent compute target (Advanced)\n", + "* Additional operations to perform on AmlCompute\n", + "* Download model explanation data from the Run History Portal\n", + "* Print the explanation data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Prerequisites\n", + "Make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Check core SDK version number\n", + "import azureml.core\n", + "\n", + "print(\"SDK version:\", azureml.core.VERSION)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Initialize a Workspace\n", + "\n", + "Initialize a workspace object from persisted configuration" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "tags": [ + "create workspace" + ] + }, + "outputs": [], + "source": [ + "from azureml.core import Workspace\n", + "\n", + "ws = Workspace.from_config()\n", + "print(ws.name, ws.resource_group, ws.location, ws.subscription_id, sep='\\n')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Create An Experiment\n", + "\n", + "**Experiment** is a logical container in an Azure ML Workspace. It hosts run records which can include run metrics and output artifacts from your experiments." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core import Experiment\n", + "experiment_name = 'explainer-remote-run-on-amlcompute'\n", + "experiment = Experiment(workspace=ws, name=experiment_name)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Introduction to AmlCompute\n", + "\n", + "Azure Machine Learning Compute is managed compute infrastructure that allows the user to easily create single to multi-node compute of the appropriate VM Family. It is created **within your workspace region** and is a resource that can be used by other users in your workspace. It autoscales by default to the max_nodes, when a job is submitted, and executes in a containerized environment packaging the dependencies as specified by the user. \n", + "\n", + "Since it is managed compute, job scheduling and cluster management are handled internally by Azure Machine Learning service. \n", + "\n", + "For more information on Azure Machine Learning Compute, please read [this article](https://docs.microsoft.com/azure/machine-learning/service/how-to-set-up-training-targets#amlcompute)\n", + "\n", + "If you are an existing BatchAI customer who is migrating to Azure Machine Learning, please read [this article](https://aka.ms/batchai-retirement)\n", + "\n", + "**Note**: As with other Azure services, there are limits on certain resources (for eg. AmlCompute quota) associated with the Azure Machine Learning service. Please read [this article](https://docs.microsoft.com/azure/machine-learning/service/how-to-manage-quotas) on the default limits and how to request more quota.\n", + "\n", + "\n", + "The training script `run_explainer.py` is already created for you. Let's have a look." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Submit an AmlCompute run in a few different ways\n", + "\n", + "First lets check which VM families are available in your region. Azure is a regional service and some specialized SKUs (especially GPUs) are only available in certain regions. Since AmlCompute is created in the region of your workspace, we will use the supported_vms () function to see if the VM family we want to use ('STANDARD_D2_V2') is supported.\n", + "\n", + "You can also pass a different region to check availability and then re-create your workspace in that region through the [configuration notebook](../../../configuration.ipynb)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core.compute import ComputeTarget, AmlCompute\n", + "\n", + "AmlCompute.supported_vmsizes(workspace=ws)\n", + "# AmlCompute.supported_vmsizes(workspace=ws, location='southcentralus')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Create project directory\n", + "\n", + "Create a directory that will contain all the necessary code from your local machine that you will need access to on the remote resource. This includes the training script, and any additional files your training script depends on" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "import shutil\n", + "\n", + "project_folder = './explainer-remote-run-on-amlcompute'\n", + "os.makedirs(project_folder, exist_ok=True)\n", + "shutil.copy('run_explainer.py', project_folder)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Provision as a run based compute target\n", + "\n", + "You can provision AmlCompute as a compute target at run-time. In this case, the compute is auto-created for your run, scales up to max_nodes that you specify, and then **deleted automatically** after the run completes." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core.runconfig import RunConfiguration\n", + "from azureml.core.conda_dependencies import CondaDependencies\n", + "from azureml.core.runconfig import DEFAULT_CPU_IMAGE\n", + "\n", + "# create a new runconfig object\n", + "run_config = RunConfiguration()\n", + "\n", + "# signal that you want to use AmlCompute to execute script.\n", + "run_config.target = \"amlcompute\"\n", + "\n", + "# AmlCompute will be created in the same region as workspace\n", + "# Set vm size for AmlCompute\n", + "run_config.amlcompute.vm_size = 'STANDARD_D2_V2'\n", + "\n", + "# enable Docker \n", + "run_config.environment.docker.enabled = True\n", + "\n", + "# set Docker base image to the default CPU-based image\n", + "run_config.environment.docker.base_image = DEFAULT_CPU_IMAGE\n", + "\n", + "# use conda_dependencies.yml to create a conda environment in the Docker image for execution\n", + "run_config.environment.python.user_managed_dependencies = False\n", + "\n", + "# auto-prepare the Docker image when used for execution (if it is not already prepared)\n", + "run_config.auto_prepare_environment = True\n", + "\n", + "azureml_pip_packages = [\n", + " 'azureml-defaults', 'azureml-contrib-explain-model', 'azureml-core', 'azureml-telemetry',\n", + " 'azureml-explain-model'\n", + "]\n", + "\n", + "# specify CondaDependencies obj\n", + "run_config.environment.python.conda_dependencies = CondaDependencies.create(conda_packages=['scikit-learn'],\n", + " pip_packages=azureml_pip_packages)\n", + "\n", + "# Now submit a run on AmlCompute\n", + "from azureml.core.script_run_config import ScriptRunConfig\n", + "\n", + "script_run_config = ScriptRunConfig(source_directory=project_folder,\n", + " script='run_explainer.py',\n", + " run_config=run_config)\n", + "\n", + "run = experiment.submit(script_run_config)\n", + "\n", + "# Show run details\n", + "run" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note: if you need to cancel a run, you can follow [these instructions](https://aka.ms/aml-docs-cancel-run)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%time\n", + "# Shows output of the run on stdout.\n", + "run.wait_for_completion(show_output=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Provision as a persistent compute target (Basic)\n", + "\n", + "You can provision a persistent AmlCompute resource by simply defining two parameters thanks to smart defaults. By default it autoscales from 0 nodes and provisions dedicated VMs to run your job in a container. This is useful when you want to continously re-use the same target, debug it between jobs or simply share the resource with other users of your workspace.\n", + "\n", + "* `vm_size`: VM family of the nodes provisioned by AmlCompute. Simply choose from the supported_vmsizes() above\n", + "* `max_nodes`: Maximum nodes to autoscale to while running a job on AmlCompute" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core.compute import ComputeTarget, AmlCompute\n", + "from azureml.core.compute_target import ComputeTargetException\n", + "\n", + "# Choose a name for your CPU cluster\n", + "cpu_cluster_name = \"cpucluster\"\n", + "\n", + "# Verify that cluster does not exist already\n", + "try:\n", + " cpu_cluster = ComputeTarget(workspace=ws, name=cpu_cluster_name)\n", + " print('Found existing cluster, use it.')\n", + "except ComputeTargetException:\n", + " compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_D2_V2',\n", + " max_nodes=4)\n", + " cpu_cluster = ComputeTarget.create(ws, cpu_cluster_name, compute_config)\n", + "\n", + "cpu_cluster.wait_for_completion(show_output=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Configure & Run" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core.runconfig import RunConfiguration\n", + "from azureml.core.conda_dependencies import CondaDependencies\n", + "\n", + "# create a new RunConfig object\n", + "run_config = RunConfiguration(framework=\"python\")\n", + "\n", + "# Set compute target to AmlCompute target created in previous step\n", + "run_config.target = cpu_cluster.name\n", + "\n", + "# enable Docker \n", + "run_config.environment.docker.enabled = True\n", + "\n", + "azureml_pip_packages = [\n", + " 'azureml-defaults', 'azureml-contrib-explain-model', 'azureml-core', 'azureml-telemetry',\n", + " 'azureml-explain-model'\n", + "]\n", + "\n", + "# specify CondaDependencies obj\n", + "run_config.environment.python.conda_dependencies = CondaDependencies.create(conda_packages=['scikit-learn'],\n", + " pip_packages=azureml_pip_packages)\n", + "\n", + "from azureml.core import Run\n", + "from azureml.core import ScriptRunConfig\n", + "\n", + "src = ScriptRunConfig(source_directory=project_folder, \n", + " script='run_explainer.py', \n", + " run_config=run_config) \n", + "run = experiment.submit(config=src)\n", + "run" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%time\n", + "# Shows output of the run on stdout.\n", + "run.wait_for_completion(show_output=True)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "run.get_metrics()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Provision as a persistent compute target (Advanced)\n", + "\n", + "You can also specify additional properties or change defaults while provisioning AmlCompute using a more advanced configuration. This is useful when you want a dedicated cluster of 4 nodes (for example you can set the min_nodes and max_nodes to 4), or want the compute to be within an existing VNet in your subscription.\n", + "\n", + "In addition to `vm_size` and `max_nodes`, you can specify:\n", + "* `min_nodes`: Minimum nodes (default 0 nodes) to downscale to while running a job on AmlCompute\n", + "* `vm_priority`: Choose between 'dedicated' (default) and 'lowpriority' VMs when provisioning AmlCompute. Low Priority VMs use Azure's excess capacity and are thus cheaper but risk your run being pre-empted\n", + "* `idle_seconds_before_scaledown`: Idle time (default 120 seconds) to wait after run completion before auto-scaling to min_nodes\n", + "* `vnet_resourcegroup_name`: Resource group of the **existing** VNet within which AmlCompute should be provisioned\n", + "* `vnet_name`: Name of VNet\n", + "* `subnet_name`: Name of SubNet within the VNet" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core.compute import ComputeTarget, AmlCompute\n", + "from azureml.core.compute_target import ComputeTargetException\n", + "\n", + "# Choose a name for your CPU cluster\n", + "cpu_cluster_name = \"cpucluster\"\n", + "\n", + "# Verify that cluster does not exist already\n", + "try:\n", + " cpu_cluster = ComputeTarget(workspace=ws, name=cpu_cluster_name)\n", + " print('Found existing cluster, use it.')\n", + "except ComputeTargetException:\n", + " compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_D2_V2',\n", + " vm_priority='lowpriority',\n", + " min_nodes=2,\n", + " max_nodes=4,\n", + " idle_seconds_before_scaledown='300',\n", + " vnet_resourcegroup_name='',\n", + " vnet_name='',\n", + " subnet_name='')\n", + " cpu_cluster = ComputeTarget.create(ws, cpu_cluster_name, compute_config)\n", + "\n", + "cpu_cluster.wait_for_completion(show_output=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Configure & Run" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core.runconfig import RunConfiguration\n", + "from azureml.core.conda_dependencies import CondaDependencies\n", + "\n", + "# create a new RunConfig object\n", + "run_config = RunConfiguration(framework=\"python\")\n", + "\n", + "# Set compute target to AmlCompute target created in previous step\n", + "run_config.target = cpu_cluster.name\n", + "\n", + "# enable Docker \n", + "run_config.environment.docker.enabled = True\n", + "\n", + "azureml_pip_packages = [\n", + " 'azureml-defaults', 'azureml-contrib-explain-model', 'azureml-core', 'azureml-telemetry',\n", + " 'azureml-explain-model'\n", + "]\n", + "\n", + "# specify CondaDependencies obj\n", + "run_config.environment.python.conda_dependencies = CondaDependencies.create(conda_packages=['scikit-learn'],\n", + " pip_packages=azureml_pip_packages)\n", + "\n", + "from azureml.core import Run\n", + "from azureml.core import ScriptRunConfig\n", + "\n", + "src = ScriptRunConfig(source_directory=project_folder, \n", + " script='run_explainer.py', \n", + " run_config=run_config) \n", + "run = experiment.submit(config=src)\n", + "run" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%time\n", + "# Shows output of the run on stdout.\n", + "run.wait_for_completion(show_output=True)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "run.get_metrics()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.contrib.explain.model.explanation.explanation_client import ExplanationClient\n", + "\n", + "client = ExplanationClient.from_run(run)\n", + "# Get the top k (e.g., 4) most important features with their importance values\n", + "explanation = client.download_model_explanation(top_k=4)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Additional operations to perform on AmlCompute\n", + "\n", + "You can perform more operations on AmlCompute such as updating the node counts or deleting the compute. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Get_status () gets the latest status of the AmlCompute target\n", + "cpu_cluster.get_status().serialize()\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Update () takes in the min_nodes, max_nodes and idle_seconds_before_scaledown and updates the AmlCompute target\n", + "# cpu_cluster.update(min_nodes=1)\n", + "# cpu_cluster.update(max_nodes=10)\n", + "cpu_cluster.update(idle_seconds_before_scaledown=300)\n", + "# cpu_cluster.update(min_nodes=2, max_nodes=4, idle_seconds_before_scaledown=600)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Delete () is used to deprovision and delete the AmlCompute target. Useful if you want to re-use the compute name \n", + "# 'cpucluster' in this case but use a different VM family for instance.\n", + "\n", + "# cpu_cluster.delete()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Download Model Explanation Data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.contrib.explain.model.explanation.explanation_client import ExplanationClient\n", + "\n", + "# Get model explanation data\n", + "client = ExplanationClient.from_run(run)\n", + "explanation = client.download_model_explanation()\n", + "local_importance_values = explanation.local_importance_values\n", + "expected_values = explanation.expected_values\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Or you can use the saved run.id to retrive the feature importance values\n", + "client = ExplanationClient.from_run_id(ws, experiment_name, run.id)\n", + "explanation = client.download_model_explanation()\n", + "local_importance_values = explanation.local_importance_values\n", + "expected_values = explanation.expected_values" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Get the top k (e.g., 4) most important features with their importance values\n", + "explanation = client.download_model_explanation(top_k=4)\n", + "global_importance_values = explanation.get_ranked_global_values()\n", + "global_importance_names = explanation.get_ranked_global_names()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "print('global importance values: {}'.format(global_importance_values))\n", + "print('global importance names: {}'.format(global_importance_names))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Success!\n", + "Great, you are ready to move on to the remaining notebooks." + ] + } + ], + "metadata": { + "authors": [ + { + "name": "mesameki" + } + ], + "kernelspec": { + "display_name": "Python 3.6", + "language": "python", + "name": "python36" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.8" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/how-to-use-azureml/explain-model/explain-run-history-sklearn-classification/explain-run-history-sklearn-classification.ipynb b/how-to-use-azureml/explain-model/explain-run-history-sklearn-classification/explain-run-history-sklearn-classification.ipynb deleted file mode 100644 index 4c9c489a..00000000 --- a/how-to-use-azureml/explain-model/explain-run-history-sklearn-classification/explain-run-history-sklearn-classification.ipynb +++ /dev/null @@ -1,255 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Breast cancer diagnosis classification with scikit-learn (save model explanations via AML Run History)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Copyright (c) Microsoft Corporation. All rights reserved.\n", - "\n", - "Licensed under the MIT License." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Explain a model with the AML explain-model package\n", - "\n", - "1. Train a SVM classification model using Scikit-learn\n", - "2. Run 'explain_model' with AML Run History, which leverages run history service to store and manage the explanation data" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from sklearn.datasets import load_breast_cancer\n", - "from sklearn import svm\n", - "from azureml.explain.model.tabular_explainer import TabularExplainer" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 1. Run model explainer locally with full data" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Load the breast cancer diagnosis data" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "breast_cancer_data = load_breast_cancer()\n", - "classes = breast_cancer_data.target_names.tolist()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Split data into train and test\n", - "from sklearn.model_selection import train_test_split\n", - "x_train, x_test, y_train, y_test = train_test_split(breast_cancer_data.data, breast_cancer_data.target, test_size=0.2, random_state=0)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Train a SVM classification model, which you want to explain" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "clf = svm.SVC(gamma=0.001, C=100., probability=True)\n", - "model = clf.fit(x_train, y_train)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain predictions on your local machine" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tabular_explainer = TabularExplainer(model, x_train, features=breast_cancer_data.feature_names, classes=classes)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain overall model predictions (global explanation)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Passing in test dataset for evaluation examples - note it must be a representative sample of the original data\n", - "# x_train can be passed as well, but with more examples explanations will take longer although they may be more accurate\n", - "global_explanation = tabular_explainer.explain_global(x_test)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 2. Save Model Explanation With AML Run History" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import azureml.core\n", - "from azureml.core import Workspace, Experiment, Run\n", - "from azureml.explain.model.tabular_explainer import TabularExplainer\n", - "from azureml.contrib.explain.model.explanation.explanation_client import ExplanationClient\n", - "# Check core SDK version number\n", - "print(\"SDK version:\", azureml.core.VERSION)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "ws = Workspace.from_config()\n", - "print('Workspace name: ' + ws.name, \n", - " 'Azure region: ' + ws.location, \n", - " 'Subscription id: ' + ws.subscription_id, \n", - " 'Resource group: ' + ws.resource_group, sep = '\\n')" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "experiment_name = 'explain_model'\n", - "experiment = Experiment(ws, experiment_name)\n", - "run = experiment.start_logging()\n", - "client = ExplanationClient.from_run(run)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Uploading model explanation data for storage or visualization in webUX\n", - "# The explanation can then be downloaded on any compute\n", - "client.upload_model_explanation(global_explanation)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Get model explanation data\n", - "explanation = client.download_model_explanation()\n", - "local_importance_values = explanation.local_importance_values\n", - "expected_values = explanation.expected_values" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Get the top k (e.g., 4) most important features with their importance values\n", - "explanation = client.download_model_explanation(top_k=4)\n", - "global_importance_values = explanation.get_ranked_global_values()\n", - "global_importance_names = explanation.get_ranked_global_names()\n", - "per_class_names = explanation.get_ranked_per_class_names()[0]\n", - "per_class_values = explanation.get_ranked_per_class_values()[0]" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "print('per class feature importance values: {}'.format(per_class_values))\n", - "print('per class feature importance names: {}'.format(per_class_names))" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "dict(zip(per_class_names, per_class_values))" - ] - } - ], - "metadata": { - "authors": [ - { - "name": "wamartin" - } - ], - "kernelspec": { - "display_name": "Python 3.6", - "language": "python", - "name": "python36" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.8" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} \ No newline at end of file diff --git a/how-to-use-azureml/explain-model/explain-run-history-sklearn-regression/explain-run-history-sklearn-regression.ipynb b/how-to-use-azureml/explain-model/explain-run-history-sklearn-regression/explain-run-history-sklearn-regression.ipynb deleted file mode 100644 index 6b6edd25..00000000 --- a/how-to-use-azureml/explain-model/explain-run-history-sklearn-regression/explain-run-history-sklearn-regression.ipynb +++ /dev/null @@ -1,269 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Boston Housing Price Prediction with scikit-learn (save model explanations via AML Run History)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Copyright (c) Microsoft Corporation. All rights reserved.\n", - "\n", - "Licensed under the MIT License." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Explain a model with the AML explain-model package\n", - "\n", - "1. Train a GradientBoosting regression model using Scikit-learn\n", - "2. Run 'explain_model' with AML Run History, which leverages run history service to store and manage the explanation data" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Save Model Explanation With AML Run History" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "#Import Iris dataset\n", - "from sklearn import datasets\n", - "from sklearn.ensemble import GradientBoostingRegressor\n", - "\n", - "import azureml.core\n", - "from azureml.core import Workspace, Experiment, Run\n", - "from azureml.explain.model.tabular_explainer import TabularExplainer\n", - "from azureml.contrib.explain.model.explanation.explanation_client import ExplanationClient\n", - "# Check core SDK version number\n", - "print(\"SDK version:\", azureml.core.VERSION)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "ws = Workspace.from_config()\n", - "print('Workspace name: ' + ws.name, \n", - " 'Azure region: ' + ws.location, \n", - " 'Subscription id: ' + ws.subscription_id, \n", - " 'Resource group: ' + ws.resource_group, sep = '\\n')" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "experiment_name = 'explain_model'\n", - "experiment = Experiment(ws, experiment_name)\n", - "run = experiment.start_logging()\n", - "client = ExplanationClient.from_run(run)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Load the Boston house price data" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "boston_data = datasets.load_boston()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Split data into train and test\n", - "from sklearn.model_selection import train_test_split\n", - "x_train, x_test, y_train, y_test = train_test_split(boston_data.data, boston_data.target, test_size=0.2, random_state=0)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Train a GradientBoosting Regression model, which you want to explain" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "clf = GradientBoostingRegressor(n_estimators=100, max_depth=4,\n", - " learning_rate=0.1, loss='huber',\n", - " random_state=1)\n", - "model = clf.fit(x_train, y_train)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain predictions on your local machine" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tabular_explainer = TabularExplainer(model, x_train, features=boston_data.feature_names)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain overall model predictions (global explanation)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Passing in test dataset for evaluation examples - note it must be a representative sample of the original data\n", - "# x_train can be passed as well, but with more examples explanations will take longer although they may be more accurate\n", - "global_explanation = tabular_explainer.explain_global(x_test)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Uploading model explanation data for storage or visualization in webUX\n", - "# The explanation can then be downloaded on any compute\n", - "client.upload_model_explanation(global_explanation)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Get model explanation data\n", - "explanation = client.download_model_explanation()\n", - "local_importance_values = explanation.local_importance_values\n", - "expected_values = explanation.expected_values" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Print the values\n", - "print('expected values: {}'.format(expected_values))\n", - "print('local importance values: {}'.format(local_importance_values))" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Get the top k (e.g., 4) most important features with their importance values\n", - "explanation = client.download_model_explanation(top_k=4)\n", - "global_importance_values = explanation.get_ranked_global_values()\n", - "global_importance_names = explanation.get_ranked_global_names()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "print('global importance values: {}'.format(global_importance_values))\n", - "print('global importance names: {}'.format(global_importance_names))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain individual instance predictions (local explanation) ##### needs to get updated with the new build" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "local_explanation = tabular_explainer.explain_local(x_test[0,:])" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# local feature importance information\n", - "local_importance_values = local_explanation.local_importance_values\n", - "print('local importance values: {}'.format(local_importance_values))" - ] - } - ], - "metadata": { - "authors": [ - { - "name": "wamartin" - } - ], - "kernelspec": { - "display_name": "Python 3.6", - "language": "python", - "name": "python36" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.8" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} \ No newline at end of file diff --git a/how-to-use-azureml/explain-model/explain-sklearn-raw-features/explain-sklearn-raw-features.ipynb b/how-to-use-azureml/explain-model/explain-sklearn-raw-features/explain-sklearn-raw-features.ipynb deleted file mode 100644 index 65c4021d..00000000 --- a/how-to-use-azureml/explain-model/explain-sklearn-raw-features/explain-sklearn-raw-features.ipynb +++ /dev/null @@ -1,221 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Summary\n", - "From raw data that is a mixture of categoricals and numeric, featurize the categoricals using one hot encoding. Use tabular explainer to get explain object and then get raw feature importances" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Copyright (c) Microsoft Corporation. All rights reserved.\n", - "\n", - "Licensed under the MIT License." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Load titanic dataset. Impute missing values by filling both backward and forward since some data is at the first/last row. This is just for illustration and not a recommended way to impute missing data." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import pandas as pd\n", - "\n", - "titanic_url = ('https://raw.githubusercontent.com/amueller/'\n", - " 'scipy-2017-sklearn/091d371/notebooks/datasets/titanic3.csv')\n", - "data = pd.read_csv(titanic_url)\n", - "# fill missing values\n", - "data = data.fillna(method=\"ffill\")\n", - "data = data.fillna(method=\"bfill\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "data.columns" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Similar to example [here](https://scikit-learn.org/stable/auto_examples/compose/plot_column_transformer_mixed_types.html#sphx-glr-auto-examples-compose-plot-column-transformer-mixed-types-py), use a subset of columns" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from sklearn.model_selection import train_test_split\n", - "\n", - "numeric_features = ['age', 'fare']\n", - "categorical_features = ['embarked', 'sex', 'pclass']\n", - "\n", - "y = data['survived'].values\n", - "X = data[categorical_features + numeric_features]\n", - "\n", - "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "One hot encode the categorical features" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from sklearn.preprocessing import OneHotEncoder\n", - "one_enc = OneHotEncoder()\n", - "one_enc.fit(X_train[categorical_features])" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Columnwise concatenate one hot encoded categoricals and numerical features." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import numpy as np\n", - "from scipy import sparse\n", - "def get_feats(X):\n", - " a = one_enc.transform(X[categorical_features])\n", - " b = X[numeric_features]\n", - " return sparse.hstack((one_enc.transform(X[categorical_features]), X[numeric_features].values))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Train a logistic regression model on featurized training data." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from sklearn.linear_model import LogisticRegression\n", - "\n", - "X_train_transformed = get_feats(X_train)\n", - "X_test_transformed = get_feats(X_test)\n", - "\n", - "clf = LogisticRegression(solver='lbfgs', max_iter=200)\n", - "clf.fit(X_train_transformed, y_train)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Get feature mapping between raw and generated features. Using the order in which features are concatenated in `get_feats` and using `categories_` in `OneHotEncoder` we are able to compute this mapping." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "raw_feat_mapping = []\n", - "start_index = 0\n", - "for cat_list in one_enc.categories_:\n", - " raw_feat_mapping.append([start_index + i for i in range(len(cat_list))])\n", - " start_index += len(cat_list)\n", - "for i in range(len(numeric_features)):\n", - " raw_feat_mapping.append([start_index])\n", - " start_index += 1 " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.explain.model.tabular_explainer import TabularExplainer\n", - "\n", - "explainer = TabularExplainer(clf, X_train_transformed)\n", - "global_explanation = explainer.explain_global(X_test_transformed)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "raw_feat_imps = global_explanation.get_raw_feature_importances(raw_feat_mapping)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "feature_names = categorical_features + numeric_features\n", - "sorted_indices = np.argsort(raw_feat_imps)[::-1]\n", - "\n", - "for i in sorted_indices:\n", - " print(\"{}: {}\".format(feature_names[i], raw_feat_imps[i]))" - ] - } - ], - "metadata": { - "authors": [ - { - "name": "hichando" - } - ], - "kernelspec": { - "display_name": "Python 3.6", - "language": "python", - "name": "python36" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.8" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} \ No newline at end of file diff --git a/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-binary-classification.ipynb b/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-binary-classification.ipynb new file mode 100644 index 00000000..e6acde5b --- /dev/null +++ b/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-binary-classification.ipynb @@ -0,0 +1,258 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Breast cancer diagnosis classification with scikit-learn (run model explainer locally)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) Microsoft Corporation. All rights reserved.\n", + "\n", + "Licensed under the MIT License." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Explain a model with the AML explain-model package\n", + "\n", + "1. Train a SVM classification model using Scikit-learn\n", + "2. Run 'explain_model' with full data in local mode, which doesn't contact any Azure services\n", + "3. Run 'explain_model' with summarized data in local mode, which doesn't contact any Azure services\n", + "4. Visualize the global and local explanations with the visualization dashboard." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from sklearn.datasets import load_breast_cancer\n", + "from sklearn import svm\n", + "from azureml.explain.model.tabular_explainer import TabularExplainer" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 1. Run model explainer locally with full data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Load the breast cancer diagnosis data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "breast_cancer_data = load_breast_cancer()\n", + "classes = breast_cancer_data.target_names.tolist()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Split data into train and test\n", + "from sklearn.model_selection import train_test_split\n", + "x_train, x_test, y_train, y_test = train_test_split(breast_cancer_data.data, breast_cancer_data.target, test_size=0.2, random_state=0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Train a SVM classification model, which you want to explain" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "clf = svm.SVC(gamma=0.001, C=100., probability=True)\n", + "model = clf.fit(x_train, y_train)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain predictions on your local machine" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tabular_explainer = TabularExplainer(model, x_train, features=breast_cancer_data.feature_names, classes=classes)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain overall model predictions (global explanation)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Passing in test dataset for evaluation examples - note it must be a representative sample of the original data\n", + "# x_train can be passed as well, but with more examples explanations will take longer although they may be more accurate\n", + "global_explanation = tabular_explainer.explain_global(x_test)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Sorted SHAP values\n", + "print('ranked global importance values: {}'.format(global_explanation.get_ranked_global_values()))\n", + "# Corresponding feature names\n", + "print('ranked global importance names: {}'.format(global_explanation.get_ranked_global_names()))\n", + "# feature ranks (based on original order of features)\n", + "print('global importance rank: {}'.format(global_explanation.global_importance_rank))\n", + "# per class feature names\n", + "print('ranked per class feature names: {}'.format(global_explanation.get_ranked_per_class_names()))\n", + "# per class feature importance values\n", + "print('ranked per class feature values: {}'.format(global_explanation.get_ranked_per_class_values()))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "dict(zip(global_explanation.get_ranked_global_names(), global_explanation.get_ranked_global_values()))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain overall model predictions as a collection of local (instance-level) explanations" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# feature shap values for all features and all data points in the training data\n", + "print('local importance values: {}'.format(global_explanation.local_importance_values))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain local data points (individual instances)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# explain the first member of the test set\n", + "instance_num = 0\n", + "local_explanation = tabular_explainer.explain_local(x_test[instance_num,:])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# get the prediction for the first member of the test set and explain why model made that prediction\n", + "prediction_value = clf.predict(x_test)[instance_num]\n", + "\n", + "sorted_local_importance_values = local_explanation.get_ranked_local_values()[prediction_value]\n", + "sorted_local_importance_names = local_explanation.get_ranked_local_names()[prediction_value]\n", + "\n", + "\n", + "dict(zip(sorted_local_importance_names, sorted_local_importance_values))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 2. Load visualization dashboard" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.contrib.explain.model.visualize import ExplanationDashboard" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ExplanationDashboard(global_explanation, model, x_test)" + ] + } + ], + "metadata": { + "authors": [ + { + "name": "mesameki" + } + ], + "kernelspec": { + "display_name": "Python 3.6", + "language": "python", + "name": "python36" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.8" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-multiclass-classification.ipynb b/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-multiclass-classification.ipynb new file mode 100644 index 00000000..fc16de97 --- /dev/null +++ b/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-multiclass-classification.ipynb @@ -0,0 +1,259 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Iris flower classification with scikit-learn (run model explainer locally)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) Microsoft Corporation. All rights reserved.\n", + "\n", + "Licensed under the MIT License." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Explain a model with the AML explain-model package\n", + "\n", + "1. Train a SVM classification model using Scikit-learn\n", + "2. Run 'explain_model' with full data in local mode, which doesn't contact any Azure services\n", + "3. Run 'explain_model' with summarized data in local mode, which doesn't contact any Azure services\n", + "4. Visualize the global and local explanations with the visualization dashboard." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from sklearn.datasets import load_iris\n", + "from sklearn import svm\n", + "from azureml.explain.model.tabular_explainer import TabularExplainer" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 1. Run model explainer locally with full data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Load the breast cancer diagnosis data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "iris = load_iris()\n", + "X = iris['data']\n", + "y = iris['target']\n", + "classes = iris['target_names']\n", + "feature_names = iris['feature_names']" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Split data into train and test\n", + "from sklearn.model_selection import train_test_split\n", + "x_train, x_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Train a SVM classification model, which you want to explain" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "clf = svm.SVC(gamma=0.001, C=100., probability=True)\n", + "model = clf.fit(x_train, y_train)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain predictions on your local machine" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tabular_explainer = TabularExplainer(model, x_train, features = feature_names, classes=classes)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain overall model predictions (global explanation)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "global_explanation = tabular_explainer.explain_global(x_test)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Sorted SHAP values\n", + "print('ranked global importance values: {}'.format(global_explanation.get_ranked_global_values()))\n", + "# Corresponding feature names\n", + "print('ranked global importance names: {}'.format(global_explanation.get_ranked_global_names()))\n", + "# feature ranks (based on original order of features)\n", + "print('global importance rank: {}'.format(global_explanation.global_importance_rank))\n", + "# per class feature names\n", + "print('ranked per class feature names: {}'.format(global_explanation.get_ranked_per_class_names()))\n", + "# per class feature importance values\n", + "print('ranked per class feature values: {}'.format(global_explanation.get_ranked_per_class_values()))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "dict(zip(global_explanation.get_ranked_global_names(), global_explanation.get_ranked_global_values()))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain overall model predictions as a collection of local (instance-level) explanations" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# feature shap values for all features and all data points in the training data\n", + "print('local importance values: {}'.format(global_explanation.local_importance_values))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain local data points (individual instances)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# explain the first member of the test set\n", + "instance_num = 0\n", + "local_explanation = tabular_explainer.explain_local(x_test[instance_num,:])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# get the prediction for the first member of the test set and explain why model made that prediction\n", + "prediction_value = clf.predict(x_test)[instance_num]\n", + "\n", + "sorted_local_importance_values = local_explanation.get_ranked_local_values()[prediction_value]\n", + "sorted_local_importance_names = local_explanation.get_ranked_local_names()[prediction_value]\n", + "\n", + "\n", + "dict(zip(sorted_local_importance_names, sorted_local_importance_values))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Load visualization dashboard" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.contrib.explain.model.visualize import ExplanationDashboard" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ExplanationDashboard(global_explanation, model, x_test)" + ] + } + ], + "metadata": { + "authors": [ + { + "name": "mesameki" + } + ], + "kernelspec": { + "display_name": "Python 3.6", + "language": "python", + "name": "python36" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.8" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-regression.ipynb b/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-regression.ipynb new file mode 100644 index 00000000..d1c83107 --- /dev/null +++ b/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-regression.ipynb @@ -0,0 +1,251 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Boston Housing Price Prediction with scikit-learn (run model explainer locally)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) Microsoft Corporation. All rights reserved.\n", + "\n", + "Licensed under the MIT License." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Explain a model with the AML explain-model package\n", + "\n", + "1. Train a GradientBoosting regression model using Scikit-learn\n", + "2. Run 'explain_model' with full dataset in local mode, which doesn't contact any Azure services.\n", + "3. Run 'explain_model' with summarized dataset in local mode, which doesn't contact any Azure services.\n", + "4. Visualize the global and local explanations with the visualization dashboard." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from sklearn import datasets\n", + "from sklearn.ensemble import GradientBoostingRegressor\n", + "from azureml.explain.model.tabular_explainer import TabularExplainer" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 1. Run model explainer locally with full data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Load the Boston house price data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "boston_data = datasets.load_boston()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Split data into train and test\n", + "from sklearn.model_selection import train_test_split\n", + "x_train, x_test, y_train, y_test = train_test_split(boston_data.data, boston_data.target, test_size=0.2, random_state=0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Train a GradientBoosting Regression model, which you want to explain" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "reg = GradientBoostingRegressor(n_estimators=100, max_depth=4,\n", + " learning_rate=0.1, loss='huber',\n", + " random_state=1)\n", + "model = reg.fit(x_train, y_train)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain predictions on your local machine" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tabular_explainer = TabularExplainer(model, x_train, features = boston_data.feature_names)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain overall model predictions (global explanation)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Passing in test dataset for evaluation examples - note it must be a representative sample of the original data\n", + "# x_train can be passed as well, but with more examples explanations will take longer although they may be more accurate\n", + "global_explanation = tabular_explainer.explain_global(x_test)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Sorted SHAP values \n", + "print('ranked global importance values: {}'.format(global_explanation.get_ranked_global_values()))\n", + "# Corresponding feature names\n", + "print('ranked global importance names: {}'.format(global_explanation.get_ranked_global_names()))\n", + "# feature ranks (based on original order of features)\n", + "print('global importance rank: {}'.format(global_explanation.global_importance_rank))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "dict(zip(global_explanation.get_ranked_global_names(), global_explanation.get_ranked_global_values()))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain overall model predictions as a collection of local (instance-level) explanations" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# feature shap values for all features and all data points in the training data\n", + "print('local importance values: {}'.format(global_explanation.local_importance_values))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain local data points (individual instances)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "local_explanation = tabular_explainer.explain_local(x_test[0,:])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# sorted local feature importance information; reflects the original feature order\n", + "sorted_local_importance_names = local_explanation.get_ranked_local_names()\n", + "sorted_local_importance_values = local_explanation.get_ranked_local_values()\n", + "\n", + "print('sorted local importance names: {}'.format(sorted_local_importance_names))\n", + "print('sorted local importance values: {}'.format(sorted_local_importance_values))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Load visualization dashboard" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.contrib.explain.model.visualize import ExplanationDashboard" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ExplanationDashboard(global_explanation, model, x_test)" + ] + } + ], + "metadata": { + "authors": [ + { + "name": "mesameki" + } + ], + "kernelspec": { + "display_name": "Python 3.6", + "language": "python", + "name": "python36" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.8" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/how-to-use-azureml/explain-model/explain-tabular-data-raw-features/explain-sklearn-raw-features.ipynb b/how-to-use-azureml/explain-model/explain-tabular-data-raw-features/explain-sklearn-raw-features.ipynb new file mode 100644 index 00000000..af44afb8 --- /dev/null +++ b/how-to-use-azureml/explain-model/explain-tabular-data-raw-features/explain-sklearn-raw-features.ipynb @@ -0,0 +1,269 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Summary\n", + "From raw data that is a mixture of categoricals and numeric, featurize the categoricals using one hot encoding. Use tabular explainer to get explain object and then get raw feature importances" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) Microsoft Corporation. All rights reserved.\n", + "\n", + "Licensed under the MIT License." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Explain a model with the AML explain-model package on raw features\n", + "\n", + "1. Train a Logistic Regression model using Scikit-learn\n", + "2. Run 'explain_model' with full dataset in local mode, which doesn't contact any Azure services.\n", + "3. Run 'explain_model' with summarized dataset in local mode, which doesn't contact any Azure services.\n", + "4. Visualize the global and local explanations with the visualization dashboard." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from sklearn.pipeline import Pipeline\n", + "from sklearn.impute import SimpleImputer\n", + "from sklearn.preprocessing import StandardScaler, OneHotEncoder\n", + "from sklearn.linear_model import LogisticRegression\n", + "from azureml.contrib.explain.model.tabular_explainer import TabularExplainer\n", + "from sklearn_pandas import DataFrameMapper\n", + "import pandas as pd\n", + "import numpy as np" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "titanic_url = ('https://raw.githubusercontent.com/amueller/'\n", + " 'scipy-2017-sklearn/091d371/notebooks/datasets/titanic3.csv')\n", + "data = pd.read_csv(titanic_url)\n", + "# fill missing values\n", + "data = data.fillna(method=\"ffill\")\n", + "data = data.fillna(method=\"bfill\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 1. Run model explainer locally with full data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Similar to example [here](https://scikit-learn.org/stable/auto_examples/compose/plot_column_transformer_mixed_types.html#sphx-glr-auto-examples-compose-plot-column-transformer-mixed-types-py), use a subset of columns" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from sklearn.model_selection import train_test_split\n", + "\n", + "numeric_features = ['age', 'fare']\n", + "categorical_features = ['embarked', 'sex', 'pclass']\n", + "\n", + "y = data['survived'].values\n", + "X = data[categorical_features + numeric_features]\n", + "\n", + "x_train, x_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from sklearn.pipeline import Pipeline\n", + "from sklearn.impute import SimpleImputer\n", + "from sklearn.preprocessing import StandardScaler, OneHotEncoder\n", + "from sklearn_pandas import DataFrameMapper\n", + "\n", + "# Impute and standardize the numeric features\n", + "numeric_transformations = [([f], Pipeline(steps=[\n", + " ('imputer', SimpleImputer(strategy='median')),\n", + " ('scaler', StandardScaler())])) for f in numeric_features]\n", + " \n", + "# One hot encode the categorical features \n", + "categorical_transformations = [([f], OneHotEncoder(handle_unknown='ignore', sparse=False)) for f in categorical_features]\n", + "\n", + "\n", + "transformations = numeric_transformations + categorical_transformations\n", + "\n", + "# Append classifier to preprocessing pipeline.\n", + "# Now we have a full prediction pipeline.\n", + "clf = Pipeline(steps=[('preprocessor', DataFrameMapper(transformations)),\n", + " ('classifier', LogisticRegression(solver='lbfgs'))])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Train a Logistic Regression model, which you want to explain" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "model = clf.fit(x_train, y_train)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain predictions on your local machine" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tabular_explainer = TabularExplainer(clf.steps[-1][1], initialization_examples=x_train, features=x_train.columns, transformations=transformations)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Passing in test dataset for evaluation examples - note it must be a representative sample of the original data\n", + "# x_train can be passed as well, but with more examples explanations will take longer although they may be more accurate\n", + "global_explanation = tabular_explainer.explain_global(x_test)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "sorted_global_importance_values = global_explanation.get_ranked_global_values()\n", + "sorted_global_importance_names = global_explanation.get_ranked_global_names()\n", + "dict(zip(sorted_global_importance_names, sorted_global_importance_values))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain overall model predictions as a collection of local (instance-level) explanations" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# explain the first member of the test set\n", + "local_explanation = tabular_explainer.explain_local(x_test[:1])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# get the prediction for the first member of the test set and explain why model made that prediction\n", + "prediction_value = clf.predict(x_test)[0]\n", + "\n", + "sorted_local_importance_values = local_explanation.get_ranked_local_values()[prediction_value]\n", + "sorted_local_importance_names = local_explanation.get_ranked_local_names()[prediction_value]\n", + "\n", + "# Sorted local SHAP values\n", + "print('ranked local importance values: {}'.format(sorted_local_importance_values))\n", + "# Corresponding feature names\n", + "print('ranked local importance names: {}'.format(sorted_local_importance_names))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 2. Load visualization dashboard" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.contrib.explain.model.visualize import ExplanationDashboard" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ExplanationDashboard(global_explanation, model, x_test)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "authors": [ + { + "name": "mesameki" + } + ], + "kernelspec": { + "display_name": "Python 3.6", + "language": "python", + "name": "python36" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.8" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-classification.ipynb b/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-classification.ipynb new file mode 100644 index 00000000..0055f956 --- /dev/null +++ b/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-classification.ipynb @@ -0,0 +1,255 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Breast cancer diagnosis classification with scikit-learn (save model explanations via AML Run History)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) Microsoft Corporation. All rights reserved.\n", + "\n", + "Licensed under the MIT License." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Explain a model with the AML explain-model package\n", + "\n", + "1. Train a SVM classification model using Scikit-learn\n", + "2. Run 'explain_model' with AML Run History, which leverages run history service to store and manage the explanation data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from sklearn.datasets import load_breast_cancer\n", + "from sklearn import svm\n", + "from azureml.explain.model.tabular_explainer import TabularExplainer" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 1. Run model explainer locally with full data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Load the breast cancer diagnosis data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "breast_cancer_data = load_breast_cancer()\n", + "classes = breast_cancer_data.target_names.tolist()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Split data into train and test\n", + "from sklearn.model_selection import train_test_split\n", + "x_train, x_test, y_train, y_test = train_test_split(breast_cancer_data.data, breast_cancer_data.target, test_size=0.2, random_state=0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Train a SVM classification model, which you want to explain" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "clf = svm.SVC(gamma=0.001, C=100., probability=True)\n", + "model = clf.fit(x_train, y_train)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain predictions on your local machine" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tabular_explainer = TabularExplainer(model, x_train, features=breast_cancer_data.feature_names, classes=classes)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain overall model predictions (global explanation)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Passing in test dataset for evaluation examples - note it must be a representative sample of the original data\n", + "# x_train can be passed as well, but with more examples explanations will take longer although they may be more accurate\n", + "global_explanation = tabular_explainer.explain_global(x_test)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 2. Save Model Explanation With AML Run History" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import azureml.core\n", + "from azureml.core import Workspace, Experiment, Run\n", + "from azureml.explain.model.tabular_explainer import TabularExplainer\n", + "from azureml.contrib.explain.model.explanation.explanation_client import ExplanationClient\n", + "# Check core SDK version number\n", + "print(\"SDK version:\", azureml.core.VERSION)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ws = Workspace.from_config()\n", + "print('Workspace name: ' + ws.name, \n", + " 'Azure region: ' + ws.location, \n", + " 'Subscription id: ' + ws.subscription_id, \n", + " 'Resource group: ' + ws.resource_group, sep = '\\n')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "experiment_name = 'explain_model'\n", + "experiment = Experiment(ws, experiment_name)\n", + "run = experiment.start_logging()\n", + "client = ExplanationClient.from_run(run)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Uploading model explanation data for storage or visualization in webUX\n", + "# The explanation can then be downloaded on any compute\n", + "client.upload_model_explanation(global_explanation)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Get model explanation data\n", + "explanation = client.download_model_explanation()\n", + "local_importance_values = explanation.local_importance_values\n", + "expected_values = explanation.expected_values" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Get the top k (e.g., 4) most important features with their importance values\n", + "explanation = client.download_model_explanation(top_k=4)\n", + "global_importance_values = explanation.get_ranked_global_values()\n", + "global_importance_names = explanation.get_ranked_global_names()\n", + "per_class_names = explanation.get_ranked_per_class_names()[0]\n", + "per_class_values = explanation.get_ranked_per_class_values()[0]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "print('per class feature importance values: {}'.format(per_class_values))\n", + "print('per class feature importance names: {}'.format(per_class_names))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "dict(zip(per_class_names, per_class_values))" + ] + } + ], + "metadata": { + "authors": [ + { + "name": "mesameki" + } + ], + "kernelspec": { + "display_name": "Python 3.6", + "language": "python", + "name": "python36" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.8" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-regression.ipynb b/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-regression.ipynb new file mode 100644 index 00000000..5b6fbb32 --- /dev/null +++ b/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-regression.ipynb @@ -0,0 +1,269 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Boston Housing Price Prediction with scikit-learn (save model explanations via AML Run History)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) Microsoft Corporation. All rights reserved.\n", + "\n", + "Licensed under the MIT License." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Explain a model with the AML explain-model package\n", + "\n", + "1. Train a GradientBoosting regression model using Scikit-learn\n", + "2. Run 'explain_model' with AML Run History, which leverages run history service to store and manage the explanation data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Save Model Explanation With AML Run History" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#Import Iris dataset\n", + "from sklearn import datasets\n", + "from sklearn.ensemble import GradientBoostingRegressor\n", + "\n", + "import azureml.core\n", + "from azureml.core import Workspace, Experiment, Run\n", + "from azureml.explain.model.tabular_explainer import TabularExplainer\n", + "from azureml.contrib.explain.model.explanation.explanation_client import ExplanationClient\n", + "# Check core SDK version number\n", + "print(\"SDK version:\", azureml.core.VERSION)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ws = Workspace.from_config()\n", + "print('Workspace name: ' + ws.name, \n", + " 'Azure region: ' + ws.location, \n", + " 'Subscription id: ' + ws.subscription_id, \n", + " 'Resource group: ' + ws.resource_group, sep = '\\n')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "experiment_name = 'explain_model'\n", + "experiment = Experiment(ws, experiment_name)\n", + "run = experiment.start_logging()\n", + "client = ExplanationClient.from_run(run)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Load the Boston house price data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "boston_data = datasets.load_boston()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Split data into train and test\n", + "from sklearn.model_selection import train_test_split\n", + "x_train, x_test, y_train, y_test = train_test_split(boston_data.data, boston_data.target, test_size=0.2, random_state=0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Train a GradientBoosting Regression model, which you want to explain" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "clf = GradientBoostingRegressor(n_estimators=100, max_depth=4,\n", + " learning_rate=0.1, loss='huber',\n", + " random_state=1)\n", + "model = clf.fit(x_train, y_train)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain predictions on your local machine" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tabular_explainer = TabularExplainer(model, x_train, features=boston_data.feature_names)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain overall model predictions (global explanation)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Passing in test dataset for evaluation examples - note it must be a representative sample of the original data\n", + "# x_train can be passed as well, but with more examples explanations will take longer although they may be more accurate\n", + "global_explanation = tabular_explainer.explain_global(x_test)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Uploading model explanation data for storage or visualization in webUX\n", + "# The explanation can then be downloaded on any compute\n", + "client.upload_model_explanation(global_explanation)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Get model explanation data\n", + "explanation = client.download_model_explanation()\n", + "local_importance_values = explanation.local_importance_values\n", + "expected_values = explanation.expected_values" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Print the values\n", + "print('expected values: {}'.format(expected_values))\n", + "print('local importance values: {}'.format(local_importance_values))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Get the top k (e.g., 4) most important features with their importance values\n", + "explanation = client.download_model_explanation(top_k=4)\n", + "global_importance_values = explanation.get_ranked_global_values()\n", + "global_importance_names = explanation.get_ranked_global_names()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "print('global importance values: {}'.format(global_importance_values))\n", + "print('global importance names: {}'.format(global_importance_names))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain individual instance predictions (local explanation) ##### needs to get updated with the new build" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "local_explanation = tabular_explainer.explain_local(x_test[0,:])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# local feature importance information\n", + "local_importance_values = local_explanation.local_importance_values\n", + "print('local importance values: {}'.format(local_importance_values))" + ] + } + ], + "metadata": { + "authors": [ + { + "name": "mesameki" + } + ], + "kernelspec": { + "display_name": "Python 3.6", + "language": "python", + "name": "python36" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.8" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/how-to-use-azureml/explain-model/explain-tabular-data/explain-tabular-data.ipynb b/how-to-use-azureml/explain-model/explain-tabular-data/explain-tabular-data.ipynb deleted file mode 100644 index 22075b3f..00000000 --- a/how-to-use-azureml/explain-model/explain-tabular-data/explain-tabular-data.ipynb +++ /dev/null @@ -1,267 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Copyright (c) Microsoft Corporation. All rights reserved.\n", - "\n", - "Licensed under the MIT License." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Uncomment these if explanation packages are not already installed in your environment\n", - "#!pip install --upgrade azureml-sdk[explain]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Explain a model with the AML explain-model package\n", - "\n", - "1. Train a SVM model using Scikit-learn\n", - "2. Run 'explain_model' in local mode, which doesn't contact any Azure services\n", - "3. Run 'explain_model' with AML Run History, which leverages Run History Service to store and manage the explanation data" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Disclaimer: this notebook is a preview of model explainability, and the APIs shown below are subject to breaking changes" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Train a SVM model, which we will try to explain" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Import Iris dataset\n", - "from sklearn import datasets\n", - "iris = datasets.load_iris()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Split data into train and test\n", - "from sklearn.model_selection import train_test_split\n", - "x_train, x_test, y_train, y_test = train_test_split(iris.data, iris.target, test_size=0.2, random_state=0)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Import scikit learn, fit a SVM model\n", - "def create_scikit_learn_model(X, y):\n", - " from sklearn import svm\n", - " clf = svm.SVC(gamma=0.001, C=100., probability=True)\n", - " model = clf.fit(X, y)\n", - " return model\n", - "model = create_scikit_learn_model(x_train, y_train)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Run model explainer locally" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.explain.model.tabular_explainer import TabularExplainer" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import time\n", - "start = time.time()\n", - "\n", - "explainer = TabularExplainer(model, x_train, features=iris.feature_names)\n", - "global_explanation = explainer.explain_global(x_test)\n", - "\n", - "# importance values for each class, test example, and feature (local importance)\n", - "local_imp_values = global_explanation.local_importance_values\n", - "# base prediction with feature importances ignored\n", - "expected_values = global_explanation.expected_values\n", - "# global feature importance information\n", - "global_imp_values = global_explanation.global_importance_values\n", - "ranked_global_imp_names = global_explanation.get_ranked_global_names()\n", - "# global per-class feature importance information\n", - "per_class_imp_values = global_explanation.per_class_values\n", - "ranked_per_class_imp_names = global_explanation.get_ranked_per_class_names()\n", - "\n", - "end = time.time()\n", - "print(end - start)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Run model explainer with AML Run History" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import azureml.core\n", - "from azureml.core import Workspace, Experiment, Run\n", - "from azureml.explain.model.tabular_explainer import TabularExplainer\n", - "from azureml.contrib.explain.model.explanation.explanation_client import ExplanationClient\n", - "# Check core SDK version number\n", - "print(\"SDK version:\", azureml.core.VERSION)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "ws = Workspace.from_config()\n", - "print('Workspace name: ' + ws.name, \n", - " 'Azure region: ' + ws.location, \n", - " 'Subscription id: ' + ws.subscription_id, \n", - " 'Resource group: ' + ws.resource_group, sep = '\\n')" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "experiment_name = 'explain_model'\n", - "experiment = Experiment(ws, experiment_name)\n", - "run = experiment.start_logging()\n", - "client = ExplanationClient.from_run(run)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import time\n", - "start = time.time()\n", - "explainer = TabularExplainer(model, x_train, features=iris.feature_names, classes=iris.target_names)\n", - "explanation = explainer.explain_global(x_test)\n", - "client.upload_model_explanation(explanation)\n", - "end = time.time()\n", - "print(end - start)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "explanation_from_run = client.download_model_explanation()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# global feature importance information\n", - "global_imp_values = explanation_from_run.global_importance_values\n", - "global_imp_names = explanation_from_run.get_ranked_global_names()\n", - "# global per-class feature importance information\n", - "per_class_imp_values = explanation_from_run.per_class_values\n", - "per_class_imp_names = explanation_from_run.get_ranked_per_class_names()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## This visualization is unsupported, and is not guaranteed to work in the future" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Get the shap values and explore locally\n", - "import shap\n", - "import numpy as np\n", - "shap.initjs()\n", - "display(shap.force_plot(explanation_from_run.expected_values[1], np.asarray(explanation_from_run.local_importance_values[1]), x_test))" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "run.complete()" - ] - } - ], - "metadata": { - "authors": [ - { - "name": "wamartin" - } - ], - "kernelspec": { - "display_name": "Python 3.6", - "language": "python", - "name": "python36" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.8" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} \ No newline at end of file From 51523db294b55a6de3ddfdab7f4e802b47134924 Mon Sep 17 00:00:00 2001 From: May Hu <47834041+MayMSFT@users.noreply.github.com> Date: Thu, 2 May 2019 09:07:11 -0700 Subject: [PATCH 003/108] add dataset tutorial --- .../datasets/datasets-tutorial.ipynb | 430 +++++++++ .../datasets/train-dataset/Titanic.csv | 892 ++++++++++++++++++ .../datasets/train-dataset/train.py | 36 + 3 files changed, 1358 insertions(+) create mode 100644 how-to-use-azureml/work-with-data/datasets/datasets-tutorial.ipynb create mode 100644 how-to-use-azureml/work-with-data/datasets/train-dataset/Titanic.csv create mode 100644 how-to-use-azureml/work-with-data/datasets/train-dataset/train.py diff --git a/how-to-use-azureml/work-with-data/datasets/datasets-tutorial.ipynb b/how-to-use-azureml/work-with-data/datasets/datasets-tutorial.ipynb new file mode 100644 index 00000000..fbdc81f7 --- /dev/null +++ b/how-to-use-azureml/work-with-data/datasets/datasets-tutorial.ipynb @@ -0,0 +1,430 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Tutorial: Learn how to use Datasets in Azure ML" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In this tutorial, you learn how to use Azure ML Datasets to train a regression model with the Azure Machine Learning SDK for Python. You will\n", + "\n", + "* Explore and prepare data for training the model\n", + "* Register the Dataset in your workspace to share it with others\n", + "* Take snapshots of data to ensure models can be trained with the same data every time\n", + "* Create and use multiple Dataset definitions to ensure that updates to the definition don't break existing pipelines/scripts\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In this tutorial, you:\n", + "\n", + "☑ Setup a Python environment and import packages\n", + "\n", + "☑ Load the Titanic data from your Azure Blob Storage. (The [original data](https://www.kaggle.com/c/titanic/data) can be found on Kaggle)\n", + "\n", + "☑ Explore and cleanse the data to remove anomalies\n", + "\n", + "☑ Register the Dataset in your workspace, allowing you to use it in model training \n", + "\n", + "☑ Take a Dataset snapshot for repeatability and train a model with the snapshot\n", + "\n", + "☑ Make changes to the dataset's definition without breaking the production model or the daily data pipeline" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Pre-requisites:\n", + "Skip to Set up your development environment to read through the notebook steps, or use the instructions below to get the notebook and run it on Azure Notebooks or your own notebook server. To run the notebook you will need:\n", + "\n", + "A Python 3.6 notebook server with the following installed:\n", + "* The Azure Machine Learning SDK for Python\n", + "* The Azure Machine Learning Data Prep SDK for Python\n", + "* The tutorial notebook\n", + "\n", + "Data and train.py script to store in your Azure Blob Storage Account.\n", + " * [Titanic data](./train-dataset/Titanic.csv)\n", + " * [train.py](./train-dataset/train.py)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To create and register Datasets you need:\n", + "\n", + " * An Azure subscription. If you don’t have an Azure subscription, create a free account before you begin. Try the [free or paid version of Azure Machine Learning service](https://aka.ms/AMLFree) today.\n", + "\n", + " * An Azure Machine Learning service workspace. See the [Create an Azure Machine Learning service workspace](https://docs.microsoft.com/en-us/azure/machine-learning/service/setup-create-workspace?branch=release-build-amls).\n", + "\n", + " * The Azure Machine Learning SDK for Python (version 1.0.21 or later). To install or update to the latest version of the SDK, see [Install or update the SDK](https://docs.microsoft.com/python/api/overview/azure/ml/install?view=azure-ml-py).\n", + "\n", + "\n", + "For more information on how to set up your workspace, see the [Create an Azure Machine Learning service workspace](https://docs.microsoft.com/en-us/azure/machine-learning/service/setup-create-workspace?branch=release-build-amls).\n", + "\n", + "The first part that needs to be done is setting up your python environment. You will need to import all of your python packages including `azureml.dataprep` and `azureml.core.dataset`. Then access your workspace through your Azure subscription and set up your compute target. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import azureml.dataprep as dprep\n", + "import azureml.core\n", + "import pandas as pd\n", + "import logging\n", + "import os\n", + "import shutil\n", + "from azureml.core import Workspace, Datastore, Dataset\n", + "\n", + "# Get existing workspace from config.json file in the same folder as the tutorial notebook\n", + "# You can download the config file from your workspace\n", + "workspace = Workspace.from_config()\n", + "print(\"Workspace\")\n", + "print(workspace)\n", + "print(\"Compute targets\")\n", + "print(workspace.compute_targets)\n", + "\n", + "# Get compute target that has already been attached to the workspace\n", + "# Pick the right compute target from the list of computes attached to your workspace\n", + "\n", + "compute_target_name = 'dataset-test'\n", + "remote_compute_target = workspace.compute_targets[compute_target_name]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To load data to your dataset, you will access the data through your datastore. After you create your dataset, you can use `get_profile()` to see your data's statistics.\n", + "\n", + "We will now upload the [original data](https://www.kaggle.com/c/titanic/data) to the default datastore(blob) within your workspace.." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "datastore = workspace.get_default_datastore()\n", + "datastore.upload_files(files=['./train-dataset/Titanic.csv'],\n", + " target_path='train-dataset/',\n", + " overwrite=True,\n", + " show_progress=True)\n", + "\n", + "dataset = Dataset.auto_read_files(path=datastore.path('train-dataset/Titanic.csv'))\n", + "\n", + "#Display Dataset Profile of the Titanic Dataset\n", + "dataset.get_profile()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To predict if a person survived the Titanic's sinking or not, the columns that are relevant to train the model are 'Survived','Pclass', 'Sex','SibSp', and 'Parch'. You can update your dataset's deinition and only keep these columns you will need. You will also need to convert values (\"male\",\"female\") in the \"Sex\" column to 0 or 1, because the algorithm in the train.py file will be using numeric values instead of strings.\n", + "\n", + "For more examples of preparing data with Datasets, see [Explore and prepare data with the Dataset class](aka.ms/azureml/howto/exploreandpreparedata)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ds_def = dataset.get_definition()\n", + "ds_def = ds_def.keep_columns(['Survived','Pclass', 'Sex','SibSp', 'Parch', 'Fare'])\n", + "ds_def = ds_def.replace('Sex','male', 0)\n", + "ds_def = ds_def.replace('Sex','female', 1)\n", + "ds_def.head(5)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Once you have cleaned your data, you can register your dataset in your workspace. \n", + "\n", + "Registering your dataset allows you to easily have access to your processed data and share it with other people in your organization using the same workspace. It can be accessed in any notebook or script that is connected to your workspace." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "dataset = dataset.update_definition(ds_def, 'Cleaned Data')\n", + "\n", + "dataset.generate_profile(compute_target='local').get_result()\n", + "\n", + "dataset_name = 'clean_Titanic_tutorial'\n", + "dataset = dataset.register(workspace=workspace,\n", + " name=dataset_name,\n", + " description='training dataset',\n", + " tags = {'year':'2019', 'month':'Apr'},\n", + " exist_ok=True)\n", + "workspace.datasets" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can also take a snapshot of your dataset. This makes for easily reproducing your data as it is in that moment. Even if you changed the definition of your dataset, or have data that refreshes regularly, you can always go back to your snapshot to compare. Since this snapshot is being created on a compute in your workspace, it may take a signficant amount of time to provision the compute before running the action itself." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "print(dataset.get_all_snapshots())\n", + "snapshot_name = 'train_snapshot'\n", + "\n", + "print(\"Compute target status\")\n", + "print(remote_compute_target.get_status().provisioning_state)\n", + "\n", + "snapshot = dataset.create_snapshot(snapshot_name=snapshot_name, \n", + " compute_target=remote_compute_target, \n", + " create_data_snapshot=True)\n", + "snapshot.wait_for_completion()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now that you have registered your dataset and created a snapshot, you can call up the dataset and it's snapshot to use it in your train.py script.\n", + "\n", + "The following code snippit will train your model locally using the train.py script." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core import Experiment, RunConfiguration\n", + "\n", + "experiment_name = 'training-datasets'\n", + "experiment = Experiment(workspace = workspace, name = experiment_name)\n", + "project_folder = './train-dataset/'\n", + "\n", + "# create a new RunConfig object\n", + "run_config = RunConfiguration()\n", + "\n", + "run_config.environment.python.user_managed_dependencies = True\n", + "\n", + "from azureml.core import Run\n", + "from azureml.core import ScriptRunConfig\n", + "\n", + "src = ScriptRunConfig(source_directory=project_folder, \n", + " script='train.py', \n", + " run_config=run_config) \n", + "run = experiment.submit(config=src)\n", + "run.wait_for_completion(show_output=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can also use the same script with your dataset snapshot for your Pipeline's Python Script Step.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.pipeline.core import Pipeline, PipelineData\n", + "from azureml.pipeline.steps import PythonScriptStep\n", + "from azureml.data.data_reference import DataReference\n", + "\n", + "trainStep = PythonScriptStep(script_name=\"train.py\",\n", + " compute_target=remote_compute_target,\n", + " source_directory=project_folder)\n", + "\n", + "pipeline = Pipeline(workspace=workspace,\n", + " steps=trainStep)\n", + "\n", + "pipeline_run = experiment.submit(pipeline)\n", + "pipeline_run.wait_for_completion()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "During any point of your workflow, you can get a previous snapshot of your dataset and use that version in your pipeline to quickly see how different versions of your data can effect your model." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "snapshot = dataset.get_snapshot(snapshot_name=snapshot_name)\n", + "snapshot.to_pandas_dataframe().head(5)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can make changes to the dataset's definition without breaking the production model or the daily data pipeline. " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can call get_definitions to see that there are several versions. After each change to a dataset's version, another one is added." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "dataset.get_definitions()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "dataset = Dataset.get(workspace=workspace, name=dataset_name)\n", + "ds_def = dataset.get_definition()\n", + "ds_def = ds_def.drop_columns(['Fare'])\n", + "dataset = dataset.update_definition(ds_def, 'Dropping Fare as PClass and Fare are strongly correlated')\n", + "dataset.generate_profile(compute_target='local').get_result()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Dataset definitions can be deprecated when usage is no longer recommended and a replacement is available. When a deprecated dataset definition is used in an AML Experimentation/Pipeline scenario, a warning message gets returned but execution will not be blocked. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Deprecate dataset definition 1 by the 2nd definition\n", + "ds_def = dataset.get_definition('1')\n", + "ds_def.deprecate(deprecate_by_dataset_id=dataset._id, deprecated_by_definition_version='2')\n", + "dataset.get_definitions()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Dataset definitions can be archived when definitions are not supposed to be used for any reasons (such as underlying data no longer available). When an archived dataset definition is used in an AML Experimentation/Pipeline scenario, execution will be blocked with error. No further actions can be performed on archived Dataset definitions, but the references will be kept intact. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Archive the deprecated dataset definition #1\n", + "ds_def = dataset.get_definition('1')\n", + "ds_def.archive()\n", + "dataset.get_definitions()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can also reactivate any defition that you archived for later use." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ds_def = dataset.get_definition('1')\n", + "ds_def.reactivate()\n", + "dataset.get_definitions()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now delete the current snapshot name to clean up your resource's space." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "dataset.delete_snapshot(snapshot_name)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You have now finished using a dataset from start to finish of your experiment!" + ] + } + ], + "metadata": { + "authors": [ + { + "name": "cforbe" + } + ], + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/how-to-use-azureml/work-with-data/datasets/train-dataset/Titanic.csv b/how-to-use-azureml/work-with-data/datasets/train-dataset/Titanic.csv new file mode 100644 index 00000000..5cc466e9 --- /dev/null +++ b/how-to-use-azureml/work-with-data/datasets/train-dataset/Titanic.csv @@ -0,0 +1,892 @@ +PassengerId,Survived,Pclass,Name,Sex,Age,SibSp,Parch,Ticket,Fare,Cabin,Embarked +1,0,3,"Braund, Mr. Owen Harris",male,22,1,0,A/5 21171,7.25,,S +2,1,1,"Cumings, Mrs. John Bradley (Florence Briggs Thayer)",female,38,1,0,PC 17599,71.2833,C85,C +3,1,3,"Heikkinen, Miss. Laina",female,26,0,0,STON/O2. 3101282,7.925,,S +4,1,1,"Futrelle, Mrs. Jacques Heath (Lily May Peel)",female,35,1,0,113803,53.1,C123,S +5,0,3,"Allen, Mr. William Henry",male,35,0,0,373450,8.05,,S +6,0,3,"Moran, Mr. James",male,,0,0,330877,8.4583,,Q +7,0,1,"McCarthy, Mr. Timothy J",male,54,0,0,17463,51.8625,E46,S +8,0,3,"Palsson, Master. Gosta Leonard",male,2,3,1,349909,21.075,,S +9,1,3,"Johnson, Mrs. Oscar W (Elisabeth Vilhelmina Berg)",female,27,0,2,347742,11.1333,,S +10,1,2,"Nasser, Mrs. Nicholas (Adele Achem)",female,14,1,0,237736,30.0708,,C +11,1,3,"Sandstrom, Miss. Marguerite Rut",female,4,1,1,PP 9549,16.7,G6,S +12,1,1,"Bonnell, Miss. Elizabeth",female,58,0,0,113783,26.55,C103,S +13,0,3,"Saundercock, Mr. William Henry",male,20,0,0,A/5. 2151,8.05,,S +14,0,3,"Andersson, Mr. Anders Johan",male,39,1,5,347082,31.275,,S +15,0,3,"Vestrom, Miss. Hulda Amanda Adolfina",female,14,0,0,350406,7.8542,,S +16,1,2,"Hewlett, Mrs. (Mary D Kingcome) ",female,55,0,0,248706,16,,S +17,0,3,"Rice, Master. Eugene",male,2,4,1,382652,29.125,,Q +18,1,2,"Williams, Mr. Charles Eugene",male,,0,0,244373,13,,S +19,0,3,"Vander Planke, Mrs. Julius (Emelia Maria Vandemoortele)",female,31,1,0,345763,18,,S +20,1,3,"Masselmani, Mrs. Fatima",female,,0,0,2649,7.225,,C +21,0,2,"Fynney, Mr. Joseph J",male,35,0,0,239865,26,,S +22,1,2,"Beesley, Mr. Lawrence",male,34,0,0,248698,13,D56,S +23,1,3,"McGowan, Miss. Anna ""Annie""",female,15,0,0,330923,8.0292,,Q +24,1,1,"Sloper, Mr. William Thompson",male,28,0,0,113788,35.5,A6,S +25,0,3,"Palsson, Miss. Torborg Danira",female,8,3,1,349909,21.075,,S +26,1,3,"Asplund, Mrs. Carl Oscar (Selma Augusta Emilia Johansson)",female,38,1,5,347077,31.3875,,S +27,0,3,"Emir, Mr. Farred Chehab",male,,0,0,2631,7.225,,C +28,0,1,"Fortune, Mr. Charles Alexander",male,19,3,2,19950,263,C23 C25 C27,S +29,1,3,"O'Dwyer, Miss. Ellen ""Nellie""",female,,0,0,330959,7.8792,,Q +30,0,3,"Todoroff, Mr. Lalio",male,,0,0,349216,7.8958,,S +31,0,1,"Uruchurtu, Don. Manuel E",male,40,0,0,PC 17601,27.7208,,C +32,1,1,"Spencer, Mrs. William Augustus (Marie Eugenie)",female,,1,0,PC 17569,146.5208,B78,C +33,1,3,"Glynn, Miss. Mary Agatha",female,,0,0,335677,7.75,,Q +34,0,2,"Wheadon, Mr. Edward H",male,66,0,0,C.A. 24579,10.5,,S +35,0,1,"Meyer, Mr. Edgar Joseph",male,28,1,0,PC 17604,82.1708,,C +36,0,1,"Holverson, Mr. Alexander Oskar",male,42,1,0,113789,52,,S +37,1,3,"Mamee, Mr. Hanna",male,,0,0,2677,7.2292,,C +38,0,3,"Cann, Mr. Ernest Charles",male,21,0,0,A./5. 2152,8.05,,S +39,0,3,"Vander Planke, Miss. Augusta Maria",female,18,2,0,345764,18,,S +40,1,3,"Nicola-Yarred, Miss. Jamila",female,14,1,0,2651,11.2417,,C +41,0,3,"Ahlin, Mrs. Johan (Johanna Persdotter Larsson)",female,40,1,0,7546,9.475,,S +42,0,2,"Turpin, Mrs. William John Robert (Dorothy Ann Wonnacott)",female,27,1,0,11668,21,,S +43,0,3,"Kraeff, Mr. Theodor",male,,0,0,349253,7.8958,,C +44,1,2,"Laroche, Miss. Simonne Marie Anne Andree",female,3,1,2,SC/Paris 2123,41.5792,,C +45,1,3,"Devaney, Miss. Margaret Delia",female,19,0,0,330958,7.8792,,Q +46,0,3,"Rogers, Mr. William John",male,,0,0,S.C./A.4. 23567,8.05,,S +47,0,3,"Lennon, Mr. Denis",male,,1,0,370371,15.5,,Q +48,1,3,"O'Driscoll, Miss. Bridget",female,,0,0,14311,7.75,,Q +49,0,3,"Samaan, Mr. Youssef",male,,2,0,2662,21.6792,,C +50,0,3,"Arnold-Franchi, Mrs. Josef (Josefine Franchi)",female,18,1,0,349237,17.8,,S +51,0,3,"Panula, Master. Juha Niilo",male,7,4,1,3101295,39.6875,,S +52,0,3,"Nosworthy, Mr. Richard Cater",male,21,0,0,A/4. 39886,7.8,,S +53,1,1,"Harper, Mrs. Henry Sleeper (Myna Haxtun)",female,49,1,0,PC 17572,76.7292,D33,C +54,1,2,"Faunthorpe, Mrs. Lizzie (Elizabeth Anne Wilkinson)",female,29,1,0,2926,26,,S +55,0,1,"Ostby, Mr. Engelhart Cornelius",male,65,0,1,113509,61.9792,B30,C +56,1,1,"Woolner, Mr. Hugh",male,,0,0,19947,35.5,C52,S +57,1,2,"Rugg, Miss. Emily",female,21,0,0,C.A. 31026,10.5,,S +58,0,3,"Novel, Mr. Mansouer",male,28.5,0,0,2697,7.2292,,C +59,1,2,"West, Miss. Constance Mirium",female,5,1,2,C.A. 34651,27.75,,S +60,0,3,"Goodwin, Master. William Frederick",male,11,5,2,CA 2144,46.9,,S +61,0,3,"Sirayanian, Mr. Orsen",male,22,0,0,2669,7.2292,,C +62,1,1,"Icard, Miss. Amelie",female,38,0,0,113572,80,B28, +63,0,1,"Harris, Mr. Henry Birkhardt",male,45,1,0,36973,83.475,C83,S +64,0,3,"Skoog, Master. Harald",male,4,3,2,347088,27.9,,S +65,0,1,"Stewart, Mr. Albert A",male,,0,0,PC 17605,27.7208,,C +66,1,3,"Moubarek, Master. Gerios",male,,1,1,2661,15.2458,,C +67,1,2,"Nye, Mrs. (Elizabeth Ramell)",female,29,0,0,C.A. 29395,10.5,F33,S +68,0,3,"Crease, Mr. Ernest James",male,19,0,0,S.P. 3464,8.1583,,S +69,1,3,"Andersson, Miss. Erna Alexandra",female,17,4,2,3101281,7.925,,S +70,0,3,"Kink, Mr. Vincenz",male,26,2,0,315151,8.6625,,S +71,0,2,"Jenkin, Mr. Stephen Curnow",male,32,0,0,C.A. 33111,10.5,,S +72,0,3,"Goodwin, Miss. Lillian Amy",female,16,5,2,CA 2144,46.9,,S +73,0,2,"Hood, Mr. Ambrose Jr",male,21,0,0,S.O.C. 14879,73.5,,S +74,0,3,"Chronopoulos, Mr. Apostolos",male,26,1,0,2680,14.4542,,C +75,1,3,"Bing, Mr. Lee",male,32,0,0,1601,56.4958,,S +76,0,3,"Moen, Mr. Sigurd Hansen",male,25,0,0,348123,7.65,F G73,S +77,0,3,"Staneff, Mr. Ivan",male,,0,0,349208,7.8958,,S +78,0,3,"Moutal, Mr. Rahamin Haim",male,,0,0,374746,8.05,,S +79,1,2,"Caldwell, Master. Alden Gates",male,0.83,0,2,248738,29,,S +80,1,3,"Dowdell, Miss. Elizabeth",female,30,0,0,364516,12.475,,S +81,0,3,"Waelens, Mr. Achille",male,22,0,0,345767,9,,S +82,1,3,"Sheerlinck, Mr. Jan Baptist",male,29,0,0,345779,9.5,,S +83,1,3,"McDermott, Miss. Brigdet Delia",female,,0,0,330932,7.7875,,Q +84,0,1,"Carrau, Mr. Francisco M",male,28,0,0,113059,47.1,,S +85,1,2,"Ilett, Miss. Bertha",female,17,0,0,SO/C 14885,10.5,,S +86,1,3,"Backstrom, Mrs. Karl Alfred (Maria Mathilda Gustafsson)",female,33,3,0,3101278,15.85,,S +87,0,3,"Ford, Mr. William Neal",male,16,1,3,W./C. 6608,34.375,,S +88,0,3,"Slocovski, Mr. Selman Francis",male,,0,0,SOTON/OQ 392086,8.05,,S +89,1,1,"Fortune, Miss. Mabel Helen",female,23,3,2,19950,263,C23 C25 C27,S +90,0,3,"Celotti, Mr. Francesco",male,24,0,0,343275,8.05,,S +91,0,3,"Christmann, Mr. Emil",male,29,0,0,343276,8.05,,S +92,0,3,"Andreasson, Mr. Paul Edvin",male,20,0,0,347466,7.8542,,S +93,0,1,"Chaffee, Mr. Herbert Fuller",male,46,1,0,W.E.P. 5734,61.175,E31,S +94,0,3,"Dean, Mr. Bertram Frank",male,26,1,2,C.A. 2315,20.575,,S +95,0,3,"Coxon, Mr. Daniel",male,59,0,0,364500,7.25,,S +96,0,3,"Shorney, Mr. Charles Joseph",male,,0,0,374910,8.05,,S +97,0,1,"Goldschmidt, Mr. George B",male,71,0,0,PC 17754,34.6542,A5,C +98,1,1,"Greenfield, Mr. William Bertram",male,23,0,1,PC 17759,63.3583,D10 D12,C +99,1,2,"Doling, Mrs. John T (Ada Julia Bone)",female,34,0,1,231919,23,,S +100,0,2,"Kantor, Mr. Sinai",male,34,1,0,244367,26,,S +101,0,3,"Petranec, Miss. Matilda",female,28,0,0,349245,7.8958,,S +102,0,3,"Petroff, Mr. Pastcho (""Pentcho"")",male,,0,0,349215,7.8958,,S +103,0,1,"White, Mr. Richard Frasar",male,21,0,1,35281,77.2875,D26,S +104,0,3,"Johansson, Mr. Gustaf Joel",male,33,0,0,7540,8.6542,,S +105,0,3,"Gustafsson, Mr. Anders Vilhelm",male,37,2,0,3101276,7.925,,S +106,0,3,"Mionoff, Mr. Stoytcho",male,28,0,0,349207,7.8958,,S +107,1,3,"Salkjelsvik, Miss. Anna Kristine",female,21,0,0,343120,7.65,,S +108,1,3,"Moss, Mr. Albert Johan",male,,0,0,312991,7.775,,S +109,0,3,"Rekic, Mr. Tido",male,38,0,0,349249,7.8958,,S +110,1,3,"Moran, Miss. Bertha",female,,1,0,371110,24.15,,Q +111,0,1,"Porter, Mr. Walter Chamberlain",male,47,0,0,110465,52,C110,S +112,0,3,"Zabour, Miss. Hileni",female,14.5,1,0,2665,14.4542,,C +113,0,3,"Barton, Mr. David John",male,22,0,0,324669,8.05,,S +114,0,3,"Jussila, Miss. Katriina",female,20,1,0,4136,9.825,,S +115,0,3,"Attalah, Miss. Malake",female,17,0,0,2627,14.4583,,C +116,0,3,"Pekoniemi, Mr. Edvard",male,21,0,0,STON/O 2. 3101294,7.925,,S +117,0,3,"Connors, Mr. Patrick",male,70.5,0,0,370369,7.75,,Q +118,0,2,"Turpin, Mr. William John Robert",male,29,1,0,11668,21,,S +119,0,1,"Baxter, Mr. Quigg Edmond",male,24,0,1,PC 17558,247.5208,B58 B60,C +120,0,3,"Andersson, Miss. Ellis Anna Maria",female,2,4,2,347082,31.275,,S +121,0,2,"Hickman, Mr. Stanley George",male,21,2,0,S.O.C. 14879,73.5,,S +122,0,3,"Moore, Mr. Leonard Charles",male,,0,0,A4. 54510,8.05,,S +123,0,2,"Nasser, Mr. Nicholas",male,32.5,1,0,237736,30.0708,,C +124,1,2,"Webber, Miss. Susan",female,32.5,0,0,27267,13,E101,S +125,0,1,"White, Mr. Percival Wayland",male,54,0,1,35281,77.2875,D26,S +126,1,3,"Nicola-Yarred, Master. Elias",male,12,1,0,2651,11.2417,,C +127,0,3,"McMahon, Mr. Martin",male,,0,0,370372,7.75,,Q +128,1,3,"Madsen, Mr. Fridtjof Arne",male,24,0,0,C 17369,7.1417,,S +129,1,3,"Peter, Miss. Anna",female,,1,1,2668,22.3583,F E69,C +130,0,3,"Ekstrom, Mr. Johan",male,45,0,0,347061,6.975,,S +131,0,3,"Drazenoic, Mr. Jozef",male,33,0,0,349241,7.8958,,C +132,0,3,"Coelho, Mr. Domingos Fernandeo",male,20,0,0,SOTON/O.Q. 3101307,7.05,,S +133,0,3,"Robins, Mrs. Alexander A (Grace Charity Laury)",female,47,1,0,A/5. 3337,14.5,,S +134,1,2,"Weisz, Mrs. Leopold (Mathilde Francoise Pede)",female,29,1,0,228414,26,,S +135,0,2,"Sobey, Mr. Samuel James Hayden",male,25,0,0,C.A. 29178,13,,S +136,0,2,"Richard, Mr. Emile",male,23,0,0,SC/PARIS 2133,15.0458,,C +137,1,1,"Newsom, Miss. Helen Monypeny",female,19,0,2,11752,26.2833,D47,S +138,0,1,"Futrelle, Mr. Jacques Heath",male,37,1,0,113803,53.1,C123,S +139,0,3,"Osen, Mr. Olaf Elon",male,16,0,0,7534,9.2167,,S +140,0,1,"Giglio, Mr. Victor",male,24,0,0,PC 17593,79.2,B86,C +141,0,3,"Boulos, Mrs. Joseph (Sultana)",female,,0,2,2678,15.2458,,C +142,1,3,"Nysten, Miss. Anna Sofia",female,22,0,0,347081,7.75,,S +143,1,3,"Hakkarainen, Mrs. Pekka Pietari (Elin Matilda Dolck)",female,24,1,0,STON/O2. 3101279,15.85,,S +144,0,3,"Burke, Mr. Jeremiah",male,19,0,0,365222,6.75,,Q +145,0,2,"Andrew, Mr. Edgardo Samuel",male,18,0,0,231945,11.5,,S +146,0,2,"Nicholls, Mr. Joseph Charles",male,19,1,1,C.A. 33112,36.75,,S +147,1,3,"Andersson, Mr. August Edvard (""Wennerstrom"")",male,27,0,0,350043,7.7958,,S +148,0,3,"Ford, Miss. Robina Maggie ""Ruby""",female,9,2,2,W./C. 6608,34.375,,S +149,0,2,"Navratil, Mr. Michel (""Louis M Hoffman"")",male,36.5,0,2,230080,26,F2,S +150,0,2,"Byles, Rev. Thomas Roussel Davids",male,42,0,0,244310,13,,S +151,0,2,"Bateman, Rev. Robert James",male,51,0,0,S.O.P. 1166,12.525,,S +152,1,1,"Pears, Mrs. Thomas (Edith Wearne)",female,22,1,0,113776,66.6,C2,S +153,0,3,"Meo, Mr. Alfonzo",male,55.5,0,0,A.5. 11206,8.05,,S +154,0,3,"van Billiard, Mr. Austin Blyler",male,40.5,0,2,A/5. 851,14.5,,S +155,0,3,"Olsen, Mr. Ole Martin",male,,0,0,Fa 265302,7.3125,,S +156,0,1,"Williams, Mr. Charles Duane",male,51,0,1,PC 17597,61.3792,,C +157,1,3,"Gilnagh, Miss. Katherine ""Katie""",female,16,0,0,35851,7.7333,,Q +158,0,3,"Corn, Mr. Harry",male,30,0,0,SOTON/OQ 392090,8.05,,S +159,0,3,"Smiljanic, Mr. Mile",male,,0,0,315037,8.6625,,S +160,0,3,"Sage, Master. Thomas Henry",male,,8,2,CA. 2343,69.55,,S +161,0,3,"Cribb, Mr. John Hatfield",male,44,0,1,371362,16.1,,S +162,1,2,"Watt, Mrs. James (Elizabeth ""Bessie"" Inglis Milne)",female,40,0,0,C.A. 33595,15.75,,S +163,0,3,"Bengtsson, Mr. John Viktor",male,26,0,0,347068,7.775,,S +164,0,3,"Calic, Mr. Jovo",male,17,0,0,315093,8.6625,,S +165,0,3,"Panula, Master. Eino Viljami",male,1,4,1,3101295,39.6875,,S +166,1,3,"Goldsmith, Master. Frank John William ""Frankie""",male,9,0,2,363291,20.525,,S +167,1,1,"Chibnall, Mrs. (Edith Martha Bowerman)",female,,0,1,113505,55,E33,S +168,0,3,"Skoog, Mrs. William (Anna Bernhardina Karlsson)",female,45,1,4,347088,27.9,,S +169,0,1,"Baumann, Mr. John D",male,,0,0,PC 17318,25.925,,S +170,0,3,"Ling, Mr. Lee",male,28,0,0,1601,56.4958,,S +171,0,1,"Van der hoef, Mr. Wyckoff",male,61,0,0,111240,33.5,B19,S +172,0,3,"Rice, Master. Arthur",male,4,4,1,382652,29.125,,Q +173,1,3,"Johnson, Miss. Eleanor Ileen",female,1,1,1,347742,11.1333,,S +174,0,3,"Sivola, Mr. Antti Wilhelm",male,21,0,0,STON/O 2. 3101280,7.925,,S +175,0,1,"Smith, Mr. James Clinch",male,56,0,0,17764,30.6958,A7,C +176,0,3,"Klasen, Mr. Klas Albin",male,18,1,1,350404,7.8542,,S +177,0,3,"Lefebre, Master. Henry Forbes",male,,3,1,4133,25.4667,,S +178,0,1,"Isham, Miss. Ann Elizabeth",female,50,0,0,PC 17595,28.7125,C49,C +179,0,2,"Hale, Mr. Reginald",male,30,0,0,250653,13,,S +180,0,3,"Leonard, Mr. Lionel",male,36,0,0,LINE,0,,S +181,0,3,"Sage, Miss. Constance Gladys",female,,8,2,CA. 2343,69.55,,S +182,0,2,"Pernot, Mr. Rene",male,,0,0,SC/PARIS 2131,15.05,,C +183,0,3,"Asplund, Master. Clarence Gustaf Hugo",male,9,4,2,347077,31.3875,,S +184,1,2,"Becker, Master. Richard F",male,1,2,1,230136,39,F4,S +185,1,3,"Kink-Heilmann, Miss. Luise Gretchen",female,4,0,2,315153,22.025,,S +186,0,1,"Rood, Mr. Hugh Roscoe",male,,0,0,113767,50,A32,S +187,1,3,"O'Brien, Mrs. Thomas (Johanna ""Hannah"" Godfrey)",female,,1,0,370365,15.5,,Q +188,1,1,"Romaine, Mr. Charles Hallace (""Mr C Rolmane"")",male,45,0,0,111428,26.55,,S +189,0,3,"Bourke, Mr. John",male,40,1,1,364849,15.5,,Q +190,0,3,"Turcin, Mr. Stjepan",male,36,0,0,349247,7.8958,,S +191,1,2,"Pinsky, Mrs. (Rosa)",female,32,0,0,234604,13,,S +192,0,2,"Carbines, Mr. William",male,19,0,0,28424,13,,S +193,1,3,"Andersen-Jensen, Miss. Carla Christine Nielsine",female,19,1,0,350046,7.8542,,S +194,1,2,"Navratil, Master. Michel M",male,3,1,1,230080,26,F2,S +195,1,1,"Brown, Mrs. James Joseph (Margaret Tobin)",female,44,0,0,PC 17610,27.7208,B4,C +196,1,1,"Lurette, Miss. Elise",female,58,0,0,PC 17569,146.5208,B80,C +197,0,3,"Mernagh, Mr. Robert",male,,0,0,368703,7.75,,Q +198,0,3,"Olsen, Mr. Karl Siegwart Andreas",male,42,0,1,4579,8.4042,,S +199,1,3,"Madigan, Miss. Margaret ""Maggie""",female,,0,0,370370,7.75,,Q +200,0,2,"Yrois, Miss. Henriette (""Mrs Harbeck"")",female,24,0,0,248747,13,,S +201,0,3,"Vande Walle, Mr. Nestor Cyriel",male,28,0,0,345770,9.5,,S +202,0,3,"Sage, Mr. Frederick",male,,8,2,CA. 2343,69.55,,S +203,0,3,"Johanson, Mr. Jakob Alfred",male,34,0,0,3101264,6.4958,,S +204,0,3,"Youseff, Mr. Gerious",male,45.5,0,0,2628,7.225,,C +205,1,3,"Cohen, Mr. Gurshon ""Gus""",male,18,0,0,A/5 3540,8.05,,S +206,0,3,"Strom, Miss. Telma Matilda",female,2,0,1,347054,10.4625,G6,S +207,0,3,"Backstrom, Mr. Karl Alfred",male,32,1,0,3101278,15.85,,S +208,1,3,"Albimona, Mr. Nassef Cassem",male,26,0,0,2699,18.7875,,C +209,1,3,"Carr, Miss. Helen ""Ellen""",female,16,0,0,367231,7.75,,Q +210,1,1,"Blank, Mr. Henry",male,40,0,0,112277,31,A31,C +211,0,3,"Ali, Mr. Ahmed",male,24,0,0,SOTON/O.Q. 3101311,7.05,,S +212,1,2,"Cameron, Miss. Clear Annie",female,35,0,0,F.C.C. 13528,21,,S +213,0,3,"Perkin, Mr. John Henry",male,22,0,0,A/5 21174,7.25,,S +214,0,2,"Givard, Mr. Hans Kristensen",male,30,0,0,250646,13,,S +215,0,3,"Kiernan, Mr. Philip",male,,1,0,367229,7.75,,Q +216,1,1,"Newell, Miss. Madeleine",female,31,1,0,35273,113.275,D36,C +217,1,3,"Honkanen, Miss. Eliina",female,27,0,0,STON/O2. 3101283,7.925,,S +218,0,2,"Jacobsohn, Mr. Sidney Samuel",male,42,1,0,243847,27,,S +219,1,1,"Bazzani, Miss. Albina",female,32,0,0,11813,76.2917,D15,C +220,0,2,"Harris, Mr. Walter",male,30,0,0,W/C 14208,10.5,,S +221,1,3,"Sunderland, Mr. Victor Francis",male,16,0,0,SOTON/OQ 392089,8.05,,S +222,0,2,"Bracken, Mr. James H",male,27,0,0,220367,13,,S +223,0,3,"Green, Mr. George Henry",male,51,0,0,21440,8.05,,S +224,0,3,"Nenkoff, Mr. Christo",male,,0,0,349234,7.8958,,S +225,1,1,"Hoyt, Mr. Frederick Maxfield",male,38,1,0,19943,90,C93,S +226,0,3,"Berglund, Mr. Karl Ivar Sven",male,22,0,0,PP 4348,9.35,,S +227,1,2,"Mellors, Mr. William John",male,19,0,0,SW/PP 751,10.5,,S +228,0,3,"Lovell, Mr. John Hall (""Henry"")",male,20.5,0,0,A/5 21173,7.25,,S +229,0,2,"Fahlstrom, Mr. Arne Jonas",male,18,0,0,236171,13,,S +230,0,3,"Lefebre, Miss. Mathilde",female,,3,1,4133,25.4667,,S +231,1,1,"Harris, Mrs. Henry Birkhardt (Irene Wallach)",female,35,1,0,36973,83.475,C83,S +232,0,3,"Larsson, Mr. Bengt Edvin",male,29,0,0,347067,7.775,,S +233,0,2,"Sjostedt, Mr. Ernst Adolf",male,59,0,0,237442,13.5,,S +234,1,3,"Asplund, Miss. Lillian Gertrud",female,5,4,2,347077,31.3875,,S +235,0,2,"Leyson, Mr. Robert William Norman",male,24,0,0,C.A. 29566,10.5,,S +236,0,3,"Harknett, Miss. Alice Phoebe",female,,0,0,W./C. 6609,7.55,,S +237,0,2,"Hold, Mr. Stephen",male,44,1,0,26707,26,,S +238,1,2,"Collyer, Miss. Marjorie ""Lottie""",female,8,0,2,C.A. 31921,26.25,,S +239,0,2,"Pengelly, Mr. Frederick William",male,19,0,0,28665,10.5,,S +240,0,2,"Hunt, Mr. George Henry",male,33,0,0,SCO/W 1585,12.275,,S +241,0,3,"Zabour, Miss. Thamine",female,,1,0,2665,14.4542,,C +242,1,3,"Murphy, Miss. Katherine ""Kate""",female,,1,0,367230,15.5,,Q +243,0,2,"Coleridge, Mr. Reginald Charles",male,29,0,0,W./C. 14263,10.5,,S +244,0,3,"Maenpaa, Mr. Matti Alexanteri",male,22,0,0,STON/O 2. 3101275,7.125,,S +245,0,3,"Attalah, Mr. Sleiman",male,30,0,0,2694,7.225,,C +246,0,1,"Minahan, Dr. William Edward",male,44,2,0,19928,90,C78,Q +247,0,3,"Lindahl, Miss. Agda Thorilda Viktoria",female,25,0,0,347071,7.775,,S +248,1,2,"Hamalainen, Mrs. William (Anna)",female,24,0,2,250649,14.5,,S +249,1,1,"Beckwith, Mr. Richard Leonard",male,37,1,1,11751,52.5542,D35,S +250,0,2,"Carter, Rev. Ernest Courtenay",male,54,1,0,244252,26,,S +251,0,3,"Reed, Mr. James George",male,,0,0,362316,7.25,,S +252,0,3,"Strom, Mrs. Wilhelm (Elna Matilda Persson)",female,29,1,1,347054,10.4625,G6,S +253,0,1,"Stead, Mr. William Thomas",male,62,0,0,113514,26.55,C87,S +254,0,3,"Lobb, Mr. William Arthur",male,30,1,0,A/5. 3336,16.1,,S +255,0,3,"Rosblom, Mrs. Viktor (Helena Wilhelmina)",female,41,0,2,370129,20.2125,,S +256,1,3,"Touma, Mrs. Darwis (Hanne Youssef Razi)",female,29,0,2,2650,15.2458,,C +257,1,1,"Thorne, Mrs. Gertrude Maybelle",female,,0,0,PC 17585,79.2,,C +258,1,1,"Cherry, Miss. Gladys",female,30,0,0,110152,86.5,B77,S +259,1,1,"Ward, Miss. Anna",female,35,0,0,PC 17755,512.3292,,C +260,1,2,"Parrish, Mrs. (Lutie Davis)",female,50,0,1,230433,26,,S +261,0,3,"Smith, Mr. Thomas",male,,0,0,384461,7.75,,Q +262,1,3,"Asplund, Master. Edvin Rojj Felix",male,3,4,2,347077,31.3875,,S +263,0,1,"Taussig, Mr. Emil",male,52,1,1,110413,79.65,E67,S +264,0,1,"Harrison, Mr. William",male,40,0,0,112059,0,B94,S +265,0,3,"Henry, Miss. Delia",female,,0,0,382649,7.75,,Q +266,0,2,"Reeves, Mr. David",male,36,0,0,C.A. 17248,10.5,,S +267,0,3,"Panula, Mr. Ernesti Arvid",male,16,4,1,3101295,39.6875,,S +268,1,3,"Persson, Mr. Ernst Ulrik",male,25,1,0,347083,7.775,,S +269,1,1,"Graham, Mrs. William Thompson (Edith Junkins)",female,58,0,1,PC 17582,153.4625,C125,S +270,1,1,"Bissette, Miss. Amelia",female,35,0,0,PC 17760,135.6333,C99,S +271,0,1,"Cairns, Mr. Alexander",male,,0,0,113798,31,,S +272,1,3,"Tornquist, Mr. William Henry",male,25,0,0,LINE,0,,S +273,1,2,"Mellinger, Mrs. (Elizabeth Anne Maidment)",female,41,0,1,250644,19.5,,S +274,0,1,"Natsch, Mr. Charles H",male,37,0,1,PC 17596,29.7,C118,C +275,1,3,"Healy, Miss. Hanora ""Nora""",female,,0,0,370375,7.75,,Q +276,1,1,"Andrews, Miss. Kornelia Theodosia",female,63,1,0,13502,77.9583,D7,S +277,0,3,"Lindblom, Miss. Augusta Charlotta",female,45,0,0,347073,7.75,,S +278,0,2,"Parkes, Mr. Francis ""Frank""",male,,0,0,239853,0,,S +279,0,3,"Rice, Master. Eric",male,7,4,1,382652,29.125,,Q +280,1,3,"Abbott, Mrs. Stanton (Rosa Hunt)",female,35,1,1,C.A. 2673,20.25,,S +281,0,3,"Duane, Mr. Frank",male,65,0,0,336439,7.75,,Q +282,0,3,"Olsson, Mr. Nils Johan Goransson",male,28,0,0,347464,7.8542,,S +283,0,3,"de Pelsmaeker, Mr. Alfons",male,16,0,0,345778,9.5,,S +284,1,3,"Dorking, Mr. Edward Arthur",male,19,0,0,A/5. 10482,8.05,,S +285,0,1,"Smith, Mr. Richard William",male,,0,0,113056,26,A19,S +286,0,3,"Stankovic, Mr. Ivan",male,33,0,0,349239,8.6625,,C +287,1,3,"de Mulder, Mr. Theodore",male,30,0,0,345774,9.5,,S +288,0,3,"Naidenoff, Mr. Penko",male,22,0,0,349206,7.8958,,S +289,1,2,"Hosono, Mr. Masabumi",male,42,0,0,237798,13,,S +290,1,3,"Connolly, Miss. Kate",female,22,0,0,370373,7.75,,Q +291,1,1,"Barber, Miss. Ellen ""Nellie""",female,26,0,0,19877,78.85,,S +292,1,1,"Bishop, Mrs. Dickinson H (Helen Walton)",female,19,1,0,11967,91.0792,B49,C +293,0,2,"Levy, Mr. Rene Jacques",male,36,0,0,SC/Paris 2163,12.875,D,C +294,0,3,"Haas, Miss. Aloisia",female,24,0,0,349236,8.85,,S +295,0,3,"Mineff, Mr. Ivan",male,24,0,0,349233,7.8958,,S +296,0,1,"Lewy, Mr. Ervin G",male,,0,0,PC 17612,27.7208,,C +297,0,3,"Hanna, Mr. Mansour",male,23.5,0,0,2693,7.2292,,C +298,0,1,"Allison, Miss. Helen Loraine",female,2,1,2,113781,151.55,C22 C26,S +299,1,1,"Saalfeld, Mr. Adolphe",male,,0,0,19988,30.5,C106,S +300,1,1,"Baxter, Mrs. James (Helene DeLaudeniere Chaput)",female,50,0,1,PC 17558,247.5208,B58 B60,C +301,1,3,"Kelly, Miss. Anna Katherine ""Annie Kate""",female,,0,0,9234,7.75,,Q +302,1,3,"McCoy, Mr. Bernard",male,,2,0,367226,23.25,,Q +303,0,3,"Johnson, Mr. William Cahoone Jr",male,19,0,0,LINE,0,,S +304,1,2,"Keane, Miss. Nora A",female,,0,0,226593,12.35,E101,Q +305,0,3,"Williams, Mr. Howard Hugh ""Harry""",male,,0,0,A/5 2466,8.05,,S +306,1,1,"Allison, Master. Hudson Trevor",male,0.92,1,2,113781,151.55,C22 C26,S +307,1,1,"Fleming, Miss. Margaret",female,,0,0,17421,110.8833,,C +308,1,1,"Penasco y Castellana, Mrs. Victor de Satode (Maria Josefa Perez de Soto y Vallejo)",female,17,1,0,PC 17758,108.9,C65,C +309,0,2,"Abelson, Mr. Samuel",male,30,1,0,P/PP 3381,24,,C +310,1,1,"Francatelli, Miss. Laura Mabel",female,30,0,0,PC 17485,56.9292,E36,C +311,1,1,"Hays, Miss. Margaret Bechstein",female,24,0,0,11767,83.1583,C54,C +312,1,1,"Ryerson, Miss. Emily Borie",female,18,2,2,PC 17608,262.375,B57 B59 B63 B66,C +313,0,2,"Lahtinen, Mrs. William (Anna Sylfven)",female,26,1,1,250651,26,,S +314,0,3,"Hendekovic, Mr. Ignjac",male,28,0,0,349243,7.8958,,S +315,0,2,"Hart, Mr. Benjamin",male,43,1,1,F.C.C. 13529,26.25,,S +316,1,3,"Nilsson, Miss. Helmina Josefina",female,26,0,0,347470,7.8542,,S +317,1,2,"Kantor, Mrs. Sinai (Miriam Sternin)",female,24,1,0,244367,26,,S +318,0,2,"Moraweck, Dr. Ernest",male,54,0,0,29011,14,,S +319,1,1,"Wick, Miss. Mary Natalie",female,31,0,2,36928,164.8667,C7,S +320,1,1,"Spedden, Mrs. Frederic Oakley (Margaretta Corning Stone)",female,40,1,1,16966,134.5,E34,C +321,0,3,"Dennis, Mr. Samuel",male,22,0,0,A/5 21172,7.25,,S +322,0,3,"Danoff, Mr. Yoto",male,27,0,0,349219,7.8958,,S +323,1,2,"Slayter, Miss. Hilda Mary",female,30,0,0,234818,12.35,,Q +324,1,2,"Caldwell, Mrs. Albert Francis (Sylvia Mae Harbaugh)",female,22,1,1,248738,29,,S +325,0,3,"Sage, Mr. George John Jr",male,,8,2,CA. 2343,69.55,,S +326,1,1,"Young, Miss. Marie Grice",female,36,0,0,PC 17760,135.6333,C32,C +327,0,3,"Nysveen, Mr. Johan Hansen",male,61,0,0,345364,6.2375,,S +328,1,2,"Ball, Mrs. (Ada E Hall)",female,36,0,0,28551,13,D,S +329,1,3,"Goldsmith, Mrs. Frank John (Emily Alice Brown)",female,31,1,1,363291,20.525,,S +330,1,1,"Hippach, Miss. Jean Gertrude",female,16,0,1,111361,57.9792,B18,C +331,1,3,"McCoy, Miss. Agnes",female,,2,0,367226,23.25,,Q +332,0,1,"Partner, Mr. Austen",male,45.5,0,0,113043,28.5,C124,S +333,0,1,"Graham, Mr. George Edward",male,38,0,1,PC 17582,153.4625,C91,S +334,0,3,"Vander Planke, Mr. Leo Edmondus",male,16,2,0,345764,18,,S +335,1,1,"Frauenthal, Mrs. Henry William (Clara Heinsheimer)",female,,1,0,PC 17611,133.65,,S +336,0,3,"Denkoff, Mr. Mitto",male,,0,0,349225,7.8958,,S +337,0,1,"Pears, Mr. Thomas Clinton",male,29,1,0,113776,66.6,C2,S +338,1,1,"Burns, Miss. Elizabeth Margaret",female,41,0,0,16966,134.5,E40,C +339,1,3,"Dahl, Mr. Karl Edwart",male,45,0,0,7598,8.05,,S +340,0,1,"Blackwell, Mr. Stephen Weart",male,45,0,0,113784,35.5,T,S +341,1,2,"Navratil, Master. Edmond Roger",male,2,1,1,230080,26,F2,S +342,1,1,"Fortune, Miss. Alice Elizabeth",female,24,3,2,19950,263,C23 C25 C27,S +343,0,2,"Collander, Mr. Erik Gustaf",male,28,0,0,248740,13,,S +344,0,2,"Sedgwick, Mr. Charles Frederick Waddington",male,25,0,0,244361,13,,S +345,0,2,"Fox, Mr. Stanley Hubert",male,36,0,0,229236,13,,S +346,1,2,"Brown, Miss. Amelia ""Mildred""",female,24,0,0,248733,13,F33,S +347,1,2,"Smith, Miss. Marion Elsie",female,40,0,0,31418,13,,S +348,1,3,"Davison, Mrs. Thomas Henry (Mary E Finck)",female,,1,0,386525,16.1,,S +349,1,3,"Coutts, Master. William Loch ""William""",male,3,1,1,C.A. 37671,15.9,,S +350,0,3,"Dimic, Mr. Jovan",male,42,0,0,315088,8.6625,,S +351,0,3,"Odahl, Mr. Nils Martin",male,23,0,0,7267,9.225,,S +352,0,1,"Williams-Lambert, Mr. Fletcher Fellows",male,,0,0,113510,35,C128,S +353,0,3,"Elias, Mr. Tannous",male,15,1,1,2695,7.2292,,C +354,0,3,"Arnold-Franchi, Mr. Josef",male,25,1,0,349237,17.8,,S +355,0,3,"Yousif, Mr. Wazli",male,,0,0,2647,7.225,,C +356,0,3,"Vanden Steen, Mr. Leo Peter",male,28,0,0,345783,9.5,,S +357,1,1,"Bowerman, Miss. Elsie Edith",female,22,0,1,113505,55,E33,S +358,0,2,"Funk, Miss. Annie Clemmer",female,38,0,0,237671,13,,S +359,1,3,"McGovern, Miss. Mary",female,,0,0,330931,7.8792,,Q +360,1,3,"Mockler, Miss. Helen Mary ""Ellie""",female,,0,0,330980,7.8792,,Q +361,0,3,"Skoog, Mr. Wilhelm",male,40,1,4,347088,27.9,,S +362,0,2,"del Carlo, Mr. Sebastiano",male,29,1,0,SC/PARIS 2167,27.7208,,C +363,0,3,"Barbara, Mrs. (Catherine David)",female,45,0,1,2691,14.4542,,C +364,0,3,"Asim, Mr. Adola",male,35,0,0,SOTON/O.Q. 3101310,7.05,,S +365,0,3,"O'Brien, Mr. Thomas",male,,1,0,370365,15.5,,Q +366,0,3,"Adahl, Mr. Mauritz Nils Martin",male,30,0,0,C 7076,7.25,,S +367,1,1,"Warren, Mrs. Frank Manley (Anna Sophia Atkinson)",female,60,1,0,110813,75.25,D37,C +368,1,3,"Moussa, Mrs. (Mantoura Boulos)",female,,0,0,2626,7.2292,,C +369,1,3,"Jermyn, Miss. Annie",female,,0,0,14313,7.75,,Q +370,1,1,"Aubart, Mme. Leontine Pauline",female,24,0,0,PC 17477,69.3,B35,C +371,1,1,"Harder, Mr. George Achilles",male,25,1,0,11765,55.4417,E50,C +372,0,3,"Wiklund, Mr. Jakob Alfred",male,18,1,0,3101267,6.4958,,S +373,0,3,"Beavan, Mr. William Thomas",male,19,0,0,323951,8.05,,S +374,0,1,"Ringhini, Mr. Sante",male,22,0,0,PC 17760,135.6333,,C +375,0,3,"Palsson, Miss. Stina Viola",female,3,3,1,349909,21.075,,S +376,1,1,"Meyer, Mrs. Edgar Joseph (Leila Saks)",female,,1,0,PC 17604,82.1708,,C +377,1,3,"Landergren, Miss. Aurora Adelia",female,22,0,0,C 7077,7.25,,S +378,0,1,"Widener, Mr. Harry Elkins",male,27,0,2,113503,211.5,C82,C +379,0,3,"Betros, Mr. Tannous",male,20,0,0,2648,4.0125,,C +380,0,3,"Gustafsson, Mr. Karl Gideon",male,19,0,0,347069,7.775,,S +381,1,1,"Bidois, Miss. Rosalie",female,42,0,0,PC 17757,227.525,,C +382,1,3,"Nakid, Miss. Maria (""Mary"")",female,1,0,2,2653,15.7417,,C +383,0,3,"Tikkanen, Mr. Juho",male,32,0,0,STON/O 2. 3101293,7.925,,S +384,1,1,"Holverson, Mrs. Alexander Oskar (Mary Aline Towner)",female,35,1,0,113789,52,,S +385,0,3,"Plotcharsky, Mr. Vasil",male,,0,0,349227,7.8958,,S +386,0,2,"Davies, Mr. Charles Henry",male,18,0,0,S.O.C. 14879,73.5,,S +387,0,3,"Goodwin, Master. Sidney Leonard",male,1,5,2,CA 2144,46.9,,S +388,1,2,"Buss, Miss. Kate",female,36,0,0,27849,13,,S +389,0,3,"Sadlier, Mr. Matthew",male,,0,0,367655,7.7292,,Q +390,1,2,"Lehmann, Miss. Bertha",female,17,0,0,SC 1748,12,,C +391,1,1,"Carter, Mr. William Ernest",male,36,1,2,113760,120,B96 B98,S +392,1,3,"Jansson, Mr. Carl Olof",male,21,0,0,350034,7.7958,,S +393,0,3,"Gustafsson, Mr. Johan Birger",male,28,2,0,3101277,7.925,,S +394,1,1,"Newell, Miss. Marjorie",female,23,1,0,35273,113.275,D36,C +395,1,3,"Sandstrom, Mrs. Hjalmar (Agnes Charlotta Bengtsson)",female,24,0,2,PP 9549,16.7,G6,S +396,0,3,"Johansson, Mr. Erik",male,22,0,0,350052,7.7958,,S +397,0,3,"Olsson, Miss. Elina",female,31,0,0,350407,7.8542,,S +398,0,2,"McKane, Mr. Peter David",male,46,0,0,28403,26,,S +399,0,2,"Pain, Dr. Alfred",male,23,0,0,244278,10.5,,S +400,1,2,"Trout, Mrs. William H (Jessie L)",female,28,0,0,240929,12.65,,S +401,1,3,"Niskanen, Mr. Juha",male,39,0,0,STON/O 2. 3101289,7.925,,S +402,0,3,"Adams, Mr. John",male,26,0,0,341826,8.05,,S +403,0,3,"Jussila, Miss. Mari Aina",female,21,1,0,4137,9.825,,S +404,0,3,"Hakkarainen, Mr. Pekka Pietari",male,28,1,0,STON/O2. 3101279,15.85,,S +405,0,3,"Oreskovic, Miss. Marija",female,20,0,0,315096,8.6625,,S +406,0,2,"Gale, Mr. Shadrach",male,34,1,0,28664,21,,S +407,0,3,"Widegren, Mr. Carl/Charles Peter",male,51,0,0,347064,7.75,,S +408,1,2,"Richards, Master. William Rowe",male,3,1,1,29106,18.75,,S +409,0,3,"Birkeland, Mr. Hans Martin Monsen",male,21,0,0,312992,7.775,,S +410,0,3,"Lefebre, Miss. Ida",female,,3,1,4133,25.4667,,S +411,0,3,"Sdycoff, Mr. Todor",male,,0,0,349222,7.8958,,S +412,0,3,"Hart, Mr. Henry",male,,0,0,394140,6.8583,,Q +413,1,1,"Minahan, Miss. Daisy E",female,33,1,0,19928,90,C78,Q +414,0,2,"Cunningham, Mr. Alfred Fleming",male,,0,0,239853,0,,S +415,1,3,"Sundman, Mr. Johan Julian",male,44,0,0,STON/O 2. 3101269,7.925,,S +416,0,3,"Meek, Mrs. Thomas (Annie Louise Rowley)",female,,0,0,343095,8.05,,S +417,1,2,"Drew, Mrs. James Vivian (Lulu Thorne Christian)",female,34,1,1,28220,32.5,,S +418,1,2,"Silven, Miss. Lyyli Karoliina",female,18,0,2,250652,13,,S +419,0,2,"Matthews, Mr. William John",male,30,0,0,28228,13,,S +420,0,3,"Van Impe, Miss. Catharina",female,10,0,2,345773,24.15,,S +421,0,3,"Gheorgheff, Mr. Stanio",male,,0,0,349254,7.8958,,C +422,0,3,"Charters, Mr. David",male,21,0,0,A/5. 13032,7.7333,,Q +423,0,3,"Zimmerman, Mr. Leo",male,29,0,0,315082,7.875,,S +424,0,3,"Danbom, Mrs. Ernst Gilbert (Anna Sigrid Maria Brogren)",female,28,1,1,347080,14.4,,S +425,0,3,"Rosblom, Mr. Viktor Richard",male,18,1,1,370129,20.2125,,S +426,0,3,"Wiseman, Mr. Phillippe",male,,0,0,A/4. 34244,7.25,,S +427,1,2,"Clarke, Mrs. Charles V (Ada Maria Winfield)",female,28,1,0,2003,26,,S +428,1,2,"Phillips, Miss. Kate Florence (""Mrs Kate Louise Phillips Marshall"")",female,19,0,0,250655,26,,S +429,0,3,"Flynn, Mr. James",male,,0,0,364851,7.75,,Q +430,1,3,"Pickard, Mr. Berk (Berk Trembisky)",male,32,0,0,SOTON/O.Q. 392078,8.05,E10,S +431,1,1,"Bjornstrom-Steffansson, Mr. Mauritz Hakan",male,28,0,0,110564,26.55,C52,S +432,1,3,"Thorneycroft, Mrs. Percival (Florence Kate White)",female,,1,0,376564,16.1,,S +433,1,2,"Louch, Mrs. Charles Alexander (Alice Adelaide Slow)",female,42,1,0,SC/AH 3085,26,,S +434,0,3,"Kallio, Mr. Nikolai Erland",male,17,0,0,STON/O 2. 3101274,7.125,,S +435,0,1,"Silvey, Mr. William Baird",male,50,1,0,13507,55.9,E44,S +436,1,1,"Carter, Miss. Lucile Polk",female,14,1,2,113760,120,B96 B98,S +437,0,3,"Ford, Miss. Doolina Margaret ""Daisy""",female,21,2,2,W./C. 6608,34.375,,S +438,1,2,"Richards, Mrs. Sidney (Emily Hocking)",female,24,2,3,29106,18.75,,S +439,0,1,"Fortune, Mr. Mark",male,64,1,4,19950,263,C23 C25 C27,S +440,0,2,"Kvillner, Mr. Johan Henrik Johannesson",male,31,0,0,C.A. 18723,10.5,,S +441,1,2,"Hart, Mrs. Benjamin (Esther Ada Bloomfield)",female,45,1,1,F.C.C. 13529,26.25,,S +442,0,3,"Hampe, Mr. Leon",male,20,0,0,345769,9.5,,S +443,0,3,"Petterson, Mr. Johan Emil",male,25,1,0,347076,7.775,,S +444,1,2,"Reynaldo, Ms. Encarnacion",female,28,0,0,230434,13,,S +445,1,3,"Johannesen-Bratthammer, Mr. Bernt",male,,0,0,65306,8.1125,,S +446,1,1,"Dodge, Master. Washington",male,4,0,2,33638,81.8583,A34,S +447,1,2,"Mellinger, Miss. Madeleine Violet",female,13,0,1,250644,19.5,,S +448,1,1,"Seward, Mr. Frederic Kimber",male,34,0,0,113794,26.55,,S +449,1,3,"Baclini, Miss. Marie Catherine",female,5,2,1,2666,19.2583,,C +450,1,1,"Peuchen, Major. Arthur Godfrey",male,52,0,0,113786,30.5,C104,S +451,0,2,"West, Mr. Edwy Arthur",male,36,1,2,C.A. 34651,27.75,,S +452,0,3,"Hagland, Mr. Ingvald Olai Olsen",male,,1,0,65303,19.9667,,S +453,0,1,"Foreman, Mr. Benjamin Laventall",male,30,0,0,113051,27.75,C111,C +454,1,1,"Goldenberg, Mr. Samuel L",male,49,1,0,17453,89.1042,C92,C +455,0,3,"Peduzzi, Mr. Joseph",male,,0,0,A/5 2817,8.05,,S +456,1,3,"Jalsevac, Mr. Ivan",male,29,0,0,349240,7.8958,,C +457,0,1,"Millet, Mr. Francis Davis",male,65,0,0,13509,26.55,E38,S +458,1,1,"Kenyon, Mrs. Frederick R (Marion)",female,,1,0,17464,51.8625,D21,S +459,1,2,"Toomey, Miss. Ellen",female,50,0,0,F.C.C. 13531,10.5,,S +460,0,3,"O'Connor, Mr. Maurice",male,,0,0,371060,7.75,,Q +461,1,1,"Anderson, Mr. Harry",male,48,0,0,19952,26.55,E12,S +462,0,3,"Morley, Mr. William",male,34,0,0,364506,8.05,,S +463,0,1,"Gee, Mr. Arthur H",male,47,0,0,111320,38.5,E63,S +464,0,2,"Milling, Mr. Jacob Christian",male,48,0,0,234360,13,,S +465,0,3,"Maisner, Mr. Simon",male,,0,0,A/S 2816,8.05,,S +466,0,3,"Goncalves, Mr. Manuel Estanslas",male,38,0,0,SOTON/O.Q. 3101306,7.05,,S +467,0,2,"Campbell, Mr. William",male,,0,0,239853,0,,S +468,0,1,"Smart, Mr. John Montgomery",male,56,0,0,113792,26.55,,S +469,0,3,"Scanlan, Mr. James",male,,0,0,36209,7.725,,Q +470,1,3,"Baclini, Miss. Helene Barbara",female,0.75,2,1,2666,19.2583,,C +471,0,3,"Keefe, Mr. Arthur",male,,0,0,323592,7.25,,S +472,0,3,"Cacic, Mr. Luka",male,38,0,0,315089,8.6625,,S +473,1,2,"West, Mrs. Edwy Arthur (Ada Mary Worth)",female,33,1,2,C.A. 34651,27.75,,S +474,1,2,"Jerwan, Mrs. Amin S (Marie Marthe Thuillard)",female,23,0,0,SC/AH Basle 541,13.7917,D,C +475,0,3,"Strandberg, Miss. Ida Sofia",female,22,0,0,7553,9.8375,,S +476,0,1,"Clifford, Mr. George Quincy",male,,0,0,110465,52,A14,S +477,0,2,"Renouf, Mr. Peter Henry",male,34,1,0,31027,21,,S +478,0,3,"Braund, Mr. Lewis Richard",male,29,1,0,3460,7.0458,,S +479,0,3,"Karlsson, Mr. Nils August",male,22,0,0,350060,7.5208,,S +480,1,3,"Hirvonen, Miss. Hildur E",female,2,0,1,3101298,12.2875,,S +481,0,3,"Goodwin, Master. Harold Victor",male,9,5,2,CA 2144,46.9,,S +482,0,2,"Frost, Mr. Anthony Wood ""Archie""",male,,0,0,239854,0,,S +483,0,3,"Rouse, Mr. Richard Henry",male,50,0,0,A/5 3594,8.05,,S +484,1,3,"Turkula, Mrs. (Hedwig)",female,63,0,0,4134,9.5875,,S +485,1,1,"Bishop, Mr. Dickinson H",male,25,1,0,11967,91.0792,B49,C +486,0,3,"Lefebre, Miss. Jeannie",female,,3,1,4133,25.4667,,S +487,1,1,"Hoyt, Mrs. Frederick Maxfield (Jane Anne Forby)",female,35,1,0,19943,90,C93,S +488,0,1,"Kent, Mr. Edward Austin",male,58,0,0,11771,29.7,B37,C +489,0,3,"Somerton, Mr. Francis William",male,30,0,0,A.5. 18509,8.05,,S +490,1,3,"Coutts, Master. Eden Leslie ""Neville""",male,9,1,1,C.A. 37671,15.9,,S +491,0,3,"Hagland, Mr. Konrad Mathias Reiersen",male,,1,0,65304,19.9667,,S +492,0,3,"Windelov, Mr. Einar",male,21,0,0,SOTON/OQ 3101317,7.25,,S +493,0,1,"Molson, Mr. Harry Markland",male,55,0,0,113787,30.5,C30,S +494,0,1,"Artagaveytia, Mr. Ramon",male,71,0,0,PC 17609,49.5042,,C +495,0,3,"Stanley, Mr. Edward Roland",male,21,0,0,A/4 45380,8.05,,S +496,0,3,"Yousseff, Mr. Gerious",male,,0,0,2627,14.4583,,C +497,1,1,"Eustis, Miss. Elizabeth Mussey",female,54,1,0,36947,78.2667,D20,C +498,0,3,"Shellard, Mr. Frederick William",male,,0,0,C.A. 6212,15.1,,S +499,0,1,"Allison, Mrs. Hudson J C (Bessie Waldo Daniels)",female,25,1,2,113781,151.55,C22 C26,S +500,0,3,"Svensson, Mr. Olof",male,24,0,0,350035,7.7958,,S +501,0,3,"Calic, Mr. Petar",male,17,0,0,315086,8.6625,,S +502,0,3,"Canavan, Miss. Mary",female,21,0,0,364846,7.75,,Q +503,0,3,"O'Sullivan, Miss. Bridget Mary",female,,0,0,330909,7.6292,,Q +504,0,3,"Laitinen, Miss. Kristina Sofia",female,37,0,0,4135,9.5875,,S +505,1,1,"Maioni, Miss. Roberta",female,16,0,0,110152,86.5,B79,S +506,0,1,"Penasco y Castellana, Mr. Victor de Satode",male,18,1,0,PC 17758,108.9,C65,C +507,1,2,"Quick, Mrs. Frederick Charles (Jane Richards)",female,33,0,2,26360,26,,S +508,1,1,"Bradley, Mr. George (""George Arthur Brayton"")",male,,0,0,111427,26.55,,S +509,0,3,"Olsen, Mr. Henry Margido",male,28,0,0,C 4001,22.525,,S +510,1,3,"Lang, Mr. Fang",male,26,0,0,1601,56.4958,,S +511,1,3,"Daly, Mr. Eugene Patrick",male,29,0,0,382651,7.75,,Q +512,0,3,"Webber, Mr. James",male,,0,0,SOTON/OQ 3101316,8.05,,S +513,1,1,"McGough, Mr. James Robert",male,36,0,0,PC 17473,26.2875,E25,S +514,1,1,"Rothschild, Mrs. Martin (Elizabeth L. Barrett)",female,54,1,0,PC 17603,59.4,,C +515,0,3,"Coleff, Mr. Satio",male,24,0,0,349209,7.4958,,S +516,0,1,"Walker, Mr. William Anderson",male,47,0,0,36967,34.0208,D46,S +517,1,2,"Lemore, Mrs. (Amelia Milley)",female,34,0,0,C.A. 34260,10.5,F33,S +518,0,3,"Ryan, Mr. Patrick",male,,0,0,371110,24.15,,Q +519,1,2,"Angle, Mrs. William A (Florence ""Mary"" Agnes Hughes)",female,36,1,0,226875,26,,S +520,0,3,"Pavlovic, Mr. Stefo",male,32,0,0,349242,7.8958,,S +521,1,1,"Perreault, Miss. Anne",female,30,0,0,12749,93.5,B73,S +522,0,3,"Vovk, Mr. Janko",male,22,0,0,349252,7.8958,,S +523,0,3,"Lahoud, Mr. Sarkis",male,,0,0,2624,7.225,,C +524,1,1,"Hippach, Mrs. Louis Albert (Ida Sophia Fischer)",female,44,0,1,111361,57.9792,B18,C +525,0,3,"Kassem, Mr. Fared",male,,0,0,2700,7.2292,,C +526,0,3,"Farrell, Mr. James",male,40.5,0,0,367232,7.75,,Q +527,1,2,"Ridsdale, Miss. Lucy",female,50,0,0,W./C. 14258,10.5,,S +528,0,1,"Farthing, Mr. John",male,,0,0,PC 17483,221.7792,C95,S +529,0,3,"Salonen, Mr. Johan Werner",male,39,0,0,3101296,7.925,,S +530,0,2,"Hocking, Mr. Richard George",male,23,2,1,29104,11.5,,S +531,1,2,"Quick, Miss. Phyllis May",female,2,1,1,26360,26,,S +532,0,3,"Toufik, Mr. Nakli",male,,0,0,2641,7.2292,,C +533,0,3,"Elias, Mr. Joseph Jr",male,17,1,1,2690,7.2292,,C +534,1,3,"Peter, Mrs. Catherine (Catherine Rizk)",female,,0,2,2668,22.3583,,C +535,0,3,"Cacic, Miss. Marija",female,30,0,0,315084,8.6625,,S +536,1,2,"Hart, Miss. Eva Miriam",female,7,0,2,F.C.C. 13529,26.25,,S +537,0,1,"Butt, Major. Archibald Willingham",male,45,0,0,113050,26.55,B38,S +538,1,1,"LeRoy, Miss. Bertha",female,30,0,0,PC 17761,106.425,,C +539,0,3,"Risien, Mr. Samuel Beard",male,,0,0,364498,14.5,,S +540,1,1,"Frolicher, Miss. Hedwig Margaritha",female,22,0,2,13568,49.5,B39,C +541,1,1,"Crosby, Miss. Harriet R",female,36,0,2,WE/P 5735,71,B22,S +542,0,3,"Andersson, Miss. Ingeborg Constanzia",female,9,4,2,347082,31.275,,S +543,0,3,"Andersson, Miss. Sigrid Elisabeth",female,11,4,2,347082,31.275,,S +544,1,2,"Beane, Mr. Edward",male,32,1,0,2908,26,,S +545,0,1,"Douglas, Mr. Walter Donald",male,50,1,0,PC 17761,106.425,C86,C +546,0,1,"Nicholson, Mr. Arthur Ernest",male,64,0,0,693,26,,S +547,1,2,"Beane, Mrs. Edward (Ethel Clarke)",female,19,1,0,2908,26,,S +548,1,2,"Padro y Manent, Mr. Julian",male,,0,0,SC/PARIS 2146,13.8625,,C +549,0,3,"Goldsmith, Mr. Frank John",male,33,1,1,363291,20.525,,S +550,1,2,"Davies, Master. John Morgan Jr",male,8,1,1,C.A. 33112,36.75,,S +551,1,1,"Thayer, Mr. John Borland Jr",male,17,0,2,17421,110.8833,C70,C +552,0,2,"Sharp, Mr. Percival James R",male,27,0,0,244358,26,,S +553,0,3,"O'Brien, Mr. Timothy",male,,0,0,330979,7.8292,,Q +554,1,3,"Leeni, Mr. Fahim (""Philip Zenni"")",male,22,0,0,2620,7.225,,C +555,1,3,"Ohman, Miss. Velin",female,22,0,0,347085,7.775,,S +556,0,1,"Wright, Mr. George",male,62,0,0,113807,26.55,,S +557,1,1,"Duff Gordon, Lady. (Lucille Christiana Sutherland) (""Mrs Morgan"")",female,48,1,0,11755,39.6,A16,C +558,0,1,"Robbins, Mr. Victor",male,,0,0,PC 17757,227.525,,C +559,1,1,"Taussig, Mrs. Emil (Tillie Mandelbaum)",female,39,1,1,110413,79.65,E67,S +560,1,3,"de Messemaeker, Mrs. Guillaume Joseph (Emma)",female,36,1,0,345572,17.4,,S +561,0,3,"Morrow, Mr. Thomas Rowan",male,,0,0,372622,7.75,,Q +562,0,3,"Sivic, Mr. Husein",male,40,0,0,349251,7.8958,,S +563,0,2,"Norman, Mr. Robert Douglas",male,28,0,0,218629,13.5,,S +564,0,3,"Simmons, Mr. John",male,,0,0,SOTON/OQ 392082,8.05,,S +565,0,3,"Meanwell, Miss. (Marion Ogden)",female,,0,0,SOTON/O.Q. 392087,8.05,,S +566,0,3,"Davies, Mr. Alfred J",male,24,2,0,A/4 48871,24.15,,S +567,0,3,"Stoytcheff, Mr. Ilia",male,19,0,0,349205,7.8958,,S +568,0,3,"Palsson, Mrs. Nils (Alma Cornelia Berglund)",female,29,0,4,349909,21.075,,S +569,0,3,"Doharr, Mr. Tannous",male,,0,0,2686,7.2292,,C +570,1,3,"Jonsson, Mr. Carl",male,32,0,0,350417,7.8542,,S +571,1,2,"Harris, Mr. George",male,62,0,0,S.W./PP 752,10.5,,S +572,1,1,"Appleton, Mrs. Edward Dale (Charlotte Lamson)",female,53,2,0,11769,51.4792,C101,S +573,1,1,"Flynn, Mr. John Irwin (""Irving"")",male,36,0,0,PC 17474,26.3875,E25,S +574,1,3,"Kelly, Miss. Mary",female,,0,0,14312,7.75,,Q +575,0,3,"Rush, Mr. Alfred George John",male,16,0,0,A/4. 20589,8.05,,S +576,0,3,"Patchett, Mr. George",male,19,0,0,358585,14.5,,S +577,1,2,"Garside, Miss. Ethel",female,34,0,0,243880,13,,S +578,1,1,"Silvey, Mrs. William Baird (Alice Munger)",female,39,1,0,13507,55.9,E44,S +579,0,3,"Caram, Mrs. Joseph (Maria Elias)",female,,1,0,2689,14.4583,,C +580,1,3,"Jussila, Mr. Eiriik",male,32,0,0,STON/O 2. 3101286,7.925,,S +581,1,2,"Christy, Miss. Julie Rachel",female,25,1,1,237789,30,,S +582,1,1,"Thayer, Mrs. John Borland (Marian Longstreth Morris)",female,39,1,1,17421,110.8833,C68,C +583,0,2,"Downton, Mr. William James",male,54,0,0,28403,26,,S +584,0,1,"Ross, Mr. John Hugo",male,36,0,0,13049,40.125,A10,C +585,0,3,"Paulner, Mr. Uscher",male,,0,0,3411,8.7125,,C +586,1,1,"Taussig, Miss. Ruth",female,18,0,2,110413,79.65,E68,S +587,0,2,"Jarvis, Mr. John Denzil",male,47,0,0,237565,15,,S +588,1,1,"Frolicher-Stehli, Mr. Maxmillian",male,60,1,1,13567,79.2,B41,C +589,0,3,"Gilinski, Mr. Eliezer",male,22,0,0,14973,8.05,,S +590,0,3,"Murdlin, Mr. Joseph",male,,0,0,A./5. 3235,8.05,,S +591,0,3,"Rintamaki, Mr. Matti",male,35,0,0,STON/O 2. 3101273,7.125,,S +592,1,1,"Stephenson, Mrs. Walter Bertram (Martha Eustis)",female,52,1,0,36947,78.2667,D20,C +593,0,3,"Elsbury, Mr. William James",male,47,0,0,A/5 3902,7.25,,S +594,0,3,"Bourke, Miss. Mary",female,,0,2,364848,7.75,,Q +595,0,2,"Chapman, Mr. John Henry",male,37,1,0,SC/AH 29037,26,,S +596,0,3,"Van Impe, Mr. Jean Baptiste",male,36,1,1,345773,24.15,,S +597,1,2,"Leitch, Miss. Jessie Wills",female,,0,0,248727,33,,S +598,0,3,"Johnson, Mr. Alfred",male,49,0,0,LINE,0,,S +599,0,3,"Boulos, Mr. Hanna",male,,0,0,2664,7.225,,C +600,1,1,"Duff Gordon, Sir. Cosmo Edmund (""Mr Morgan"")",male,49,1,0,PC 17485,56.9292,A20,C +601,1,2,"Jacobsohn, Mrs. Sidney Samuel (Amy Frances Christy)",female,24,2,1,243847,27,,S +602,0,3,"Slabenoff, Mr. Petco",male,,0,0,349214,7.8958,,S +603,0,1,"Harrington, Mr. Charles H",male,,0,0,113796,42.4,,S +604,0,3,"Torber, Mr. Ernst William",male,44,0,0,364511,8.05,,S +605,1,1,"Homer, Mr. Harry (""Mr E Haven"")",male,35,0,0,111426,26.55,,C +606,0,3,"Lindell, Mr. Edvard Bengtsson",male,36,1,0,349910,15.55,,S +607,0,3,"Karaic, Mr. Milan",male,30,0,0,349246,7.8958,,S +608,1,1,"Daniel, Mr. Robert Williams",male,27,0,0,113804,30.5,,S +609,1,2,"Laroche, Mrs. Joseph (Juliette Marie Louise Lafargue)",female,22,1,2,SC/Paris 2123,41.5792,,C +610,1,1,"Shutes, Miss. Elizabeth W",female,40,0,0,PC 17582,153.4625,C125,S +611,0,3,"Andersson, Mrs. Anders Johan (Alfrida Konstantia Brogren)",female,39,1,5,347082,31.275,,S +612,0,3,"Jardin, Mr. Jose Neto",male,,0,0,SOTON/O.Q. 3101305,7.05,,S +613,1,3,"Murphy, Miss. Margaret Jane",female,,1,0,367230,15.5,,Q +614,0,3,"Horgan, Mr. John",male,,0,0,370377,7.75,,Q +615,0,3,"Brocklebank, Mr. William Alfred",male,35,0,0,364512,8.05,,S +616,1,2,"Herman, Miss. Alice",female,24,1,2,220845,65,,S +617,0,3,"Danbom, Mr. Ernst Gilbert",male,34,1,1,347080,14.4,,S +618,0,3,"Lobb, Mrs. William Arthur (Cordelia K Stanlick)",female,26,1,0,A/5. 3336,16.1,,S +619,1,2,"Becker, Miss. Marion Louise",female,4,2,1,230136,39,F4,S +620,0,2,"Gavey, Mr. Lawrence",male,26,0,0,31028,10.5,,S +621,0,3,"Yasbeck, Mr. Antoni",male,27,1,0,2659,14.4542,,C +622,1,1,"Kimball, Mr. Edwin Nelson Jr",male,42,1,0,11753,52.5542,D19,S +623,1,3,"Nakid, Mr. Sahid",male,20,1,1,2653,15.7417,,C +624,0,3,"Hansen, Mr. Henry Damsgaard",male,21,0,0,350029,7.8542,,S +625,0,3,"Bowen, Mr. David John ""Dai""",male,21,0,0,54636,16.1,,S +626,0,1,"Sutton, Mr. Frederick",male,61,0,0,36963,32.3208,D50,S +627,0,2,"Kirkland, Rev. Charles Leonard",male,57,0,0,219533,12.35,,Q +628,1,1,"Longley, Miss. Gretchen Fiske",female,21,0,0,13502,77.9583,D9,S +629,0,3,"Bostandyeff, Mr. Guentcho",male,26,0,0,349224,7.8958,,S +630,0,3,"O'Connell, Mr. Patrick D",male,,0,0,334912,7.7333,,Q +631,1,1,"Barkworth, Mr. Algernon Henry Wilson",male,80,0,0,27042,30,A23,S +632,0,3,"Lundahl, Mr. Johan Svensson",male,51,0,0,347743,7.0542,,S +633,1,1,"Stahelin-Maeglin, Dr. Max",male,32,0,0,13214,30.5,B50,C +634,0,1,"Parr, Mr. William Henry Marsh",male,,0,0,112052,0,,S +635,0,3,"Skoog, Miss. Mabel",female,9,3,2,347088,27.9,,S +636,1,2,"Davis, Miss. Mary",female,28,0,0,237668,13,,S +637,0,3,"Leinonen, Mr. Antti Gustaf",male,32,0,0,STON/O 2. 3101292,7.925,,S +638,0,2,"Collyer, Mr. Harvey",male,31,1,1,C.A. 31921,26.25,,S +639,0,3,"Panula, Mrs. Juha (Maria Emilia Ojala)",female,41,0,5,3101295,39.6875,,S +640,0,3,"Thorneycroft, Mr. Percival",male,,1,0,376564,16.1,,S +641,0,3,"Jensen, Mr. Hans Peder",male,20,0,0,350050,7.8542,,S +642,1,1,"Sagesser, Mlle. Emma",female,24,0,0,PC 17477,69.3,B35,C +643,0,3,"Skoog, Miss. Margit Elizabeth",female,2,3,2,347088,27.9,,S +644,1,3,"Foo, Mr. Choong",male,,0,0,1601,56.4958,,S +645,1,3,"Baclini, Miss. Eugenie",female,0.75,2,1,2666,19.2583,,C +646,1,1,"Harper, Mr. Henry Sleeper",male,48,1,0,PC 17572,76.7292,D33,C +647,0,3,"Cor, Mr. Liudevit",male,19,0,0,349231,7.8958,,S +648,1,1,"Simonius-Blumer, Col. Oberst Alfons",male,56,0,0,13213,35.5,A26,C +649,0,3,"Willey, Mr. Edward",male,,0,0,S.O./P.P. 751,7.55,,S +650,1,3,"Stanley, Miss. Amy Zillah Elsie",female,23,0,0,CA. 2314,7.55,,S +651,0,3,"Mitkoff, Mr. Mito",male,,0,0,349221,7.8958,,S +652,1,2,"Doling, Miss. Elsie",female,18,0,1,231919,23,,S +653,0,3,"Kalvik, Mr. Johannes Halvorsen",male,21,0,0,8475,8.4333,,S +654,1,3,"O'Leary, Miss. Hanora ""Norah""",female,,0,0,330919,7.8292,,Q +655,0,3,"Hegarty, Miss. Hanora ""Nora""",female,18,0,0,365226,6.75,,Q +656,0,2,"Hickman, Mr. Leonard Mark",male,24,2,0,S.O.C. 14879,73.5,,S +657,0,3,"Radeff, Mr. Alexander",male,,0,0,349223,7.8958,,S +658,0,3,"Bourke, Mrs. John (Catherine)",female,32,1,1,364849,15.5,,Q +659,0,2,"Eitemiller, Mr. George Floyd",male,23,0,0,29751,13,,S +660,0,1,"Newell, Mr. Arthur Webster",male,58,0,2,35273,113.275,D48,C +661,1,1,"Frauenthal, Dr. Henry William",male,50,2,0,PC 17611,133.65,,S +662,0,3,"Badt, Mr. Mohamed",male,40,0,0,2623,7.225,,C +663,0,1,"Colley, Mr. Edward Pomeroy",male,47,0,0,5727,25.5875,E58,S +664,0,3,"Coleff, Mr. Peju",male,36,0,0,349210,7.4958,,S +665,1,3,"Lindqvist, Mr. Eino William",male,20,1,0,STON/O 2. 3101285,7.925,,S +666,0,2,"Hickman, Mr. Lewis",male,32,2,0,S.O.C. 14879,73.5,,S +667,0,2,"Butler, Mr. Reginald Fenton",male,25,0,0,234686,13,,S +668,0,3,"Rommetvedt, Mr. Knud Paust",male,,0,0,312993,7.775,,S +669,0,3,"Cook, Mr. Jacob",male,43,0,0,A/5 3536,8.05,,S +670,1,1,"Taylor, Mrs. Elmer Zebley (Juliet Cummins Wright)",female,,1,0,19996,52,C126,S +671,1,2,"Brown, Mrs. Thomas William Solomon (Elizabeth Catherine Ford)",female,40,1,1,29750,39,,S +672,0,1,"Davidson, Mr. Thornton",male,31,1,0,F.C. 12750,52,B71,S +673,0,2,"Mitchell, Mr. Henry Michael",male,70,0,0,C.A. 24580,10.5,,S +674,1,2,"Wilhelms, Mr. Charles",male,31,0,0,244270,13,,S +675,0,2,"Watson, Mr. Ennis Hastings",male,,0,0,239856,0,,S +676,0,3,"Edvardsson, Mr. Gustaf Hjalmar",male,18,0,0,349912,7.775,,S +677,0,3,"Sawyer, Mr. Frederick Charles",male,24.5,0,0,342826,8.05,,S +678,1,3,"Turja, Miss. Anna Sofia",female,18,0,0,4138,9.8417,,S +679,0,3,"Goodwin, Mrs. Frederick (Augusta Tyler)",female,43,1,6,CA 2144,46.9,,S +680,1,1,"Cardeza, Mr. Thomas Drake Martinez",male,36,0,1,PC 17755,512.3292,B51 B53 B55,C +681,0,3,"Peters, Miss. Katie",female,,0,0,330935,8.1375,,Q +682,1,1,"Hassab, Mr. Hammad",male,27,0,0,PC 17572,76.7292,D49,C +683,0,3,"Olsvigen, Mr. Thor Anderson",male,20,0,0,6563,9.225,,S +684,0,3,"Goodwin, Mr. Charles Edward",male,14,5,2,CA 2144,46.9,,S +685,0,2,"Brown, Mr. Thomas William Solomon",male,60,1,1,29750,39,,S +686,0,2,"Laroche, Mr. Joseph Philippe Lemercier",male,25,1,2,SC/Paris 2123,41.5792,,C +687,0,3,"Panula, Mr. Jaako Arnold",male,14,4,1,3101295,39.6875,,S +688,0,3,"Dakic, Mr. Branko",male,19,0,0,349228,10.1708,,S +689,0,3,"Fischer, Mr. Eberhard Thelander",male,18,0,0,350036,7.7958,,S +690,1,1,"Madill, Miss. Georgette Alexandra",female,15,0,1,24160,211.3375,B5,S +691,1,1,"Dick, Mr. Albert Adrian",male,31,1,0,17474,57,B20,S +692,1,3,"Karun, Miss. Manca",female,4,0,1,349256,13.4167,,C +693,1,3,"Lam, Mr. Ali",male,,0,0,1601,56.4958,,S +694,0,3,"Saad, Mr. Khalil",male,25,0,0,2672,7.225,,C +695,0,1,"Weir, Col. John",male,60,0,0,113800,26.55,,S +696,0,2,"Chapman, Mr. Charles Henry",male,52,0,0,248731,13.5,,S +697,0,3,"Kelly, Mr. James",male,44,0,0,363592,8.05,,S +698,1,3,"Mullens, Miss. Katherine ""Katie""",female,,0,0,35852,7.7333,,Q +699,0,1,"Thayer, Mr. John Borland",male,49,1,1,17421,110.8833,C68,C +700,0,3,"Humblen, Mr. Adolf Mathias Nicolai Olsen",male,42,0,0,348121,7.65,F G63,S +701,1,1,"Astor, Mrs. John Jacob (Madeleine Talmadge Force)",female,18,1,0,PC 17757,227.525,C62 C64,C +702,1,1,"Silverthorne, Mr. Spencer Victor",male,35,0,0,PC 17475,26.2875,E24,S +703,0,3,"Barbara, Miss. Saiide",female,18,0,1,2691,14.4542,,C +704,0,3,"Gallagher, Mr. Martin",male,25,0,0,36864,7.7417,,Q +705,0,3,"Hansen, Mr. Henrik Juul",male,26,1,0,350025,7.8542,,S +706,0,2,"Morley, Mr. Henry Samuel (""Mr Henry Marshall"")",male,39,0,0,250655,26,,S +707,1,2,"Kelly, Mrs. Florence ""Fannie""",female,45,0,0,223596,13.5,,S +708,1,1,"Calderhead, Mr. Edward Pennington",male,42,0,0,PC 17476,26.2875,E24,S +709,1,1,"Cleaver, Miss. Alice",female,22,0,0,113781,151.55,,S +710,1,3,"Moubarek, Master. Halim Gonios (""William George"")",male,,1,1,2661,15.2458,,C +711,1,1,"Mayne, Mlle. Berthe Antonine (""Mrs de Villiers"")",female,24,0,0,PC 17482,49.5042,C90,C +712,0,1,"Klaber, Mr. Herman",male,,0,0,113028,26.55,C124,S +713,1,1,"Taylor, Mr. Elmer Zebley",male,48,1,0,19996,52,C126,S +714,0,3,"Larsson, Mr. August Viktor",male,29,0,0,7545,9.4833,,S +715,0,2,"Greenberg, Mr. Samuel",male,52,0,0,250647,13,,S +716,0,3,"Soholt, Mr. Peter Andreas Lauritz Andersen",male,19,0,0,348124,7.65,F G73,S +717,1,1,"Endres, Miss. Caroline Louise",female,38,0,0,PC 17757,227.525,C45,C +718,1,2,"Troutt, Miss. Edwina Celia ""Winnie""",female,27,0,0,34218,10.5,E101,S +719,0,3,"McEvoy, Mr. Michael",male,,0,0,36568,15.5,,Q +720,0,3,"Johnson, Mr. Malkolm Joackim",male,33,0,0,347062,7.775,,S +721,1,2,"Harper, Miss. Annie Jessie ""Nina""",female,6,0,1,248727,33,,S +722,0,3,"Jensen, Mr. Svend Lauritz",male,17,1,0,350048,7.0542,,S +723,0,2,"Gillespie, Mr. William Henry",male,34,0,0,12233,13,,S +724,0,2,"Hodges, Mr. Henry Price",male,50,0,0,250643,13,,S +725,1,1,"Chambers, Mr. Norman Campbell",male,27,1,0,113806,53.1,E8,S +726,0,3,"Oreskovic, Mr. Luka",male,20,0,0,315094,8.6625,,S +727,1,2,"Renouf, Mrs. Peter Henry (Lillian Jefferys)",female,30,3,0,31027,21,,S +728,1,3,"Mannion, Miss. Margareth",female,,0,0,36866,7.7375,,Q +729,0,2,"Bryhl, Mr. Kurt Arnold Gottfrid",male,25,1,0,236853,26,,S +730,0,3,"Ilmakangas, Miss. Pieta Sofia",female,25,1,0,STON/O2. 3101271,7.925,,S +731,1,1,"Allen, Miss. Elisabeth Walton",female,29,0,0,24160,211.3375,B5,S +732,0,3,"Hassan, Mr. Houssein G N",male,11,0,0,2699,18.7875,,C +733,0,2,"Knight, Mr. Robert J",male,,0,0,239855,0,,S +734,0,2,"Berriman, Mr. William John",male,23,0,0,28425,13,,S +735,0,2,"Troupiansky, Mr. Moses Aaron",male,23,0,0,233639,13,,S +736,0,3,"Williams, Mr. Leslie",male,28.5,0,0,54636,16.1,,S +737,0,3,"Ford, Mrs. Edward (Margaret Ann Watson)",female,48,1,3,W./C. 6608,34.375,,S +738,1,1,"Lesurer, Mr. Gustave J",male,35,0,0,PC 17755,512.3292,B101,C +739,0,3,"Ivanoff, Mr. Kanio",male,,0,0,349201,7.8958,,S +740,0,3,"Nankoff, Mr. Minko",male,,0,0,349218,7.8958,,S +741,1,1,"Hawksford, Mr. Walter James",male,,0,0,16988,30,D45,S +742,0,1,"Cavendish, Mr. Tyrell William",male,36,1,0,19877,78.85,C46,S +743,1,1,"Ryerson, Miss. Susan Parker ""Suzette""",female,21,2,2,PC 17608,262.375,B57 B59 B63 B66,C +744,0,3,"McNamee, Mr. Neal",male,24,1,0,376566,16.1,,S +745,1,3,"Stranden, Mr. Juho",male,31,0,0,STON/O 2. 3101288,7.925,,S +746,0,1,"Crosby, Capt. Edward Gifford",male,70,1,1,WE/P 5735,71,B22,S +747,0,3,"Abbott, Mr. Rossmore Edward",male,16,1,1,C.A. 2673,20.25,,S +748,1,2,"Sinkkonen, Miss. Anna",female,30,0,0,250648,13,,S +749,0,1,"Marvin, Mr. Daniel Warner",male,19,1,0,113773,53.1,D30,S +750,0,3,"Connaghton, Mr. Michael",male,31,0,0,335097,7.75,,Q +751,1,2,"Wells, Miss. Joan",female,4,1,1,29103,23,,S +752,1,3,"Moor, Master. Meier",male,6,0,1,392096,12.475,E121,S +753,0,3,"Vande Velde, Mr. Johannes Joseph",male,33,0,0,345780,9.5,,S +754,0,3,"Jonkoff, Mr. Lalio",male,23,0,0,349204,7.8958,,S +755,1,2,"Herman, Mrs. Samuel (Jane Laver)",female,48,1,2,220845,65,,S +756,1,2,"Hamalainen, Master. Viljo",male,0.67,1,1,250649,14.5,,S +757,0,3,"Carlsson, Mr. August Sigfrid",male,28,0,0,350042,7.7958,,S +758,0,2,"Bailey, Mr. Percy Andrew",male,18,0,0,29108,11.5,,S +759,0,3,"Theobald, Mr. Thomas Leonard",male,34,0,0,363294,8.05,,S +760,1,1,"Rothes, the Countess. of (Lucy Noel Martha Dyer-Edwards)",female,33,0,0,110152,86.5,B77,S +761,0,3,"Garfirth, Mr. John",male,,0,0,358585,14.5,,S +762,0,3,"Nirva, Mr. Iisakki Antino Aijo",male,41,0,0,SOTON/O2 3101272,7.125,,S +763,1,3,"Barah, Mr. Hanna Assi",male,20,0,0,2663,7.2292,,C +764,1,1,"Carter, Mrs. William Ernest (Lucile Polk)",female,36,1,2,113760,120,B96 B98,S +765,0,3,"Eklund, Mr. Hans Linus",male,16,0,0,347074,7.775,,S +766,1,1,"Hogeboom, Mrs. John C (Anna Andrews)",female,51,1,0,13502,77.9583,D11,S +767,0,1,"Brewe, Dr. Arthur Jackson",male,,0,0,112379,39.6,,C +768,0,3,"Mangan, Miss. Mary",female,30.5,0,0,364850,7.75,,Q +769,0,3,"Moran, Mr. Daniel J",male,,1,0,371110,24.15,,Q +770,0,3,"Gronnestad, Mr. Daniel Danielsen",male,32,0,0,8471,8.3625,,S +771,0,3,"Lievens, Mr. Rene Aime",male,24,0,0,345781,9.5,,S +772,0,3,"Jensen, Mr. Niels Peder",male,48,0,0,350047,7.8542,,S +773,0,2,"Mack, Mrs. (Mary)",female,57,0,0,S.O./P.P. 3,10.5,E77,S +774,0,3,"Elias, Mr. Dibo",male,,0,0,2674,7.225,,C +775,1,2,"Hocking, Mrs. Elizabeth (Eliza Needs)",female,54,1,3,29105,23,,S +776,0,3,"Myhrman, Mr. Pehr Fabian Oliver Malkolm",male,18,0,0,347078,7.75,,S +777,0,3,"Tobin, Mr. Roger",male,,0,0,383121,7.75,F38,Q +778,1,3,"Emanuel, Miss. Virginia Ethel",female,5,0,0,364516,12.475,,S +779,0,3,"Kilgannon, Mr. Thomas J",male,,0,0,36865,7.7375,,Q +780,1,1,"Robert, Mrs. Edward Scott (Elisabeth Walton McMillan)",female,43,0,1,24160,211.3375,B3,S +781,1,3,"Ayoub, Miss. Banoura",female,13,0,0,2687,7.2292,,C +782,1,1,"Dick, Mrs. Albert Adrian (Vera Gillespie)",female,17,1,0,17474,57,B20,S +783,0,1,"Long, Mr. Milton Clyde",male,29,0,0,113501,30,D6,S +784,0,3,"Johnston, Mr. Andrew G",male,,1,2,W./C. 6607,23.45,,S +785,0,3,"Ali, Mr. William",male,25,0,0,SOTON/O.Q. 3101312,7.05,,S +786,0,3,"Harmer, Mr. Abraham (David Lishin)",male,25,0,0,374887,7.25,,S +787,1,3,"Sjoblom, Miss. Anna Sofia",female,18,0,0,3101265,7.4958,,S +788,0,3,"Rice, Master. George Hugh",male,8,4,1,382652,29.125,,Q +789,1,3,"Dean, Master. Bertram Vere",male,1,1,2,C.A. 2315,20.575,,S +790,0,1,"Guggenheim, Mr. Benjamin",male,46,0,0,PC 17593,79.2,B82 B84,C +791,0,3,"Keane, Mr. Andrew ""Andy""",male,,0,0,12460,7.75,,Q +792,0,2,"Gaskell, Mr. Alfred",male,16,0,0,239865,26,,S +793,0,3,"Sage, Miss. Stella Anna",female,,8,2,CA. 2343,69.55,,S +794,0,1,"Hoyt, Mr. William Fisher",male,,0,0,PC 17600,30.6958,,C +795,0,3,"Dantcheff, Mr. Ristiu",male,25,0,0,349203,7.8958,,S +796,0,2,"Otter, Mr. Richard",male,39,0,0,28213,13,,S +797,1,1,"Leader, Dr. Alice (Farnham)",female,49,0,0,17465,25.9292,D17,S +798,1,3,"Osman, Mrs. Mara",female,31,0,0,349244,8.6833,,S +799,0,3,"Ibrahim Shawah, Mr. Yousseff",male,30,0,0,2685,7.2292,,C +800,0,3,"Van Impe, Mrs. Jean Baptiste (Rosalie Paula Govaert)",female,30,1,1,345773,24.15,,S +801,0,2,"Ponesell, Mr. Martin",male,34,0,0,250647,13,,S +802,1,2,"Collyer, Mrs. Harvey (Charlotte Annie Tate)",female,31,1,1,C.A. 31921,26.25,,S +803,1,1,"Carter, Master. William Thornton II",male,11,1,2,113760,120,B96 B98,S +804,1,3,"Thomas, Master. Assad Alexander",male,0.42,0,1,2625,8.5167,,C +805,1,3,"Hedman, Mr. Oskar Arvid",male,27,0,0,347089,6.975,,S +806,0,3,"Johansson, Mr. Karl Johan",male,31,0,0,347063,7.775,,S +807,0,1,"Andrews, Mr. Thomas Jr",male,39,0,0,112050,0,A36,S +808,0,3,"Pettersson, Miss. Ellen Natalia",female,18,0,0,347087,7.775,,S +809,0,2,"Meyer, Mr. August",male,39,0,0,248723,13,,S +810,1,1,"Chambers, Mrs. Norman Campbell (Bertha Griggs)",female,33,1,0,113806,53.1,E8,S +811,0,3,"Alexander, Mr. William",male,26,0,0,3474,7.8875,,S +812,0,3,"Lester, Mr. James",male,39,0,0,A/4 48871,24.15,,S +813,0,2,"Slemen, Mr. Richard James",male,35,0,0,28206,10.5,,S +814,0,3,"Andersson, Miss. Ebba Iris Alfrida",female,6,4,2,347082,31.275,,S +815,0,3,"Tomlin, Mr. Ernest Portage",male,30.5,0,0,364499,8.05,,S +816,0,1,"Fry, Mr. Richard",male,,0,0,112058,0,B102,S +817,0,3,"Heininen, Miss. Wendla Maria",female,23,0,0,STON/O2. 3101290,7.925,,S +818,0,2,"Mallet, Mr. Albert",male,31,1,1,S.C./PARIS 2079,37.0042,,C +819,0,3,"Holm, Mr. John Fredrik Alexander",male,43,0,0,C 7075,6.45,,S +820,0,3,"Skoog, Master. Karl Thorsten",male,10,3,2,347088,27.9,,S +821,1,1,"Hays, Mrs. Charles Melville (Clara Jennings Gregg)",female,52,1,1,12749,93.5,B69,S +822,1,3,"Lulic, Mr. Nikola",male,27,0,0,315098,8.6625,,S +823,0,1,"Reuchlin, Jonkheer. John George",male,38,0,0,19972,0,,S +824,1,3,"Moor, Mrs. (Beila)",female,27,0,1,392096,12.475,E121,S +825,0,3,"Panula, Master. Urho Abraham",male,2,4,1,3101295,39.6875,,S +826,0,3,"Flynn, Mr. John",male,,0,0,368323,6.95,,Q +827,0,3,"Lam, Mr. Len",male,,0,0,1601,56.4958,,S +828,1,2,"Mallet, Master. Andre",male,1,0,2,S.C./PARIS 2079,37.0042,,C +829,1,3,"McCormack, Mr. Thomas Joseph",male,,0,0,367228,7.75,,Q +830,1,1,"Stone, Mrs. George Nelson (Martha Evelyn)",female,62,0,0,113572,80,B28, +831,1,3,"Yasbeck, Mrs. Antoni (Selini Alexander)",female,15,1,0,2659,14.4542,,C +832,1,2,"Richards, Master. George Sibley",male,0.83,1,1,29106,18.75,,S +833,0,3,"Saad, Mr. Amin",male,,0,0,2671,7.2292,,C +834,0,3,"Augustsson, Mr. Albert",male,23,0,0,347468,7.8542,,S +835,0,3,"Allum, Mr. Owen George",male,18,0,0,2223,8.3,,S +836,1,1,"Compton, Miss. Sara Rebecca",female,39,1,1,PC 17756,83.1583,E49,C +837,0,3,"Pasic, Mr. Jakob",male,21,0,0,315097,8.6625,,S +838,0,3,"Sirota, Mr. Maurice",male,,0,0,392092,8.05,,S +839,1,3,"Chip, Mr. Chang",male,32,0,0,1601,56.4958,,S +840,1,1,"Marechal, Mr. Pierre",male,,0,0,11774,29.7,C47,C +841,0,3,"Alhomaki, Mr. Ilmari Rudolf",male,20,0,0,SOTON/O2 3101287,7.925,,S +842,0,2,"Mudd, Mr. Thomas Charles",male,16,0,0,S.O./P.P. 3,10.5,,S +843,1,1,"Serepeca, Miss. Augusta",female,30,0,0,113798,31,,C +844,0,3,"Lemberopolous, Mr. Peter L",male,34.5,0,0,2683,6.4375,,C +845,0,3,"Culumovic, Mr. Jeso",male,17,0,0,315090,8.6625,,S +846,0,3,"Abbing, Mr. Anthony",male,42,0,0,C.A. 5547,7.55,,S +847,0,3,"Sage, Mr. Douglas Bullen",male,,8,2,CA. 2343,69.55,,S +848,0,3,"Markoff, Mr. Marin",male,35,0,0,349213,7.8958,,C +849,0,2,"Harper, Rev. John",male,28,0,1,248727,33,,S +850,1,1,"Goldenberg, Mrs. Samuel L (Edwiga Grabowska)",female,,1,0,17453,89.1042,C92,C +851,0,3,"Andersson, Master. Sigvard Harald Elias",male,4,4,2,347082,31.275,,S +852,0,3,"Svensson, Mr. Johan",male,74,0,0,347060,7.775,,S +853,0,3,"Boulos, Miss. Nourelain",female,9,1,1,2678,15.2458,,C +854,1,1,"Lines, Miss. Mary Conover",female,16,0,1,PC 17592,39.4,D28,S +855,0,2,"Carter, Mrs. Ernest Courtenay (Lilian Hughes)",female,44,1,0,244252,26,,S +856,1,3,"Aks, Mrs. Sam (Leah Rosen)",female,18,0,1,392091,9.35,,S +857,1,1,"Wick, Mrs. George Dennick (Mary Hitchcock)",female,45,1,1,36928,164.8667,,S +858,1,1,"Daly, Mr. Peter Denis ",male,51,0,0,113055,26.55,E17,S +859,1,3,"Baclini, Mrs. Solomon (Latifa Qurban)",female,24,0,3,2666,19.2583,,C +860,0,3,"Razi, Mr. Raihed",male,,0,0,2629,7.2292,,C +861,0,3,"Hansen, Mr. Claus Peter",male,41,2,0,350026,14.1083,,S +862,0,2,"Giles, Mr. Frederick Edward",male,21,1,0,28134,11.5,,S +863,1,1,"Swift, Mrs. Frederick Joel (Margaret Welles Barron)",female,48,0,0,17466,25.9292,D17,S +864,0,3,"Sage, Miss. Dorothy Edith ""Dolly""",female,,8,2,CA. 2343,69.55,,S +865,0,2,"Gill, Mr. John William",male,24,0,0,233866,13,,S +866,1,2,"Bystrom, Mrs. (Karolina)",female,42,0,0,236852,13,,S +867,1,2,"Duran y More, Miss. Asuncion",female,27,1,0,SC/PARIS 2149,13.8583,,C +868,0,1,"Roebling, Mr. Washington Augustus II",male,31,0,0,PC 17590,50.4958,A24,S +869,0,3,"van Melkebeke, Mr. Philemon",male,,0,0,345777,9.5,,S +870,1,3,"Johnson, Master. Harold Theodor",male,4,1,1,347742,11.1333,,S +871,0,3,"Balkic, Mr. Cerin",male,26,0,0,349248,7.8958,,S +872,1,1,"Beckwith, Mrs. Richard Leonard (Sallie Monypeny)",female,47,1,1,11751,52.5542,D35,S +873,0,1,"Carlsson, Mr. Frans Olof",male,33,0,0,695,5,B51 B53 B55,S +874,0,3,"Vander Cruyssen, Mr. Victor",male,47,0,0,345765,9,,S +875,1,2,"Abelson, Mrs. Samuel (Hannah Wizosky)",female,28,1,0,P/PP 3381,24,,C +876,1,3,"Najib, Miss. Adele Kiamie ""Jane""",female,15,0,0,2667,7.225,,C +877,0,3,"Gustafsson, Mr. Alfred Ossian",male,20,0,0,7534,9.8458,,S +878,0,3,"Petroff, Mr. Nedelio",male,19,0,0,349212,7.8958,,S +879,0,3,"Laleff, Mr. Kristo",male,,0,0,349217,7.8958,,S +880,1,1,"Potter, Mrs. Thomas Jr (Lily Alexenia Wilson)",female,56,0,1,11767,83.1583,C50,C +881,1,2,"Shelley, Mrs. William (Imanita Parrish Hall)",female,25,0,1,230433,26,,S +882,0,3,"Markun, Mr. Johann",male,33,0,0,349257,7.8958,,S +883,0,3,"Dahlberg, Miss. Gerda Ulrika",female,22,0,0,7552,10.5167,,S +884,0,2,"Banfield, Mr. Frederick James",male,28,0,0,C.A./SOTON 34068,10.5,,S +885,0,3,"Sutehall, Mr. Henry Jr",male,25,0,0,SOTON/OQ 392076,7.05,,S +886,0,3,"Rice, Mrs. William (Margaret Norton)",female,39,0,5,382652,29.125,,Q +887,0,2,"Montvila, Rev. Juozas",male,27,0,0,211536,13,,S +888,1,1,"Graham, Miss. Margaret Edith",female,19,0,0,112053,30,B42,S +889,0,3,"Johnston, Miss. Catherine Helen ""Carrie""",female,,1,2,W./C. 6607,23.45,,S +890,1,1,"Behr, Mr. Karl Howell",male,26,0,0,111369,30,C148,C +891,0,3,"Dooley, Mr. Patrick",male,32,0,0,370376,7.75,,Q diff --git a/how-to-use-azureml/work-with-data/datasets/train-dataset/train.py b/how-to-use-azureml/work-with-data/datasets/train-dataset/train.py new file mode 100644 index 00000000..fb33937f --- /dev/null +++ b/how-to-use-azureml/work-with-data/datasets/train-dataset/train.py @@ -0,0 +1,36 @@ +import azureml.dataprep as dprep +import azureml.core +import pandas as pd +import logging +import os +import datetime +import shutil + +from azureml.core import Workspace, Datastore, Dataset, Experiment, Run +from sklearn.model_selection import train_test_split +from azureml.core.compute import ComputeTarget, AmlCompute +from azureml.core.compute_target import ComputeTargetException +from sklearn.tree import DecisionTreeClassifier + +run = Run.get_context() +workspace = run.experiment.workspace + +dataset_name = 'training_data' + +dataset = Dataset.get(workspace=workspace, name=dataset_name) +dflow = dataset.get_definition() +dflow_val, dflow_train = dflow.random_split(percentage=0.3) + +y_df = dflow_train.keep_columns(['HasDetections']).to_pandas_dataframe() +x_df = dflow_train.drop_columns(['HasDetections']).to_pandas_dataframe() +y_val = dflow_val.keep_columns(['HasDetections']).to_pandas_dataframe() +x_val = dflow_val.drop_columns(['HasDetections']).to_pandas_dataframe() + +data = {"train": {"X": x_df, "y": y_df}, + + "validation": {"X": x_val, "y": y_val}} + +clf = DecisionTreeClassifier().fit(data["train"]["X"], data["train"]["y"]) + +print('Accuracy of Decision Tree classifier on training set: {:.2f}'.format(clf.score(x_df, y_df))) +print('Accuracy of Decision Tree classifier on validation set: {:.2f}'.format(clf.score(x_val, y_val))) From 9c9b4bb122ebff6a2e71a0ebbaadf4dc016d233e Mon Sep 17 00:00:00 2001 From: Ilya Matiach Date: Thu, 2 May 2019 14:29:53 -0400 Subject: [PATCH 004/108] Update raw features explanation notebook --- .../explain-sklearn-raw-features.ipynb | 44 ++++++++++++------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/how-to-use-azureml/explain-model/explain-tabular-data-raw-features/explain-sklearn-raw-features.ipynb b/how-to-use-azureml/explain-model/explain-tabular-data-raw-features/explain-sklearn-raw-features.ipynb index af44afb8..d5ff0a66 100644 --- a/how-to-use-azureml/explain-model/explain-tabular-data-raw-features/explain-sklearn-raw-features.ipynb +++ b/how-to-use-azureml/explain-model/explain-tabular-data-raw-features/explain-sklearn-raw-features.ipynb @@ -29,6 +29,22 @@ "4. Visualize the global and local explanations with the visualization dashboard." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This example needs sklearn-pandas. If it is not installed, uncomment and run the following line." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#!pip install sklearn-pandas" + ] + }, { "cell_type": "code", "execution_count": null, @@ -39,7 +55,7 @@ "from sklearn.impute import SimpleImputer\n", "from sklearn.preprocessing import StandardScaler, OneHotEncoder\n", "from sklearn.linear_model import LogisticRegression\n", - "from azureml.contrib.explain.model.tabular_explainer import TabularExplainer\n", + "from azureml.explain.model.tabular_explainer import TabularExplainer\n", "from sklearn_pandas import DataFrameMapper\n", "import pandas as pd\n", "import numpy as np" @@ -101,16 +117,19 @@ "from sklearn.preprocessing import StandardScaler, OneHotEncoder\n", "from sklearn_pandas import DataFrameMapper\n", "\n", - "# Impute and standardize the numeric features\n", - "numeric_transformations = [([f], Pipeline(steps=[\n", - " ('imputer', SimpleImputer(strategy='median')),\n", - " ('scaler', StandardScaler())])) for f in numeric_features]\n", - " \n", - "# One hot encode the categorical features \n", - "categorical_transformations = [([f], OneHotEncoder(handle_unknown='ignore', sparse=False)) for f in categorical_features]\n", + "# Impute, standardize the numeric features and one-hot encode the categorical features. \n", "\n", + "transformations = [\n", + " ([\"age\", \"fare\"], Pipeline(steps=[\n", + " ('imputer', SimpleImputer(strategy='median')),\n", + " ('scaler', StandardScaler())\n", + " ])),\n", + " ([\"embarked\"], Pipeline(steps=[\n", + " (\"imputer\", SimpleImputer(strategy='constant', fill_value='missing')), \n", + " (\"encoder\", OneHotEncoder(sparse=False))])),\n", + " ([\"sex\", \"pclass\"], OneHotEncoder(sparse=False)) \n", + "]\n", "\n", - "transformations = numeric_transformations + categorical_transformations\n", "\n", "# Append classifier to preprocessing pipeline.\n", "# Now we have a full prediction pipeline.\n", @@ -231,13 +250,6 @@ "source": [ "ExplanationDashboard(global_explanation, model, x_test)" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { From cb8dc41766a75c22ec5311766d54129168e79961 Mon Sep 17 00:00:00 2001 From: Roope Astala Date: Fri, 3 May 2019 10:25:39 -0400 Subject: [PATCH 005/108] how to use environments --- .../using-environments/example/example.py | 8 + .../using-environments.ipynb | 364 ++++++++++++++++++ 2 files changed, 372 insertions(+) create mode 100644 how-to-use-azureml/training/using-environments/example/example.py create mode 100644 how-to-use-azureml/training/using-environments/using-environments.ipynb diff --git a/how-to-use-azureml/training/using-environments/example/example.py b/how-to-use-azureml/training/using-environments/example/example.py new file mode 100644 index 00000000..90386313 --- /dev/null +++ b/how-to-use-azureml/training/using-environments/example/example.py @@ -0,0 +1,8 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License + +# Very simple script to demonstrate run in environment +# Print message passed in as environment variable +import os + +print(os.environ.get("MESSAGE")) diff --git a/how-to-use-azureml/training/using-environments/using-environments.ipynb b/how-to-use-azureml/training/using-environments/using-environments.ipynb new file mode 100644 index 00000000..1c541715 --- /dev/null +++ b/how-to-use-azureml/training/using-environments/using-environments.ipynb @@ -0,0 +1,364 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) Microsoft Corporation. All rights reserved.\n", + "\n", + "Licensed under the MIT License" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Using environments\n", + "\n", + "\n", + "## Contents\n", + "\n", + "1. [Introduction](#Introduction)\n", + "1. [Setup](#Setup)\n", + "1. [Create environment](#Create-environment)\n", + " 1. Add Python packages\n", + " 1. Specify environment variables\n", + "1. [Submit run using environment](#Submit-run-using-environment)\n", + "1. [Register environment](#Register-environment)\n", + "1. [List and get existing environments](#List-and-get-existing-environments)\n", + "1. [Other ways to create environments](#Other-ways-to-create-environments)\n", + " 1. From existing Conda environment\n", + " 1. From Conda or pip files\n", + "1. [Docker settings](#Docker-settings)\n", + "1. [Spark and Azure Databricks settings](#Spark-and-Azure-Databricks-settings)\n", + "1. [Next steps](#Next-steps)\n", + "\n", + "## Introduction\n", + "\n", + "Azure ML environments are an encapsulation of the environment where your machine learning training happens. They define Python packages, environment variables, Docker settings and other attributes in declarative fashion. Environments are versioned: you can update them and retrieve old versions to revist and review your work.\n", + "\n", + "Environments allow you to:\n", + "* Encapsulate dependencies of your training process, such as Python packages and their versions.\n", + "* Reproduce the Python environment on your local computer in a remote run on VM or ML Compute cluster\n", + "* Reproduce your experimentation environment in production setting.\n", + "* Revisit and audit the environment in which an existing model was trained.\n", + "\n", + "Environment, compute target and training script together form run configuration: the full specification of training run.\n", + "\n", + "## Setup\n", + "\n", + "Make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't.\n", + "\n", + "First, let's validate Azure ML SDK version and connect to workspace." + ] + }, + { + "cell_type": "raw", + "metadata": {}, + "source": [ + "import azureml.core\n", + "from azureml.core import Workspace\n", + "\n", + "print(azureml.core.VERSION)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ws = Workspace.from_config()\n", + "ws.get_details()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Create environment\n", + "\n", + "You can create an environment by instantiating ```Environment``` object and then setting its attributes: set of Python packages, environment variables and others.\n", + "\n", + "### Add Python packages\n", + "\n", + "The recommended way is to specify Conda packages, as they typically come with complete set of pre-built binaries." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core import Environment\n", + "from azureml.core.environment import CondaDependencies\n", + "\n", + "myenv = Environment(name=\"myenv\")\n", + "conda_dep = CondaDependencies()\n", + "conda_dep.add_conda_package(\"scikit-learn\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can also add pip packages, and specify the version of package" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "conda_dep.add_pip_package(\"pillow==5.4.1\")\n", + "myenv.python.conda_dependencies=conda_dep" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Specify environment variables\n", + "\n", + "You can add environment variables to your environment. These then become available using ```os.environ.get``` in your training script." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "myenv.environment_variables = {\"MESSAGE\":\"Hello from Azure Machine Learning\"}" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Submit run using environment\n", + "\n", + "When you submit a run, you can specify which environment to use. \n", + "\n", + "On the first run in given environment, Azure ML spends some time building the environment. On the subsequent runs, Azure ML keeps track of changes and uses the existing environment, resulting in faster run completion." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core import ScriptRunConfig, Experiment\n", + "\n", + "myexp = Experiment(workspace=ws, name = \"environment-example\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To submit a run, create a run configuration that combines the script file and environment, and pass it to ```Experiment.submit```. In this example, the script is submitted to local computer, but you can specify other compute targets such as remote clusters as well." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "runconfig = ScriptRunConfig(source_directory=\"example\", script=\"example.py\")\n", + "runconfig.run_config.target = \"local\"\n", + "runconfig.run_config.environment = myenv\n", + "run = myexp.submit(config=runconfig)\n", + "\n", + "run.wait_for_completion(show_output=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Register environment\n", + "\n", + "You can manage environments by registering them. This allows you to track their versions, and reuse them in future runs. For example, once you've constructed an environment that meets your requirements, you can register it and use it in other experiments so as to standardize your workflow.\n", + "\n", + "If you register the environment with same name, the version number is increased by one. Note that Azure ML keeps track of differences between the version, so if you re-register an identical version, the version number is not increased." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "myenv.register(workspace=ws)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## List and get existing environments\n", + "\n", + "Your workspace contains a dictionary of registered environments. You can then use ```Environment.get``` to retrieve a specific environment with specific version." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "for name,env in ws.environments.items():\n", + " print(\"Name {} \\t version {}\".format(name,env.version))\n", + "\n", + "restored_environment = Environment.get(workspace=ws,name=\"myenv\",version=\"1\")\n", + "\n", + "print(\"Attributes of restored environment\")\n", + "restored_environment" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Other ways to create environments\n", + "\n", + "### From existing Conda environment\n", + "\n", + "You can create an environment from existing conda environment. This make it easy to reuse your local interactive environment in Azure ML remote runs. For example, if you've created conda environment using\n", + "```\n", + "conda create -n mycondaenv\n", + "```\n", + "you can create Azure ML environment out of that conda environment using\n", + "```\n", + "myenv = Environment.from_existing_conda_environment(name=\"myenv\",conda_environment_name=\"mycondaenv\")\n", + "```\n", + "\n", + "### From conda or pip files\n", + "\n", + "You can create environments from conda specification or pip requirements files using\n", + "```\n", + "myenv = Environment.from_conda_specification(name=\"myenv\", file_path=\"path-to-conda-specification-file\")\n", + "\n", + "myenv = Environment.from_pip_requirements(name=\"myenv\", file_path=\"path-to-pip-requirements-file\")\n", + "```\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Docker settings\n", + "\n", + "Docker container provides an efficient way to encapsulate the dependencies. When you enable Docker, Azure ML builds a Docker image and creates a Python environment within that container, given your specifications. The Docker images are reused: the first run in a new environment typically takes longer as the image is build.\n", + "\n", + "**Note:** For runs on local computer or attached virtual machine, that computer must have Docker installed and enabled. Machine Learning Compute has Docker pre-installed.\n", + "\n", + "Attribute ```docker.enabled``` controls whether to use Docker container or host OS for execution. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "myenv.docker.enabled = True" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can specify custom Docker base image and registry. This allows you to customize and control in detail the guest OS in which your training run executes. whether to use GPU, whether to use shared volumes, and shm size." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "myenv.docker.base_image\n", + "myenv.docker.base_image_registry" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can also specify whether to use GPU or shared volumes, and shm size." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "myenv.docker.gpu_support\n", + "myenv.docker.shared_volumes\n", + "myenv.docker.shm_size" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Spark and Azure Databricks settings\n", + "\n", + "In addition to Python and Docker settings, Environment also contains attributes for Spark and Azure Databricks runs. These attributes become relevant when you submit runs on those compute targets." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Next steps\n", + "\n", + "Learn more about remote runs on different compute targets:\n", + "\n", + "* [Train on ML Compute](../../train-on-amlcompute)\n", + "\n", + "* [Train on remote VM](../../train-on-remote-vm)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "authors": [ + { + "name": "roastala" + } + ], + "kernelspec": { + "display_name": "Python 3.6", + "language": "python", + "name": "python36" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.5" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From 513e36d9b2882a2e9ca3d71caa91d2bedf832c52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Fri, 3 May 2019 22:54:02 -0700 Subject: [PATCH 006/108] updated the config verbiage and tracking pixel --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5edf1824..364a9dd5 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,8 @@ pip install azureml-sdk Read more detailed instructions on [how to set up your environment](./NBSETUP.md) using Azure Notebook service, your own Jupyter notebook server, or Docker. ## How to navigate and use the example notebooks? -You should always run the [Configuration](./configuration.ipynb) notebook first when setting up a notebook library on a new machine or in a new environment. It configures your notebook library to connect to an Azure Machine Learning workspace, and sets up your workspace and compute to be used by many of the other examples. +If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the Configuration](./configuration.ipynb) notebook first if you haven't already to establish your connection to the AzureML Workspace. +It configures your notebook library to connect to an Azure Machine Learning workspace, and sets up your workspace and compute to be used by many of the other examples. If you want to... @@ -53,4 +54,10 @@ The [How to use Azure ML](./how-to-use-azureml) folder contains specific example Visit following repos to see projects contributed by Azure ML users: - [Fine tune natural language processing models using Azure Machine Learning service](https://github.com/Microsoft/AzureML-BERT) - - [Fashion MNIST with Azure ML SDK](https://github.com/amynic/azureml-sdk-fashion) \ No newline at end of file + - [Fashion MNIST with Azure ML SDK](https://github.com/amynic/azureml-sdk-fashion) + + + ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/README.png) + + + From 3c6c09073277d84599f910faaea1a2cd25a3baf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Fri, 3 May 2019 22:54:31 -0700 Subject: [PATCH 007/108] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 364a9dd5..763b65dc 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ pip install azureml-sdk Read more detailed instructions on [how to set up your environment](./NBSETUP.md) using Azure Notebook service, your own Jupyter notebook server, or Docker. ## How to navigate and use the example notebooks? -If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the Configuration](./configuration.ipynb) notebook first if you haven't already to establish your connection to the AzureML Workspace. +If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [Configuration](./configuration.ipynb) notebook first if you haven't already to establish your connection to the AzureML Workspace. It configures your notebook library to connect to an Azure Machine Learning workspace, and sets up your workspace and compute to be used by many of the other examples. If you want to... From 78abb65f5e3176df049f95b0753338e9f8ec08f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Fri, 3 May 2019 23:08:55 -0700 Subject: [PATCH 008/108] updated configuration text --- how-to-use-azureml/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/how-to-use-azureml/README.md b/how-to-use-azureml/README.md index 70e015e1..b1c31812 100644 --- a/how-to-use-azureml/README.md +++ b/how-to-use-azureml/README.md @@ -2,7 +2,7 @@ Learn how to use Azure Machine Learning services for experimentation and model management. -As a pre-requisite, run the [configuration Notebook](../configuration.ipynb) notebook first to set up your Azure ML Workspace. Then, run the notebooks in following recommended order. +If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration Notebook](../configuration.ipynb) first if you haven't already to establish your connection to the AzureML Workspace. Then, run the notebooks in following recommended order. * [train-within-notebook](./training/train-within-notebook): Train a model hile tracking run history, and learn how to deploy the model as web service to Azure Container Instance. * [train-on-local](./training/train-on-local): Learn how to submit a run to local computer and use Azure ML managed run configuration. From 08c6b1f4ed5fa7a4a3e33868e1bb1feec472ce3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Fri, 3 May 2019 23:15:28 -0700 Subject: [PATCH 009/108] tracking pixel test --- .../azure-hdi/automl_hdi_local_classification.ipynb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/how-to-use-azureml/azure-hdi/automl_hdi_local_classification.ipynb b/how-to-use-azureml/azure-hdi/automl_hdi_local_classification.ipynb index 2c77d310..9d223949 100644 --- a/how-to-use-azureml/azure-hdi/automl_hdi_local_classification.ipynb +++ b/how-to-use-azureml/azure-hdi/automl_hdi_local_classification.ipynb @@ -8,7 +8,14 @@ "\n", "Licensed under the MIT License." ] - }, + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/azure-hdi/automl_hdi_local_classification.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, From e5488478812b64327e7df5213c6db9df8ef285ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Fri, 3 May 2019 23:20:57 -0700 Subject: [PATCH 010/108] pixel text and config text update --- .../deploy-to-cloud/model-register-and-deploy.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/deploy-to-cloud/model-register-and-deploy.ipynb b/how-to-use-azureml/deploy-to-cloud/model-register-and-deploy.ipynb index 8acdb4a2..21e732f9 100644 --- a/how-to-use-azureml/deploy-to-cloud/model-register-and-deploy.ipynb +++ b/how-to-use-azureml/deploy-to-cloud/model-register-and-deploy.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deploy-to-cloud/model-register-and-deploy.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -26,7 +33,7 @@ "metadata": {}, "source": [ "## Prerequisites\n", - "Make sure you go through the [configuration](../../../configuration.ipynb) Notebook first if you haven't." + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration](../../../configuration.ipynb) Notebook first if you haven't already to establish your connection to the AzureML Workspace." ] }, { @@ -272,4 +279,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From a7c3db0560d45dc7f2ca4209b204cb15dc74c7bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Fri, 3 May 2019 23:21:58 -0700 Subject: [PATCH 011/108] Update model-register-and-deploy.ipynb --- .../deploy-to-cloud/model-register-and-deploy.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/how-to-use-azureml/deploy-to-cloud/model-register-and-deploy.ipynb b/how-to-use-azureml/deploy-to-cloud/model-register-and-deploy.ipynb index 21e732f9..feed709a 100644 --- a/how-to-use-azureml/deploy-to-cloud/model-register-and-deploy.ipynb +++ b/how-to-use-azureml/deploy-to-cloud/model-register-and-deploy.ipynb @@ -33,7 +33,7 @@ "metadata": {}, "source": [ "## Prerequisites\n", - "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration](../../../configuration.ipynb) Notebook first if you haven't already to establish your connection to the AzureML Workspace." + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration](../../configuration.ipynb) Notebook first if you haven't already to establish your connection to the AzureML Workspace." ] }, { From 7d8289679d1f837b496227d33e0358adda80db2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 08:40:18 -0700 Subject: [PATCH 012/108] added the tracking pixel and the edited the config text --- .../training/logging-api/logging-api.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/training/logging-api/logging-api.ipynb b/how-to-use-azureml/training/logging-api/logging-api.ipynb index a416f401..dd0205bc 100644 --- a/how-to-use-azureml/training/logging-api/logging-api.ipynb +++ b/how-to-use-azureml/training/logging-api/logging-api.ipynb @@ -8,6 +8,13 @@ "\n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/logging-api/logging-api.png)" + ] }, { "cell_type": "markdown", @@ -62,7 +69,7 @@ "\n", "## Setup\n", "\n", - "Make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't. Also make sure you have tqdm and matplotlib installed in the current kernel.\n", + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration](../../../configuration.ipynb) Notebook first if you haven't already to establish your connection to the AzureML Workspace. Also make sure you have tqdm and matplotlib installed in the current kernel.\n", "\n", "```\n", "(myenv) $ conda install -y tqdm matplotlib\n", @@ -527,4 +534,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From aa657ac528756bd5c3e4c0e0f64c48a8fad79ed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 09:29:00 -0700 Subject: [PATCH 013/108] Update manage-runs.ipynb --- .../training/manage-runs/manage-runs.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/training/manage-runs/manage-runs.ipynb b/how-to-use-azureml/training/manage-runs/manage-runs.ipynb index 9536518a..b96fc93d 100644 --- a/how-to-use-azureml/training/manage-runs/manage-runs.ipynb +++ b/how-to-use-azureml/training/manage-runs/manage-runs.ipynb @@ -8,6 +8,13 @@ "\n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/manage-runs/manage-runs.png)" + ] }, { "cell_type": "markdown", @@ -45,7 +52,7 @@ "source": [ "## Setup\n", "\n", - "Make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't. Also, if you're new to Azure ML, we recommend that you go through [the tutorial](https://docs.microsoft.com/en-us/azure/machine-learning/service/tutorial-train-models-with-aml) first to learn the basic concepts.\n", + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't. Also, if you're new to Azure ML, we recommend that you go through [the tutorial](https://docs.microsoft.com/en-us/azure/machine-learning/service/tutorial-train-models-with-aml) first to learn the basic concepts.\n", "\n", "Let's first import required packages, check Azure ML SDK version, connect to your workspace and create an Experiment to hold the runs." ] @@ -592,4 +599,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From ba033d72f81db49fd6ef8341c0e11958fd60172c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 09:33:07 -0700 Subject: [PATCH 014/108] Update train-in-spark.ipynb --- .../training/train-in-spark/train-in-spark.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/training/train-in-spark/train-in-spark.ipynb b/how-to-use-azureml/training/train-in-spark/train-in-spark.ipynb index deea7fca..a3fefdcf 100644 --- a/how-to-use-azureml/training/train-in-spark/train-in-spark.ipynb +++ b/how-to-use-azureml/training/train-in-spark/train-in-spark.ipynb @@ -8,6 +8,13 @@ "\n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/train-in-spark/train-in-spark.png)" + ] }, { "cell_type": "markdown", @@ -25,7 +32,7 @@ "metadata": {}, "source": [ "## Prerequisites\n", - "Make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't." + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't." ] }, { @@ -275,4 +282,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 57c5ef318f759c22d31d0e66e095f21b23f869b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 13:25:11 -0700 Subject: [PATCH 015/108] updated with pixel tracker --- how-to-use-azureml/training/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/how-to-use-azureml/training/README.md b/how-to-use-azureml/training/README.md index 40f25601..21b8e3e8 100644 --- a/how-to-use-azureml/training/README.md +++ b/how-to-use-azureml/training/README.md @@ -7,4 +7,6 @@ Follow these sample notebooks to learn: 3. [Train on remote VM](train-on-remote-vm): train a model using a remote Azure VM as compute target. 4. [Train on AmlCompute](train-on-amlcompute): train a model using an AmlCompute cluster as compute target. 5. [Train in an HDI Spark cluster](train-in-spark): train a Spark ML model using an HDInsight Spark cluster as compute target. -6. [Logging API](logging-api): experiment with various logging functions to create runs and automatically generate graphs. \ No newline at end of file +6. [Logging API](logging-api): experiment with various logging functions to create runs and automatically generate graphs. + + ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/README.png) From c24b65d4aefdf0f5669b66d9f9883ef84c2d82e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 13:32:14 -0700 Subject: [PATCH 016/108] updated with tracking pixel --- how-to-use-azureml/machine-learning-pipelines/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/how-to-use-azureml/machine-learning-pipelines/README.md b/how-to-use-azureml/machine-learning-pipelines/README.md index 796aa0ce..00ae0011 100644 --- a/how-to-use-azureml/machine-learning-pipelines/README.md +++ b/how-to-use-azureml/machine-learning-pipelines/README.md @@ -54,3 +54,6 @@ In this directory, there are two types of notebooks: 1. [pipeline-batch-scoring.ipynb](https://aka.ms/pl-batch-score): This notebook demonstrates how to run a batch scoring job using Azure Machine Learning pipelines. 2. [pipeline-style-transfer.ipynb](https://aka.ms/pl-style-trans) + + + ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/README.png) From 5d02206cbda0f377741d0df3619f325b19c7a0e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 13:34:11 -0700 Subject: [PATCH 017/108] updated with tracking pixel --- .../machine-learning-pipelines/intro-to-pipelines/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/README.md b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/README.md index 807b253e..274c579b 100644 --- a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/README.md +++ b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/README.md @@ -13,3 +13,6 @@ These notebooks below are designed to go in sequence. 8. [aml-pipelines-parameter-tuning-with-hyperdrive.ipynb](https://aka.ms/pl-hyperdrive): HyperDriveStep in Pipelines shows how you can do hyper parameter tuning using Pipelines. 9. [aml-pipelines-how-to-use-azurebatch-to-run-a-windows-executable.ipynb](https://aka.ms/pl-azbatch): AzureBatchStep can be used to run your custom code in AzureBatch cluster. 10. [aml-pipelines-setup-schedule-for-a-published-pipeline.ipynb](https://aka.ms/pl-schedule): Once you publish a Pipeline, you can schedule it to trigger based on an interval or on data change in a defined datastore. + + + ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/README.png) From 1401cdef3370346071b5ff899372d2fbc3331794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 13:41:34 -0700 Subject: [PATCH 018/108] updated config text --- .../intro-to-pipelines/aml-pipelines-data-transfer.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-data-transfer.ipynb b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-data-transfer.ipynb index 56f26f8a..14e6bafa 100644 --- a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-data-transfer.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-data-transfer.ipynb @@ -62,7 +62,7 @@ "source": [ "## Initialize Workspace\n", "\n", - "Initialize a workspace object from persisted configuration. Make sure the config file is present at .\\config.json\n", + "Initialize a workspace object from persisted configuration.If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure the config file is present at .\\config.json\n", "\n", "If you don't have a config.json file, please go through the configuration Notebook located here:\n", "https://github.com/Azure/MachineLearningNotebooks. \n", From 55ef0bda6a166d8aadec3eb262b1c5990f65008f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 13:46:43 -0700 Subject: [PATCH 019/108] updated config text --- .../intro-to-pipelines/aml-pipelines-getting-started.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-getting-started.ipynb b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-getting-started.ipynb index b6830cb4..e57964a7 100644 --- a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-getting-started.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-getting-started.ipynb @@ -46,7 +46,7 @@ "metadata": {}, "source": [ "## Prerequisites and Azure Machine Learning Basics\n", - "Make sure you go through the configuration Notebook located at https://github.com/Azure/MachineLearningNotebooks first if you haven't. This sets you up with a working config file that has information on your workspace, subscription id, etc. \n" + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the configuration Notebook located at https://github.com/Azure/MachineLearningNotebooks first if you haven't. This sets you up with a working config file that has information on your workspace, subscription id, etc. \n" ] }, { From 484b6bbb7a0214d865f1c73edaba97de9473dbc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 13:51:12 -0700 Subject: [PATCH 020/108] updated the config text and pixel server --- ...o-use-azurebatch-to-run-a-windows-executable.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-azurebatch-to-run-a-windows-executable.ipynb b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-azurebatch-to-run-a-windows-executable.ipynb index 6af8c37b..9749f45b 100644 --- a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-azurebatch-to-run-a-windows-executable.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-azurebatch-to-run-a-windows-executable.ipynb @@ -8,6 +8,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-azurebatch-to-run-a-windows-executable.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -67,7 +74,7 @@ "source": [ "Initialize a workspace object from persisted configuration. Make sure the config file is present at .\\config.json\n", "\n", - "If you don't have a config.json file, please go through the configuration Notebook located [here](https://github.com/Azure/MachineLearningNotebooks). \n", + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, if you don't have a config.json file, please go through the configuration Notebook located [here](https://github.com/Azure/MachineLearningNotebooks). \n", "\n", "This sets you up with a working config file that has information on your workspace, subscription id, etc. " ] @@ -373,4 +380,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 8adb206ae39727cb72f945aaa384684d512cb917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 13:56:09 -0700 Subject: [PATCH 021/108] updated config text and pixel tracker --- .../aml-pipelines-how-to-use-estimatorstep.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-estimatorstep.ipynb b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-estimatorstep.ipynb index 9b57a8e9..925679d5 100644 --- a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-estimatorstep.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-estimatorstep.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-estimatorstep.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -20,7 +27,7 @@ "\n", "## Prerequisite:\n", "* Understand the [architecture and terms](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture) introduced by Azure Machine Learning\n", - "* Go through the [configuration notebook](../../../configuration.ipynb) to:\n", + "* If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise,go through the [configuration notebook](../../../configuration.ipynb) to:\n", " * install the AML SDK\n", " * create a workspace and its configuration file (`config.json`)" ] @@ -278,4 +285,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From b13139f103858b16e4b3b7120b35fe85765b55e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 14:31:25 -0700 Subject: [PATCH 022/108] update the config text and the tracking pixel --- ...l-pipelines-parameter-tuning-with-hyperdrive.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-parameter-tuning-with-hyperdrive.ipynb b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-parameter-tuning-with-hyperdrive.ipynb index 5681bc2b..248ec1fe 100644 --- a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-parameter-tuning-with-hyperdrive.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-parameter-tuning-with-hyperdrive.ipynb @@ -8,6 +8,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-parameter-tuning-with-hyperdrive.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -50,7 +57,7 @@ "source": [ "## Initialize workspace\n", "\n", - "Initialize a workspace object from persisted configuration. Make sure the config file is present at .\\config.json" + "Initialize a workspace object from persisted configuration. If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure the config file is present at .\\config.json" ] }, { @@ -434,4 +441,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From bdb7db15eff781716bc0857602a0676ba2686b03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 14:35:28 -0700 Subject: [PATCH 023/108] updated tracking pixel and the config text --- ...ipelines-publish-and-run-using-rest-endpoint.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-publish-and-run-using-rest-endpoint.ipynb b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-publish-and-run-using-rest-endpoint.ipynb index 83360ab0..eab7dd69 100644 --- a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-publish-and-run-using-rest-endpoint.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-publish-and-run-using-rest-endpoint.ipynb @@ -8,6 +8,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-publish-and-run-using-rest-endpoint.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -21,7 +28,7 @@ "metadata": {}, "source": [ "## Prerequisites and Azure Machine Learning Basics\n", - "Make sure you go through the configuration Notebook located at https://github.com/Azure/MachineLearningNotebooks first if you haven't. This sets you up with a working config file that has information on your workspace, subscription id, etc. \n", + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the configuration Notebook located at https://github.com/Azure/MachineLearningNotebooks first if you haven't. This sets you up with a working config file that has information on your workspace, subscription id, etc. \n", "\n", "### Initialization Steps" ] @@ -413,4 +420,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 046c6051fb0ef99c4a6c313ef66e72715971b89c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 14:38:39 -0700 Subject: [PATCH 024/108] updated config text and added tracking pixel --- ...ines-setup-schedule-for-a-published-pipeline.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-setup-schedule-for-a-published-pipeline.ipynb b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-setup-schedule-for-a-published-pipeline.ipynb index 801731bb..8b275bcc 100644 --- a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-setup-schedule-for-a-published-pipeline.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-setup-schedule-for-a-published-pipeline.ipynb @@ -8,6 +8,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-setup-schedule-for-a-published-pipeline.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -21,7 +28,7 @@ "metadata": {}, "source": [ "## Prerequisites and AML Basics\n", - "Make sure you go through the configuration Notebook located at https://github.com/Azure/MachineLearningNotebooks first if you haven't. This sets you up with a working config file that has information on your workspace, subscription id, etc.\n", + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the configuration Notebook located at https://github.com/Azure/MachineLearningNotebooks first if you haven't. This sets you up with a working config file that has information on your workspace, subscription id, etc.\n", "\n", "### Initialization Steps" ] @@ -444,4 +451,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 8b0998ac9fec63dd92aac266f75b3e24a1c54df9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 14:49:29 -0700 Subject: [PATCH 025/108] updated the config text and the tracking pixel --- .../aml-pipelines-use-adla-as-compute-target.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-use-adla-as-compute-target.ipynb b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-use-adla-as-compute-target.ipynb index c493e5cd..44b62bc3 100644 --- a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-use-adla-as-compute-target.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-use-adla-as-compute-target.ipynb @@ -8,6 +8,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-use-adla-as-compute-target.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -52,7 +59,7 @@ "source": [ "## Initialize Workspace\n", "\n", - "Initialize a workspace object from persisted configuration. Make sure the config file is present at .\\config.json" + "Initialize a workspace object from persisted configuration. If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure the config file is present at .\\config.json" ] }, { @@ -364,4 +371,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 42e0a31f88b748e765f3cfc274bf98457eca521e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 14:54:37 -0700 Subject: [PATCH 026/108] updated the config text and the tracking pixel --- ...l-pipelines-use-databricks-as-compute-target.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-use-databricks-as-compute-target.ipynb b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-use-databricks-as-compute-target.ipynb index 9826b3ea..d6b650ac 100644 --- a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-use-databricks-as-compute-target.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-use-databricks-as-compute-target.ipynb @@ -7,6 +7,13 @@ "Copyright (c) Microsoft Corporation. All rights reserved. \n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-use-databricks-as-compute-target.png)" + ] }, { "cell_type": "markdown", @@ -105,7 +112,7 @@ "source": [ "## Initialize Workspace\n", "\n", - "Initialize a workspace object from persisted configuration. Make sure the config file is present at .\\config.json" + "Initialize a workspace object from persisted configuration. If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure the config file is present at .\\config.json" ] }, { @@ -705,4 +712,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From cefe2f0811599976f301a5e44a3eaf4afefc6f93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 14:58:45 -0700 Subject: [PATCH 027/108] updated the config text and added the tracking pixel --- ...pelines-with-automated-machine-learning-step.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-with-automated-machine-learning-step.ipynb b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-with-automated-machine-learning-step.ipynb index 23e0765b..9d4c18f2 100644 --- a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-with-automated-machine-learning-step.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-with-automated-machine-learning-step.ipynb @@ -7,6 +7,13 @@ "Copyright (c) Microsoft Corporation. All rights reserved. \n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-with-automated-machine-learning-step.png)" + ] }, { "cell_type": "markdown", @@ -23,7 +30,7 @@ "## Introduction\n", "In this example we use the scikit-learn's [digit dataset](http://scikit-learn.org/stable/datasets/index.html#optical-recognition-of-handwritten-digits-dataset) to showcase how you can use AutoML for a simple classification problem.\n", "\n", - "Make sure you have executed the [configuration](../../../configuration.ipynb) before running this notebook.\n", + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you have executed the [configuration](../../../configuration.ipynb) before running this notebook.\n", "\n", "In this notebook you would see\n", "1. Create an `Experiment` in an existing `Workspace`.\n", @@ -514,4 +521,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From fbb01bde708b925863023ceeba6628aa9f28286a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 15:01:35 -0700 Subject: [PATCH 028/108] update the config text and added pixel tracker server --- .../aml-pipelines-with-data-dependency-steps.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-with-data-dependency-steps.ipynb b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-with-data-dependency-steps.ipynb index 77f6aa05..16e440a8 100644 --- a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-with-data-dependency-steps.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-with-data-dependency-steps.ipynb @@ -7,6 +7,13 @@ "Copyright (c) Microsoft Corporation. All rights reserved. \n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-with-data-dependency-steps.png)" + ] }, { "cell_type": "markdown", @@ -21,7 +28,7 @@ "metadata": {}, "source": [ "## Prerequisites and Azure Machine Learning Basics\n", - "Make sure you go through the configuration Notebook located at https://github.com/Azure/MachineLearningNotebooks first if you haven't. This sets you up with a working config file that has information on your workspace, subscription id, etc. \n", + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the configuration Notebook located at https://github.com/Azure/MachineLearningNotebooks first if you haven't. This sets you up with a working config file that has information on your workspace, subscription id, etc. \n", "\n", "### Azure Machine Learning and Pipeline SDK-specific Imports" ] @@ -464,4 +471,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 46b8611b74987b2d6c206ea98ffadf69f81a54ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 15:08:57 -0700 Subject: [PATCH 029/108] tracking pixel and edited config text --- .../pipeline-batch-scoring.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/machine-learning-pipelines/pipeline-batch-scoring/pipeline-batch-scoring.ipynb b/how-to-use-azureml/machine-learning-pipelines/pipeline-batch-scoring/pipeline-batch-scoring.ipynb index 5dcc1b5e..d48aed0b 100644 --- a/how-to-use-azureml/machine-learning-pipelines/pipeline-batch-scoring/pipeline-batch-scoring.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/pipeline-batch-scoring/pipeline-batch-scoring.ipynb @@ -7,6 +7,13 @@ "Copyright (c) Microsoft Corporation. All rights reserved. \n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/pipeline-batch-scoring/pipeline-batch-scoring.png)" + ] }, { "cell_type": "markdown", @@ -28,7 +35,7 @@ "metadata": {}, "source": [ "## Prerequisites\n", - "Make sure you go through the configuration Notebook located at https://github.com/Azure/MachineLearningNotebooks first if you haven't. This sets you up with a working config file that has information on your workspace, subscription id, etc. " + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the configuration Notebook located at https://github.com/Azure/MachineLearningNotebooks first if you haven't. This sets you up with a working config file that has information on your workspace, subscription id, etc. " ] }, { @@ -593,4 +600,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 1608c19aa61bb57a7ce5d3cace6efb1f3c09f2ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 15:12:53 -0700 Subject: [PATCH 030/108] updated tracking pixel and and config text --- .../pipeline-style-transfer.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/machine-learning-pipelines/pipeline-style-transfer/pipeline-style-transfer.ipynb b/how-to-use-azureml/machine-learning-pipelines/pipeline-style-transfer/pipeline-style-transfer.ipynb index 79bcdcb1..a53a2dbf 100644 --- a/how-to-use-azureml/machine-learning-pipelines/pipeline-style-transfer/pipeline-style-transfer.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/pipeline-style-transfer/pipeline-style-transfer.ipynb @@ -8,6 +8,13 @@ "\n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/pipeline-style-transfer/pipeline-style-transfer.png)" + ] }, { "cell_type": "markdown", @@ -25,7 +32,7 @@ "metadata": {}, "source": [ "## Prerequisites\n", - "Make sure you go through the configuration Notebook located at https://github.com/Azure/MachineLearningNotebooks first if you haven't. This sets you up with a working config file that has information on your workspace, subscription id, etc. " + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwsie, make sure you go through the configuration Notebook located at https://github.com/Azure/MachineLearningNotebooks first if you haven't. This sets you up with a working config file that has information on your workspace, subscription id, etc. " ] }, { @@ -643,4 +650,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 4e14c35b9bcaa6eae16072b015cc6b97ee89c2d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 16:31:07 -0700 Subject: [PATCH 031/108] added pixel tracker --- .../enable-app-insights-in-production-service.ipynb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/how-to-use-azureml/deployment/enable-app-insights-in-production-service/enable-app-insights-in-production-service.ipynb b/how-to-use-azureml/deployment/enable-app-insights-in-production-service/enable-app-insights-in-production-service.ipynb index 9f293001..06e271fc 100644 --- a/how-to-use-azureml/deployment/enable-app-insights-in-production-service/enable-app-insights-in-production-service.ipynb +++ b/how-to-use-azureml/deployment/enable-app-insights-in-production-service/enable-app-insights-in-production-service.ipynb @@ -25,6 +25,13 @@ "3. Build new image and deploy it. " ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/enable-app-insights-in-production-service/enable-app-insights-in-production-service.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -488,4 +495,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 69126edfcb085d613ebaeb973a0f8d51c387b262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 19:20:46 -0700 Subject: [PATCH 032/108] update config text and added tracking pixel --- .../register-model-deploy-local-advanced.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/deploy-to-local/register-model-deploy-local-advanced.ipynb b/how-to-use-azureml/deploy-to-local/register-model-deploy-local-advanced.ipynb index 7fab4730..b2d1f519 100644 --- a/how-to-use-azureml/deploy-to-local/register-model-deploy-local-advanced.ipynb +++ b/how-to-use-azureml/deploy-to-local/register-model-deploy-local-advanced.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deploy-to-local/register-model-deploy-local-advanced.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -28,7 +35,7 @@ "metadata": {}, "source": [ "## Prerequisites\n", - "Make sure you go through the [configuration](../../../configuration.ipynb) Notebook first if you haven't." + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise,make sure you go through the [configuration](../../../configuration.ipynb) Notebook first if you haven't." ] }, { @@ -484,4 +491,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 4188bd247464e32170d7194952e1f53ac5a8f072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 19:25:26 -0700 Subject: [PATCH 033/108] updated the config text and added the tracking pixel --- .../deploy-to-local/register-model-deploy-local.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/deploy-to-local/register-model-deploy-local.ipynb b/how-to-use-azureml/deploy-to-local/register-model-deploy-local.ipynb index 640bd484..ce0af4bf 100644 --- a/how-to-use-azureml/deploy-to-local/register-model-deploy-local.ipynb +++ b/how-to-use-azureml/deploy-to-local/register-model-deploy-local.ipynb @@ -8,6 +8,13 @@ "\n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deploy-to-local/register-model-deploy-local.png)" + ] }, { "cell_type": "markdown", @@ -28,7 +35,7 @@ "metadata": {}, "source": [ "## Prerequisites\n", - "Make sure you go through the [configuration](../../../configuration.ipynb) Notebook first if you haven't." + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the [configuration](../../../configuration.ipynb) Notebook first if you haven't." ] }, { @@ -339,4 +346,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From b6cddafa3e14fe4dddf64bca51264872bae9549d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 19:31:59 -0700 Subject: [PATCH 034/108] edited config text and added the pixel tracker --- .../regression-sklearn-on-amlcompute.ipynb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/how-to-use-azureml/explain-model/explain-on-amlcompute/regression-sklearn-on-amlcompute.ipynb b/how-to-use-azureml/explain-model/explain-on-amlcompute/regression-sklearn-on-amlcompute.ipynb index d9ccecc1..966958ca 100644 --- a/how-to-use-azureml/explain-model/explain-on-amlcompute/regression-sklearn-on-amlcompute.ipynb +++ b/how-to-use-azureml/explain-model/explain-on-amlcompute/regression-sklearn-on-amlcompute.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/explain-model/explain-on-amlcompute/regression-sklearn-on-amlcompute.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -32,7 +39,7 @@ "metadata": {}, "source": [ "## Prerequisites\n", - "Make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't." + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't." ] }, { From e0618302e3c60ed460939a40a62f2371b28e6fed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 19:35:57 -0700 Subject: [PATCH 035/108] added tracking pixel --- .../explain-local-sklearn-binary-classification.ipynb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-binary-classification.ipynb b/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-binary-classification.ipynb index e6acde5b..d5275b4e 100644 --- a/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-binary-classification.ipynb +++ b/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-binary-classification.ipynb @@ -7,6 +7,13 @@ "# Breast cancer diagnosis classification with scikit-learn (run model explainer locally)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-binary-classification.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, From b398c24262e7f0dd82dd309db5196b4d39aa4e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 19:38:28 -0700 Subject: [PATCH 036/108] added tracking pixel --- .../explain-local-sklearn-multiclass-classification.ipynb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-multiclass-classification.ipynb b/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-multiclass-classification.ipynb index fc16de97..eed8e9e8 100644 --- a/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-multiclass-classification.ipynb +++ b/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-multiclass-classification.ipynb @@ -7,6 +7,13 @@ "# Iris flower classification with scikit-learn (run model explainer locally)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-multiclass-classification.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, From 92bb98ac62dfe2d2df21ff0f5c884027a5552111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 19:41:33 -0700 Subject: [PATCH 037/108] added tracking pixel --- .../explain-local-sklearn-regression.ipynb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-regression.ipynb b/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-regression.ipynb index d1c83107..7b2bf8f0 100644 --- a/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-regression.ipynb +++ b/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-regression.ipynb @@ -7,6 +7,13 @@ "# Boston Housing Price Prediction with scikit-learn (run model explainer locally)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-regression.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, From 46206716a41b16041958dea0446b1bf95a83f1d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 19:44:23 -0700 Subject: [PATCH 038/108] added tracking pixel --- .../explain-sklearn-raw-features.ipynb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/how-to-use-azureml/explain-model/explain-tabular-data-raw-features/explain-sklearn-raw-features.ipynb b/how-to-use-azureml/explain-model/explain-tabular-data-raw-features/explain-sklearn-raw-features.ipynb index d5ff0a66..00b11dfe 100644 --- a/how-to-use-azureml/explain-model/explain-tabular-data-raw-features/explain-sklearn-raw-features.ipynb +++ b/how-to-use-azureml/explain-model/explain-tabular-data-raw-features/explain-sklearn-raw-features.ipynb @@ -8,6 +8,13 @@ "From raw data that is a mixture of categoricals and numeric, featurize the categoricals using one hot encoding. Use tabular explainer to get explain object and then get raw feature importances" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/explain-model/explain-tabular-data-raw-features/explain-sklearn-raw-features.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, From b7b10c394ba29e5adb67c97ee2b59760ed999c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 19:47:28 -0700 Subject: [PATCH 039/108] added tracking pixel --- .../explain-run-history-sklearn-classification.ipynb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-classification.ipynb b/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-classification.ipynb index 0055f956..e6bebcea 100644 --- a/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-classification.ipynb +++ b/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-classification.ipynb @@ -7,6 +7,13 @@ "# Breast cancer diagnosis classification with scikit-learn (save model explanations via AML Run History)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-classification.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, From 137db8aec084a31e8b4046b3f4ea2e90ab6412de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 19:49:50 -0700 Subject: [PATCH 040/108] added tracking pixel --- .../explain-run-history-sklearn-regression.ipynb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-regression.ipynb b/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-regression.ipynb index 5b6fbb32..73cd356c 100644 --- a/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-regression.ipynb +++ b/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-regression.ipynb @@ -7,6 +7,13 @@ "# Boston Housing Price Prediction with scikit-learn (save model explanations via AML Run History)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-regression.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, From 6a20160173893469b07892830aef7ec43ef8388f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 20:02:01 -0700 Subject: [PATCH 041/108] added tracking pixel --- .../authentication-in-azure-ml.ipynb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/how-to-use-azureml/manage-azureml-service/authentication-in-azureml/authentication-in-azure-ml.ipynb b/how-to-use-azureml/manage-azureml-service/authentication-in-azureml/authentication-in-azure-ml.ipynb index 116d7eaa..dddd63a8 100644 --- a/how-to-use-azureml/manage-azureml-service/authentication-in-azureml/authentication-in-azure-ml.ipynb +++ b/how-to-use-azureml/manage-azureml-service/authentication-in-azureml/authentication-in-azure-ml.ipynb @@ -18,6 +18,13 @@ " \n", "The interactive authentication is suitable for local experimentation on your own computer. Azure CLI authentication is suitable if you are already using Azure CLI for managing Azure resources, and want to sign in only once. The Service Principal authentication is suitable for automated workflows, for example as part of Azure Devops build." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/manage-azureml-service/authentication-in-azureml/authentication-in-azureml.png)" + ] }, { "cell_type": "code", @@ -250,4 +257,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 725013511eba8c51bba6b437a357e33eefb88c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 20:34:58 -0700 Subject: [PATCH 042/108] added tracking pixel --- .../enable-data-collection-for-models-in-aks.ipynb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/how-to-use-azureml/deployment/enable-data-collection-for-models-in-aks/enable-data-collection-for-models-in-aks.ipynb b/how-to-use-azureml/deployment/enable-data-collection-for-models-in-aks/enable-data-collection-for-models-in-aks.ipynb index e12e2ab6..78259d4a 100644 --- a/how-to-use-azureml/deployment/enable-data-collection-for-models-in-aks/enable-data-collection-for-models-in-aks.ipynb +++ b/how-to-use-azureml/deployment/enable-data-collection-for-models-in-aks/enable-data-collection-for-models-in-aks.ipynb @@ -24,6 +24,13 @@ "4. Build new image and deploy it. " ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/enable-data-collection-for-models-in-aks/enable-data-collection-for-models-in-aks.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -468,4 +475,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 6b82991017468e5b4235a66180dd08b6147e40e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 20:40:23 -0700 Subject: [PATCH 043/108] edited config text and added tracking pixel --- .../onnx/onnx-convert-aml-deploy-tinyyolo.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/deployment/onnx/onnx-convert-aml-deploy-tinyyolo.ipynb b/how-to-use-azureml/deployment/onnx/onnx-convert-aml-deploy-tinyyolo.ipynb index fe3b7001..2258c2d8 100644 --- a/how-to-use-azureml/deployment/onnx/onnx-convert-aml-deploy-tinyyolo.ipynb +++ b/how-to-use-azureml/deployment/onnx/onnx-convert-aml-deploy-tinyyolo.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/onnx/onnx-convert-aml-deploy-tinyyolo.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -33,7 +40,7 @@ "To make the best use of your time, make sure you have done the following:\n", "\n", "* Understand the [architecture and terms](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture) introduced by Azure Machine Learning\n", - "* Go through the [configuration](../../../configuration.ipynb) notebook to:\n", + "* If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration](../../../configuration.ipynb) notebook to:\n", " * install the AML SDK\n", " * create a workspace and its configuration file (config.json)" ] @@ -433,4 +440,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From a1968aafa243de5257eb2c455d316ce6cd0b5fe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 20:43:54 -0700 Subject: [PATCH 044/108] updated config text and added tracking pixel --- ...ference-facial-expression-recognition-deploy.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/deployment/onnx/onnx-inference-facial-expression-recognition-deploy.ipynb b/how-to-use-azureml/deployment/onnx/onnx-inference-facial-expression-recognition-deploy.ipynb index b94ea70b..479f99bc 100644 --- a/how-to-use-azureml/deployment/onnx/onnx-inference-facial-expression-recognition-deploy.ipynb +++ b/how-to-use-azureml/deployment/onnx/onnx-inference-facial-expression-recognition-deploy.ipynb @@ -7,6 +7,13 @@ "Copyright (c) Microsoft Corporation. All rights reserved. \n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/onnx/onnx-inference-facial-expression-recognition-deploy.png)" + ] }, { "cell_type": "markdown", @@ -34,7 +41,7 @@ "## Prerequisites\n", "\n", "### 1. Install Azure ML SDK and create a new workspace\n", - "Please follow [Azure ML configuration notebook](../../../configuration.ipynb) to set up your environment.\n", + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, please follow [Azure ML configuration notebook](../../../configuration.ipynb) to set up your environment.\n", "\n", "### 2. Install additional packages needed for this Notebook\n", "You need to install the popular plotting library `matplotlib`, the image manipulation library `opencv`, and the `onnx` library in the conda environment where Azure Maching Learning SDK is installed.\n", @@ -806,4 +813,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 5f19d75a423ad10ca90c5446e6582c7fb30e0c88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 20:48:04 -0700 Subject: [PATCH 045/108] added tracking pixel and edited the config text --- .../deployment/onnx/onnx-inference-mnist-deploy.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/deployment/onnx/onnx-inference-mnist-deploy.ipynb b/how-to-use-azureml/deployment/onnx/onnx-inference-mnist-deploy.ipynb index fa12f6ac..accbb189 100644 --- a/how-to-use-azureml/deployment/onnx/onnx-inference-mnist-deploy.ipynb +++ b/how-to-use-azureml/deployment/onnx/onnx-inference-mnist-deploy.ipynb @@ -8,6 +8,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/onnx/onnx-inference-mnist-deploy.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -34,7 +41,7 @@ "## Prerequisites\n", "\n", "### 1. Install Azure ML SDK and create a new workspace\n", - "Please follow [Azure ML configuration notebook](../../../configuration.ipynb) to set up your environment.\n", + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, please follow [Azure ML configuration notebook](../../../configuration.ipynb) to set up your environment.\n", "\n", "### 2. Install additional packages needed for this tutorial notebook\n", "You need to install the popular plotting library `matplotlib`, the image manipulation library `opencv`, and the `onnx` library in the conda environment where Azure Maching Learning SDK is installed. \n", @@ -810,4 +817,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From c7b56929bc65245b7f4af99d44c530bc27ddfd13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 20:50:57 -0700 Subject: [PATCH 046/108] added tracking pixel and edited config text --- .../onnx/onnx-modelzoo-aml-deploy-resnet50.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/deployment/onnx/onnx-modelzoo-aml-deploy-resnet50.ipynb b/how-to-use-azureml/deployment/onnx/onnx-modelzoo-aml-deploy-resnet50.ipynb index 781d25c2..87dc64da 100644 --- a/how-to-use-azureml/deployment/onnx/onnx-modelzoo-aml-deploy-resnet50.ipynb +++ b/how-to-use-azureml/deployment/onnx/onnx-modelzoo-aml-deploy-resnet50.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/onnx/onnx-modelzoo-aml-deploy-resnet50.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -33,7 +40,7 @@ "To make the best use of your time, make sure you have done the following:\n", "\n", "* Understand the [architecture and terms](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture) introduced by Azure Machine Learning\n", - "* Go through the [configuration notebook](../../../configuration.ipynb) to:\n", + "* If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration notebook](../../../configuration.ipynb) to:\n", " * install the AML SDK\n", " * create a workspace and its configuration file (config.json)" ] @@ -417,4 +424,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From f36dda0c2d2f7dcb9124de695501a66e56d92255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 20:54:32 -0700 Subject: [PATCH 047/108] added tracking pixel and edited the config text --- .../onnx/onnx-train-pytorch-aml-deploy-mnist.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/deployment/onnx/onnx-train-pytorch-aml-deploy-mnist.ipynb b/how-to-use-azureml/deployment/onnx/onnx-train-pytorch-aml-deploy-mnist.ipynb index ad69718c..0374e259 100644 --- a/how-to-use-azureml/deployment/onnx/onnx-train-pytorch-aml-deploy-mnist.ipynb +++ b/how-to-use-azureml/deployment/onnx/onnx-train-pytorch-aml-deploy-mnist.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/onnx/onnx-train-pytorch-aml-deploy-mnist.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -30,7 +37,7 @@ "source": [ "## Prerequisites\n", "* Understand the [architecture and terms](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture) introduced by Azure Machine Learning\n", - "* Go through the [configuration notebook](../../../configuration.ipynb) to:\n", + "* If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration notebook](../../../configuration.ipynb) to:\n", " * install the AML SDK\n", " * create a workspace and its configuration file (`config.json`)" ] @@ -663,4 +670,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 532f65c9982b61611386c124d4ce74c065c764da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 20:59:50 -0700 Subject: [PATCH 048/108] added tracking pixel and edited config text --- how-to-use-azureml/deployment/onnx/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/how-to-use-azureml/deployment/onnx/README.md b/how-to-use-azureml/deployment/onnx/README.md index b4127ff1..28082799 100644 --- a/how-to-use-azureml/deployment/onnx/README.md +++ b/how-to-use-azureml/deployment/onnx/README.md @@ -1,10 +1,11 @@ # ONNX on Azure Machine Learning + ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/onnx/README.png) These tutorials show how to create and deploy Open Neural Network eXchange ([ONNX](http://onnx.ai)) models in Azure Machine Learning environments using [ONNX Runtime](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-build-deploy-onnx) for inference. Once deployed as a web service, you can ping the model with your own set of images to be analyzed! ## Tutorials -0. [Configure your Azure Machine Learning Workspace](../../../configuration.ipynb) +0. If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, [Configure your Azure Machine Learning Workspace](../../../configuration.ipynb) #### Obtain pretrained models from the [ONNX Model Zoo](https://github.com/onnx/models) and deploy with ONNX Runtime 1. [MNIST - Handwritten Digit Classification with ONNX Runtime](onnx-inference-mnist-deploy.ipynb) @@ -34,3 +35,5 @@ Licensed under the MIT License. ## Acknowledgements These tutorials were developed by Vinitra Swamy and Prasanth Pulavarthi of the Microsoft AI Frameworks team and adapted for presentation at Microsoft Ignite 2018. + + From 5f04a467b79c6f30a0ccf5c0d8f413e09a41ac9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 21:03:08 -0700 Subject: [PATCH 049/108] added tracking pixel --- .../production-deploy-to-aks.ipynb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/how-to-use-azureml/deployment/production-deploy-to-aks/production-deploy-to-aks.ipynb b/how-to-use-azureml/deployment/production-deploy-to-aks/production-deploy-to-aks.ipynb index 628813ad..da53fda3 100644 --- a/how-to-use-azureml/deployment/production-deploy-to-aks/production-deploy-to-aks.ipynb +++ b/how-to-use-azureml/deployment/production-deploy-to-aks/production-deploy-to-aks.ipynb @@ -8,6 +8,13 @@ "\n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/production-deploy-to-aks/production-deploy-to-aks.png)" + ] }, { "cell_type": "markdown", @@ -467,4 +474,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 23771fc59908ad52f9147ea820557d4edda76c41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 21:08:10 -0700 Subject: [PATCH 050/108] added tracking pixel and edited config text --- .../register-model-create-image-deploy-service.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/deployment/register-model-create-image-deploy-service/register-model-create-image-deploy-service.ipynb b/how-to-use-azureml/deployment/register-model-create-image-deploy-service/register-model-create-image-deploy-service.ipynb index 0d9bce06..da501f02 100644 --- a/how-to-use-azureml/deployment/register-model-create-image-deploy-service/register-model-create-image-deploy-service.ipynb +++ b/how-to-use-azureml/deployment/register-model-create-image-deploy-service/register-model-create-image-deploy-service.ipynb @@ -8,6 +8,13 @@ "\n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/register-model-create-image-deploy-service/register-model-create-image-deploy-service.png)" + ] }, { "cell_type": "markdown", @@ -34,7 +41,7 @@ "metadata": {}, "source": [ "## Prerequisites\n", - "Make sure you go through the [configuration](../../../configuration.ipynb) Notebook first if you haven't." + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the [configuration](../../../configuration.ipynb) Notebook first if you haven't." ] }, { @@ -443,4 +450,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 3637dce58adbb48867f3508141befa2f58b2c3ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 23:48:16 -0700 Subject: [PATCH 051/108] Update train-on-amlcompute.ipynb --- .../train-on-amlcompute/train-on-amlcompute.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/training/train-on-amlcompute/train-on-amlcompute.ipynb b/how-to-use-azureml/training/train-on-amlcompute/train-on-amlcompute.ipynb index ea33a1b0..2133b9ec 100644 --- a/how-to-use-azureml/training/train-on-amlcompute/train-on-amlcompute.ipynb +++ b/how-to-use-azureml/training/train-on-amlcompute/train-on-amlcompute.ipynb @@ -8,6 +8,13 @@ "\n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/train-on-amlcompute/train-on-amlcompute.png)" + ] }, { "cell_type": "markdown", @@ -31,7 +38,7 @@ "metadata": {}, "source": [ "## Prerequisites\n", - "Make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't." + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't." ] }, { @@ -519,4 +526,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 73db8ae04dfc4dca031807004b5d0005eaa90362 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sat, 4 May 2019 23:52:01 -0700 Subject: [PATCH 052/108] Update train-on-local.ipynb --- .../training/train-on-local/train-on-local.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/training/train-on-local/train-on-local.ipynb b/how-to-use-azureml/training/train-on-local/train-on-local.ipynb index feefa8a0..8acf24e6 100644 --- a/how-to-use-azureml/training/train-on-local/train-on-local.ipynb +++ b/how-to-use-azureml/training/train-on-local/train-on-local.ipynb @@ -8,6 +8,13 @@ "\n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/train-on-local/train-on-local.png)" + ] }, { "cell_type": "markdown", @@ -29,7 +36,7 @@ "metadata": {}, "source": [ "## Prerequisites\n", - "Make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't." + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't." ] }, { @@ -532,4 +539,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 6ff06dd13749431a792d842b31e2c413d6a3b83b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sun, 5 May 2019 00:06:23 -0700 Subject: [PATCH 053/108] Update train-on-remote-vm.ipynb --- .../train-on-remote-vm/train-on-remote-vm.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/training/train-on-remote-vm/train-on-remote-vm.ipynb b/how-to-use-azureml/training/train-on-remote-vm/train-on-remote-vm.ipynb index f4a419c1..9427db37 100644 --- a/how-to-use-azureml/training/train-on-remote-vm/train-on-remote-vm.ipynb +++ b/how-to-use-azureml/training/train-on-remote-vm/train-on-remote-vm.ipynb @@ -8,6 +8,13 @@ "\n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/train-on-remote-vm/train-on-remote-vm.png)" + ] }, { "cell_type": "markdown", @@ -30,7 +37,7 @@ "metadata": {}, "source": [ "## Prerequisites\n", - "Make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't." + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't." ] }, { @@ -638,4 +645,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 71e8e9bd235b2c605fb83a9a58c84ce176f42ffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sun, 5 May 2019 00:09:26 -0700 Subject: [PATCH 054/108] Update train-within-notebook.ipynb --- .../train-within-notebook/train-within-notebook.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/training/train-within-notebook/train-within-notebook.ipynb b/how-to-use-azureml/training/train-within-notebook/train-within-notebook.ipynb index 76abee73..0f2d1d4e 100644 --- a/how-to-use-azureml/training/train-within-notebook/train-within-notebook.ipynb +++ b/how-to-use-azureml/training/train-within-notebook/train-within-notebook.ipynb @@ -8,6 +8,13 @@ "\n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/train-within-notebook/train-within-notebook.png)" + ] }, { "cell_type": "markdown", @@ -57,7 +64,7 @@ "---\n", "\n", "## Setup\n", - "Make sure you have completed the [Configuration](../../../configuration.ipnyb) notebook to set up your Azure Machine Learning workspace and ensure other common prerequisites are met. From the configuration, the important sections are the workspace configuration and ACI regristration.\n", + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you have completed the [Configuration](../../../configuration.ipnyb) notebook to set up your Azure Machine Learning workspace and ensure other common prerequisites are met. From the configuration, the important sections are the workspace configuration and ACI regristration.\n", "\n", "We will also need the following libraries install to our conda environment. If these are not installed, use the following command to do so and restart the notebook.\n", "```shell\n", @@ -696,4 +703,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From c4163017c226cd4ab5b87b0231828b3ab9ca33ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sun, 5 May 2019 00:11:40 -0700 Subject: [PATCH 055/108] Update using-environments.ipynb --- .../training/using-environments/using-environments.ipynb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/how-to-use-azureml/training/using-environments/using-environments.ipynb b/how-to-use-azureml/training/using-environments/using-environments.ipynb index 1c541715..df03b9d8 100644 --- a/how-to-use-azureml/training/using-environments/using-environments.ipynb +++ b/how-to-use-azureml/training/using-environments/using-environments.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/using-environments/using-environments.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -47,7 +54,7 @@ "\n", "## Setup\n", "\n", - "Make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't.\n", + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't.\n", "\n", "First, let's validate Azure ML SDK version and connect to workspace." ] From 4761b668ff471fe91ae810452bd43a2b8badb030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sun, 5 May 2019 15:09:28 -0700 Subject: [PATCH 056/108] Update distributed-chainer.ipynb --- .../distributed-chainer/distributed-chainer.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/training-with-deep-learning/distributed-chainer/distributed-chainer.ipynb b/how-to-use-azureml/training-with-deep-learning/distributed-chainer/distributed-chainer.ipynb index b0b2cbf1..d6d0f6f3 100644 --- a/how-to-use-azureml/training-with-deep-learning/distributed-chainer/distributed-chainer.ipynb +++ b/how-to-use-azureml/training-with-deep-learning/distributed-chainer/distributed-chainer.ipynb @@ -8,6 +8,13 @@ "\n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/distributed-chainer/distributed-chainer.png)" + ] }, { "cell_type": "markdown", @@ -22,7 +29,7 @@ "metadata": {}, "source": [ "## Prerequisites\n", - "* Go through the [Configuration](../../../configuration.ipynb) notebook to install the Azure Machine Learning Python SDK and create an Azure ML `Workspace`" + "* If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [Configuration](../../../configuration.ipynb) notebook to install the Azure Machine Learning Python SDK and create an Azure ML `Workspace`" ] }, { @@ -312,4 +319,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 2804a8d859faefbeeb0712dd4133c56f686fb0ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sun, 5 May 2019 15:11:51 -0700 Subject: [PATCH 057/108] Update distributed-cntk-with-custom-docker.ipynb --- .../distributed-cntk-with-custom-docker.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/training-with-deep-learning/distributed-cntk-with-custom-docker/distributed-cntk-with-custom-docker.ipynb b/how-to-use-azureml/training-with-deep-learning/distributed-cntk-with-custom-docker/distributed-cntk-with-custom-docker.ipynb index 547949b1..1cf731e5 100644 --- a/how-to-use-azureml/training-with-deep-learning/distributed-cntk-with-custom-docker/distributed-cntk-with-custom-docker.ipynb +++ b/how-to-use-azureml/training-with-deep-learning/distributed-cntk-with-custom-docker/distributed-cntk-with-custom-docker.ipynb @@ -8,6 +8,13 @@ "\n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/distributed-cntk-with-custom-docker/distributed-cntk-with-custom-docker.png)" + ] }, { "cell_type": "markdown", @@ -23,7 +30,7 @@ "source": [ "## Prerequisites\n", "* Understand the [architecture and terms](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture) introduced by Azure Machine Learning\n", - "* Go through the [configuration notebook](../../../configuration.ipynb) to:\n", + "* If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration notebook](../../../configuration.ipynb) to:\n", " * install the AML SDK\n", " * create a workspace and its configuration file (`config.json`)" ] @@ -391,4 +398,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 9ea0ba51310b5bc0fc1b258087f9c74965c550cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sun, 5 May 2019 15:13:28 -0700 Subject: [PATCH 058/108] Update distributed-pytorch-with-horovod.ipynb --- .../distributed-pytorch-with-horovod.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/training-with-deep-learning/distributed-pytorch-with-horovod/distributed-pytorch-with-horovod.ipynb b/how-to-use-azureml/training-with-deep-learning/distributed-pytorch-with-horovod/distributed-pytorch-with-horovod.ipynb index 0ef4e505..efedb662 100644 --- a/how-to-use-azureml/training-with-deep-learning/distributed-pytorch-with-horovod/distributed-pytorch-with-horovod.ipynb +++ b/how-to-use-azureml/training-with-deep-learning/distributed-pytorch-with-horovod/distributed-pytorch-with-horovod.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/distributed-pytorch-with-horovod/distributed-pytorch-with-horovod.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -22,7 +29,7 @@ "metadata": {}, "source": [ "## Prerequisites\n", - "* Go through the [Configuration](../../../configuration.ipynb) notebook to install the Azure Machine Learning Python SDK and create an Azure ML `Workspace`\n", + "* If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [Configuration](../../../configuration.ipynb) notebook to install the Azure Machine Learning Python SDK and create an Azure ML `Workspace`\n", "* Review the [tutorial](../train-hyperparameter-tune-deploy-with-pytorch/train-hyperparameter-tune-deploy-with-pytorch.ipynb) on single-node PyTorch training using Azure Machine Learning" ] }, @@ -332,4 +339,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 463718e26b36f08b1bdb1f2ee67247320a47a62f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sun, 5 May 2019 15:15:13 -0700 Subject: [PATCH 059/108] Update distributed-tensorflow-with-horovod.ipynb --- .../distributed-tensorflow-with-horovod.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/training-with-deep-learning/distributed-tensorflow-with-horovod/distributed-tensorflow-with-horovod.ipynb b/how-to-use-azureml/training-with-deep-learning/distributed-tensorflow-with-horovod/distributed-tensorflow-with-horovod.ipynb index 700175dc..e0b7e4fd 100644 --- a/how-to-use-azureml/training-with-deep-learning/distributed-tensorflow-with-horovod/distributed-tensorflow-with-horovod.ipynb +++ b/how-to-use-azureml/training-with-deep-learning/distributed-tensorflow-with-horovod/distributed-tensorflow-with-horovod.ipynb @@ -8,6 +8,13 @@ "\n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/distributed-tensorflow-with-horovod/distributed-tensorflow-with-horovod.png)" + ] }, { "cell_type": "markdown", @@ -23,7 +30,7 @@ "source": [ "## Prerequisites\n", "* Understand the [architecture and terms](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture) introduced by Azure Machine Learning (AML)\n", - "* Go through the [configuration notebook](../../../configuration.ipynb) to:\n", + "* If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration notebook](../../../configuration.ipynb) to:\n", " * install the AML SDK\n", " * create a workspace and its configuration file (`config.json`)\n", "* Review the [tutorial](../train-hyperparameter-tune-deploy-with-tensorflow/train-hyperparameter-tune-deploy-with-tensorflow.ipynb) on single-node TensorFlow training using the SDK" @@ -401,4 +408,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 59452a314118d5ec4b7eaf382351f5b850dcea40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sun, 5 May 2019 15:17:15 -0700 Subject: [PATCH 060/108] Update distributed-tensorflow-with-parameter-server.ipynb --- ...distributed-tensorflow-with-parameter-server.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/training-with-deep-learning/distributed-tensorflow-with-parameter-server/distributed-tensorflow-with-parameter-server.ipynb b/how-to-use-azureml/training-with-deep-learning/distributed-tensorflow-with-parameter-server/distributed-tensorflow-with-parameter-server.ipynb index 9c8a8591..5b993ba3 100644 --- a/how-to-use-azureml/training-with-deep-learning/distributed-tensorflow-with-parameter-server/distributed-tensorflow-with-parameter-server.ipynb +++ b/how-to-use-azureml/training-with-deep-learning/distributed-tensorflow-with-parameter-server/distributed-tensorflow-with-parameter-server.ipynb @@ -8,6 +8,13 @@ "\n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/distributed-tensorflow-with-parameter-server/distributed-tensorflow-with-parameter-server.png)" + ] }, { "cell_type": "markdown", @@ -23,7 +30,7 @@ "source": [ "## Prerequisites\n", "* Understand the [architecture and terms](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture) introduced by Azure Machine Learning (AML)\n", - "* Go through the [configuration notebook](../../../configuration.ipynb) to:\n", + "* If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration notebook](../../../configuration.ipynb) to:\n", " * install the AML SDK\n", " * create a workspace and its configuration file (`config.json`)\n", "* Review the [tutorial](../train-hyperparameter-tune-deploy-with-tensorflow/train-hyperparameter-tune-deploy-with-tensorflow.ipynb) on single-node TensorFlow training using the SDK" @@ -316,4 +323,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 58557abd20cb7fdd0b894e4649025a4e48ff5954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sun, 5 May 2019 15:18:48 -0700 Subject: [PATCH 061/108] Update export-run-history-to-tensorboard.ipynb --- .../export-run-history-to-tensorboard.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/training-with-deep-learning/export-run-history-to-tensorboard/export-run-history-to-tensorboard.ipynb b/how-to-use-azureml/training-with-deep-learning/export-run-history-to-tensorboard/export-run-history-to-tensorboard.ipynb index 59c19e52..93f20ddf 100644 --- a/how-to-use-azureml/training-with-deep-learning/export-run-history-to-tensorboard/export-run-history-to-tensorboard.ipynb +++ b/how-to-use-azureml/training-with-deep-learning/export-run-history-to-tensorboard/export-run-history-to-tensorboard.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/export-run-history-to-tensorboard/export-run-history-to-tensorboard.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -26,7 +33,7 @@ "source": [ "## Prerequisites\n", "* Understand the [architecture and terms](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture) introduced by Azure Machine Learning\n", - "* Go through the [configuration notebook](../../../configuration.ipynb) notebook to:\n", + "* If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration notebook](../../../configuration.ipynb) notebook to:\n", " * install the AML SDK\n", " * create a workspace and its configuration file (`config.json`)" ] @@ -262,4 +269,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From cba2c6b9e2719f0d408d4500a8f540fc1fbbe43a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sun, 5 May 2019 15:20:50 -0700 Subject: [PATCH 062/108] Update how-to-use-estimator.ipynb --- .../how-to-use-estimator/how-to-use-estimator.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/training-with-deep-learning/how-to-use-estimator/how-to-use-estimator.ipynb b/how-to-use-azureml/training-with-deep-learning/how-to-use-estimator/how-to-use-estimator.ipynb index 01c06e79..c2527208 100644 --- a/how-to-use-azureml/training-with-deep-learning/how-to-use-estimator/how-to-use-estimator.ipynb +++ b/how-to-use-azureml/training-with-deep-learning/how-to-use-estimator/how-to-use-estimator.ipynb @@ -8,6 +8,13 @@ "\n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/how-to-use-estimator/how-to-use-estimator.png)" + ] }, { "cell_type": "markdown", @@ -25,7 +32,7 @@ "\n", "## Prerequisite:\n", "* Understand the [architecture and terms](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture) introduced by Azure Machine Learning\n", - "* Go through the [configuration notebook](../../../configuration.ipynb) to:\n", + "* If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration notebook](../../../configuration.ipynb) to:\n", " * install the AML SDK\n", " * create a workspace and its configuration file (`config.json`)" ] @@ -361,4 +368,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 6b6a6da9dc5a13468cc51d6f8b12426efe9de9d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sun, 5 May 2019 15:22:28 -0700 Subject: [PATCH 063/108] Update tensorboard.ipynb --- .../tensorboard/tensorboard.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/training-with-deep-learning/tensorboard/tensorboard.ipynb b/how-to-use-azureml/training-with-deep-learning/tensorboard/tensorboard.ipynb index 8e355d98..757a1a0e 100644 --- a/how-to-use-azureml/training-with-deep-learning/tensorboard/tensorboard.ipynb +++ b/how-to-use-azureml/training-with-deep-learning/tensorboard/tensorboard.ipynb @@ -8,6 +8,13 @@ "\n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/tensorboard/tensorboard.png)" + ] }, { "cell_type": "markdown", @@ -27,7 +34,7 @@ "source": [ "## Prerequisites\n", "* Understand the [architecture and terms](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture) introduced by Azure Machine Learning\n", - "* Go through the [configuration notebook](../../../configuration.ipynb) notebook to:\n", + "* If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration notebook](../../../configuration.ipynb) notebook to:\n", " * install the AML SDK\n", " * create a workspace and its configuration file (`config.json`)" ] @@ -564,4 +571,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 5e39582de3ea912265dfc5e4370a2d8d7bc5c427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sun, 5 May 2019 15:24:14 -0700 Subject: [PATCH 064/108] Update train-hyperparameter-tune-deploy-with-chainer.ipynb --- ...rain-hyperparameter-tune-deploy-with-chainer.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-chainer/train-hyperparameter-tune-deploy-with-chainer.ipynb b/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-chainer/train-hyperparameter-tune-deploy-with-chainer.ipynb index 28bf9b1c..b6e0493f 100644 --- a/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-chainer/train-hyperparameter-tune-deploy-with-chainer.ipynb +++ b/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-chainer/train-hyperparameter-tune-deploy-with-chainer.ipynb @@ -8,6 +8,13 @@ "\n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-chainer/train-hyperparameter-tune-deploy-with-chainer.png)" + ] }, { "cell_type": "markdown", @@ -23,7 +30,7 @@ "metadata": {}, "source": [ "## Prerequisites\n", - "* Go through the [Configuration](../../../configuration.ipynb) notebook to install the Azure Machine Learning Python SDK and create an Azure ML `Workspace`" + "* If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [Configuration](../../../configuration.ipynb) notebook to install the Azure Machine Learning Python SDK and create an Azure ML `Workspace`" ] }, { @@ -422,4 +429,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 0ca05093bd5a34d858dcdeaa0f4cf8e2467bb662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sun, 5 May 2019 15:28:16 -0700 Subject: [PATCH 065/108] Update train-hyperparameter-tune-deploy-with-keras.ipynb --- .../train-hyperparameter-tune-deploy-with-keras.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-keras/train-hyperparameter-tune-deploy-with-keras.ipynb b/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-keras/train-hyperparameter-tune-deploy-with-keras.ipynb index 145044b4..afe0d04e 100644 --- a/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-keras/train-hyperparameter-tune-deploy-with-keras.ipynb +++ b/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-keras/train-hyperparameter-tune-deploy-with-keras.ipynb @@ -8,6 +8,13 @@ "\n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-keras/train-hyperparameter-tune-deploy-with-keras.png)" + ] }, { "cell_type": "markdown", @@ -26,7 +33,7 @@ "\n", "## Prerequisite:\n", "* Understand the [architecture and terms](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture) introduced by Azure Machine Learning\n", - "* Go through the [configuration notebook](../../../configuration.ipynb) to:\n", + "* If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration notebook](../../../configuration.ipynb) to:\n", " * install the AML SDK\n", " * create a workspace and its configuration file (`config.json`)\n", "* For local scoring test, you will also need to have `tensorflow` and `keras` installed in the current Jupyter kernel." @@ -1168,4 +1175,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From ae256548828d56ca1bed7232da320c5428511383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sun, 5 May 2019 15:29:42 -0700 Subject: [PATCH 066/108] Update train-hyperparameter-tune-deploy-with-pytorch.ipynb --- ...rain-hyperparameter-tune-deploy-with-pytorch.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-pytorch/train-hyperparameter-tune-deploy-with-pytorch.ipynb b/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-pytorch/train-hyperparameter-tune-deploy-with-pytorch.ipynb index 359eadaa..cc07a918 100644 --- a/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-pytorch/train-hyperparameter-tune-deploy-with-pytorch.ipynb +++ b/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-pytorch/train-hyperparameter-tune-deploy-with-pytorch.ipynb @@ -8,6 +8,13 @@ "\n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-pytorch/train-hyperparameter-tune-deploy-with-pytorch.png)" + ] }, { "cell_type": "markdown", @@ -25,7 +32,7 @@ "metadata": {}, "source": [ "## Prerequisites\n", - "* Go through the [Configuration](../../../configuration.ipynb) notebook to install the Azure Machine Learning Python SDK and create an Azure ML `Workspace`" + "* If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [Configuration](../../../configuration.ipynb) notebook to install the Azure Machine Learning Python SDK and create an Azure ML `Workspace`" ] }, { @@ -735,4 +742,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 32e2b5f647b4215960f575284b628f0b251cf3cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sun, 5 May 2019 15:32:19 -0700 Subject: [PATCH 067/108] Update train-hyperparameter-tune-deploy-with-tensorflow.ipynb --- ...n-hyperparameter-tune-deploy-with-tensorflow.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-tensorflow/train-hyperparameter-tune-deploy-with-tensorflow.ipynb b/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-tensorflow/train-hyperparameter-tune-deploy-with-tensorflow.ipynb index 1560dd85..fab74177 100644 --- a/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-tensorflow/train-hyperparameter-tune-deploy-with-tensorflow.ipynb +++ b/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-tensorflow/train-hyperparameter-tune-deploy-with-tensorflow.ipynb @@ -8,6 +8,13 @@ "\n", "Licensed under the MIT License." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-tensorflow/train-hyperparameter-tune-deploy-with-tensorflow.png)" + ] }, { "cell_type": "markdown", @@ -26,7 +33,7 @@ "\n", "## Prerequisite:\n", "* Understand the [architecture and terms](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture) introduced by Azure Machine Learning\n", - "* Go through the [configuration notebook](../../../configuration.ipynb) to:\n", + "* If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration notebook](../../../configuration.ipynb) to:\n", " * install the AML SDK\n", " * create a workspace and its configuration file (`config.json`)" ] @@ -1168,4 +1175,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 5faa9d293cf30e3f308d723e7d2a58f3bb8dc49a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sun, 5 May 2019 15:34:27 -0700 Subject: [PATCH 068/108] Update README.md --- how-to-use-azureml/training-with-deep-learning/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/how-to-use-azureml/training-with-deep-learning/README.md b/how-to-use-azureml/training-with-deep-learning/README.md index 975108f4..7bc0c072 100644 --- a/how-to-use-azureml/training-with-deep-learning/README.md +++ b/how-to-use-azureml/training-with-deep-learning/README.md @@ -16,3 +16,5 @@ These examples show you: 12. [Use TensorBoard to monitor training execution](tensorboard) Learn more about how to use `Estimator` class to [train deep neural networks with Azure Machine Learning](https://docs.microsoft.com/azure/machine-learning/service/how-to-train-ml-models). + +![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/README.png) From eb643fe2130110cb1ad5bf069bb03630c791f59a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sun, 5 May 2019 17:26:29 -0700 Subject: [PATCH 069/108] Update README.md --- tutorials/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tutorials/README.md b/tutorials/README.md index 3c656e7f..7262c4c1 100644 --- a/tutorials/README.md +++ b/tutorials/README.md @@ -6,7 +6,7 @@ two sets of tutorial articles for: * [Image classification using MNIST dataset](https://docs.microsoft.com/en-us/azure/machine-learning/service/tutorial-train-models-with-aml) * [Regression using NYC Taxi dataset](https://docs.microsoft.com/en-us/azure/machine-learning/service/tutorial-data-prep) -As a pre-requisite, run the [configuration Notebook](../configuration.ipynb) notebook first to set up your Azure ML Workspace. Then, run the notebooks in following recommended order. +If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, run the [configuration Notebook](../configuration.ipynb) notebook first to set up your Azure ML Workspace. Then, run the notebooks in following recommended order. ### Image classification @@ -18,3 +18,5 @@ As a pre-requisite, run the [configuration Notebook](../configuration.ipynb) not * [Part 2](regression-part2-automated-ml.ipynb): Train a model using Automated Machine Learning. Also find quickstarts and how-tos on the [official documentation site for Azure Machine Learning service](https://docs.microsoft.com/en-us/azure/machine-learning/service/). + +![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/tutorials/README.png) From 4c1167edc41cbb3c4fadeceac8bb78873352280f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sun, 5 May 2019 17:45:48 -0700 Subject: [PATCH 070/108] Update img-classification-part1-training.ipynb --- tutorials/img-classification-part1-training.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tutorials/img-classification-part1-training.ipynb b/tutorials/img-classification-part1-training.ipynb index c9e2bd53..9e39d424 100644 --- a/tutorials/img-classification-part1-training.ipynb +++ b/tutorials/img-classification-part1-training.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/tutorials/img-classification-part1-training.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -30,7 +37,7 @@ "\n", "## Prerequisites\n", "\n", - "See prerequisites in the [Azure Machine Learning documentation](https://docs.microsoft.com/azure/machine-learning/service/tutorial-train-models-with-aml#prerequisites)." + "See prerequisites in the [Azure Machine Learning documentation](https://docs.microsoft.com/azure/machine-learning/service/tutorial-train-models-with-aml#prerequisites). If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration](../../../configuration.ipynb) Notebook first if you haven't already to establish your connection to the AzureML Workspace." ] }, { @@ -685,4 +692,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 56b0664b6b11b59edf0ed38c694fed290cbfd651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Sun, 5 May 2019 17:47:31 -0700 Subject: [PATCH 071/108] Update img-classification-part1-training.ipynb --- tutorials/img-classification-part1-training.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/img-classification-part1-training.ipynb b/tutorials/img-classification-part1-training.ipynb index 9e39d424..a2f87b2b 100644 --- a/tutorials/img-classification-part1-training.ipynb +++ b/tutorials/img-classification-part1-training.ipynb @@ -37,7 +37,7 @@ "\n", "## Prerequisites\n", "\n", - "See prerequisites in the [Azure Machine Learning documentation](https://docs.microsoft.com/azure/machine-learning/service/tutorial-train-models-with-aml#prerequisites). If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration](../../../configuration.ipynb) Notebook first if you haven't already to establish your connection to the AzureML Workspace." + "See prerequisites in the [Azure Machine Learning documentation](https://docs.microsoft.com/azure/machine-learning/service/tutorial-train-models-with-aml#prerequisites)." ] }, { From 7ccaa2cf5742fc774eab89791b25c0f916f15bb9 Mon Sep 17 00:00:00 2001 From: Paula Ledgerwood Date: Mon, 6 May 2019 09:41:54 -0700 Subject: [PATCH 072/108] Update readme from PM's instructions --- .../deployment/accelerated-models/README.md | 19 ++++++++++++++++--- .../accelerated-models-object-detection.ipynb | 10 ++++++---- .../accelerated-models-quickstart.ipynb | 8 +++++--- .../accelerated-models-training.ipynb | 12 +++++++----- 4 files changed, 34 insertions(+), 15 deletions(-) diff --git a/how-to-use-azureml/deployment/accelerated-models/README.md b/how-to-use-azureml/deployment/accelerated-models/README.md index 23ad499b..b9981ac9 100644 --- a/how-to-use-azureml/deployment/accelerated-models/README.md +++ b/how-to-use-azureml/deployment/accelerated-models/README.md @@ -13,8 +13,21 @@ To learn more about the azureml-accel-model classes, see the section [Model Clas ### Step 1: Create an Azure ML workspace Follow [these instructions](https://docs.microsoft.com/en-us/azure/machine-learning/service/quickstart-create-workspace-with-python) to install the Azure ML SDK on your local machine, create an Azure ML workspace, and set up your notebook environment, which is required for the next step. - -### Step 2: Install the Azure ML Accelerated Models SDK + +### Step 2: Check your FPGA quota +Use the Azure CLI to check whether you have quota. + +```shell +az vm list-usage --location "eastus" -o table +``` + +The other locations are ``southeastasia``, ``westeurope``, and ``westus2``. + +Under the "Name" column, look for "Standard PBS Family vCPUs" and ensure you have at least 6 vCPUs under "CurrentValue." + +If you do not have quota, then submit a request form [here](https://aka.ms/accelerateAI). + +### Step 3: Install the Azure ML Accelerated Models SDK Once you have set up your environment, install the Azure ML Accel Models SDK. This package requires tensorflow >= 1.6,<2.0 to be installed. If you already have tensorflow >= 1.6,<2.0 installed in your development environment, you can install the SDK package using: @@ -35,7 +48,7 @@ If your machine supports GPU (for example, on an [Azure DSVM](https://docs.micro pip install azureml-accel-models[gpu] ``` -### Step 3: Follow our notebooks +### Step 4: Follow our notebooks The notebooks in this repo walk through the following scenarios: * [Quickstart](accelerated-models-quickstart.ipynb), deploy and inference a ResNet50 model trained on ImageNet diff --git a/how-to-use-azureml/deployment/accelerated-models/accelerated-models-object-detection.ipynb b/how-to-use-azureml/deployment/accelerated-models/accelerated-models-object-detection.ipynb index be6894e8..35ec0963 100644 --- a/how-to-use-azureml/deployment/accelerated-models/accelerated-models-object-detection.ipynb +++ b/how-to-use-azureml/deployment/accelerated-models/accelerated-models-object-detection.ipynb @@ -273,11 +273,12 @@ "from azureml.core.compute import AksCompute, ComputeTarget\n", "\n", "# Uses the specific FPGA enabled VM (sku: Standard_PB6s)\n", - "# Authentication is enabled by default, but for testing we specify False\n", + "# Standard_PB6s are available in: eastus, westus2, westeurope, southeastasia\n", "prov_config = AksCompute.provisioning_configuration(vm_size = \"Standard_PB6s\",\n", - " agent_count = 1)\n", + " agent_count = 1, \n", + " location = \"eastus\")\n", "\n", - "aks_name = 'my-aks-pb6-ssd-vgg'\n", + "aks_name = 'aks-pb6-obj'\n", "# Create the cluster\n", "aks_target = ComputeTarget.create(workspace = ws, \n", " name = aks_name, \n", @@ -318,6 +319,7 @@ "from azureml.core.webservice import Webservice, AksWebservice\n", "\n", "# Set the web service configuration (for creating a test service, we don't want autoscale enabled)\n", + "# Authentication is enabled by default, but for testing we specify False\n", "aks_config = AksWebservice.deploy_configuration(autoscale_enabled=False,\n", " num_replicas=1,\n", " auth_enabled = False)\n", @@ -482,7 +484,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.0" + "version": "3.5.6" } }, "nbformat": 4, diff --git a/how-to-use-azureml/deployment/accelerated-models/accelerated-models-quickstart.ipynb b/how-to-use-azureml/deployment/accelerated-models/accelerated-models-quickstart.ipynb index fb6c4976..6a9f0c1d 100644 --- a/how-to-use-azureml/deployment/accelerated-models/accelerated-models-quickstart.ipynb +++ b/how-to-use-azureml/deployment/accelerated-models/accelerated-models-quickstart.ipynb @@ -341,9 +341,10 @@ "from azureml.core.compute import AksCompute, ComputeTarget\n", "\n", "# Uses the specific FPGA enabled VM (sku: Standard_PB6s)\n", - "# Authentication is enabled by default, but for testing we specify False\n", + "# Standard_PB6s are available in: eastus, westus2, westeurope, southeastasia\n", "prov_config = AksCompute.provisioning_configuration(vm_size = \"Standard_PB6s\",\n", - " agent_count = 1)\n", + " agent_count = 1, \n", + " location = \"eastus\")\n", "\n", "aks_name = 'my-aks-pb6'\n", "# Create the cluster\n", @@ -386,6 +387,7 @@ "from azureml.core.webservice import Webservice, AksWebservice\n", "\n", "#Set the web service configuration (for creating a test service, we don't want autoscale enabled)\n", + "# Authentication is enabled by default, but for testing we specify False\n", "aks_config = AksWebservice.deploy_configuration(autoscale_enabled=False,\n", " num_replicas=1,\n", " auth_enabled = False)\n", @@ -536,7 +538,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.0" + "version": "3.5.6" } }, "nbformat": 4, diff --git a/how-to-use-azureml/deployment/accelerated-models/accelerated-models-training.ipynb b/how-to-use-azureml/deployment/accelerated-models/accelerated-models-training.ipynb index f0d645fe..5b823608 100644 --- a/how-to-use-azureml/deployment/accelerated-models/accelerated-models-training.ipynb +++ b/how-to-use-azureml/deployment/accelerated-models/accelerated-models-training.ipynb @@ -47,7 +47,7 @@ " * [Transfer Learning](#transfer-learning)\n", " * [Transfer Learning with Custom Weights](#custom-weights)\n", "* [Create Image](#create-image)\n", - "* [Deploy Model](#deploy-model)\n", + "* [Deploy Image](#deploy-image)\n", "* [Test the service](#test-service)\n", "* [Clean-up](#cleanup)\n", "* [Appendix](#appendix)" @@ -630,11 +630,12 @@ "from azureml.core.compute import AksCompute, ComputeTarget\n", "\n", "# Uses the specific FPGA enabled VM (sku: Standard_PB6s)\n", - "# Authentication is enabled by default, but for testing we specify False\n", + "# Standard_PB6s are available in: eastus, westus2, westeurope, southeastasia\n", "prov_config = AksCompute.provisioning_configuration(vm_size = \"Standard_PB6s\",\n", - " agent_count = 1)\n", + " agent_count = 1,\n", + " location = \"eastus\")\n", "\n", - "aks_name = 'my-aks-pb6-training'\n", + "aks_name = 'aks-pb6-tl'\n", "# Create the cluster\n", "aks_target = ComputeTarget.create(workspace = ws, \n", " name = aks_name, \n", @@ -675,6 +676,7 @@ "from azureml.core.webservice import Webservice, AksWebservice\n", "\n", "# Set the web service configuration (for creating a test service, we don't want autoscale enabled)\n", + "# Authentication is enabled by default, but for testing we specify False\n", "aks_config = AksWebservice.deploy_configuration(autoscale_enabled=False,\n", " num_replicas=1,\n", " auth_enabled = False)\n", @@ -850,7 +852,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.0" + "version": "3.5.6" } }, "nbformat": 4, From 5328186d688438477387179a11f279669832abe1 Mon Sep 17 00:00:00 2001 From: Paula Ledgerwood Date: Mon, 6 May 2019 09:45:20 -0700 Subject: [PATCH 073/108] Update python kernel version --- .../accelerated-models-object-detection.ipynb | 2 +- .../accelerated-models/accelerated-models-quickstart.ipynb | 2 +- .../accelerated-models/accelerated-models-training.ipynb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/how-to-use-azureml/deployment/accelerated-models/accelerated-models-object-detection.ipynb b/how-to-use-azureml/deployment/accelerated-models/accelerated-models-object-detection.ipynb index 35ec0963..12dda529 100644 --- a/how-to-use-azureml/deployment/accelerated-models/accelerated-models-object-detection.ipynb +++ b/how-to-use-azureml/deployment/accelerated-models/accelerated-models-object-detection.ipynb @@ -484,7 +484,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.5.6" + "version": "3.6.0" } }, "nbformat": 4, diff --git a/how-to-use-azureml/deployment/accelerated-models/accelerated-models-quickstart.ipynb b/how-to-use-azureml/deployment/accelerated-models/accelerated-models-quickstart.ipynb index 6a9f0c1d..af1d153e 100644 --- a/how-to-use-azureml/deployment/accelerated-models/accelerated-models-quickstart.ipynb +++ b/how-to-use-azureml/deployment/accelerated-models/accelerated-models-quickstart.ipynb @@ -538,7 +538,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.5.6" + "version": "3.6.0" } }, "nbformat": 4, diff --git a/how-to-use-azureml/deployment/accelerated-models/accelerated-models-training.ipynb b/how-to-use-azureml/deployment/accelerated-models/accelerated-models-training.ipynb index 5b823608..f3cb1cd4 100644 --- a/how-to-use-azureml/deployment/accelerated-models/accelerated-models-training.ipynb +++ b/how-to-use-azureml/deployment/accelerated-models/accelerated-models-training.ipynb @@ -852,7 +852,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.5.6" + "version": "3.6.0" } }, "nbformat": 4, From 83cfe3b9b3dfdf86bfb911ef81ffe5dc0948e3df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9e=20Martens?= Date: Wed, 8 May 2019 12:25:41 -0500 Subject: [PATCH 074/108] Update README.md --- .../machine-learning-pipelines/README.md | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/how-to-use-azureml/machine-learning-pipelines/README.md b/how-to-use-azureml/machine-learning-pipelines/README.md index 00ae0011..03bab9b6 100644 --- a/how-to-use-azureml/machine-learning-pipelines/README.md +++ b/how-to-use-azureml/machine-learning-pipelines/README.md @@ -34,26 +34,29 @@ Azure Machine Learning Pipelines optimize for simplicity, speed, and efficiency. ### Notebooks -In this directory, there are two types of notebooks: -* The first type of notebooks will introduce you to core Azure Machine Learning Pipelines features. These notebooks below belong in this category, and are designed to go in sequence; they're all located in the "intro-to-pipelines" folder: +**End-to-end introductory notebook series** -1. [aml-pipelines-getting-started.ipynb](https://aka.ms/pl-get-started): Start with this notebook to understand the concepts of using Azure Machine Learning Pipelines. This notebook will show you how to runs steps in parallel and in sequence. -2. [aml-pipelines-with-data-dependency-steps.ipynb](https://aka.ms/pl-data-dep): This notebooks shows how to connect steps in your pipeline using data. Data produced by one step is used by subsequent steps to force an explicit dependency between steps. -3. [aml-pipelines-publish-and-run-using-rest-endpoint.ipynb](https://aka.ms/pl-pub-rep): Once you are satisfied with your iterative runs in, you could publish your pipeline to get a REST endpoint which could be invoked from non-Pythons clients as well. -4. [aml-pipelines-data-transfer.ipynb](https://aka.ms/pl-data-trans): This notebook shows how you transfer data between supported datastores. -5. [aml-pipelines-use-databricks-as-compute-target.ipynb](https://aka.ms/pl-databricks): This notebooks shows how you can use Pipelines to send your compute payload to Azure Databricks. -6. [aml-pipelines-use-adla-as-compute-target.ipynb](https://aka.ms/pl-adla): This notebook shows how you can use Azure Data Lake Analytics (ADLA) as a compute target. -7. [aml-pipelines-how-to-use-estimatorstep.ipynb](https://aka.ms/pl-estimator): This notebook shows how to use the EstimatorStep. -7. [aml-pipelines-parameter-tuning-with-hyperdrive.ipynb](https://aka.ms/pl-hyperdrive): HyperDriveStep in Pipelines shows how you can do hyper parameter tuning using Pipelines. -8. [aml-pipelines-how-to-use-azurebatch-to-run-a-windows-executable.ipynb](https://aka.ms/pl-azbatch): AzureBatchStep can be used to run your custom code in AzureBatch cluster. -9. [aml-pipelines-setup-schedule-for-a-published-pipeline.ipynb](https://aka.ms/pl-schedule): Once you publish a Pipeline, you can schedule it to trigger based on an interval or on data change in a defined datastore. -10. [aml-pipelines-with-automated-machine-learning-step.ipynb](https://aka.ms/pl-automl): AutoMLStep in Pipelines shows how you can do automated machine learning using Pipelines. +Learn about Azure Machine Learning Pipelines by following the notebooks in this directory **in sequence**: -* The second type of notebooks illustrate more sophisticated scenarios, and are independent of each other. These notebooks include: + |Notebook|Description| + |--------|-----------| + |1. [aml-pipelines-getting-started.ipynb](https://aka.ms/pl-get-started)|Get started and run Azure Machine Learning Pipeline steps in parallel and in sequence.| + |2. [aml-pipelines-with-data-dependency-steps.ipynb](https://aka.ms/pl-data-dep)|Connect pipeline steps where data produced by one step is used by subsequent steps to force an explicit dependency between the steps. | + |3. [aml-pipelines-publish-and-run-using-rest-endpoint.ipynb](https://aka.ms/pl-pub-rep)|Publish pipelines to get a REST endpoint consumeable by Python and non-Pythons clients. | + |4. [aml-pipelines-data-transfer.ipynb](https://aka.ms/pl-data-trans)|Transfer data between supported datastores in pipelines.| + |5. [aml-pipelines-use-adla-as-compute-target.ipynb](https://aka.ms/pl-adla)|Run pipelines on Azure Data Lake Analytics (ADLA).| + |6. [aml-pipelines-how-to-use-estimatorstep.ipynb](https://aka.ms/pl-estimator)|Add estimator training to a pipeline with `EstimatorStep`.| + |7. [aml-pipelines-parameter-tuning-with-hyperdrive.ipynb](https://aka.ms/pl-hyperdrive)|Hyperparameter tune in your pipelines with `HyperDriveStep`.| + |8. [aml-pipelines-how-to-use-azurebatch-to-run-a-windows-executable.ipynb](https://aka.ms/pl-azbatch)|Run custom code in an Azure Batch cluster with `AzureBatchStep`.| + |9. [aml-pipelines-setup-schedule-for-a-published-pipeline.ipynb](https://aka.ms/pl-schedule)|Schedule published pipeline job at specific intervals or after change in datastore.| + |10. [aml-pipelines-with-automated-machine-learning-step.ipynb](https://aka.ms/pl-automl)|Use automated ML in your pipelines with `AutoMLStep`.| -1. [pipeline-batch-scoring.ipynb](https://aka.ms/pl-batch-score): This notebook demonstrates how to run a batch scoring job using Azure Machine Learning pipelines. -2. [pipeline-style-transfer.ipynb](https://aka.ms/pl-style-trans) +**Advanced scenarios** + |Notebook|Description| + |--------|-----------| + |[pipeline-batch-scoring.ipynb](https://aka.ms/pl-batch-score)|Run a batch scoring job using Azure Machine Learning pipelines| + |[pipeline-style-transfer.ipynb](https://aka.ms/pl-style-trans)|| ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/README.png) From a240ac319fc79340cc740bea05bd00fec673df65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9e=20Martens?= Date: Wed, 8 May 2019 12:27:57 -0500 Subject: [PATCH 075/108] Update README.md --- how-to-use-azureml/machine-learning-pipelines/README.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/how-to-use-azureml/machine-learning-pipelines/README.md b/how-to-use-azureml/machine-learning-pipelines/README.md index 03bab9b6..9a7d4667 100644 --- a/how-to-use-azureml/machine-learning-pipelines/README.md +++ b/how-to-use-azureml/machine-learning-pipelines/README.md @@ -32,10 +32,7 @@ Azure Machine Learning Pipelines optimize for simplicity, speed, and efficiency. **Tracking and versioning**: Instead of manually tracking data and result paths as you iterate, use the pipelines SDK to explicitly name and version your data sources, inputs, and outputs as well as manage scripts and data separately for increased productivity. -### Notebooks - - -**End-to-end introductory notebook series** +## End-to-end introductory notebook series Learn about Azure Machine Learning Pipelines by following the notebooks in this directory **in sequence**: @@ -52,7 +49,7 @@ Learn about Azure Machine Learning Pipelines by following the notebooks in this |9. [aml-pipelines-setup-schedule-for-a-published-pipeline.ipynb](https://aka.ms/pl-schedule)|Schedule published pipeline job at specific intervals or after change in datastore.| |10. [aml-pipelines-with-automated-machine-learning-step.ipynb](https://aka.ms/pl-automl)|Use automated ML in your pipelines with `AutoMLStep`.| -**Advanced scenarios** +## Advanced scenarios |Notebook|Description| |--------|-----------| From 8b1bffc200b88d5bbdd768b22e5ca1f25fb7ca5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9e=20Martens?= Date: Wed, 8 May 2019 12:36:49 -0500 Subject: [PATCH 076/108] Update README.md --- how-to-use-azureml/explain-model/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/how-to-use-azureml/explain-model/README.md b/how-to-use-azureml/explain-model/README.md index 4fc9147a..d4ca292b 100644 --- a/how-to-use-azureml/explain-model/README.md +++ b/how-to-use-azureml/explain-model/README.md @@ -3,6 +3,7 @@ Follow these sample notebooks to learn: 1. [Explain tabular data locally](explain-tabular-data-local): Basic example of explaining model trained on tabular data. + 4. [Explain on remote AMLCompute](explain-on-amlcompute): Explain a model on a remote AMLCompute target. 5. [Explain tabular data with Run History](explain-tabular-data-run-history): Explain a model with Run History. 7. [Explain raw features](explain-tabular-data-raw-features): Explain the raw features of a trained model. From 22597ac6840c82e4ba5653097685b1fe5346d489 Mon Sep 17 00:00:00 2001 From: Roger He Date: Thu, 9 May 2019 16:51:51 -0700 Subject: [PATCH 077/108] adding macOS specific yml. Install nomkl to workaround openmp issue --- .../automl_env_mac.yml | 22 +++++++++++++++++++ .../automl_setup_mac.sh | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 how-to-use-azureml/automated-machine-learning/automl_env_mac.yml diff --git a/how-to-use-azureml/automated-machine-learning/automl_env_mac.yml b/how-to-use-azureml/automated-machine-learning/automl_env_mac.yml new file mode 100644 index 00000000..b023d8dd --- /dev/null +++ b/how-to-use-azureml/automated-machine-learning/automl_env_mac.yml @@ -0,0 +1,22 @@ +name: azure_automl +dependencies: + # The python interpreter version. + # Currently Azure ML only supports 3.5.2 and later. +- nomkl +- python>=3.5.2,<3.6.8 +- nb_conda +- matplotlib==2.1.0 +- numpy>=1.11.0,<=1.16.2 +- cython +- urllib3<1.24 +- scipy>=1.0.0,<=1.1.0 +- scikit-learn>=0.19.0,<=0.20.3 +- pandas>=0.22.0,<0.23.0 +- py-xgboost<=0.80 + +- pip: + # Required packages for AzureML execution, history, and data preparation. + - azureml-sdk[automl,explain] + - azureml-widgets + - pandas_ml + diff --git a/how-to-use-azureml/automated-machine-learning/automl_setup_mac.sh b/how-to-use-azureml/automated-machine-learning/automl_setup_mac.sh index e2250c4b..f2a5de45 100644 --- a/how-to-use-azureml/automated-machine-learning/automl_setup_mac.sh +++ b/how-to-use-azureml/automated-machine-learning/automl_setup_mac.sh @@ -12,7 +12,7 @@ fi if [ "$AUTOML_ENV_FILE" == "" ] then - AUTOML_ENV_FILE="automl_env.yml" + AUTOML_ENV_FILE="automl_env_mac.yml" fi if [ ! -f $AUTOML_ENV_FILE ]; then From 2d41c004889d50739345b2c9c4b8a49030930251 Mon Sep 17 00:00:00 2001 From: Roope Astala Date: Tue, 14 May 2019 16:01:14 -0400 Subject: [PATCH 078/108] version 1.0.39 --- NBSETUP.md | 4 +- README.md | 11 +- configuration.ipynb | 92 -- .../auto-ml-classification-with-onnx.ipynb | 2 +- .../auto-ml-classification.ipynb | 6 + .../auto-ml-dataprep-remote-execution.ipynb | 147 +- .../dataprep/auto-ml-dataprep.ipynb | 126 +- .../auto-ml-forecasting-bike-share.ipynb | 6 +- .../auto-ml-remote-amlcompute.ipynb | 33 +- .../auto-ml-remote-execution.ipynb | 2 +- .../model-register-and-deploy.ipynb | 12 +- ...register-model-deploy-local-advanced.ipynb | 8 +- .../register-model-deploy-local.ipynb | 8 +- ...e-app-insights-in-production-service.ipynb | 6 +- ...le-data-collection-for-models-in-aks.ipynb | 16 +- how-to-use-azureml/deployment/onnx/README.md | 2 +- .../onnx-convert-aml-deploy-tinyyolo.ipynb | 6 +- ...facial-expression-recognition-deploy.ipynb | 8 +- .../onnx/onnx-inference-mnist-deploy.ipynb | 6 +- .../onnx-modelzoo-aml-deploy-resnet50.ipynb | 8 +- .../onnx-train-pytorch-aml-deploy-mnist.ipynb | 6 +- .../production-deploy-to-aks.ipynb | 8 +- ...er-model-create-image-deploy-service.ipynb | 8 +- how-to-use-azureml/explain-model/README.md | 1 - .../regression-sklearn-on-amlcompute.ipynb | 1201 ++++++++--------- ...-local-sklearn-binary-classification.ipynb | 530 ++++---- ...al-sklearn-multiclass-classification.ipynb | 532 ++++---- .../explain-local-sklearn-regression.ipynb | 516 +++---- .../explain-sklearn-raw-features.ipynb | 576 ++++---- ...n-run-history-sklearn-classification.ipynb | 510 +++---- ...plain-run-history-sklearn-regression.ipynb | 538 ++++---- .../machine-learning-pipelines/README.md | 26 +- .../aml-pipelines-data-transfer.ipynb | 12 +- .../aml-pipelines-getting-started.ipynb | 55 +- ...urebatch-to-run-a-windows-executable.ipynb | 34 +- ...l-pipelines-how-to-use-estimatorstep.ipynb | 42 +- ...nes-parameter-tuning-with-hyperdrive.ipynb | 48 +- ...-publish-and-run-using-rest-endpoint.ipynb | 21 +- ...up-schedule-for-a-published-pipeline.ipynb | 37 +- ...s-setup-versioned-pipeline-endpoints.ipynb | 553 ++++++++ ...pipelines-use-adla-as-compute-target.ipynb | 6 +- ...nes-use-databricks-as-compute-target.ipynb | 12 +- ...with-automated-machine-learning-step.ipynb | 40 +- ...pipelines-with-data-dependency-steps.ipynb | 30 +- .../pipeline-batch-scoring.ipynb | 38 +- .../pipeline-style-transfer.ipynb | 10 +- .../authentication-in-azureml.ipynb | 260 ++++ .../training-with-deep-learning/README.md | 3 +- .../distributed-chainer.ipynb | 35 +- .../distributed-cntk-with-custom-docker.ipynb | 33 +- .../distributed-pytorch-with-horovod.ipynb | 33 +- .../distributed-tensorflow-with-horovod.ipynb | 35 +- ...ted-tensorflow-with-parameter-server.ipynb | 33 +- .../export-run-history-to-tensorboard.ipynb | 22 +- .../how-to-use-estimator/dummy_train.py | 19 +- .../how-to-use-estimator.ipynb | 191 ++- .../tensorboard/tensorboard.ipynb | 24 +- ...erparameter-tune-deploy-with-chainer.ipynb | 51 +- ...yperparameter-tune-deploy-with-keras.ipynb | 61 +- ...arameter-tune-deploy-with-tensorflow.ipynb | 61 +- how-to-use-azureml/training/README.md | 2 +- .../training/logging-api/logging-api.ipynb | 30 +- .../training/manage-runs/manage-runs.ipynb | 10 +- .../train-in-spark/train-in-spark.ipynb | 12 +- .../train-on-amlcompute.ipynb | 25 +- .../train-on-local/train-on-local.ipynb | 269 +++- .../train-on-remote-vm.ipynb | 10 +- .../train-within-notebook.ipynb | 39 +- .../using-environments.ipynb | 728 +++++----- .../work-with-data/dataprep/README.md | 33 +- .../add-column-using-expression.ipynb | 40 + .../how-to-guides/data-ingestion.ipynb | 9 +- .../dataprep/how-to-guides/data-profile.ipynb | 2 +- .../work-with-data/datasets/README.md | 155 +++ tutorials/README.md | 2 - .../img-classification-part1-training.ipynb | 45 +- 76 files changed, 4441 insertions(+), 3730 deletions(-) create mode 100644 how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-setup-versioned-pipeline-endpoints.ipynb create mode 100644 how-to-use-azureml/manage-azureml-service/authentication-in-azureml/authentication-in-azureml.ipynb create mode 100644 how-to-use-azureml/work-with-data/datasets/README.md diff --git a/NBSETUP.md b/NBSETUP.md index c51f404f..7349f880 100644 --- a/NBSETUP.md +++ b/NBSETUP.md @@ -24,8 +24,8 @@ pip install azureml-sdk git clone https://github.com/Azure/MachineLearningNotebooks.git # below steps are optional -# install the base SDK and a Jupyter notebook server -pip install azureml-sdk[notebooks] +# install the base SDK, Jupyter notebook server and tensorboard +pip install azureml-sdk[notebooks,tensorboard] # install model explainability component pip install azureml-sdk[explain] diff --git a/README.md b/README.md index 763b65dc..f42c5d97 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,7 @@ pip install azureml-sdk Read more detailed instructions on [how to set up your environment](./NBSETUP.md) using Azure Notebook service, your own Jupyter notebook server, or Docker. ## How to navigate and use the example notebooks? -If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [Configuration](./configuration.ipynb) notebook first if you haven't already to establish your connection to the AzureML Workspace. -It configures your notebook library to connect to an Azure Machine Learning workspace, and sets up your workspace and compute to be used by many of the other examples. +If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, you should always run the [Configuration](./configuration.ipynb) notebook first when setting up a notebook library on a new machine or in a new environment. It configures your notebook library to connect to an Azure Machine Learning workspace, and sets up your workspace and compute to be used by many of the other examples. If you want to... @@ -21,7 +20,7 @@ If you want to... * ...learn about experimentation and tracking run history, first [train within Notebook](./how-to-use-azureml/training/train-within-notebook/train-within-notebook.ipynb), then try [training on remote VM](./how-to-use-azureml/training/train-on-remote-vm/train-on-remote-vm.ipynb) and [using logging APIs](./how-to-use-azureml/training/logging-api/logging-api.ipynb). * ...train deep learning models at scale, first learn about [Machine Learning Compute](./how-to-use-azureml/training/train-on-amlcompute/train-on-amlcompute.ipynb), and then try [distributed hyperparameter tuning](./how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-pytorch/train-hyperparameter-tune-deploy-with-pytorch.ipynb) and [distributed training](./how-to-use-azureml/training-with-deep-learning/distributed-pytorch-with-horovod/distributed-pytorch-with-horovod.ipynb). * ...deploy models as a realtime scoring service, first learn the basics by [training within Notebook and deploying to Azure Container Instance](./how-to-use-azureml/training/train-within-notebook/train-within-notebook.ipynb), then learn how to [register and manage models, and create Docker images](./how-to-use-azureml/deployment/register-model-create-image-deploy-service/register-model-create-image-deploy-service.ipynb), and [production deploy models on Azure Kubernetes Cluster](./how-to-use-azureml/deployment/production-deploy-to-aks/production-deploy-to-aks.ipynb). - * ...deploy models as a batch scoring service, first [train a model within Notebook](./how-to-use-azureml/training/train-within-notebook/train-within-notebook.ipynb), learn how to [register and manage models](./how-to-use-azureml/deployment/register-model-create-image-deploy-service/register-model-create-image-deploy-service.ipynb), then [create Machine Learning Compute for scoring compute](./how-to-use-azureml/training/train-on-amlcompute/train-on-amlcompute.ipynb), and [use Machine Learning Pipelines to deploy your model](./how-to-use-azureml/machine-learning-pipelines/pipeline-mpi-batch-prediction.ipynb). + * ...deploy models as a batch scoring service, first [train a model within Notebook](./how-to-use-azureml/training/train-within-notebook/train-within-notebook.ipynb), learn how to [register and manage models](./how-to-use-azureml/deployment/register-model-create-image-deploy-service/register-model-create-image-deploy-service.ipynb), then [create Machine Learning Compute for scoring compute](./how-to-use-azureml/training/train-on-amlcompute/train-on-amlcompute.ipynb), and [use Machine Learning Pipelines to deploy your model](https://aka.ms/pl-batch-scoring). * ...monitor your deployed models, learn about using [App Insights](./how-to-use-azureml/deployment/enable-app-insights-in-production-service/enable-app-insights-in-production-service.ipynb) and [model data collection](./how-to-use-azureml/deployment/enable-data-collection-for-models-in-aks/enable-data-collection-for-models-in-aks.ipynb). ## Tutorials @@ -55,9 +54,5 @@ Visit following repos to see projects contributed by Azure ML users: - [Fine tune natural language processing models using Azure Machine Learning service](https://github.com/Microsoft/AzureML-BERT) - [Fashion MNIST with Azure ML SDK](https://github.com/amynic/azureml-sdk-fashion) - - - ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/README.png) - - + ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/README.png) diff --git a/configuration.ipynb b/configuration.ipynb index f4002cf6..542e200b 100644 --- a/configuration.ipynb +++ b/configuration.ipynb @@ -32,7 +32,6 @@ " 1. Workspace parameters\n", " 1. Access your workspace\n", " 1. Create a new workspace\n", - " 1. Create compute resources\n", "1. [Next steps](#Next%20steps)\n", "\n", "---\n", @@ -235,97 +234,6 @@ "ws.write_config()" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Create compute resources for your training experiments\n", - "\n", - "Many of the sample notebooks use Azure ML managed compute (AmlCompute) to train models using a dynamically scalable pool of compute. In this section you will create default compute clusters for use by the other notebooks and any other operations you choose.\n", - "\n", - "To create a cluster, you need to specify a compute configuration that specifies the type of machine to be used and the scalability behaviors. Then you choose a name for the cluster that is unique within the workspace that can be used to address the cluster later.\n", - "\n", - "The cluster parameters are:\n", - "* vm_size - this describes the virtual machine type and size used in the cluster. All machines in the cluster are the same type. You can get the list of vm sizes available in your region by using the CLI command\n", - "\n", - "```shell\n", - "az vm list-skus -o tsv\n", - "```\n", - "* min_nodes - this sets the minimum size of the cluster. If you set the minimum to 0 the cluster will shut down all nodes while note in use. Setting this number to a value higher than 0 will allow for faster start-up times, but you will also be billed when the cluster is not in use.\n", - "* max_nodes - this sets the maximum size of the cluster. Setting this to a larger number allows for more concurrency and a greater distributed processing of scale-out jobs.\n", - "\n", - "\n", - "To create a **CPU** cluster now, run the cell below. The autoscale settings mean that the cluster will scale down to 0 nodes when inactive and up to 4 nodes when busy." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.core.compute import ComputeTarget, AmlCompute\n", - "from azureml.core.compute_target import ComputeTargetException\n", - "\n", - "# Choose a name for your CPU cluster\n", - "cpu_cluster_name = \"cpucluster\"\n", - "\n", - "# Verify that cluster does not exist already\n", - "try:\n", - " cpu_cluster = ComputeTarget(workspace=ws, name=cpu_cluster_name)\n", - " print(\"Found existing cpucluster\")\n", - "except ComputeTargetException:\n", - " print(\"Creating new cpucluster\")\n", - " \n", - " # Specify the configuration for the new cluster\n", - " compute_config = AmlCompute.provisioning_configuration(vm_size=\"STANDARD_D2_V2\",\n", - " min_nodes=0,\n", - " max_nodes=4)\n", - "\n", - " # Create the cluster with the specified name and configuration\n", - " cpu_cluster = ComputeTarget.create(ws, cpu_cluster_name, compute_config)\n", - " \n", - " # Wait for the cluster to complete, show the output log\n", - " cpu_cluster.wait_for_completion(show_output=True)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "To create a **GPU** cluster, run the cell below. Note that your subscription must have sufficient quota for GPU VMs or the command will fail. To increase quota, see [these instructions](https://docs.microsoft.com/en-us/azure/azure-supportability/resource-manager-core-quotas-request). " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.core.compute import ComputeTarget, AmlCompute\n", - "from azureml.core.compute_target import ComputeTargetException\n", - "\n", - "# Choose a name for your GPU cluster\n", - "gpu_cluster_name = \"gpucluster\"\n", - "\n", - "# Verify that cluster does not exist already\n", - "try:\n", - " gpu_cluster = ComputeTarget(workspace=ws, name=gpu_cluster_name)\n", - " print(\"Found existing gpu cluster\")\n", - "except ComputeTargetException:\n", - " print(\"Creating new gpucluster\")\n", - " \n", - " # Specify the configuration for the new cluster\n", - " compute_config = AmlCompute.provisioning_configuration(vm_size=\"STANDARD_NC6\",\n", - " min_nodes=0,\n", - " max_nodes=4)\n", - " # Create the cluster with the specified name and configuration\n", - " gpu_cluster = ComputeTarget.create(ws, gpu_cluster_name, compute_config)\n", - "\n", - " # Wait for the cluster to complete, show the output log\n", - " gpu_cluster.wait_for_completion(show_output=True)" - ] - }, { "cell_type": "markdown", "metadata": {}, diff --git a/how-to-use-azureml/automated-machine-learning/classification-with-onnx/auto-ml-classification-with-onnx.ipynb b/how-to-use-azureml/automated-machine-learning/classification-with-onnx/auto-ml-classification-with-onnx.ipynb index 53351dc2..bbd35031 100644 --- a/how-to-use-azureml/automated-machine-learning/classification-with-onnx/auto-ml-classification-with-onnx.ipynb +++ b/how-to-use-azureml/automated-machine-learning/classification-with-onnx/auto-ml-classification-with-onnx.ipynb @@ -249,7 +249,7 @@ "metadata": {}, "outputs": [], "source": [ - "from azureml.train.automl._vendor.automl.client.core.common.onnx_convert import OnnxConverter\n", + "from azureml.automl.core.onnx_convert import OnnxConverter\n", "onnx_fl_path = \"./best_model.onnx\"\n", "OnnxConverter.save_onnx_model(onnx_mdl, onnx_fl_path)" ] diff --git a/how-to-use-azureml/automated-machine-learning/classification/auto-ml-classification.ipynb b/how-to-use-azureml/automated-machine-learning/classification/auto-ml-classification.ipynb index a4e891ec..bd4b2087 100644 --- a/how-to-use-azureml/automated-machine-learning/classification/auto-ml-classification.ipynb +++ b/how-to-use-azureml/automated-machine-learning/classification/auto-ml-classification.ipynb @@ -328,6 +328,12 @@ " print()\n", " for estimator in step[1].estimators:\n", " print_model(estimator[1], estimator[0]+ ' - ')\n", + " elif hasattr(step[1], '_base_learners') and hasattr(step[1], '_meta_learner'):\n", + " print(\"\\nMeta Learner\")\n", + " pprint(step[1]._meta_learner)\n", + " print()\n", + " for estimator in step[1]._base_learners:\n", + " print_model(estimator[1], estimator[0]+ ' - ')\n", " else:\n", " pprint(step[1].get_params())\n", " print()\n", diff --git a/how-to-use-azureml/automated-machine-learning/dataprep-remote-execution/auto-ml-dataprep-remote-execution.ipynb b/how-to-use-azureml/automated-machine-learning/dataprep-remote-execution/auto-ml-dataprep-remote-execution.ipynb index 304aed96..fbf7b09c 100644 --- a/how-to-use-azureml/automated-machine-learning/dataprep-remote-execution/auto-ml-dataprep-remote-execution.ipynb +++ b/how-to-use-azureml/automated-machine-learning/dataprep-remote-execution/auto-ml-dataprep-remote-execution.ipynb @@ -117,21 +117,12 @@ "outputs": [], "source": [ "# You can use `auto_read_file` which intelligently figures out delimiters and datatypes of a file.\n", - "# The data referenced here was pulled from `sklearn.datasets.load_digits()`.\n", - "simple_example_data_root = 'https://dprepdata.blob.core.windows.net/automl-notebook-data/'\n", - "X = dprep.auto_read_file(simple_example_data_root + 'X.csv').skip(1) # Remove the header row.\n", - "\n", + "# The data referenced here was a 1MB simple random sample of the Chicago Crime data into a local temporary directory.\n", "# You can also use `read_csv` and `to_*` transformations to read (with overridable delimiter)\n", "# and convert column types manually.\n", - "# Here we read a comma delimited file and convert all columns to integers.\n", - "y = dprep.read_csv(simple_example_data_root + 'y.csv').to_long(dprep.ColumnSelector(term='.*', use_regex = True))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "You can peek the result of a Dataflow at any range using `skip(i)` and `head(j)`. Doing so evaluates only `j` records for all the steps in the Dataflow, which makes it fast even against large datasets." + "example_data = 'https://dprepdata.blob.core.windows.net/demo/crime0-random.csv'\n", + "dflow = dprep.auto_read_file(example_data).skip(1) # Remove the header row.\n", + "dflow.get_profile()" ] }, { @@ -140,7 +131,30 @@ "metadata": {}, "outputs": [], "source": [ - "X.skip(1).head(5)" + "# As `Primary Type` is our y data, we need to drop the values those are null in this column.\n", + "dflow = dflow.drop_nulls('Primary Type')\n", + "dflow.head(5)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Review the Data Preparation Result\n", + "\n", + "You can peek the result of a Dataflow at any range using `skip(i)` and `head(j)`. Doing so evaluates only `j` records for all the steps in the Dataflow, which makes it fast even against large datasets.\n", + "\n", + "`Dataflow` objects are immutable and are composed of a list of data preparation steps. A `Dataflow` object can be branched at any point for further usage." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "X = dflow.drop_columns(columns=['Primary Type', 'FBI Code'])\n", + "y = dflow.keep_columns(columns=['Primary Type'], validate_column_exists=True)" ] }, { @@ -162,9 +176,8 @@ " \"iteration_timeout_minutes\" : 10,\n", " \"iterations\" : 2,\n", " \"primary_metric\" : 'AUC_weighted',\n", - " \"preprocess\" : False,\n", - " \"verbosity\" : logging.INFO,\n", - " \"n_cross_validations\": 3\n", + " \"preprocess\" : True,\n", + " \"verbosity\" : logging.INFO\n", "}" ] }, @@ -181,7 +194,7 @@ "metadata": {}, "outputs": [], "source": [ - "dsvm_name = 'mydsvmc'\n", + "dsvm_name = 'mydsvmb'\n", "\n", "try:\n", " while ws.compute_targets[dsvm_name].provisioning_state == 'Creating':\n", @@ -257,6 +270,23 @@ "remote_run" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Pre-process cache cleanup\n", + "The preprocess data gets cache at user default file store. When the run is completed the cache can be cleaned by running below cell" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "remote_run.clean_preprocessor_cache()" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -376,7 +406,8 @@ "source": [ "## Test\n", "\n", - "#### Load Test Data" + "#### Load Test Data\n", + "For the test data, it should have the same preparation step as the train data. Otherwise it might get failed at the preprocessing step." ] }, { @@ -385,12 +416,8 @@ "metadata": {}, "outputs": [], "source": [ - "from sklearn import datasets\n", - "\n", - "digits = datasets.load_digits()\n", - "X_test = digits.data[:10, :]\n", - "y_test = digits.target[:10]\n", - "images = digits.images[:10]" + "dflow_test = dprep.auto_read_file(path='https://dprepdata.blob.core.windows.net/demo/crime0-test.csv').skip(1)\n", + "dflow_test = dflow_test.drop_nulls('Primary Type')" ] }, { @@ -398,7 +425,7 @@ "metadata": {}, "source": [ "#### Testing Our Best Fitted Model\n", - "We will try to predict 2 digits and see how our model works." + "We will use confusion matrix to see how our model works." ] }, { @@ -407,65 +434,19 @@ "metadata": {}, "outputs": [], "source": [ - "#Randomly select digits and test\n", - "from matplotlib import pyplot as plt\n", - "import numpy as np\n", + "from pandas_ml import ConfusionMatrix\n", "\n", - "for index in np.random.choice(len(y_test), 2, replace = False):\n", - " print(index)\n", - " predicted = fitted_model.predict(X_test[index:index + 1])[0]\n", - " label = y_test[index]\n", - " title = \"Label value = %d Predicted value = %d \" % (label, predicted)\n", - " fig = plt.figure(1, figsize=(3,3))\n", - " ax1 = fig.add_axes((0,0,.8,.8))\n", - " ax1.set_title(title)\n", - " plt.imshow(images[index], cmap = plt.cm.gray_r, interpolation = 'nearest')\n", - " plt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Appendix" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Capture the `Dataflow` Objects for Later Use in AutoML\n", + "y_test = dflow_test.keep_columns(columns=['Primary Type']).to_pandas_dataframe()\n", + "X_test = dflow_test.drop_columns(columns=['Primary Type', 'FBI Code']).to_pandas_dataframe()\n", "\n", - "`Dataflow` objects are immutable and are composed of a list of data preparation steps. A `Dataflow` object can be branched at any point for further usage." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# sklearn.digits.data + target\n", - "digits_complete = dprep.auto_read_file('https://dprepdata.blob.core.windows.net/automl-notebook-data/digits-complete.csv')" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "`digits_complete` (sourced from `sklearn.datasets.load_digits()`) is forked into `dflow_X` to capture all the feature columns and `dflow_y` to capture the label column." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "print(digits_complete.to_pandas_dataframe().shape)\n", - "labels_column = 'Column64'\n", - "dflow_X = digits_complete.drop_columns(columns = [labels_column])\n", - "dflow_y = digits_complete.keep_columns(columns = [labels_column])" + "\n", + "ypred = fitted_model.predict(X_test)\n", + "\n", + "cm = ConfusionMatrix(y_test['Primary Type'], ypred)\n", + "\n", + "print(cm)\n", + "\n", + "cm.plot()" ] } ], diff --git a/how-to-use-azureml/automated-machine-learning/dataprep/auto-ml-dataprep.ipynb b/how-to-use-azureml/automated-machine-learning/dataprep/auto-ml-dataprep.ipynb index 2836d1d7..4af365d9 100644 --- a/how-to-use-azureml/automated-machine-learning/dataprep/auto-ml-dataprep.ipynb +++ b/how-to-use-azureml/automated-machine-learning/dataprep/auto-ml-dataprep.ipynb @@ -115,23 +115,12 @@ "outputs": [], "source": [ "# You can use `auto_read_file` which intelligently figures out delimiters and datatypes of a file.\n", - "# The data referenced here was pulled from `sklearn.datasets.load_digits()`.\n", - "simple_example_data_root = 'https://dprepdata.blob.core.windows.net/automl-notebook-data/'\n", - "X = dprep.auto_read_file(simple_example_data_root + 'X.csv').skip(1) # Remove the header row.\n", - "\n", + "# The data referenced here was a 1MB simple random sample of the Chicago Crime data into a local temporary directory.\n", "# You can also use `read_csv` and `to_*` transformations to read (with overridable delimiter)\n", "# and convert column types manually.\n", - "# Here we read a comma delimited file and convert all columns to integers.\n", - "y = dprep.read_csv(simple_example_data_root + 'y.csv').to_long(dprep.ColumnSelector(term='.*', use_regex = True))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Review the Data Preparation Result\n", - "\n", - "You can peek the result of a Dataflow at any range using `skip(i)` and `head(j)`. Doing so evaluates only `j` records for all the steps in the Dataflow, which makes it fast even against large datasets." + "example_data = 'https://dprepdata.blob.core.windows.net/demo/crime0-random.csv'\n", + "dflow = dprep.auto_read_file(example_data).skip(1) # Remove the header row.\n", + "dflow.get_profile()" ] }, { @@ -140,7 +129,30 @@ "metadata": {}, "outputs": [], "source": [ - "X.skip(1).head(5)" + "# As `Primary Type` is our y data, we need to drop the values those are null in this column.\n", + "dflow = dflow.drop_nulls('Primary Type')\n", + "dflow.head(5)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Review the Data Preparation Result\n", + "\n", + "You can peek the result of a Dataflow at any range using `skip(i)` and `head(j)`. Doing so evaluates only `j` records for all the steps in the Dataflow, which makes it fast even against large datasets.\n", + "\n", + "`Dataflow` objects are immutable and are composed of a list of data preparation steps. A `Dataflow` object can be branched at any point for further usage." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "X = dflow.drop_columns(columns=['Primary Type', 'FBI Code'])\n", + "y = dflow.keep_columns(columns=['Primary Type'], validate_column_exists=True)" ] }, { @@ -162,7 +174,7 @@ " \"iteration_timeout_minutes\" : 10,\n", " \"iterations\" : 2,\n", " \"primary_metric\" : 'AUC_weighted',\n", - " \"preprocess\" : False,\n", + " \"preprocess\" : True,\n", " \"verbosity\" : logging.INFO\n", "}" ] @@ -326,7 +338,8 @@ "source": [ "## Test\n", "\n", - "#### Load Test Data" + "#### Load Test Data\n", + "For the test data, it should have the same preparation step as the train data. Otherwise it might get failed at the preprocessing step." ] }, { @@ -335,12 +348,8 @@ "metadata": {}, "outputs": [], "source": [ - "from sklearn import datasets\n", - "\n", - "digits = datasets.load_digits()\n", - "X_test = digits.data[:10, :]\n", - "y_test = digits.target[:10]\n", - "images = digits.images[:10]" + "dflow_test = dprep.auto_read_file(path='https://dprepdata.blob.core.windows.net/demo/crime0-test.csv').skip(1)\n", + "dflow_test = dflow_test.drop_nulls('Primary Type')" ] }, { @@ -348,7 +357,7 @@ "metadata": {}, "source": [ "#### Testing Our Best Fitted Model\n", - "We will try to predict 2 digits and see how our model works." + "We will use confusion matrix to see how our model works." ] }, { @@ -357,65 +366,18 @@ "metadata": {}, "outputs": [], "source": [ - "#Randomly select digits and test\n", - "from matplotlib import pyplot as plt\n", - "import numpy as np\n", + "from pandas_ml import ConfusionMatrix\n", "\n", - "for index in np.random.choice(len(y_test), 2, replace = False):\n", - " print(index)\n", - " predicted = fitted_model.predict(X_test[index:index + 1])[0]\n", - " label = y_test[index]\n", - " title = \"Label value = %d Predicted value = %d \" % (label, predicted)\n", - " fig = plt.figure(1, figsize=(3,3))\n", - " ax1 = fig.add_axes((0,0,.8,.8))\n", - " ax1.set_title(title)\n", - " plt.imshow(images[index], cmap = plt.cm.gray_r, interpolation = 'nearest')\n", - " plt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Appendix" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Capture the `Dataflow` Objects for Later Use in AutoML\n", + "y_test = dflow_test.keep_columns(columns=['Primary Type']).to_pandas_dataframe()\n", + "X_test = dflow_test.drop_columns(columns=['Primary Type', 'FBI Code']).to_pandas_dataframe()\n", "\n", - "`Dataflow` objects are immutable and are composed of a list of data preparation steps. A `Dataflow` object can be branched at any point for further usage." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# sklearn.digits.data + target\n", - "digits_complete = dprep.auto_read_file('https://dprepdata.blob.core.windows.net/automl-notebook-data/digits-complete.csv')" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "`digits_complete` (sourced from `sklearn.datasets.load_digits()`) is forked into `dflow_X` to capture all the feature columns and `dflow_y` to capture the label column." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "print(digits_complete.to_pandas_dataframe().shape)\n", - "labels_column = 'Column64'\n", - "dflow_X = digits_complete.drop_columns(columns = [labels_column])\n", - "dflow_y = digits_complete.keep_columns(columns = [labels_column])" + "ypred = fitted_model.predict(X_test)\n", + "\n", + "cm = ConfusionMatrix(y_test['Primary Type'], ypred)\n", + "\n", + "print(cm)\n", + "\n", + "cm.plot()" ] } ], diff --git a/how-to-use-azureml/automated-machine-learning/forecasting-bike-share/auto-ml-forecasting-bike-share.ipynb b/how-to-use-azureml/automated-machine-learning/forecasting-bike-share/auto-ml-forecasting-bike-share.ipynb index 5b45181c..8053693c 100644 --- a/how-to-use-azureml/automated-machine-learning/forecasting-bike-share/auto-ml-forecasting-bike-share.ipynb +++ b/how-to-use-azureml/automated-machine-learning/forecasting-bike-share/auto-ml-forecasting-bike-share.ipynb @@ -220,7 +220,7 @@ "|**X**|(sparse) array-like, shape = [n_samples, n_features]|\n", "|**y**|(sparse) array-like, shape = [n_samples, ], targets values.|\n", "|**n_cross_validations**|Number of cross validation splits.|\n", - "|**country**|The country used to generate holiday features. These should be ISO 3166 two-letter country codes (i.e. 'US', 'GB').|\n", + "|**country_or_region**|The country/region used to generate holiday features. These should be ISO 3166 two-letter country/region codes (i.e. 'US', 'GB').|\n", "|**path**|Relative path to the project folder. AutoML stores configuration files for the experiment under this folder. You can specify a new empty folder. " ] }, @@ -235,8 +235,8 @@ " \"time_column_name\": time_column_name,\n", " # these columns are a breakdown of the total and therefore a leak\n", " \"drop_column_names\": ['casual', 'registered'],\n", - " # knowing the country allows Automated ML to bring in holidays\n", - " \"country\" : 'US',\n", + " # knowing the country/region allows Automated ML to bring in holidays\n", + " \"country_or_region\" : 'US',\n", " \"max_horizon\" : max_horizon,\n", " \"target_lags\": 1 \n", "}\n", diff --git a/how-to-use-azureml/automated-machine-learning/remote-amlcompute/auto-ml-remote-amlcompute.ipynb b/how-to-use-azureml/automated-machine-learning/remote-amlcompute/auto-ml-remote-amlcompute.ipynb index 38ffd41e..d72a0fc1 100644 --- a/how-to-use-azureml/automated-machine-learning/remote-amlcompute/auto-ml-remote-amlcompute.ipynb +++ b/how-to-use-azureml/automated-machine-learning/remote-amlcompute/auto-ml-remote-amlcompute.ipynb @@ -112,9 +112,7 @@ "metadata": {}, "source": [ "### Create or Attach existing AmlCompute\n", - "You will need to create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for your AutoML run. In this tutorial, you create `AmlCompute` as your training compute resource.\n", - "\n", - "**Creation of AmlCompute takes approximately 5 minutes.** If the AmlCompute with that name is already in your workspace this code will skip the creation process.\n", + "You will need to create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for your AutoML run. In this tutorial, you attach the default `AmlCompute` as your training compute resource.\n", "\n", "As with other Azure services, there are limits on certain resources (e.g. AmlCompute) associated with the Azure Machine Learning service. Please read [this article](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-manage-quotas) on the default limits and how to request more quota." ] @@ -125,34 +123,7 @@ "metadata": {}, "outputs": [], "source": [ - "from azureml.core.compute import AmlCompute\n", - "from azureml.core.compute import ComputeTarget\n", - "\n", - "# Choose a name for your cluster.\n", - "amlcompute_cluster_name = \"automlcl\"\n", - "\n", - "found = False\n", - "# Check if this compute target already exists in the workspace.\n", - "cts = ws.compute_targets\n", - "if amlcompute_cluster_name in cts and cts[amlcompute_cluster_name].type == 'AmlCompute':\n", - " found = True\n", - " print('Found existing compute target.')\n", - " compute_target = cts[amlcompute_cluster_name]\n", - " \n", - "if not found:\n", - " print('Creating a new compute target...')\n", - " provisioning_config = AmlCompute.provisioning_configuration(vm_size = \"STANDARD_D2_V2\", # for GPU, use \"STANDARD_NC6\"\n", - " #vm_priority = 'lowpriority', # optional\n", - " max_nodes = 6)\n", - "\n", - " # Create the cluster.\n", - " compute_target = ComputeTarget.create(ws, amlcompute_cluster_name, provisioning_config)\n", - " \n", - " # Can poll for a minimum number of nodes and for a specific timeout.\n", - " # If no min_node_count is provided, it will use the scale settings for the cluster.\n", - " compute_target.wait_for_completion(show_output = True, min_node_count = None, timeout_in_minutes = 20)\n", - " \n", - " # For a more detailed view of current AmlCompute status, use get_status()." + "compute_target = ws.get_default_compute_target(\"CPU\")" ] }, { diff --git a/how-to-use-azureml/automated-machine-learning/remote-execution/auto-ml-remote-execution.ipynb b/how-to-use-azureml/automated-machine-learning/remote-execution/auto-ml-remote-execution.ipynb index 637d9a3f..ab98207d 100644 --- a/how-to-use-azureml/automated-machine-learning/remote-execution/auto-ml-remote-execution.ipynb +++ b/how-to-use-azureml/automated-machine-learning/remote-execution/auto-ml-remote-execution.ipynb @@ -130,7 +130,7 @@ " print('Found an existing DSVM.')\n", "except:\n", " print('Creating a new DSVM.')\n", - " dsvm_config = DsvmCompute.provisioning_configuration(vm_size = \"Standard_D2s_v3\")\n", + " dsvm_config = DsvmCompute.provisioning_configuration(vm_size = \"Standard_D2_v2\")\n", " dsvm_compute = DsvmCompute.create(ws, name = dsvm_name, provisioning_configuration = dsvm_config)\n", " dsvm_compute.wait_for_completion(show_output = True)\n", " print(\"Waiting one minute for ssh to be accessible\")\n", diff --git a/how-to-use-azureml/deploy-to-cloud/model-register-and-deploy.ipynb b/how-to-use-azureml/deploy-to-cloud/model-register-and-deploy.ipynb index feed709a..f17e0912 100644 --- a/how-to-use-azureml/deploy-to-cloud/model-register-and-deploy.ipynb +++ b/how-to-use-azureml/deploy-to-cloud/model-register-and-deploy.ipynb @@ -9,13 +9,13 @@ "Licensed under the MIT License." ] }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deploy-to-cloud/model-register-and-deploy.png)" - ] - }, + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deploy-to-cloud/model-register-and-deploy.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -33,7 +33,7 @@ "metadata": {}, "source": [ "## Prerequisites\n", - "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration](../../configuration.ipynb) Notebook first if you haven't already to establish your connection to the AzureML Workspace." + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the [configuration](../../../configuration.ipynb) Notebook first if you haven't." ] }, { @@ -279,4 +279,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/deploy-to-local/register-model-deploy-local-advanced.ipynb b/how-to-use-azureml/deploy-to-local/register-model-deploy-local-advanced.ipynb index b2d1f519..86496502 100644 --- a/how-to-use-azureml/deploy-to-local/register-model-deploy-local-advanced.ipynb +++ b/how-to-use-azureml/deploy-to-local/register-model-deploy-local-advanced.ipynb @@ -13,8 +13,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deploy-to-local/register-model-deploy-local-advanced.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deploy-to-local/register-model-deploy-local-advanced.png)" + ] }, { "cell_type": "markdown", @@ -35,7 +35,7 @@ "metadata": {}, "source": [ "## Prerequisites\n", - "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise,make sure you go through the [configuration](../../../configuration.ipynb) Notebook first if you haven't." + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the [configuration](../../../configuration.ipynb) Notebook first if you haven't." ] }, { @@ -491,4 +491,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/deploy-to-local/register-model-deploy-local.ipynb b/how-to-use-azureml/deploy-to-local/register-model-deploy-local.ipynb index ce0af4bf..2ef008ef 100644 --- a/how-to-use-azureml/deploy-to-local/register-model-deploy-local.ipynb +++ b/how-to-use-azureml/deploy-to-local/register-model-deploy-local.ipynb @@ -9,12 +9,12 @@ "Licensed under the MIT License." ] }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deploy-to-local/register-model-deploy-local.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deploy-to-local/register-model-deploy-local.png)" + ] }, { "cell_type": "markdown", @@ -346,4 +346,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/deployment/enable-app-insights-in-production-service/enable-app-insights-in-production-service.ipynb b/how-to-use-azureml/deployment/enable-app-insights-in-production-service/enable-app-insights-in-production-service.ipynb index 06e271fc..79d98eac 100644 --- a/how-to-use-azureml/deployment/enable-app-insights-in-production-service/enable-app-insights-in-production-service.ipynb +++ b/how-to-use-azureml/deployment/enable-app-insights-in-production-service/enable-app-insights-in-production-service.ipynb @@ -29,8 +29,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/enable-app-insights-in-production-service/enable-app-insights-in-production-service.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/enable-app-insights-in-production-service/enable-app-insights-in-production-service.png)" + ] }, { "cell_type": "markdown", @@ -495,4 +495,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/deployment/enable-data-collection-for-models-in-aks/enable-data-collection-for-models-in-aks.ipynb b/how-to-use-azureml/deployment/enable-data-collection-for-models-in-aks/enable-data-collection-for-models-in-aks.ipynb index 78259d4a..2540321f 100644 --- a/how-to-use-azureml/deployment/enable-data-collection-for-models-in-aks/enable-data-collection-for-models-in-aks.ipynb +++ b/how-to-use-azureml/deployment/enable-data-collection-for-models-in-aks/enable-data-collection-for-models-in-aks.ipynb @@ -1,5 +1,12 @@ { "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/enable-data-collection-for-models-in-aks/enable-data-collection-for-models-in-aks.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -24,13 +31,6 @@ "4. Build new image and deploy it. " ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/enable-data-collection-for-models-in-aks/enable-data-collection-for-models-in-aks.png)" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -475,4 +475,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/deployment/onnx/README.md b/how-to-use-azureml/deployment/onnx/README.md index 28082799..05869368 100644 --- a/how-to-use-azureml/deployment/onnx/README.md +++ b/how-to-use-azureml/deployment/onnx/README.md @@ -1,5 +1,4 @@ # ONNX on Azure Machine Learning - ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/onnx/README.png) These tutorials show how to create and deploy Open Neural Network eXchange ([ONNX](http://onnx.ai)) models in Azure Machine Learning environments using [ONNX Runtime](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-build-deploy-onnx) for inference. Once deployed as a web service, you can ping the model with your own set of images to be analyzed! @@ -37,3 +36,4 @@ Licensed under the MIT License. These tutorials were developed by Vinitra Swamy and Prasanth Pulavarthi of the Microsoft AI Frameworks team and adapted for presentation at Microsoft Ignite 2018. + ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/onnx/README.png) diff --git a/how-to-use-azureml/deployment/onnx/onnx-convert-aml-deploy-tinyyolo.ipynb b/how-to-use-azureml/deployment/onnx/onnx-convert-aml-deploy-tinyyolo.ipynb index 2258c2d8..2c7d5513 100644 --- a/how-to-use-azureml/deployment/onnx/onnx-convert-aml-deploy-tinyyolo.ipynb +++ b/how-to-use-azureml/deployment/onnx/onnx-convert-aml-deploy-tinyyolo.ipynb @@ -13,8 +13,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/onnx/onnx-convert-aml-deploy-tinyyolo.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/onnx/onnx-convert-aml-deploy-tinyyolo.png)" + ] }, { "cell_type": "markdown", @@ -440,4 +440,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/deployment/onnx/onnx-inference-facial-expression-recognition-deploy.ipynb b/how-to-use-azureml/deployment/onnx/onnx-inference-facial-expression-recognition-deploy.ipynb index 479f99bc..3f3a0fd9 100644 --- a/how-to-use-azureml/deployment/onnx/onnx-inference-facial-expression-recognition-deploy.ipynb +++ b/how-to-use-azureml/deployment/onnx/onnx-inference-facial-expression-recognition-deploy.ipynb @@ -8,12 +8,12 @@ "Licensed under the MIT License." ] }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/onnx/onnx-inference-facial-expression-recognition-deploy.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/onnx/onnx-inference-facial-expression-recognition-deploy.png)" + ] }, { "cell_type": "markdown", @@ -813,4 +813,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/deployment/onnx/onnx-inference-mnist-deploy.ipynb b/how-to-use-azureml/deployment/onnx/onnx-inference-mnist-deploy.ipynb index accbb189..43c22a09 100644 --- a/how-to-use-azureml/deployment/onnx/onnx-inference-mnist-deploy.ipynb +++ b/how-to-use-azureml/deployment/onnx/onnx-inference-mnist-deploy.ipynb @@ -12,8 +12,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/onnx/onnx-inference-mnist-deploy.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/onnx/onnx-inference-mnist-deploy.png)" + ] }, { "cell_type": "markdown", @@ -817,4 +817,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/deployment/onnx/onnx-modelzoo-aml-deploy-resnet50.ipynb b/how-to-use-azureml/deployment/onnx/onnx-modelzoo-aml-deploy-resnet50.ipynb index 87dc64da..1213c12f 100644 --- a/how-to-use-azureml/deployment/onnx/onnx-modelzoo-aml-deploy-resnet50.ipynb +++ b/how-to-use-azureml/deployment/onnx/onnx-modelzoo-aml-deploy-resnet50.ipynb @@ -13,8 +13,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/onnx/onnx-modelzoo-aml-deploy-resnet50.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/onnx/onnx-modelzoo-aml-deploy-resnet50.png)" + ] }, { "cell_type": "markdown", @@ -40,7 +40,7 @@ "To make the best use of your time, make sure you have done the following:\n", "\n", "* Understand the [architecture and terms](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture) introduced by Azure Machine Learning\n", - "* If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration notebook](../../../configuration.ipynb) to:\n", + "* If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration notebook](../../../configuration.ipynb) to:\n", " * install the AML SDK\n", " * create a workspace and its configuration file (config.json)" ] @@ -424,4 +424,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/deployment/onnx/onnx-train-pytorch-aml-deploy-mnist.ipynb b/how-to-use-azureml/deployment/onnx/onnx-train-pytorch-aml-deploy-mnist.ipynb index 0374e259..5d44a1d5 100644 --- a/how-to-use-azureml/deployment/onnx/onnx-train-pytorch-aml-deploy-mnist.ipynb +++ b/how-to-use-azureml/deployment/onnx/onnx-train-pytorch-aml-deploy-mnist.ipynb @@ -13,8 +13,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/onnx/onnx-train-pytorch-aml-deploy-mnist.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/onnx/onnx-train-pytorch-aml-deploy-mnist.png)" + ] }, { "cell_type": "markdown", @@ -670,4 +670,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/deployment/production-deploy-to-aks/production-deploy-to-aks.ipynb b/how-to-use-azureml/deployment/production-deploy-to-aks/production-deploy-to-aks.ipynb index da53fda3..292eb621 100644 --- a/how-to-use-azureml/deployment/production-deploy-to-aks/production-deploy-to-aks.ipynb +++ b/how-to-use-azureml/deployment/production-deploy-to-aks/production-deploy-to-aks.ipynb @@ -9,12 +9,12 @@ "Licensed under the MIT License." ] }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/production-deploy-to-aks/production-deploy-to-aks.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/production-deploy-to-aks/production-deploy-to-aks.png)" + ] }, { "cell_type": "markdown", @@ -474,4 +474,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/deployment/register-model-create-image-deploy-service/register-model-create-image-deploy-service.ipynb b/how-to-use-azureml/deployment/register-model-create-image-deploy-service/register-model-create-image-deploy-service.ipynb index da501f02..ba5ccd15 100644 --- a/how-to-use-azureml/deployment/register-model-create-image-deploy-service/register-model-create-image-deploy-service.ipynb +++ b/how-to-use-azureml/deployment/register-model-create-image-deploy-service/register-model-create-image-deploy-service.ipynb @@ -9,12 +9,12 @@ "Licensed under the MIT License." ] }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/register-model-create-image-deploy-service/register-model-create-image-deploy-service.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/register-model-create-image-deploy-service/register-model-create-image-deploy-service.png)" + ] }, { "cell_type": "markdown", @@ -450,4 +450,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/explain-model/README.md b/how-to-use-azureml/explain-model/README.md index d4ca292b..4fc9147a 100644 --- a/how-to-use-azureml/explain-model/README.md +++ b/how-to-use-azureml/explain-model/README.md @@ -3,7 +3,6 @@ Follow these sample notebooks to learn: 1. [Explain tabular data locally](explain-tabular-data-local): Basic example of explaining model trained on tabular data. - 4. [Explain on remote AMLCompute](explain-on-amlcompute): Explain a model on a remote AMLCompute target. 5. [Explain tabular data with Run History](explain-tabular-data-run-history): Explain a model with Run History. 7. [Explain raw features](explain-tabular-data-raw-features): Explain the raw features of a trained model. diff --git a/how-to-use-azureml/explain-model/explain-on-amlcompute/regression-sklearn-on-amlcompute.ipynb b/how-to-use-azureml/explain-model/explain-on-amlcompute/regression-sklearn-on-amlcompute.ipynb index 966958ca..b236705b 100644 --- a/how-to-use-azureml/explain-model/explain-on-amlcompute/regression-sklearn-on-amlcompute.ipynb +++ b/how-to-use-azureml/explain-model/explain-on-amlcompute/regression-sklearn-on-amlcompute.ipynb @@ -1,609 +1,606 @@ { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Copyright (c) Microsoft Corporation. All rights reserved.\n", - "\n", - "Licensed under the MIT License." - ] - }, - { + "cells": [ + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/explain-model/explain-on-amlcompute/regression-sklearn-on-amlcompute.png)" - ] + "Copyright (c) Microsoft Corporation. All rights reserved.\n", + "\n", + "Licensed under the MIT License." + ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Train using Azure Machine Learning Compute\n", - "\n", - "* Initialize a Workspace\n", - "* Create an Experiment\n", - "* Introduction to AmlCompute\n", - "* Submit an AmlCompute run in a few different ways\n", - " - Provision as a run based compute target \n", - " - Provision as a persistent compute target (Basic)\n", - " - Provision as a persistent compute target (Advanced)\n", - "* Additional operations to perform on AmlCompute\n", - "* Download model explanation data from the Run History Portal\n", - "* Print the explanation data" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Prerequisites\n", - "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Check core SDK version number\n", - "import azureml.core\n", - "\n", - "print(\"SDK version:\", azureml.core.VERSION)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Initialize a Workspace\n", - "\n", - "Initialize a workspace object from persisted configuration" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "tags": [ - "create workspace" - ] - }, - "outputs": [], - "source": [ - "from azureml.core import Workspace\n", - "\n", - "ws = Workspace.from_config()\n", - "print(ws.name, ws.resource_group, ws.location, ws.subscription_id, sep='\\n')" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Create An Experiment\n", - "\n", - "**Experiment** is a logical container in an Azure ML Workspace. It hosts run records which can include run metrics and output artifacts from your experiments." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.core import Experiment\n", - "experiment_name = 'explainer-remote-run-on-amlcompute'\n", - "experiment = Experiment(workspace=ws, name=experiment_name)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Introduction to AmlCompute\n", - "\n", - "Azure Machine Learning Compute is managed compute infrastructure that allows the user to easily create single to multi-node compute of the appropriate VM Family. It is created **within your workspace region** and is a resource that can be used by other users in your workspace. It autoscales by default to the max_nodes, when a job is submitted, and executes in a containerized environment packaging the dependencies as specified by the user. \n", - "\n", - "Since it is managed compute, job scheduling and cluster management are handled internally by Azure Machine Learning service. \n", - "\n", - "For more information on Azure Machine Learning Compute, please read [this article](https://docs.microsoft.com/azure/machine-learning/service/how-to-set-up-training-targets#amlcompute)\n", - "\n", - "If you are an existing BatchAI customer who is migrating to Azure Machine Learning, please read [this article](https://aka.ms/batchai-retirement)\n", - "\n", - "**Note**: As with other Azure services, there are limits on certain resources (for eg. AmlCompute quota) associated with the Azure Machine Learning service. Please read [this article](https://docs.microsoft.com/azure/machine-learning/service/how-to-manage-quotas) on the default limits and how to request more quota.\n", - "\n", - "\n", - "The training script `run_explainer.py` is already created for you. Let's have a look." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Submit an AmlCompute run in a few different ways\n", - "\n", - "First lets check which VM families are available in your region. Azure is a regional service and some specialized SKUs (especially GPUs) are only available in certain regions. Since AmlCompute is created in the region of your workspace, we will use the supported_vms () function to see if the VM family we want to use ('STANDARD_D2_V2') is supported.\n", - "\n", - "You can also pass a different region to check availability and then re-create your workspace in that region through the [configuration notebook](../../../configuration.ipynb)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.core.compute import ComputeTarget, AmlCompute\n", - "\n", - "AmlCompute.supported_vmsizes(workspace=ws)\n", - "# AmlCompute.supported_vmsizes(workspace=ws, location='southcentralus')" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Create project directory\n", - "\n", - "Create a directory that will contain all the necessary code from your local machine that you will need access to on the remote resource. This includes the training script, and any additional files your training script depends on" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import os\n", - "import shutil\n", - "\n", - "project_folder = './explainer-remote-run-on-amlcompute'\n", - "os.makedirs(project_folder, exist_ok=True)\n", - "shutil.copy('run_explainer.py', project_folder)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Provision as a run based compute target\n", - "\n", - "You can provision AmlCompute as a compute target at run-time. In this case, the compute is auto-created for your run, scales up to max_nodes that you specify, and then **deleted automatically** after the run completes." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.core.runconfig import RunConfiguration\n", - "from azureml.core.conda_dependencies import CondaDependencies\n", - "from azureml.core.runconfig import DEFAULT_CPU_IMAGE\n", - "\n", - "# create a new runconfig object\n", - "run_config = RunConfiguration()\n", - "\n", - "# signal that you want to use AmlCompute to execute script.\n", - "run_config.target = \"amlcompute\"\n", - "\n", - "# AmlCompute will be created in the same region as workspace\n", - "# Set vm size for AmlCompute\n", - "run_config.amlcompute.vm_size = 'STANDARD_D2_V2'\n", - "\n", - "# enable Docker \n", - "run_config.environment.docker.enabled = True\n", - "\n", - "# set Docker base image to the default CPU-based image\n", - "run_config.environment.docker.base_image = DEFAULT_CPU_IMAGE\n", - "\n", - "# use conda_dependencies.yml to create a conda environment in the Docker image for execution\n", - "run_config.environment.python.user_managed_dependencies = False\n", - "\n", - "# auto-prepare the Docker image when used for execution (if it is not already prepared)\n", - "run_config.auto_prepare_environment = True\n", - "\n", - "azureml_pip_packages = [\n", - " 'azureml-defaults', 'azureml-contrib-explain-model', 'azureml-core', 'azureml-telemetry',\n", - " 'azureml-explain-model'\n", - "]\n", - "\n", - "# specify CondaDependencies obj\n", - "run_config.environment.python.conda_dependencies = CondaDependencies.create(conda_packages=['scikit-learn'],\n", - " pip_packages=azureml_pip_packages)\n", - "\n", - "# Now submit a run on AmlCompute\n", - "from azureml.core.script_run_config import ScriptRunConfig\n", - "\n", - "script_run_config = ScriptRunConfig(source_directory=project_folder,\n", - " script='run_explainer.py',\n", - " run_config=run_config)\n", - "\n", - "run = experiment.submit(script_run_config)\n", - "\n", - "# Show run details\n", - "run" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Note: if you need to cancel a run, you can follow [these instructions](https://aka.ms/aml-docs-cancel-run)." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "%%time\n", - "# Shows output of the run on stdout.\n", - "run.wait_for_completion(show_output=True)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Provision as a persistent compute target (Basic)\n", - "\n", - "You can provision a persistent AmlCompute resource by simply defining two parameters thanks to smart defaults. By default it autoscales from 0 nodes and provisions dedicated VMs to run your job in a container. This is useful when you want to continously re-use the same target, debug it between jobs or simply share the resource with other users of your workspace.\n", - "\n", - "* `vm_size`: VM family of the nodes provisioned by AmlCompute. Simply choose from the supported_vmsizes() above\n", - "* `max_nodes`: Maximum nodes to autoscale to while running a job on AmlCompute" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.core.compute import ComputeTarget, AmlCompute\n", - "from azureml.core.compute_target import ComputeTargetException\n", - "\n", - "# Choose a name for your CPU cluster\n", - "cpu_cluster_name = \"cpucluster\"\n", - "\n", - "# Verify that cluster does not exist already\n", - "try:\n", - " cpu_cluster = ComputeTarget(workspace=ws, name=cpu_cluster_name)\n", - " print('Found existing cluster, use it.')\n", - "except ComputeTargetException:\n", - " compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_D2_V2',\n", - " max_nodes=4)\n", - " cpu_cluster = ComputeTarget.create(ws, cpu_cluster_name, compute_config)\n", - "\n", - "cpu_cluster.wait_for_completion(show_output=True)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Configure & Run" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.core.runconfig import RunConfiguration\n", - "from azureml.core.conda_dependencies import CondaDependencies\n", - "\n", - "# create a new RunConfig object\n", - "run_config = RunConfiguration(framework=\"python\")\n", - "\n", - "# Set compute target to AmlCompute target created in previous step\n", - "run_config.target = cpu_cluster.name\n", - "\n", - "# enable Docker \n", - "run_config.environment.docker.enabled = True\n", - "\n", - "azureml_pip_packages = [\n", - " 'azureml-defaults', 'azureml-contrib-explain-model', 'azureml-core', 'azureml-telemetry',\n", - " 'azureml-explain-model'\n", - "]\n", - "\n", - "# specify CondaDependencies obj\n", - "run_config.environment.python.conda_dependencies = CondaDependencies.create(conda_packages=['scikit-learn'],\n", - " pip_packages=azureml_pip_packages)\n", - "\n", - "from azureml.core import Run\n", - "from azureml.core import ScriptRunConfig\n", - "\n", - "src = ScriptRunConfig(source_directory=project_folder, \n", - " script='run_explainer.py', \n", - " run_config=run_config) \n", - "run = experiment.submit(config=src)\n", - "run" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "%%time\n", - "# Shows output of the run on stdout.\n", - "run.wait_for_completion(show_output=True)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "run.get_metrics()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Provision as a persistent compute target (Advanced)\n", - "\n", - "You can also specify additional properties or change defaults while provisioning AmlCompute using a more advanced configuration. This is useful when you want a dedicated cluster of 4 nodes (for example you can set the min_nodes and max_nodes to 4), or want the compute to be within an existing VNet in your subscription.\n", - "\n", - "In addition to `vm_size` and `max_nodes`, you can specify:\n", - "* `min_nodes`: Minimum nodes (default 0 nodes) to downscale to while running a job on AmlCompute\n", - "* `vm_priority`: Choose between 'dedicated' (default) and 'lowpriority' VMs when provisioning AmlCompute. Low Priority VMs use Azure's excess capacity and are thus cheaper but risk your run being pre-empted\n", - "* `idle_seconds_before_scaledown`: Idle time (default 120 seconds) to wait after run completion before auto-scaling to min_nodes\n", - "* `vnet_resourcegroup_name`: Resource group of the **existing** VNet within which AmlCompute should be provisioned\n", - "* `vnet_name`: Name of VNet\n", - "* `subnet_name`: Name of SubNet within the VNet" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.core.compute import ComputeTarget, AmlCompute\n", - "from azureml.core.compute_target import ComputeTargetException\n", - "\n", - "# Choose a name for your CPU cluster\n", - "cpu_cluster_name = \"cpucluster\"\n", - "\n", - "# Verify that cluster does not exist already\n", - "try:\n", - " cpu_cluster = ComputeTarget(workspace=ws, name=cpu_cluster_name)\n", - " print('Found existing cluster, use it.')\n", - "except ComputeTargetException:\n", - " compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_D2_V2',\n", - " vm_priority='lowpriority',\n", - " min_nodes=2,\n", - " max_nodes=4,\n", - " idle_seconds_before_scaledown='300',\n", - " vnet_resourcegroup_name='',\n", - " vnet_name='',\n", - " subnet_name='')\n", - " cpu_cluster = ComputeTarget.create(ws, cpu_cluster_name, compute_config)\n", - "\n", - "cpu_cluster.wait_for_completion(show_output=True)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Configure & Run" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.core.runconfig import RunConfiguration\n", - "from azureml.core.conda_dependencies import CondaDependencies\n", - "\n", - "# create a new RunConfig object\n", - "run_config = RunConfiguration(framework=\"python\")\n", - "\n", - "# Set compute target to AmlCompute target created in previous step\n", - "run_config.target = cpu_cluster.name\n", - "\n", - "# enable Docker \n", - "run_config.environment.docker.enabled = True\n", - "\n", - "azureml_pip_packages = [\n", - " 'azureml-defaults', 'azureml-contrib-explain-model', 'azureml-core', 'azureml-telemetry',\n", - " 'azureml-explain-model'\n", - "]\n", - "\n", - "# specify CondaDependencies obj\n", - "run_config.environment.python.conda_dependencies = CondaDependencies.create(conda_packages=['scikit-learn'],\n", - " pip_packages=azureml_pip_packages)\n", - "\n", - "from azureml.core import Run\n", - "from azureml.core import ScriptRunConfig\n", - "\n", - "src = ScriptRunConfig(source_directory=project_folder, \n", - " script='run_explainer.py', \n", - " run_config=run_config) \n", - "run = experiment.submit(config=src)\n", - "run" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "%%time\n", - "# Shows output of the run on stdout.\n", - "run.wait_for_completion(show_output=True)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "run.get_metrics()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.contrib.explain.model.explanation.explanation_client import ExplanationClient\n", - "\n", - "client = ExplanationClient.from_run(run)\n", - "# Get the top k (e.g., 4) most important features with their importance values\n", - "explanation = client.download_model_explanation(top_k=4)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Additional operations to perform on AmlCompute\n", - "\n", - "You can perform more operations on AmlCompute such as updating the node counts or deleting the compute. " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Get_status () gets the latest status of the AmlCompute target\n", - "cpu_cluster.get_status().serialize()\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Update () takes in the min_nodes, max_nodes and idle_seconds_before_scaledown and updates the AmlCompute target\n", - "# cpu_cluster.update(min_nodes=1)\n", - "# cpu_cluster.update(max_nodes=10)\n", - "cpu_cluster.update(idle_seconds_before_scaledown=300)\n", - "# cpu_cluster.update(min_nodes=2, max_nodes=4, idle_seconds_before_scaledown=600)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Delete () is used to deprovision and delete the AmlCompute target. Useful if you want to re-use the compute name \n", - "# 'cpucluster' in this case but use a different VM family for instance.\n", - "\n", - "# cpu_cluster.delete()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Download Model Explanation Data" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.contrib.explain.model.explanation.explanation_client import ExplanationClient\n", - "\n", - "# Get model explanation data\n", - "client = ExplanationClient.from_run(run)\n", - "explanation = client.download_model_explanation()\n", - "local_importance_values = explanation.local_importance_values\n", - "expected_values = explanation.expected_values\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Or you can use the saved run.id to retrive the feature importance values\n", - "client = ExplanationClient.from_run_id(ws, experiment_name, run.id)\n", - "explanation = client.download_model_explanation()\n", - "local_importance_values = explanation.local_importance_values\n", - "expected_values = explanation.expected_values" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Get the top k (e.g., 4) most important features with their importance values\n", - "explanation = client.download_model_explanation(top_k=4)\n", - "global_importance_values = explanation.get_ranked_global_values()\n", - "global_importance_names = explanation.get_ranked_global_names()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "print('global importance values: {}'.format(global_importance_values))\n", - "print('global importance names: {}'.format(global_importance_names))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Success!\n", - "Great, you are ready to move on to the remaining notebooks." - ] - } - ], - "metadata": { - "authors": [ - { - "name": "mesameki" - } + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/explain-model/explain-on-amlcompute/regression-sklearn-on-amlcompute.png)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Train using Azure Machine Learning Compute\n", + "\n", + "* Initialize a Workspace\n", + "* Create an Experiment\n", + "* Introduction to AmlCompute\n", + "* Submit an AmlCompute run in a few different ways\n", + " - Provision as a run based compute target \n", + " - Provision as a persistent compute target (Basic)\n", + " - Provision as a persistent compute target (Advanced)\n", + "* Additional operations to perform on AmlCompute\n", + "* Download model explanation data from the Run History Portal\n", + "* Print the explanation data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Prerequisites\n", + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Check core SDK version number\n", + "import azureml.core\n", + "\n", + "print(\"SDK version:\", azureml.core.VERSION)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Initialize a Workspace\n", + "\n", + "Initialize a workspace object from persisted configuration" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "tags": [ + "create workspace" + ] + }, + "outputs": [], + "source": [ + "from azureml.core import Workspace\n", + "\n", + "ws = Workspace.from_config()\n", + "print(ws.name, ws.resource_group, ws.location, ws.subscription_id, sep='\\n')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Create An Experiment\n", + "\n", + "**Experiment** is a logical container in an Azure ML Workspace. It hosts run records which can include run metrics and output artifacts from your experiments." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core import Experiment\n", + "experiment_name = 'explainer-remote-run-on-amlcompute'\n", + "experiment = Experiment(workspace=ws, name=experiment_name)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Introduction to AmlCompute\n", + "\n", + "Azure Machine Learning Compute is managed compute infrastructure that allows the user to easily create single to multi-node compute of the appropriate VM Family. It is created **within your workspace region** and is a resource that can be used by other users in your workspace. It autoscales by default to the max_nodes, when a job is submitted, and executes in a containerized environment packaging the dependencies as specified by the user. \n", + "\n", + "Since it is managed compute, job scheduling and cluster management are handled internally by Azure Machine Learning service. \n", + "\n", + "For more information on Azure Machine Learning Compute, please read [this article](https://docs.microsoft.com/azure/machine-learning/service/how-to-set-up-training-targets#amlcompute)\n", + "\n", + "If you are an existing BatchAI customer who is migrating to Azure Machine Learning, please read [this article](https://aka.ms/batchai-retirement)\n", + "\n", + "**Note**: As with other Azure services, there are limits on certain resources (for eg. AmlCompute quota) associated with the Azure Machine Learning service. Please read [this article](https://docs.microsoft.com/azure/machine-learning/service/how-to-manage-quotas) on the default limits and how to request more quota.\n", + "\n", + "\n", + "The training script `run_explainer.py` is already created for you. Let's have a look." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Submit an AmlCompute run in a few different ways\n", + "\n", + "First lets check which VM families are available in your region. Azure is a regional service and some specialized SKUs (especially GPUs) are only available in certain regions. Since AmlCompute is created in the region of your workspace, we will use the supported_vms () function to see if the VM family we want to use ('STANDARD_D2_V2') is supported.\n", + "\n", + "You can also pass a different region to check availability and then re-create your workspace in that region through the [configuration notebook](../../../configuration.ipynb)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core.compute import ComputeTarget, AmlCompute\n", + "\n", + "AmlCompute.supported_vmsizes(workspace=ws)\n", + "# AmlCompute.supported_vmsizes(workspace=ws, location='southcentralus')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Create project directory\n", + "\n", + "Create a directory that will contain all the necessary code from your local machine that you will need access to on the remote resource. This includes the training script, and any additional files your training script depends on" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "import shutil\n", + "\n", + "project_folder = './explainer-remote-run-on-amlcompute'\n", + "os.makedirs(project_folder, exist_ok=True)\n", + "shutil.copy('run_explainer.py', project_folder)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Provision as a run based compute target\n", + "\n", + "You can provision AmlCompute as a compute target at run-time. In this case, the compute is auto-created for your run, scales up to max_nodes that you specify, and then **deleted automatically** after the run completes." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core.runconfig import RunConfiguration\n", + "from azureml.core.conda_dependencies import CondaDependencies\n", + "from azureml.core.runconfig import DEFAULT_CPU_IMAGE\n", + "\n", + "# create a new runconfig object\n", + "run_config = RunConfiguration()\n", + "\n", + "# signal that you want to use AmlCompute to execute script.\n", + "run_config.target = \"amlcompute\"\n", + "\n", + "# AmlCompute will be created in the same region as workspace\n", + "# Set vm size for AmlCompute\n", + "run_config.amlcompute.vm_size = 'STANDARD_D2_V2'\n", + "\n", + "# enable Docker \n", + "run_config.environment.docker.enabled = True\n", + "\n", + "# set Docker base image to the default CPU-based image\n", + "run_config.environment.docker.base_image = DEFAULT_CPU_IMAGE\n", + "\n", + "# use conda_dependencies.yml to create a conda environment in the Docker image for execution\n", + "run_config.environment.python.user_managed_dependencies = False\n", + "\n", + "azureml_pip_packages = [\n", + " 'azureml-defaults', 'azureml-contrib-explain-model', 'azureml-core', 'azureml-telemetry',\n", + " 'azureml-explain-model'\n", + "]\n", + "\n", + "# specify CondaDependencies obj\n", + "run_config.environment.python.conda_dependencies = CondaDependencies.create(conda_packages=['scikit-learn'],\n", + " pip_packages=azureml_pip_packages)\n", + "\n", + "# Now submit a run on AmlCompute\n", + "from azureml.core.script_run_config import ScriptRunConfig\n", + "\n", + "script_run_config = ScriptRunConfig(source_directory=project_folder,\n", + " script='run_explainer.py',\n", + " run_config=run_config)\n", + "\n", + "run = experiment.submit(script_run_config)\n", + "\n", + "# Show run details\n", + "run" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note: if you need to cancel a run, you can follow [these instructions](https://aka.ms/aml-docs-cancel-run)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%time\n", + "# Shows output of the run on stdout.\n", + "run.wait_for_completion(show_output=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Provision as a persistent compute target (Basic)\n", + "\n", + "You can provision a persistent AmlCompute resource by simply defining two parameters thanks to smart defaults. By default it autoscales from 0 nodes and provisions dedicated VMs to run your job in a container. This is useful when you want to continously re-use the same target, debug it between jobs or simply share the resource with other users of your workspace.\n", + "\n", + "* `vm_size`: VM family of the nodes provisioned by AmlCompute. Simply choose from the supported_vmsizes() above\n", + "* `max_nodes`: Maximum nodes to autoscale to while running a job on AmlCompute" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core.compute import ComputeTarget, AmlCompute\n", + "from azureml.core.compute_target import ComputeTargetException\n", + "\n", + "# Choose a name for your CPU cluster\n", + "cpu_cluster_name = \"cpucluster\"\n", + "\n", + "# Verify that cluster does not exist already\n", + "try:\n", + " cpu_cluster = ComputeTarget(workspace=ws, name=cpu_cluster_name)\n", + " print('Found existing cluster, use it.')\n", + "except ComputeTargetException:\n", + " compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_D2_V2',\n", + " max_nodes=4)\n", + " cpu_cluster = ComputeTarget.create(ws, cpu_cluster_name, compute_config)\n", + "\n", + "cpu_cluster.wait_for_completion(show_output=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Configure & Run" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core.runconfig import RunConfiguration\n", + "from azureml.core.conda_dependencies import CondaDependencies\n", + "\n", + "# create a new RunConfig object\n", + "run_config = RunConfiguration(framework=\"python\")\n", + "\n", + "# Set compute target to AmlCompute target created in previous step\n", + "run_config.target = cpu_cluster.name\n", + "\n", + "# enable Docker \n", + "run_config.environment.docker.enabled = True\n", + "\n", + "azureml_pip_packages = [\n", + " 'azureml-defaults', 'azureml-contrib-explain-model', 'azureml-core', 'azureml-telemetry',\n", + " 'azureml-explain-model'\n", + "]\n", + "\n", + "# specify CondaDependencies obj\n", + "run_config.environment.python.conda_dependencies = CondaDependencies.create(conda_packages=['scikit-learn'],\n", + " pip_packages=azureml_pip_packages)\n", + "\n", + "from azureml.core import Run\n", + "from azureml.core import ScriptRunConfig\n", + "\n", + "src = ScriptRunConfig(source_directory=project_folder, \n", + " script='run_explainer.py', \n", + " run_config=run_config) \n", + "run = experiment.submit(config=src)\n", + "run" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%time\n", + "# Shows output of the run on stdout.\n", + "run.wait_for_completion(show_output=True)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "run.get_metrics()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Provision as a persistent compute target (Advanced)\n", + "\n", + "You can also specify additional properties or change defaults while provisioning AmlCompute using a more advanced configuration. This is useful when you want a dedicated cluster of 4 nodes (for example you can set the min_nodes and max_nodes to 4), or want the compute to be within an existing VNet in your subscription.\n", + "\n", + "In addition to `vm_size` and `max_nodes`, you can specify:\n", + "* `min_nodes`: Minimum nodes (default 0 nodes) to downscale to while running a job on AmlCompute\n", + "* `vm_priority`: Choose between 'dedicated' (default) and 'lowpriority' VMs when provisioning AmlCompute. Low Priority VMs use Azure's excess capacity and are thus cheaper but risk your run being pre-empted\n", + "* `idle_seconds_before_scaledown`: Idle time (default 120 seconds) to wait after run completion before auto-scaling to min_nodes\n", + "* `vnet_resourcegroup_name`: Resource group of the **existing** VNet within which AmlCompute should be provisioned\n", + "* `vnet_name`: Name of VNet\n", + "* `subnet_name`: Name of SubNet within the VNet" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core.compute import ComputeTarget, AmlCompute\n", + "from azureml.core.compute_target import ComputeTargetException\n", + "\n", + "# Choose a name for your CPU cluster\n", + "cpu_cluster_name = \"cpucluster\"\n", + "\n", + "# Verify that cluster does not exist already\n", + "try:\n", + " cpu_cluster = ComputeTarget(workspace=ws, name=cpu_cluster_name)\n", + " print('Found existing cluster, use it.')\n", + "except ComputeTargetException:\n", + " compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_D2_V2',\n", + " vm_priority='lowpriority',\n", + " min_nodes=2,\n", + " max_nodes=4,\n", + " idle_seconds_before_scaledown='300',\n", + " vnet_resourcegroup_name='',\n", + " vnet_name='',\n", + " subnet_name='')\n", + " cpu_cluster = ComputeTarget.create(ws, cpu_cluster_name, compute_config)\n", + "\n", + "cpu_cluster.wait_for_completion(show_output=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Configure & Run" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core.runconfig import RunConfiguration\n", + "from azureml.core.conda_dependencies import CondaDependencies\n", + "\n", + "# create a new RunConfig object\n", + "run_config = RunConfiguration(framework=\"python\")\n", + "\n", + "# Set compute target to AmlCompute target created in previous step\n", + "run_config.target = cpu_cluster.name\n", + "\n", + "# enable Docker \n", + "run_config.environment.docker.enabled = True\n", + "\n", + "azureml_pip_packages = [\n", + " 'azureml-defaults', 'azureml-contrib-explain-model', 'azureml-core', 'azureml-telemetry',\n", + " 'azureml-explain-model'\n", + "]\n", + "\n", + "# specify CondaDependencies obj\n", + "run_config.environment.python.conda_dependencies = CondaDependencies.create(conda_packages=['scikit-learn'],\n", + " pip_packages=azureml_pip_packages)\n", + "\n", + "from azureml.core import Run\n", + "from azureml.core import ScriptRunConfig\n", + "\n", + "src = ScriptRunConfig(source_directory=project_folder, \n", + " script='run_explainer.py', \n", + " run_config=run_config) \n", + "run = experiment.submit(config=src)\n", + "run" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%time\n", + "# Shows output of the run on stdout.\n", + "run.wait_for_completion(show_output=True)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "run.get_metrics()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.contrib.explain.model.explanation.explanation_client import ExplanationClient\n", + "\n", + "client = ExplanationClient.from_run(run)\n", + "# Get the top k (e.g., 4) most important features with their importance values\n", + "explanation = client.download_model_explanation(top_k=4)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Additional operations to perform on AmlCompute\n", + "\n", + "You can perform more operations on AmlCompute such as updating the node counts or deleting the compute. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Get_status () gets the latest status of the AmlCompute target\n", + "cpu_cluster.get_status().serialize()\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Update () takes in the min_nodes, max_nodes and idle_seconds_before_scaledown and updates the AmlCompute target\n", + "# cpu_cluster.update(min_nodes=1)\n", + "# cpu_cluster.update(max_nodes=10)\n", + "cpu_cluster.update(idle_seconds_before_scaledown=300)\n", + "# cpu_cluster.update(min_nodes=2, max_nodes=4, idle_seconds_before_scaledown=600)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Delete () is used to deprovision and delete the AmlCompute target. Useful if you want to re-use the compute name \n", + "# 'cpucluster' in this case but use a different VM family for instance.\n", + "\n", + "# cpu_cluster.delete()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Download Model Explanation Data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.contrib.explain.model.explanation.explanation_client import ExplanationClient\n", + "\n", + "# Get model explanation data\n", + "client = ExplanationClient.from_run(run)\n", + "explanation = client.download_model_explanation()\n", + "local_importance_values = explanation.local_importance_values\n", + "expected_values = explanation.expected_values\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Or you can use the saved run.id to retrive the feature importance values\n", + "client = ExplanationClient.from_run_id(ws, experiment_name, run.id)\n", + "explanation = client.download_model_explanation()\n", + "local_importance_values = explanation.local_importance_values\n", + "expected_values = explanation.expected_values" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Get the top k (e.g., 4) most important features with their importance values\n", + "explanation = client.download_model_explanation(top_k=4)\n", + "global_importance_values = explanation.get_ranked_global_values()\n", + "global_importance_names = explanation.get_ranked_global_names()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "print('global importance values: {}'.format(global_importance_values))\n", + "print('global importance names: {}'.format(global_importance_names))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Success!\n", + "Great, you are ready to move on to the remaining notebooks." + ] + } ], - "kernelspec": { - "display_name": "Python 3.6", - "language": "python", - "name": "python36" + "metadata": { + "authors": [ + { + "name": "mesameki" + } + ], + "kernelspec": { + "display_name": "Python 3.6", + "language": "python", + "name": "python36" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.8" + } }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.8" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} + "nbformat": 4, + "nbformat_minor": 2 +} \ No newline at end of file diff --git a/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-binary-classification.ipynb b/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-binary-classification.ipynb index d5275b4e..2c57d6a6 100644 --- a/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-binary-classification.ipynb +++ b/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-binary-classification.ipynb @@ -1,265 +1,279 @@ { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Breast cancer diagnosis classification with scikit-learn (run model explainer locally)" - ] - }, - { + "cells": [ + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-binary-classification.png)" - ] + "# Breast cancer diagnosis classification with scikit-learn (run model explainer locally)" + ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Copyright (c) Microsoft Corporation. All rights reserved.\n", - "\n", - "Licensed under the MIT License." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Explain a model with the AML explain-model package\n", - "\n", - "1. Train a SVM classification model using Scikit-learn\n", - "2. Run 'explain_model' with full data in local mode, which doesn't contact any Azure services\n", - "3. Run 'explain_model' with summarized data in local mode, which doesn't contact any Azure services\n", - "4. Visualize the global and local explanations with the visualization dashboard." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from sklearn.datasets import load_breast_cancer\n", - "from sklearn import svm\n", - "from azureml.explain.model.tabular_explainer import TabularExplainer" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 1. Run model explainer locally with full data" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Load the breast cancer diagnosis data" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "breast_cancer_data = load_breast_cancer()\n", - "classes = breast_cancer_data.target_names.tolist()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Split data into train and test\n", - "from sklearn.model_selection import train_test_split\n", - "x_train, x_test, y_train, y_test = train_test_split(breast_cancer_data.data, breast_cancer_data.target, test_size=0.2, random_state=0)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Train a SVM classification model, which you want to explain" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "clf = svm.SVC(gamma=0.001, C=100., probability=True)\n", - "model = clf.fit(x_train, y_train)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain predictions on your local machine" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tabular_explainer = TabularExplainer(model, x_train, features=breast_cancer_data.feature_names, classes=classes)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain overall model predictions (global explanation)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Passing in test dataset for evaluation examples - note it must be a representative sample of the original data\n", - "# x_train can be passed as well, but with more examples explanations will take longer although they may be more accurate\n", - "global_explanation = tabular_explainer.explain_global(x_test)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Sorted SHAP values\n", - "print('ranked global importance values: {}'.format(global_explanation.get_ranked_global_values()))\n", - "# Corresponding feature names\n", - "print('ranked global importance names: {}'.format(global_explanation.get_ranked_global_names()))\n", - "# feature ranks (based on original order of features)\n", - "print('global importance rank: {}'.format(global_explanation.global_importance_rank))\n", - "# per class feature names\n", - "print('ranked per class feature names: {}'.format(global_explanation.get_ranked_per_class_names()))\n", - "# per class feature importance values\n", - "print('ranked per class feature values: {}'.format(global_explanation.get_ranked_per_class_values()))" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "dict(zip(global_explanation.get_ranked_global_names(), global_explanation.get_ranked_global_values()))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain overall model predictions as a collection of local (instance-level) explanations" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# feature shap values for all features and all data points in the training data\n", - "print('local importance values: {}'.format(global_explanation.local_importance_values))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain local data points (individual instances)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# explain the first member of the test set\n", - "instance_num = 0\n", - "local_explanation = tabular_explainer.explain_local(x_test[instance_num,:])" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# get the prediction for the first member of the test set and explain why model made that prediction\n", - "prediction_value = clf.predict(x_test)[instance_num]\n", - "\n", - "sorted_local_importance_values = local_explanation.get_ranked_local_values()[prediction_value]\n", - "sorted_local_importance_names = local_explanation.get_ranked_local_names()[prediction_value]\n", - "\n", - "\n", - "dict(zip(sorted_local_importance_names, sorted_local_importance_values))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 2. Load visualization dashboard" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.contrib.explain.model.visualize import ExplanationDashboard" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "ExplanationDashboard(global_explanation, model, x_test)" - ] - } - ], - "metadata": { - "authors": [ - { - "name": "mesameki" - } + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-binary-classification.png)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) Microsoft Corporation. All rights reserved.\n", + "\n", + "Licensed under the MIT License." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Explain a model with the AML explain-model package\n", + "\n", + "1. Train a SVM classification model using Scikit-learn\n", + "2. Run 'explain_model' with full data in local mode, which doesn't contact any Azure services\n", + "3. Run 'explain_model' with summarized data in local mode, which doesn't contact any Azure services\n", + "4. Visualize the global and local explanations with the visualization dashboard." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from sklearn.datasets import load_breast_cancer\n", + "from sklearn import svm\n", + "from azureml.explain.model.tabular_explainer import TabularExplainer" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 1. Run model explainer locally with full data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Load the breast cancer diagnosis data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "breast_cancer_data = load_breast_cancer()\n", + "classes = breast_cancer_data.target_names.tolist()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Split data into train and test\n", + "from sklearn.model_selection import train_test_split\n", + "x_train, x_test, y_train, y_test = train_test_split(breast_cancer_data.data, breast_cancer_data.target, test_size=0.2, random_state=0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Train a SVM classification model, which you want to explain" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "clf = svm.SVC(gamma=0.001, C=100., probability=True)\n", + "model = clf.fit(x_train, y_train)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain predictions on your local machine" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tabular_explainer = TabularExplainer(model, x_train, features=breast_cancer_data.feature_names, classes=classes)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain overall model predictions (global explanation)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Passing in test dataset for evaluation examples - note it must be a representative sample of the original data\n", + "# x_train can be passed as well, but with more examples explanations will take longer although they may be more accurate\n", + "global_explanation = tabular_explainer.explain_global(x_test)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Sorted SHAP values\n", + "print('ranked global importance values: {}'.format(global_explanation.get_ranked_global_values()))\n", + "# Corresponding feature names\n", + "print('ranked global importance names: {}'.format(global_explanation.get_ranked_global_names()))\n", + "# feature ranks (based on original order of features)\n", + "print('global importance rank: {}'.format(global_explanation.global_importance_rank))\n", + "# per class feature names\n", + "print('ranked per class feature names: {}'.format(global_explanation.get_ranked_per_class_names()))\n", + "# per class feature importance values\n", + "print('ranked per class feature values: {}'.format(global_explanation.get_ranked_per_class_values()))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "dict(zip(global_explanation.get_ranked_global_names(), global_explanation.get_ranked_global_values()))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain overall model predictions as a collection of local (instance-level) explanations" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# feature shap values for all features and all data points in the training data\n", + "print('local importance values: {}'.format(global_explanation.local_importance_values))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain local data points (individual instances)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# explain the first member of the test set\n", + "instance_num = 0\n", + "local_explanation = tabular_explainer.explain_local(x_test[instance_num,:])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# get the prediction for the first member of the test set and explain why model made that prediction\n", + "prediction_value = clf.predict(x_test)[instance_num]\n", + "\n", + "sorted_local_importance_values = local_explanation.get_ranked_local_values()[prediction_value]\n", + "sorted_local_importance_names = local_explanation.get_ranked_local_names()[prediction_value]\n", + "\n", + "\n", + "dict(zip(sorted_local_importance_names, sorted_local_importance_values))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 2. Load visualization dashboard" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Note you will need to have extensions enabled prior to jupyter kernel starting\n", + "!jupyter nbextension install --py --sys-prefix azureml.contrib.explain.model.visualize\n", + "!jupyter nbextension enable --py --sys-prefix azureml.contrib.explain.model.visualize\n", + "# Or, in Jupyter Labs, uncomment below\n", + "# jupyter labextension install @jupyter-widgets/jupyterlab-manager\n", + "# jupyter labextension install microsoft-mli-widget" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.contrib.explain.model.visualize import ExplanationDashboard" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ExplanationDashboard(global_explanation, model, x_test)" + ] + } ], - "kernelspec": { - "display_name": "Python 3.6", - "language": "python", - "name": "python36" + "metadata": { + "authors": [ + { + "name": "mesameki" + } + ], + "kernelspec": { + "display_name": "Python 3.6", + "language": "python", + "name": "python36" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.8" + } }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.8" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} + "nbformat": 4, + "nbformat_minor": 2 +} \ No newline at end of file diff --git a/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-multiclass-classification.ipynb b/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-multiclass-classification.ipynb index eed8e9e8..0f8dd7ce 100644 --- a/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-multiclass-classification.ipynb +++ b/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-multiclass-classification.ipynb @@ -1,266 +1,280 @@ { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Iris flower classification with scikit-learn (run model explainer locally)" - ] - }, - { + "cells": [ + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-multiclass-classification.png)" - ] + "# Iris flower classification with scikit-learn (run model explainer locally)" + ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Copyright (c) Microsoft Corporation. All rights reserved.\n", - "\n", - "Licensed under the MIT License." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Explain a model with the AML explain-model package\n", - "\n", - "1. Train a SVM classification model using Scikit-learn\n", - "2. Run 'explain_model' with full data in local mode, which doesn't contact any Azure services\n", - "3. Run 'explain_model' with summarized data in local mode, which doesn't contact any Azure services\n", - "4. Visualize the global and local explanations with the visualization dashboard." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from sklearn.datasets import load_iris\n", - "from sklearn import svm\n", - "from azureml.explain.model.tabular_explainer import TabularExplainer" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 1. Run model explainer locally with full data" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Load the breast cancer diagnosis data" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "iris = load_iris()\n", - "X = iris['data']\n", - "y = iris['target']\n", - "classes = iris['target_names']\n", - "feature_names = iris['feature_names']" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Split data into train and test\n", - "from sklearn.model_selection import train_test_split\n", - "x_train, x_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Train a SVM classification model, which you want to explain" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "clf = svm.SVC(gamma=0.001, C=100., probability=True)\n", - "model = clf.fit(x_train, y_train)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain predictions on your local machine" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tabular_explainer = TabularExplainer(model, x_train, features = feature_names, classes=classes)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain overall model predictions (global explanation)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "global_explanation = tabular_explainer.explain_global(x_test)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Sorted SHAP values\n", - "print('ranked global importance values: {}'.format(global_explanation.get_ranked_global_values()))\n", - "# Corresponding feature names\n", - "print('ranked global importance names: {}'.format(global_explanation.get_ranked_global_names()))\n", - "# feature ranks (based on original order of features)\n", - "print('global importance rank: {}'.format(global_explanation.global_importance_rank))\n", - "# per class feature names\n", - "print('ranked per class feature names: {}'.format(global_explanation.get_ranked_per_class_names()))\n", - "# per class feature importance values\n", - "print('ranked per class feature values: {}'.format(global_explanation.get_ranked_per_class_values()))" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "dict(zip(global_explanation.get_ranked_global_names(), global_explanation.get_ranked_global_values()))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain overall model predictions as a collection of local (instance-level) explanations" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# feature shap values for all features and all data points in the training data\n", - "print('local importance values: {}'.format(global_explanation.local_importance_values))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain local data points (individual instances)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# explain the first member of the test set\n", - "instance_num = 0\n", - "local_explanation = tabular_explainer.explain_local(x_test[instance_num,:])" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# get the prediction for the first member of the test set and explain why model made that prediction\n", - "prediction_value = clf.predict(x_test)[instance_num]\n", - "\n", - "sorted_local_importance_values = local_explanation.get_ranked_local_values()[prediction_value]\n", - "sorted_local_importance_names = local_explanation.get_ranked_local_names()[prediction_value]\n", - "\n", - "\n", - "dict(zip(sorted_local_importance_names, sorted_local_importance_values))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Load visualization dashboard" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.contrib.explain.model.visualize import ExplanationDashboard" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "ExplanationDashboard(global_explanation, model, x_test)" - ] - } - ], - "metadata": { - "authors": [ - { - "name": "mesameki" - } + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-multiclass-classification.png)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) Microsoft Corporation. All rights reserved.\n", + "\n", + "Licensed under the MIT License." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Explain a model with the AML explain-model package\n", + "\n", + "1. Train a SVM classification model using Scikit-learn\n", + "2. Run 'explain_model' with full data in local mode, which doesn't contact any Azure services\n", + "3. Run 'explain_model' with summarized data in local mode, which doesn't contact any Azure services\n", + "4. Visualize the global and local explanations with the visualization dashboard." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from sklearn.datasets import load_iris\n", + "from sklearn import svm\n", + "from azureml.explain.model.tabular_explainer import TabularExplainer" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 1. Run model explainer locally with full data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Load the breast cancer diagnosis data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "iris = load_iris()\n", + "X = iris['data']\n", + "y = iris['target']\n", + "classes = iris['target_names']\n", + "feature_names = iris['feature_names']" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Split data into train and test\n", + "from sklearn.model_selection import train_test_split\n", + "x_train, x_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Train a SVM classification model, which you want to explain" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "clf = svm.SVC(gamma=0.001, C=100., probability=True)\n", + "model = clf.fit(x_train, y_train)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain predictions on your local machine" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tabular_explainer = TabularExplainer(model, x_train, features = feature_names, classes=classes)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain overall model predictions (global explanation)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "global_explanation = tabular_explainer.explain_global(x_test)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Sorted SHAP values\n", + "print('ranked global importance values: {}'.format(global_explanation.get_ranked_global_values()))\n", + "# Corresponding feature names\n", + "print('ranked global importance names: {}'.format(global_explanation.get_ranked_global_names()))\n", + "# feature ranks (based on original order of features)\n", + "print('global importance rank: {}'.format(global_explanation.global_importance_rank))\n", + "# per class feature names\n", + "print('ranked per class feature names: {}'.format(global_explanation.get_ranked_per_class_names()))\n", + "# per class feature importance values\n", + "print('ranked per class feature values: {}'.format(global_explanation.get_ranked_per_class_values()))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "dict(zip(global_explanation.get_ranked_global_names(), global_explanation.get_ranked_global_values()))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain overall model predictions as a collection of local (instance-level) explanations" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# feature shap values for all features and all data points in the training data\n", + "print('local importance values: {}'.format(global_explanation.local_importance_values))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain local data points (individual instances)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# explain the first member of the test set\n", + "instance_num = 0\n", + "local_explanation = tabular_explainer.explain_local(x_test[instance_num,:])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# get the prediction for the first member of the test set and explain why model made that prediction\n", + "prediction_value = clf.predict(x_test)[instance_num]\n", + "\n", + "sorted_local_importance_values = local_explanation.get_ranked_local_values()[prediction_value]\n", + "sorted_local_importance_names = local_explanation.get_ranked_local_names()[prediction_value]\n", + "\n", + "\n", + "dict(zip(sorted_local_importance_names, sorted_local_importance_values))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Load visualization dashboard" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Note you will need to have extensions enabled prior to jupyter kernel starting\n", + "!jupyter nbextension install --py --sys-prefix azureml.contrib.explain.model.visualize\n", + "!jupyter nbextension enable --py --sys-prefix azureml.contrib.explain.model.visualize\n", + "# Or, in Jupyter Labs, uncomment below\n", + "# jupyter labextension install @jupyter-widgets/jupyterlab-manager\n", + "# jupyter labextension install microsoft-mli-widget" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.contrib.explain.model.visualize import ExplanationDashboard" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ExplanationDashboard(global_explanation, model, x_test)" + ] + } ], - "kernelspec": { - "display_name": "Python 3.6", - "language": "python", - "name": "python36" + "metadata": { + "authors": [ + { + "name": "mesameki" + } + ], + "kernelspec": { + "display_name": "Python 3.6", + "language": "python", + "name": "python36" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.8" + } }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.8" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} + "nbformat": 4, + "nbformat_minor": 2 +} \ No newline at end of file diff --git a/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-regression.ipynb b/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-regression.ipynb index 7b2bf8f0..926144fe 100644 --- a/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-regression.ipynb +++ b/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-regression.ipynb @@ -1,258 +1,272 @@ { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Boston Housing Price Prediction with scikit-learn (run model explainer locally)" - ] - }, - { + "cells": [ + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-regression.png)" - ] + "# Boston Housing Price Prediction with scikit-learn (run model explainer locally)" + ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Copyright (c) Microsoft Corporation. All rights reserved.\n", - "\n", - "Licensed under the MIT License." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Explain a model with the AML explain-model package\n", - "\n", - "1. Train a GradientBoosting regression model using Scikit-learn\n", - "2. Run 'explain_model' with full dataset in local mode, which doesn't contact any Azure services.\n", - "3. Run 'explain_model' with summarized dataset in local mode, which doesn't contact any Azure services.\n", - "4. Visualize the global and local explanations with the visualization dashboard." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from sklearn import datasets\n", - "from sklearn.ensemble import GradientBoostingRegressor\n", - "from azureml.explain.model.tabular_explainer import TabularExplainer" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 1. Run model explainer locally with full data" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Load the Boston house price data" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "boston_data = datasets.load_boston()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Split data into train and test\n", - "from sklearn.model_selection import train_test_split\n", - "x_train, x_test, y_train, y_test = train_test_split(boston_data.data, boston_data.target, test_size=0.2, random_state=0)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Train a GradientBoosting Regression model, which you want to explain" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "reg = GradientBoostingRegressor(n_estimators=100, max_depth=4,\n", - " learning_rate=0.1, loss='huber',\n", - " random_state=1)\n", - "model = reg.fit(x_train, y_train)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain predictions on your local machine" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tabular_explainer = TabularExplainer(model, x_train, features = boston_data.feature_names)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain overall model predictions (global explanation)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Passing in test dataset for evaluation examples - note it must be a representative sample of the original data\n", - "# x_train can be passed as well, but with more examples explanations will take longer although they may be more accurate\n", - "global_explanation = tabular_explainer.explain_global(x_test)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Sorted SHAP values \n", - "print('ranked global importance values: {}'.format(global_explanation.get_ranked_global_values()))\n", - "# Corresponding feature names\n", - "print('ranked global importance names: {}'.format(global_explanation.get_ranked_global_names()))\n", - "# feature ranks (based on original order of features)\n", - "print('global importance rank: {}'.format(global_explanation.global_importance_rank))" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "dict(zip(global_explanation.get_ranked_global_names(), global_explanation.get_ranked_global_values()))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain overall model predictions as a collection of local (instance-level) explanations" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# feature shap values for all features and all data points in the training data\n", - "print('local importance values: {}'.format(global_explanation.local_importance_values))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain local data points (individual instances)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "local_explanation = tabular_explainer.explain_local(x_test[0,:])" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# sorted local feature importance information; reflects the original feature order\n", - "sorted_local_importance_names = local_explanation.get_ranked_local_names()\n", - "sorted_local_importance_values = local_explanation.get_ranked_local_values()\n", - "\n", - "print('sorted local importance names: {}'.format(sorted_local_importance_names))\n", - "print('sorted local importance values: {}'.format(sorted_local_importance_values))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Load visualization dashboard" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.contrib.explain.model.visualize import ExplanationDashboard" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "ExplanationDashboard(global_explanation, model, x_test)" - ] - } - ], - "metadata": { - "authors": [ - { - "name": "mesameki" - } + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/explain-model/explain-tabular-data-local/explain-local-sklearn-regression.png)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) Microsoft Corporation. All rights reserved.\n", + "\n", + "Licensed under the MIT License." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Explain a model with the AML explain-model package\n", + "\n", + "1. Train a GradientBoosting regression model using Scikit-learn\n", + "2. Run 'explain_model' with full dataset in local mode, which doesn't contact any Azure services.\n", + "3. Run 'explain_model' with summarized dataset in local mode, which doesn't contact any Azure services.\n", + "4. Visualize the global and local explanations with the visualization dashboard." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from sklearn import datasets\n", + "from sklearn.ensemble import GradientBoostingRegressor\n", + "from azureml.explain.model.tabular_explainer import TabularExplainer" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 1. Run model explainer locally with full data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Load the Boston house price data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "boston_data = datasets.load_boston()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Split data into train and test\n", + "from sklearn.model_selection import train_test_split\n", + "x_train, x_test, y_train, y_test = train_test_split(boston_data.data, boston_data.target, test_size=0.2, random_state=0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Train a GradientBoosting Regression model, which you want to explain" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "reg = GradientBoostingRegressor(n_estimators=100, max_depth=4,\n", + " learning_rate=0.1, loss='huber',\n", + " random_state=1)\n", + "model = reg.fit(x_train, y_train)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain predictions on your local machine" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tabular_explainer = TabularExplainer(model, x_train, features = boston_data.feature_names)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain overall model predictions (global explanation)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Passing in test dataset for evaluation examples - note it must be a representative sample of the original data\n", + "# x_train can be passed as well, but with more examples explanations will take longer although they may be more accurate\n", + "global_explanation = tabular_explainer.explain_global(x_test)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Sorted SHAP values \n", + "print('ranked global importance values: {}'.format(global_explanation.get_ranked_global_values()))\n", + "# Corresponding feature names\n", + "print('ranked global importance names: {}'.format(global_explanation.get_ranked_global_names()))\n", + "# feature ranks (based on original order of features)\n", + "print('global importance rank: {}'.format(global_explanation.global_importance_rank))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "dict(zip(global_explanation.get_ranked_global_names(), global_explanation.get_ranked_global_values()))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain overall model predictions as a collection of local (instance-level) explanations" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# feature shap values for all features and all data points in the training data\n", + "print('local importance values: {}'.format(global_explanation.local_importance_values))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain local data points (individual instances)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "local_explanation = tabular_explainer.explain_local(x_test[0,:])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# sorted local feature importance information; reflects the original feature order\n", + "sorted_local_importance_names = local_explanation.get_ranked_local_names()\n", + "sorted_local_importance_values = local_explanation.get_ranked_local_values()\n", + "\n", + "print('sorted local importance names: {}'.format(sorted_local_importance_names))\n", + "print('sorted local importance values: {}'.format(sorted_local_importance_values))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Load visualization dashboard" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Note you will need to have extensions enabled prior to jupyter kernel starting\n", + "!jupyter nbextension install --py --sys-prefix azureml.contrib.explain.model.visualize\n", + "!jupyter nbextension enable --py --sys-prefix azureml.contrib.explain.model.visualize\n", + "# Or, in Jupyter Labs, uncomment below\n", + "# jupyter labextension install @jupyter-widgets/jupyterlab-manager\n", + "# jupyter labextension install microsoft-mli-widget" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.contrib.explain.model.visualize import ExplanationDashboard" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ExplanationDashboard(global_explanation, model, x_test)" + ] + } ], - "kernelspec": { - "display_name": "Python 3.6", - "language": "python", - "name": "python36" + "metadata": { + "authors": [ + { + "name": "mesameki" + } + ], + "kernelspec": { + "display_name": "Python 3.6", + "language": "python", + "name": "python36" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.8" + } }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.8" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} + "nbformat": 4, + "nbformat_minor": 2 +} \ No newline at end of file diff --git a/how-to-use-azureml/explain-model/explain-tabular-data-raw-features/explain-sklearn-raw-features.ipynb b/how-to-use-azureml/explain-model/explain-tabular-data-raw-features/explain-sklearn-raw-features.ipynb index 00b11dfe..b98487cc 100644 --- a/how-to-use-azureml/explain-model/explain-tabular-data-raw-features/explain-sklearn-raw-features.ipynb +++ b/how-to-use-azureml/explain-model/explain-tabular-data-raw-features/explain-sklearn-raw-features.ipynb @@ -1,288 +1,302 @@ { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Summary\n", - "From raw data that is a mixture of categoricals and numeric, featurize the categoricals using one hot encoding. Use tabular explainer to get explain object and then get raw feature importances" - ] - }, - { + "cells": [ + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/explain-model/explain-tabular-data-raw-features/explain-sklearn-raw-features.png)" - ] + "# Summary\n", + "From raw data that is a mixture of categoricals and numeric, featurize the categoricals using one hot encoding. Use tabular explainer to get explain object and then get raw feature importances" + ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Copyright (c) Microsoft Corporation. All rights reserved.\n", - "\n", - "Licensed under the MIT License." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Explain a model with the AML explain-model package on raw features\n", - "\n", - "1. Train a Logistic Regression model using Scikit-learn\n", - "2. Run 'explain_model' with full dataset in local mode, which doesn't contact any Azure services.\n", - "3. Run 'explain_model' with summarized dataset in local mode, which doesn't contact any Azure services.\n", - "4. Visualize the global and local explanations with the visualization dashboard." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "This example needs sklearn-pandas. If it is not installed, uncomment and run the following line." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "#!pip install sklearn-pandas" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from sklearn.pipeline import Pipeline\n", - "from sklearn.impute import SimpleImputer\n", - "from sklearn.preprocessing import StandardScaler, OneHotEncoder\n", - "from sklearn.linear_model import LogisticRegression\n", - "from azureml.explain.model.tabular_explainer import TabularExplainer\n", - "from sklearn_pandas import DataFrameMapper\n", - "import pandas as pd\n", - "import numpy as np" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "titanic_url = ('https://raw.githubusercontent.com/amueller/'\n", - " 'scipy-2017-sklearn/091d371/notebooks/datasets/titanic3.csv')\n", - "data = pd.read_csv(titanic_url)\n", - "# fill missing values\n", - "data = data.fillna(method=\"ffill\")\n", - "data = data.fillna(method=\"bfill\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 1. Run model explainer locally with full data" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Similar to example [here](https://scikit-learn.org/stable/auto_examples/compose/plot_column_transformer_mixed_types.html#sphx-glr-auto-examples-compose-plot-column-transformer-mixed-types-py), use a subset of columns" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from sklearn.model_selection import train_test_split\n", - "\n", - "numeric_features = ['age', 'fare']\n", - "categorical_features = ['embarked', 'sex', 'pclass']\n", - "\n", - "y = data['survived'].values\n", - "X = data[categorical_features + numeric_features]\n", - "\n", - "x_train, x_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from sklearn.pipeline import Pipeline\n", - "from sklearn.impute import SimpleImputer\n", - "from sklearn.preprocessing import StandardScaler, OneHotEncoder\n", - "from sklearn_pandas import DataFrameMapper\n", - "\n", - "# Impute, standardize the numeric features and one-hot encode the categorical features. \n", - "\n", - "transformations = [\n", - " ([\"age\", \"fare\"], Pipeline(steps=[\n", - " ('imputer', SimpleImputer(strategy='median')),\n", - " ('scaler', StandardScaler())\n", - " ])),\n", - " ([\"embarked\"], Pipeline(steps=[\n", - " (\"imputer\", SimpleImputer(strategy='constant', fill_value='missing')), \n", - " (\"encoder\", OneHotEncoder(sparse=False))])),\n", - " ([\"sex\", \"pclass\"], OneHotEncoder(sparse=False)) \n", - "]\n", - "\n", - "\n", - "# Append classifier to preprocessing pipeline.\n", - "# Now we have a full prediction pipeline.\n", - "clf = Pipeline(steps=[('preprocessor', DataFrameMapper(transformations)),\n", - " ('classifier', LogisticRegression(solver='lbfgs'))])" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Train a Logistic Regression model, which you want to explain" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "model = clf.fit(x_train, y_train)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain predictions on your local machine" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tabular_explainer = TabularExplainer(clf.steps[-1][1], initialization_examples=x_train, features=x_train.columns, transformations=transformations)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Passing in test dataset for evaluation examples - note it must be a representative sample of the original data\n", - "# x_train can be passed as well, but with more examples explanations will take longer although they may be more accurate\n", - "global_explanation = tabular_explainer.explain_global(x_test)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "sorted_global_importance_values = global_explanation.get_ranked_global_values()\n", - "sorted_global_importance_names = global_explanation.get_ranked_global_names()\n", - "dict(zip(sorted_global_importance_names, sorted_global_importance_values))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain overall model predictions as a collection of local (instance-level) explanations" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# explain the first member of the test set\n", - "local_explanation = tabular_explainer.explain_local(x_test[:1])" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# get the prediction for the first member of the test set and explain why model made that prediction\n", - "prediction_value = clf.predict(x_test)[0]\n", - "\n", - "sorted_local_importance_values = local_explanation.get_ranked_local_values()[prediction_value]\n", - "sorted_local_importance_names = local_explanation.get_ranked_local_names()[prediction_value]\n", - "\n", - "# Sorted local SHAP values\n", - "print('ranked local importance values: {}'.format(sorted_local_importance_values))\n", - "# Corresponding feature names\n", - "print('ranked local importance names: {}'.format(sorted_local_importance_names))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 2. Load visualization dashboard" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.contrib.explain.model.visualize import ExplanationDashboard" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "ExplanationDashboard(global_explanation, model, x_test)" - ] - } - ], - "metadata": { - "authors": [ - { - "name": "mesameki" - } + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) Microsoft Corporation. All rights reserved.\n", + "\n", + "Licensed under the MIT License." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/explain-model/explain-tabular-data-raw-features/explain-sklearn-raw-features.png)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Explain a model with the AML explain-model package on raw features\n", + "\n", + "1. Train a Logistic Regression model using Scikit-learn\n", + "2. Run 'explain_model' with full dataset in local mode, which doesn't contact any Azure services.\n", + "3. Run 'explain_model' with summarized dataset in local mode, which doesn't contact any Azure services.\n", + "4. Visualize the global and local explanations with the visualization dashboard." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This example needs sklearn-pandas. If it is not installed, uncomment and run the following line." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#!pip install sklearn-pandas" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from sklearn.pipeline import Pipeline\n", + "from sklearn.impute import SimpleImputer\n", + "from sklearn.preprocessing import StandardScaler, OneHotEncoder\n", + "from sklearn.linear_model import LogisticRegression\n", + "from azureml.explain.model.tabular_explainer import TabularExplainer\n", + "from sklearn_pandas import DataFrameMapper\n", + "import pandas as pd\n", + "import numpy as np" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "titanic_url = ('https://raw.githubusercontent.com/amueller/'\n", + " 'scipy-2017-sklearn/091d371/notebooks/datasets/titanic3.csv')\n", + "data = pd.read_csv(titanic_url)\n", + "# fill missing values\n", + "data = data.fillna(method=\"ffill\")\n", + "data = data.fillna(method=\"bfill\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 1. Run model explainer locally with full data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Similar to example [here](https://scikit-learn.org/stable/auto_examples/compose/plot_column_transformer_mixed_types.html#sphx-glr-auto-examples-compose-plot-column-transformer-mixed-types-py), use a subset of columns" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from sklearn.model_selection import train_test_split\n", + "\n", + "numeric_features = ['age', 'fare']\n", + "categorical_features = ['embarked', 'sex', 'pclass']\n", + "\n", + "y = data['survived'].values\n", + "X = data[categorical_features + numeric_features]\n", + "\n", + "x_train, x_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from sklearn.pipeline import Pipeline\n", + "from sklearn.impute import SimpleImputer\n", + "from sklearn.preprocessing import StandardScaler, OneHotEncoder\n", + "from sklearn_pandas import DataFrameMapper\n", + "\n", + "# Impute, standardize the numeric features and one-hot encode the categorical features. \n", + "\n", + "transformations = [\n", + " ([\"age\", \"fare\"], Pipeline(steps=[\n", + " ('imputer', SimpleImputer(strategy='median')),\n", + " ('scaler', StandardScaler())\n", + " ])),\n", + " ([\"embarked\"], Pipeline(steps=[\n", + " (\"imputer\", SimpleImputer(strategy='constant', fill_value='missing')), \n", + " (\"encoder\", OneHotEncoder(sparse=False))])),\n", + " ([\"sex\", \"pclass\"], OneHotEncoder(sparse=False)) \n", + "]\n", + "\n", + "\n", + "# Append classifier to preprocessing pipeline.\n", + "# Now we have a full prediction pipeline.\n", + "clf = Pipeline(steps=[('preprocessor', DataFrameMapper(transformations)),\n", + " ('classifier', LogisticRegression(solver='lbfgs'))])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Train a Logistic Regression model, which you want to explain" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "model = clf.fit(x_train, y_train)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain predictions on your local machine" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tabular_explainer = TabularExplainer(clf.steps[-1][1], initialization_examples=x_train, features=x_train.columns, transformations=transformations)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Passing in test dataset for evaluation examples - note it must be a representative sample of the original data\n", + "# x_train can be passed as well, but with more examples explanations will take longer although they may be more accurate\n", + "global_explanation = tabular_explainer.explain_global(x_test)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "sorted_global_importance_values = global_explanation.get_ranked_global_values()\n", + "sorted_global_importance_names = global_explanation.get_ranked_global_names()\n", + "dict(zip(sorted_global_importance_names, sorted_global_importance_values))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain overall model predictions as a collection of local (instance-level) explanations" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# explain the first member of the test set\n", + "local_explanation = tabular_explainer.explain_local(x_test[:1])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# get the prediction for the first member of the test set and explain why model made that prediction\n", + "prediction_value = clf.predict(x_test)[0]\n", + "\n", + "sorted_local_importance_values = local_explanation.get_ranked_local_values()[prediction_value]\n", + "sorted_local_importance_names = local_explanation.get_ranked_local_names()[prediction_value]\n", + "\n", + "# Sorted local SHAP values\n", + "print('ranked local importance values: {}'.format(sorted_local_importance_values))\n", + "# Corresponding feature names\n", + "print('ranked local importance names: {}'.format(sorted_local_importance_names))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 2. Load visualization dashboard" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Note you will need to have extensions enabled prior to jupyter kernel starting\n", + "!jupyter nbextension install --py --sys-prefix azureml.contrib.explain.model.visualize\n", + "!jupyter nbextension enable --py --sys-prefix azureml.contrib.explain.model.visualize\n", + "# Or, in Jupyter Labs, uncomment below\n", + "# jupyter labextension install @jupyter-widgets/jupyterlab-manager\n", + "# jupyter labextension install microsoft-mli-widget" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.contrib.explain.model.visualize import ExplanationDashboard" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ExplanationDashboard(global_explanation, model, x_test)" + ] + } ], - "kernelspec": { - "display_name": "Python 3.6", - "language": "python", - "name": "python36" + "metadata": { + "authors": [ + { + "name": "mesameki" + } + ], + "kernelspec": { + "display_name": "Python 3.6", + "language": "python", + "name": "python36" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.8" + } }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.8" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} + "nbformat": 4, + "nbformat_minor": 2 +} \ No newline at end of file diff --git a/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-classification.ipynb b/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-classification.ipynb index e6bebcea..0ac1032a 100644 --- a/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-classification.ipynb +++ b/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-classification.ipynb @@ -1,262 +1,262 @@ { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Breast cancer diagnosis classification with scikit-learn (save model explanations via AML Run History)" - ] - }, - { + "cells": [ + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-classification.png)" - ] + "# Breast cancer diagnosis classification with scikit-learn (save model explanations via AML Run History)" + ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Copyright (c) Microsoft Corporation. All rights reserved.\n", - "\n", - "Licensed under the MIT License." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Explain a model with the AML explain-model package\n", - "\n", - "1. Train a SVM classification model using Scikit-learn\n", - "2. Run 'explain_model' with AML Run History, which leverages run history service to store and manage the explanation data" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from sklearn.datasets import load_breast_cancer\n", - "from sklearn import svm\n", - "from azureml.explain.model.tabular_explainer import TabularExplainer" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 1. Run model explainer locally with full data" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Load the breast cancer diagnosis data" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "breast_cancer_data = load_breast_cancer()\n", - "classes = breast_cancer_data.target_names.tolist()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Split data into train and test\n", - "from sklearn.model_selection import train_test_split\n", - "x_train, x_test, y_train, y_test = train_test_split(breast_cancer_data.data, breast_cancer_data.target, test_size=0.2, random_state=0)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Train a SVM classification model, which you want to explain" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "clf = svm.SVC(gamma=0.001, C=100., probability=True)\n", - "model = clf.fit(x_train, y_train)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain predictions on your local machine" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tabular_explainer = TabularExplainer(model, x_train, features=breast_cancer_data.feature_names, classes=classes)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain overall model predictions (global explanation)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Passing in test dataset for evaluation examples - note it must be a representative sample of the original data\n", - "# x_train can be passed as well, but with more examples explanations will take longer although they may be more accurate\n", - "global_explanation = tabular_explainer.explain_global(x_test)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 2. Save Model Explanation With AML Run History" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import azureml.core\n", - "from azureml.core import Workspace, Experiment, Run\n", - "from azureml.explain.model.tabular_explainer import TabularExplainer\n", - "from azureml.contrib.explain.model.explanation.explanation_client import ExplanationClient\n", - "# Check core SDK version number\n", - "print(\"SDK version:\", azureml.core.VERSION)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "ws = Workspace.from_config()\n", - "print('Workspace name: ' + ws.name, \n", - " 'Azure region: ' + ws.location, \n", - " 'Subscription id: ' + ws.subscription_id, \n", - " 'Resource group: ' + ws.resource_group, sep = '\\n')" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "experiment_name = 'explain_model'\n", - "experiment = Experiment(ws, experiment_name)\n", - "run = experiment.start_logging()\n", - "client = ExplanationClient.from_run(run)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Uploading model explanation data for storage or visualization in webUX\n", - "# The explanation can then be downloaded on any compute\n", - "client.upload_model_explanation(global_explanation)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Get model explanation data\n", - "explanation = client.download_model_explanation()\n", - "local_importance_values = explanation.local_importance_values\n", - "expected_values = explanation.expected_values" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Get the top k (e.g., 4) most important features with their importance values\n", - "explanation = client.download_model_explanation(top_k=4)\n", - "global_importance_values = explanation.get_ranked_global_values()\n", - "global_importance_names = explanation.get_ranked_global_names()\n", - "per_class_names = explanation.get_ranked_per_class_names()[0]\n", - "per_class_values = explanation.get_ranked_per_class_values()[0]" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "print('per class feature importance values: {}'.format(per_class_values))\n", - "print('per class feature importance names: {}'.format(per_class_names))" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "dict(zip(per_class_names, per_class_values))" - ] - } - ], - "metadata": { - "authors": [ - { - "name": "mesameki" - } + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-classification.png)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) Microsoft Corporation. All rights reserved.\n", + "\n", + "Licensed under the MIT License." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Explain a model with the AML explain-model package\n", + "\n", + "1. Train a SVM classification model using Scikit-learn\n", + "2. Run 'explain_model' with AML Run History, which leverages run history service to store and manage the explanation data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from sklearn.datasets import load_breast_cancer\n", + "from sklearn import svm\n", + "from azureml.explain.model.tabular_explainer import TabularExplainer" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 1. Run model explainer locally with full data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Load the breast cancer diagnosis data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "breast_cancer_data = load_breast_cancer()\n", + "classes = breast_cancer_data.target_names.tolist()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Split data into train and test\n", + "from sklearn.model_selection import train_test_split\n", + "x_train, x_test, y_train, y_test = train_test_split(breast_cancer_data.data, breast_cancer_data.target, test_size=0.2, random_state=0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Train a SVM classification model, which you want to explain" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "clf = svm.SVC(gamma=0.001, C=100., probability=True)\n", + "model = clf.fit(x_train, y_train)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain predictions on your local machine" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tabular_explainer = TabularExplainer(model, x_train, features=breast_cancer_data.feature_names, classes=classes)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain overall model predictions (global explanation)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Passing in test dataset for evaluation examples - note it must be a representative sample of the original data\n", + "# x_train can be passed as well, but with more examples explanations will take longer although they may be more accurate\n", + "global_explanation = tabular_explainer.explain_global(x_test)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 2. Save Model Explanation With AML Run History" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import azureml.core\n", + "from azureml.core import Workspace, Experiment, Run\n", + "from azureml.explain.model.tabular_explainer import TabularExplainer\n", + "from azureml.contrib.explain.model.explanation.explanation_client import ExplanationClient\n", + "# Check core SDK version number\n", + "print(\"SDK version:\", azureml.core.VERSION)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ws = Workspace.from_config()\n", + "print('Workspace name: ' + ws.name, \n", + " 'Azure region: ' + ws.location, \n", + " 'Subscription id: ' + ws.subscription_id, \n", + " 'Resource group: ' + ws.resource_group, sep = '\\n')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "experiment_name = 'explain_model'\n", + "experiment = Experiment(ws, experiment_name)\n", + "run = experiment.start_logging()\n", + "client = ExplanationClient.from_run(run)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Uploading model explanation data for storage or visualization in webUX\n", + "# The explanation can then be downloaded on any compute\n", + "client.upload_model_explanation(global_explanation)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Get model explanation data\n", + "explanation = client.download_model_explanation()\n", + "local_importance_values = explanation.local_importance_values\n", + "expected_values = explanation.expected_values" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Get the top k (e.g., 4) most important features with their importance values\n", + "explanation = client.download_model_explanation(top_k=4)\n", + "global_importance_values = explanation.get_ranked_global_values()\n", + "global_importance_names = explanation.get_ranked_global_names()\n", + "per_class_names = explanation.get_ranked_per_class_names()[0]\n", + "per_class_values = explanation.get_ranked_per_class_values()[0]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "print('per class feature importance values: {}'.format(per_class_values))\n", + "print('per class feature importance names: {}'.format(per_class_names))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "dict(zip(per_class_names, per_class_values))" + ] + } ], - "kernelspec": { - "display_name": "Python 3.6", - "language": "python", - "name": "python36" + "metadata": { + "authors": [ + { + "name": "mesameki" + } + ], + "kernelspec": { + "display_name": "Python 3.6", + "language": "python", + "name": "python36" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.8" + } }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.8" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} + "nbformat": 4, + "nbformat_minor": 2 +} \ No newline at end of file diff --git a/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-regression.ipynb b/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-regression.ipynb index 73cd356c..1fbdb4ea 100644 --- a/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-regression.ipynb +++ b/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-regression.ipynb @@ -1,276 +1,276 @@ { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Boston Housing Price Prediction with scikit-learn (save model explanations via AML Run History)" - ] - }, - { + "cells": [ + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-regression.png)" - ] + "# Boston Housing Price Prediction with scikit-learn (save model explanations via AML Run History)" + ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Copyright (c) Microsoft Corporation. All rights reserved.\n", - "\n", - "Licensed under the MIT License." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Explain a model with the AML explain-model package\n", - "\n", - "1. Train a GradientBoosting regression model using Scikit-learn\n", - "2. Run 'explain_model' with AML Run History, which leverages run history service to store and manage the explanation data" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Save Model Explanation With AML Run History" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "#Import Iris dataset\n", - "from sklearn import datasets\n", - "from sklearn.ensemble import GradientBoostingRegressor\n", - "\n", - "import azureml.core\n", - "from azureml.core import Workspace, Experiment, Run\n", - "from azureml.explain.model.tabular_explainer import TabularExplainer\n", - "from azureml.contrib.explain.model.explanation.explanation_client import ExplanationClient\n", - "# Check core SDK version number\n", - "print(\"SDK version:\", azureml.core.VERSION)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "ws = Workspace.from_config()\n", - "print('Workspace name: ' + ws.name, \n", - " 'Azure region: ' + ws.location, \n", - " 'Subscription id: ' + ws.subscription_id, \n", - " 'Resource group: ' + ws.resource_group, sep = '\\n')" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "experiment_name = 'explain_model'\n", - "experiment = Experiment(ws, experiment_name)\n", - "run = experiment.start_logging()\n", - "client = ExplanationClient.from_run(run)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Load the Boston house price data" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "boston_data = datasets.load_boston()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Split data into train and test\n", - "from sklearn.model_selection import train_test_split\n", - "x_train, x_test, y_train, y_test = train_test_split(boston_data.data, boston_data.target, test_size=0.2, random_state=0)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Train a GradientBoosting Regression model, which you want to explain" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "clf = GradientBoostingRegressor(n_estimators=100, max_depth=4,\n", - " learning_rate=0.1, loss='huber',\n", - " random_state=1)\n", - "model = clf.fit(x_train, y_train)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain predictions on your local machine" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tabular_explainer = TabularExplainer(model, x_train, features=boston_data.feature_names)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain overall model predictions (global explanation)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Passing in test dataset for evaluation examples - note it must be a representative sample of the original data\n", - "# x_train can be passed as well, but with more examples explanations will take longer although they may be more accurate\n", - "global_explanation = tabular_explainer.explain_global(x_test)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Uploading model explanation data for storage or visualization in webUX\n", - "# The explanation can then be downloaded on any compute\n", - "client.upload_model_explanation(global_explanation)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Get model explanation data\n", - "explanation = client.download_model_explanation()\n", - "local_importance_values = explanation.local_importance_values\n", - "expected_values = explanation.expected_values" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Print the values\n", - "print('expected values: {}'.format(expected_values))\n", - "print('local importance values: {}'.format(local_importance_values))" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Get the top k (e.g., 4) most important features with their importance values\n", - "explanation = client.download_model_explanation(top_k=4)\n", - "global_importance_values = explanation.get_ranked_global_values()\n", - "global_importance_names = explanation.get_ranked_global_names()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "print('global importance values: {}'.format(global_importance_values))\n", - "print('global importance names: {}'.format(global_importance_names))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Explain individual instance predictions (local explanation) ##### needs to get updated with the new build" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "local_explanation = tabular_explainer.explain_local(x_test[0,:])" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# local feature importance information\n", - "local_importance_values = local_explanation.local_importance_values\n", - "print('local importance values: {}'.format(local_importance_values))" - ] - } - ], - "metadata": { - "authors": [ - { - "name": "mesameki" - } + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/explain-model/explain-tabular-data-run-history/explain-run-history-sklearn-regression.png)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) Microsoft Corporation. All rights reserved.\n", + "\n", + "Licensed under the MIT License." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Explain a model with the AML explain-model package\n", + "\n", + "1. Train a GradientBoosting regression model using Scikit-learn\n", + "2. Run 'explain_model' with AML Run History, which leverages run history service to store and manage the explanation data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Save Model Explanation With AML Run History" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#Import Iris dataset\n", + "from sklearn import datasets\n", + "from sklearn.ensemble import GradientBoostingRegressor\n", + "\n", + "import azureml.core\n", + "from azureml.core import Workspace, Experiment, Run\n", + "from azureml.explain.model.tabular_explainer import TabularExplainer\n", + "from azureml.contrib.explain.model.explanation.explanation_client import ExplanationClient\n", + "# Check core SDK version number\n", + "print(\"SDK version:\", azureml.core.VERSION)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ws = Workspace.from_config()\n", + "print('Workspace name: ' + ws.name, \n", + " 'Azure region: ' + ws.location, \n", + " 'Subscription id: ' + ws.subscription_id, \n", + " 'Resource group: ' + ws.resource_group, sep = '\\n')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "experiment_name = 'explain_model'\n", + "experiment = Experiment(ws, experiment_name)\n", + "run = experiment.start_logging()\n", + "client = ExplanationClient.from_run(run)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Load the Boston house price data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "boston_data = datasets.load_boston()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Split data into train and test\n", + "from sklearn.model_selection import train_test_split\n", + "x_train, x_test, y_train, y_test = train_test_split(boston_data.data, boston_data.target, test_size=0.2, random_state=0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Train a GradientBoosting Regression model, which you want to explain" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "clf = GradientBoostingRegressor(n_estimators=100, max_depth=4,\n", + " learning_rate=0.1, loss='huber',\n", + " random_state=1)\n", + "model = clf.fit(x_train, y_train)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain predictions on your local machine" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tabular_explainer = TabularExplainer(model, x_train, features=boston_data.feature_names)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain overall model predictions (global explanation)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Passing in test dataset for evaluation examples - note it must be a representative sample of the original data\n", + "# x_train can be passed as well, but with more examples explanations will take longer although they may be more accurate\n", + "global_explanation = tabular_explainer.explain_global(x_test)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Uploading model explanation data for storage or visualization in webUX\n", + "# The explanation can then be downloaded on any compute\n", + "client.upload_model_explanation(global_explanation)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Get model explanation data\n", + "explanation = client.download_model_explanation()\n", + "local_importance_values = explanation.local_importance_values\n", + "expected_values = explanation.expected_values" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Print the values\n", + "print('expected values: {}'.format(expected_values))\n", + "print('local importance values: {}'.format(local_importance_values))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Get the top k (e.g., 4) most important features with their importance values\n", + "explanation = client.download_model_explanation(top_k=4)\n", + "global_importance_values = explanation.get_ranked_global_values()\n", + "global_importance_names = explanation.get_ranked_global_names()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "print('global importance values: {}'.format(global_importance_values))\n", + "print('global importance names: {}'.format(global_importance_names))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Explain individual instance predictions (local explanation) ##### needs to get updated with the new build" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "local_explanation = tabular_explainer.explain_local(x_test[0,:])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# local feature importance information\n", + "local_importance_values = local_explanation.local_importance_values\n", + "print('local importance values: {}'.format(local_importance_values))" + ] + } ], - "kernelspec": { - "display_name": "Python 3.6", - "language": "python", - "name": "python36" + "metadata": { + "authors": [ + { + "name": "mesameki" + } + ], + "kernelspec": { + "display_name": "Python 3.6", + "language": "python", + "name": "python36" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.8" + } }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.8" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} + "nbformat": 4, + "nbformat_minor": 2 +} \ No newline at end of file diff --git a/how-to-use-azureml/machine-learning-pipelines/README.md b/how-to-use-azureml/machine-learning-pipelines/README.md index 9a7d4667..1a120631 100644 --- a/how-to-use-azureml/machine-learning-pipelines/README.md +++ b/how-to-use-azureml/machine-learning-pipelines/README.md @@ -32,28 +32,16 @@ Azure Machine Learning Pipelines optimize for simplicity, speed, and efficiency. **Tracking and versioning**: Instead of manually tracking data and result paths as you iterate, use the pipelines SDK to explicitly name and version your data sources, inputs, and outputs as well as manage scripts and data separately for increased productivity. -## End-to-end introductory notebook series +### Notebooks -Learn about Azure Machine Learning Pipelines by following the notebooks in this directory **in sequence**: +In this directory, there are two types of notebooks: - |Notebook|Description| - |--------|-----------| - |1. [aml-pipelines-getting-started.ipynb](https://aka.ms/pl-get-started)|Get started and run Azure Machine Learning Pipeline steps in parallel and in sequence.| - |2. [aml-pipelines-with-data-dependency-steps.ipynb](https://aka.ms/pl-data-dep)|Connect pipeline steps where data produced by one step is used by subsequent steps to force an explicit dependency between the steps. | - |3. [aml-pipelines-publish-and-run-using-rest-endpoint.ipynb](https://aka.ms/pl-pub-rep)|Publish pipelines to get a REST endpoint consumeable by Python and non-Pythons clients. | - |4. [aml-pipelines-data-transfer.ipynb](https://aka.ms/pl-data-trans)|Transfer data between supported datastores in pipelines.| - |5. [aml-pipelines-use-adla-as-compute-target.ipynb](https://aka.ms/pl-adla)|Run pipelines on Azure Data Lake Analytics (ADLA).| - |6. [aml-pipelines-how-to-use-estimatorstep.ipynb](https://aka.ms/pl-estimator)|Add estimator training to a pipeline with `EstimatorStep`.| - |7. [aml-pipelines-parameter-tuning-with-hyperdrive.ipynb](https://aka.ms/pl-hyperdrive)|Hyperparameter tune in your pipelines with `HyperDriveStep`.| - |8. [aml-pipelines-how-to-use-azurebatch-to-run-a-windows-executable.ipynb](https://aka.ms/pl-azbatch)|Run custom code in an Azure Batch cluster with `AzureBatchStep`.| - |9. [aml-pipelines-setup-schedule-for-a-published-pipeline.ipynb](https://aka.ms/pl-schedule)|Schedule published pipeline job at specific intervals or after change in datastore.| - |10. [aml-pipelines-with-automated-machine-learning-step.ipynb](https://aka.ms/pl-automl)|Use automated ML in your pipelines with `AutoMLStep`.| +* The first type of notebooks will introduce you to core Azure Machine Learning Pipelines features. These notebooks below belong in this category, and are designed to go in sequence; they're all located in the "intro-to-pipelines" folder: +Take a look at [intro-to-pipelines](./intro-to-pipelines/) for the list of notebooks that introduce Azure Machine Learning concepts for you. -## Advanced scenarios +* The second type of notebooks illustrate more sophisticated scenarios, and are independent of each other. These notebooks include: - |Notebook|Description| - |--------|-----------| - |[pipeline-batch-scoring.ipynb](https://aka.ms/pl-batch-score)|Run a batch scoring job using Azure Machine Learning pipelines| - |[pipeline-style-transfer.ipynb](https://aka.ms/pl-style-trans)|| +1. [pipeline-batch-scoring.ipynb](https://aka.ms/pl-batch-score): This notebook demonstrates how to run a batch scoring job using Azure Machine Learning pipelines. +2. [pipeline-style-transfer.ipynb](https://aka.ms/pl-style-trans): This notebook demonstrates a multi-step pipeline that uses GPU compute. ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/README.png) diff --git a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-data-transfer.ipynb b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-data-transfer.ipynb index 14e6bafa..437b4d90 100644 --- a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-data-transfer.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-data-transfer.ipynb @@ -8,15 +8,13 @@ "Licensed under the MIT License." ] }, - - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-data-transfer.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-data-transfer.png)" + ] }, - { "cell_type": "markdown", "metadata": {}, @@ -62,7 +60,7 @@ "source": [ "## Initialize Workspace\n", "\n", - "Initialize a workspace object from persisted configuration.If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure the config file is present at .\\config.json\n", + "Initialize a workspace object from persisted configuration. If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure the config file is present at .\\config.json\n", "\n", "If you don't have a config.json file, please go through the configuration Notebook located here:\n", "https://github.com/Azure/MachineLearningNotebooks. \n", @@ -475,4 +473,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-getting-started.ipynb b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-getting-started.ipynb index e57964a7..942c9378 100644 --- a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-getting-started.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-getting-started.ipynb @@ -8,15 +8,13 @@ "Licensed under the MIT License." ] }, - { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-getting-started.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-getting-started.png)" + ] }, - { "cell_type": "markdown", "metadata": {}, @@ -46,7 +44,7 @@ "metadata": {}, "source": [ "## Prerequisites and Azure Machine Learning Basics\n", - "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the configuration Notebook located at https://github.com/Azure/MachineLearningNotebooks first if you haven't. This sets you up with a working config file that has information on your workspace, subscription id, etc. \n" + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the [configuration notebook](../../../configuration.ipynb) located at https://github.com/Azure/MachineLearningNotebooks first if you haven't. This sets you up with a working config file that has information on your workspace, subscription id, etc. \n" ] }, { @@ -155,7 +153,7 @@ "metadata": {}, "source": [ "### Datastore concepts\n", - "A [Datastore](https://docs.microsoft.com/en-us/python/api/azureml-core/azureml.core.datastore(class)?view=azure-ml-py) is a place where data can be stored that is then made accessible to a compute either by means of mounting or copying the data to the compute target. \n", + "A [Datastore](https://docs.microsoft.com/en-us/python/api/azureml-core/azureml.core.datastore.datastore?view=azure-ml-py) is a place where data can be stored that is then made accessible to a compute either by means of mounting or copying the data to the compute target. \n", "\n", "A Datastore can either be backed by an Azure File Storage (default) or by an Azure Blob Storage.\n", "\n", @@ -198,7 +196,7 @@ "metadata": {}, "source": [ "#### (Optional) See your files using Azure Portal\n", - "Once you successfully uploaded the files, you can browse to them (or upload more files) using [Azure Portal](https://portal.azure.com). At the portal, make sure you have selected **AzureML Nursery** as your subscription (click *Resource Groups* and then select the subscription). Then look for your **Machine Learning Workspace** (it has your *alias* as the name). It has a link to your storage. Click on the storage link. It will take you to a page where you can see [Blobs](https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blobs-introduction), [Files](https://docs.microsoft.com/en-us/azure/storage/files/storage-files-introduction), [Tables](https://docs.microsoft.com/en-us/azure/storage/tables/table-storage-overview), and [Queues](https://docs.microsoft.com/en-us/azure/storage/queues/storage-queues-introduction). We have just uploaded a file to the Blob storage and another one to the File storage. You should be able to see both of these files in their respective locations. " + "Once you successfully uploaded the files, you can browse to them (or upload more files) using [Azure Portal](https://portal.azure.com). At the portal, make sure you have selected your subscription (click *Resource Groups* and then select the subscription). Then look for your **Machine Learning Workspace** name. It has a link to your storage. Click on the storage link. It will take you to a page where you can see [Blobs](https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blobs-introduction), [Files](https://docs.microsoft.com/en-us/azure/storage/files/storage-files-introduction), [Tables](https://docs.microsoft.com/en-us/azure/storage/tables/table-storage-overview), and [Queues](https://docs.microsoft.com/en-us/azure/storage/queues/storage-queues-introduction). We have uploaded a file each to the Blob storage and to the File storage in the above step. You should be able to see both of these files in their respective locations. " ] }, { @@ -235,15 +233,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Retrieve or create a Azure Machine Learning compute\n", - "Azure Machine Learning Compute is a service for provisioning and managing clusters of Azure virtual machines for running machine learning workloads. Let's create a new Azure Machine Learning Compute in the current workspace, if it doesn't already exist. We will then run the training script on this compute target.\n", - "\n", - "If we could not find the compute with the given name in the previous cell, then we will create a new compute here. We will create an Azure Machine Learning Compute containing **STANDARD_D2_V2 CPU VMs**. This process is broken down into the following steps:\n", - "\n", - "1. Create the configuration\n", - "2. Create the Azure Machine Learning compute\n", - "\n", - "**This process will take about 3 minutes and is providing only sparse output in the process. Please make sure to wait until the call returns before moving to the next cell.**" + "#### Retrieve default Azure Machine Learning compute\n", + "Azure Machine Learning Compute is a service for provisioning and managing clusters of Azure virtual machines for running machine learning workloads. Let's get the default Azure Machine Learning Compute in the current workspace. We will then run the training script on this compute target." ] }, { @@ -252,22 +243,7 @@ "metadata": {}, "outputs": [], "source": [ - "from azureml.core.compute_target import ComputeTargetException\n", - "\n", - "aml_compute_target = \"aml-compute\"\n", - "try:\n", - " aml_compute = AmlCompute(ws, aml_compute_target)\n", - " print(\"found existing compute target.\")\n", - "except ComputeTargetException:\n", - " print(\"creating new compute target\")\n", - " \n", - " provisioning_config = AmlCompute.provisioning_configuration(vm_size = \"STANDARD_D2_V2\",\n", - " min_nodes = 1, \n", - " max_nodes = 4) \n", - " aml_compute = ComputeTarget.create(ws, aml_compute_target, provisioning_config)\n", - " aml_compute.wait_for_completion(show_output=True, min_node_count=None, timeout_in_minutes=20)\n", - " \n", - "print(\"Azure Machine Learning Compute attached\")\n" + "aml_compute = ws.get_default_compute_target(\"CPU\")" ] }, { @@ -304,11 +280,15 @@ "## Creating a Step in a Pipeline\n", "A Step is a unit of execution. Step typically needs a target of execution (compute target), a script to execute, and may require script arguments and inputs, and can produce outputs. The step also could take a number of other parameters. Azure Machine Learning Pipelines provides the following built-in Steps:\n", "\n", - "- [**PythonScriptStep**](https://docs.microsoft.com/en-us/python/api/azureml-pipeline-steps/azureml.pipeline.steps.python_script_step.pythonscriptstep?view=azure-ml-py): Add a step to run a Python script in a Pipeline.\n", + "- [**PythonScriptStep**](https://docs.microsoft.com/en-us/python/api/azureml-pipeline-steps/azureml.pipeline.steps.python_script_step.pythonscriptstep?view=azure-ml-py): Adds a step to run a Python script in a Pipeline.\n", "- [**AdlaStep**](https://docs.microsoft.com/en-us/python/api/azureml-pipeline-steps/azureml.pipeline.steps.adla_step.adlastep?view=azure-ml-py): Adds a step to run U-SQL script using Azure Data Lake Analytics.\n", "- [**DataTransferStep**](https://docs.microsoft.com/en-us/python/api/azureml-pipeline-steps/azureml.pipeline.steps.data_transfer_step.datatransferstep?view=azure-ml-py): Transfers data between Azure Blob and Data Lake accounts.\n", "- [**DatabricksStep**](https://docs.microsoft.com/en-us/python/api/azureml-pipeline-steps/azureml.pipeline.steps.databricks_step.databricksstep?view=azure-ml-py): Adds a DataBricks notebook as a step in a Pipeline.\n", "- [**HyperDriveStep**](https://docs.microsoft.com/en-us/python/api/azureml-pipeline-steps/azureml.pipeline.steps.hyper_drive_step.hyperdrivestep?view=azure-ml-py): Creates a Hyper Drive step for Hyper Parameter Tuning in a Pipeline.\n", + "- [**AzureBatchStep**](https://docs.microsoft.com/en-us/python/api/azureml-pipeline-steps/azureml.pipeline.steps.azurebatch_step.azurebatchstep?view=azure-ml-py): Creates a step for submitting jobs to Azure Batch\n", + "- [**EstimatorStep**](https://docs.microsoft.com/en-us/python/api/azureml-pipeline-steps/azureml.pipeline.steps.estimator_step.estimatorstep?view=azure-ml-py): Adds a step to run Estimator in a Pipeline.\n", + "- [**MpiStep**](https://docs.microsoft.com/en-us/python/api/azureml-pipeline-steps/azureml.pipeline.steps.mpi_step.mpistep?view=azure-ml-py): Adds a step to run a MPI job in a Pipeline.\n", + "- [**AutoMLStep**](https://docs.microsoft.com/en-us/python/api/azureml-train-automl/azureml.train.automl.automlstep?view=azure-ml-py): Creates a AutoML step in a Pipeline.\n", "\n", "The following code will create a PythonScriptStep to be executed in the Azure Machine Learning Compute we created above using train.py, one of the files already made available in the project folder.\n", "\n", @@ -395,9 +375,6 @@ "# use conda_dependencies.yml to create a conda environment in the Docker image for execution\n", "run_config.environment.python.user_managed_dependencies = False\n", "\n", - "# auto-prepare the Docker image when used for execution (if it is not already prepared)\n", - "run_config.auto_prepare_environment = True\n", - "\n", "# specify CondaDependencies obj\n", "run_config.environment.python.conda_dependencies = CondaDependencies.create(conda_packages=['scikit-learn'])\n", "\n", @@ -476,8 +453,8 @@ "source": [ "# Submit syntax\n", "# submit(experiment_name, \n", - "# pipeline_parameters=None, \n", - "# continue_on_node_failure=False, \n", + "# pipeline_params=None, \n", + "# continue_on_step_failure=False, \n", "# regenerate_outputs=False)\n", "\n", "pipeline_run1 = Experiment(ws, 'Hello_World1').submit(pipeline1, regenerate_outputs=False)\n", @@ -643,4 +620,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-azurebatch-to-run-a-windows-executable.ipynb b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-azurebatch-to-run-a-windows-executable.ipynb index 9749f45b..faea7552 100644 --- a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-azurebatch-to-run-a-windows-executable.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-azurebatch-to-run-a-windows-executable.ipynb @@ -12,8 +12,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-azurebatch-to-run-a-windows-executable.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-azurebatch-to-run-a-windows-executable.png)" + ] }, { "cell_type": "markdown", @@ -74,7 +74,7 @@ "source": [ "Initialize a workspace object from persisted configuration. Make sure the config file is present at .\\config.json\n", "\n", - "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, if you don't have a config.json file, please go through the configuration Notebook located [here](https://github.com/Azure/MachineLearningNotebooks). \n", + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, If you don't have a config.json file, please go through the configuration Notebook located [here](https://github.com/Azure/MachineLearningNotebooks). \n", "\n", "This sets you up with a working config file that has information on your workspace, subscription id, etc. " ] @@ -113,25 +113,7 @@ "metadata": {}, "outputs": [], "source": [ - "batch_compute_name = 'mybatchcompute' # Name to associate with new compute in workspace\n", - "\n", - "# Batch account details needed to attach as compute to workspace\n", - "batch_account_name = \"\" # Name of the Batch account\n", - "batch_resource_group = \"\" # Name of the resource group which contains this account\n", - "\n", - "try:\n", - " # check if already attached\n", - " batch_compute = BatchCompute(ws, batch_compute_name)\n", - "except ComputeTargetException:\n", - " print('Attaching Batch compute...')\n", - " provisioning_config = BatchCompute.attach_configuration(resource_group=batch_resource_group, \n", - " account_name=batch_account_name)\n", - " batch_compute = ComputeTarget.attach(ws, batch_compute_name, provisioning_config)\n", - " batch_compute.wait_for_completion()\n", - " print(\"Provisioning state:{}\".format(batch_compute.provisioning_state))\n", - " print(\"Provisioning errors:{}\".format(batch_compute.provisioning_errors))\n", - "\n", - "print(\"Using Batch compute:{}\".format(batch_compute.cluster_resource_id))" + "batch_compute = ws.get_default_compute_target(\"CPU\")" ] }, { @@ -196,8 +178,8 @@ "\n", "\n", "def upload_file_to_datastore(datastore, file_name, content):\n", - " dir = create_local_file(content=content, file_name=file_name)\n", - " datastore.upload(src_dir=dir, overwrite=True, show_progress=True)" + " src_dir = create_local_file(content=content, file_name=file_name)\n", + " datastore.upload(src_dir=src_dir, overwrite=True, show_progress=True)" ] }, { @@ -252,7 +234,7 @@ "\n", "file_name=\"azurebatch.cmd\"\n", "with open(path.join(binaries_folder, file_name), 'w') as f:\n", - " f.write(\"copy \\\"%1\\\" \\\"%2\\\"\")" + " f.write(\"copy \\\"%1\\\" \\\"%2\\\"\")" ] }, { @@ -380,4 +362,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-estimatorstep.ipynb b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-estimatorstep.ipynb index 925679d5..12d84393 100644 --- a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-estimatorstep.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-estimatorstep.ipynb @@ -13,8 +13,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-estimatorstep.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-estimatorstep.png)" + ] }, { "cell_type": "markdown", @@ -27,7 +27,7 @@ "\n", "## Prerequisite:\n", "* Understand the [architecture and terms](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture) introduced by Azure Machine Learning\n", - "* If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise,go through the [configuration notebook](../../../configuration.ipynb) to:\n", + "* If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration notebook](../../../configuration.ipynb) to:\n", " * install the AML SDK\n", " * create a workspace and its configuration file (`config.json`)" ] @@ -76,18 +76,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Create or Attach existing AmlCompute\n", - "You will need to create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for training your model. In this tutorial, you create `AmlCompute` as your training compute resource." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "If we could not find the cluster with the given name, then we will create a new cluster here. We will create an `AmlCompute` cluster of `STANDARD_NC6` GPU VMs. This process is broken down into 3 steps:\n", - "1. create the configuration (this step is local and only takes a second)\n", - "2. create the cluster (this step will take about **20 seconds**)\n", - "3. provision the VMs to bring the cluster to the initial size (of 1 in this case). This step will take about **3-5 minutes** and is providing only sparse output in the process. Please make sure to wait until the call returns before moving to the next cell" + "## Get default AmlCompute\n", + "You can create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for training your model. In this tutorial, you use default `AmlCompute` as your training compute resource." ] }, { @@ -96,25 +86,7 @@ "metadata": {}, "outputs": [], "source": [ - "from azureml.core.compute import ComputeTarget, AmlCompute\n", - "from azureml.core.compute_target import ComputeTargetException\n", - "\n", - "# choose a name for your cluster\n", - "cluster_name = \"cpucluster\"\n", - "\n", - "try:\n", - " cpu_cluster = ComputeTarget(workspace=ws, name=cluster_name)\n", - " print('Found existing compute target')\n", - "except ComputeTargetException:\n", - " print('Creating a new compute target...')\n", - " compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_NC6', max_nodes=4)\n", - "\n", - " # create the cluster\n", - " cpu_cluster = ComputeTarget.create(ws, cluster_name, compute_config)\n", - "\n", - " # can poll for a minimum number of nodes and for a specific timeout. \n", - " # if no min node count is provided it uses the scale settings for the cluster\n", - " cpu_cluster.wait_for_completion(show_output=True, min_node_count=None, timeout_in_minutes=20)\n", + "cpu_cluster = ws.get_default_compute_target(\"CPU\")\n", "\n", "# use get_status() to get a detailed status for the current cluster. \n", "print(cpu_cluster.get_status().serialize())" @@ -285,4 +257,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-parameter-tuning-with-hyperdrive.ipynb b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-parameter-tuning-with-hyperdrive.ipynb index 248ec1fe..2e3383c3 100644 --- a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-parameter-tuning-with-hyperdrive.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-parameter-tuning-with-hyperdrive.ipynb @@ -12,8 +12,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-parameter-tuning-with-hyperdrive.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-parameter-tuning-with-hyperdrive.png)" + ] }, { "cell_type": "markdown", @@ -135,14 +135,7 @@ "metadata": {}, "source": [ "## Retrieve or create a Azure Machine Learning compute\n", - "Azure Machine Learning Compute is a service for provisioning and managing clusters of Azure virtual machines for running machine learning workloads. Let's create a new Azure Machine Learning Compute in the current workspace, if it doesn't already exist. We will then run the training script on this compute target.\n", - "\n", - "If we could not find the compute with the given name in the previous cell, then we will create a new compute here. This process is broken down into the following steps:\n", - "\n", - "1. Create the configuration\n", - "2. Create the Azure Machine Learning compute\n", - "\n", - "**This process will take a few minutes and is providing only sparse output in the process. Please make sure to wait until the call returns before moving to the next cell.**\n" + "Azure Machine Learning Compute is a service for provisioning and managing clusters of Azure virtual machines for running machine learning workloads. Let's get the default Azure Machine Learning Compute in the current workspace. We will then run the training script on this compute target." ] }, { @@ -151,20 +144,7 @@ "metadata": {}, "outputs": [], "source": [ - "cluster_name = \"gpucluster\"\n", - "\n", - "try:\n", - " compute_target = ComputeTarget(workspace=ws, name=cluster_name)\n", - " print('Found existing compute target {}.'.format(cluster_name))\n", - "except ComputeTargetException:\n", - " print('Creating a new compute target...')\n", - " compute_config = AmlCompute.provisioning_configuration(vm_size=\"STANDARD_NC6\",\n", - " max_nodes=4)\n", - "\n", - " compute_target = ComputeTarget.create(ws, cluster_name, compute_config)\n", - " compute_target.wait_for_completion(show_output=True, timeout_in_minutes=20)\n", - "\n", - "print(\"Azure Machine Learning Compute attached\")" + "compute_target = ws.get_default_compute_target(\"GPU\")" ] }, { @@ -266,13 +246,13 @@ "metadata": {}, "outputs": [], "source": [ - "hd_config = HyperDriveRunConfig(estimator=est, \n", - " hyperparameter_sampling=ps,\n", - " policy=early_termination_policy,\n", - " primary_metric_name='validation_acc', \n", - " primary_metric_goal=PrimaryMetricGoal.MAXIMIZE, \n", - " max_total_runs=1,\n", - " max_concurrent_runs=1)" + "hd_config = HyperDriveConfig(estimator=est, \n", + " hyperparameter_sampling=ps,\n", + " policy=early_termination_policy,\n", + " primary_metric_name='validation_acc', \n", + " primary_metric_goal=PrimaryMetricGoal.MAXIMIZE, \n", + " max_total_runs=1,\n", + " max_concurrent_runs=1)" ] }, { @@ -302,7 +282,7 @@ "### HyperDriveStep\n", "HyperDriveStep can be used to run HyperDrive job as a step in pipeline.\n", "- **name:** Name of the step\n", - "- **hyperdrive_run_config:** A HyperDriveRunConfig that defines the configuration for this HyperDrive run\n", + "- **hyperdrive_config:** A HyperDriveConfig that defines the configuration for this HyperDrive run\n", "- **estimator_entry_script_arguments:** List of command-line arguments for estimator entry script\n", "- **inputs:** List of input port bindings\n", "- **outputs:** List of output port bindings\n", @@ -324,7 +304,7 @@ "\n", "hd_step = HyperDriveStep(\n", " name=\"hyperdrive_module\",\n", - " hyperdrive_run_config=hd_config,\n", + " hyperdrive_config=hd_config,\n", " estimator_entry_script_arguments=['--data-folder', data_folder],\n", " inputs=[data_folder],\n", " metrics_output=metirics_data)" @@ -441,4 +421,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-publish-and-run-using-rest-endpoint.ipynb b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-publish-and-run-using-rest-endpoint.ipynb index eab7dd69..0296f720 100644 --- a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-publish-and-run-using-rest-endpoint.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-publish-and-run-using-rest-endpoint.ipynb @@ -12,8 +12,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-publish-and-run-using-rest-endpoint.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-publish-and-run-using-rest-endpoint.png)" + ] }, { "cell_type": "markdown", @@ -79,20 +79,7 @@ "metadata": {}, "outputs": [], "source": [ - "from azureml.core.compute_target import ComputeTargetException\n", - "\n", - "aml_compute_target = \"cpucluster\"\n", - "try:\n", - " aml_compute = AmlCompute(ws, aml_compute_target)\n", - " print(\"found existing compute target.\")\n", - "except ComputeTargetException:\n", - " print(\"creating new compute target\")\n", - " \n", - " provisioning_config = AmlCompute.provisioning_configuration(vm_size = \"STANDARD_D2_V2\",\n", - " min_nodes = 1, \n", - " max_nodes = 4) \n", - " aml_compute = ComputeTarget.create(ws, aml_compute_target, provisioning_config)\n", - " aml_compute.wait_for_completion(show_output=True, min_node_count=None, timeout_in_minutes=20)\n" + "aml_compute = ws.get_default_compute_target(\"CPU\")" ] }, { @@ -420,4 +407,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-setup-schedule-for-a-published-pipeline.ipynb b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-setup-schedule-for-a-published-pipeline.ipynb index 8b275bcc..a4317294 100644 --- a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-setup-schedule-for-a-published-pipeline.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-setup-schedule-for-a-published-pipeline.ipynb @@ -12,8 +12,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-setup-schedule-for-a-published-pipeline.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-setup-schedule-for-a-published-pipeline.png)" + ] }, { "cell_type": "markdown", @@ -54,7 +54,7 @@ "metadata": {}, "source": [ "### Compute Targets\n", - "#### Retrieve an already attached Azure Machine Learning Compute" + "#### Retrieve the default Azure Machine Learning Compute" ] }, { @@ -63,31 +63,7 @@ "metadata": {}, "outputs": [], "source": [ - "from azureml.core import Run, Experiment, Datastore\n", - "\n", - "from azureml.widgets import RunDetails\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.core.compute import AmlCompute, ComputeTarget\n", - "aml_compute_target = \"aml-compute\"\n", - "try:\n", - " aml_compute = AmlCompute(ws, aml_compute_target)\n", - " print(\"Found existing compute target: {}\".format(aml_compute_target))\n", - "except:\n", - " print(\"Creating new compute target: {}\".format(aml_compute_target))\n", - " \n", - " provisioning_config = AmlCompute.provisioning_configuration(vm_size = \"STANDARD_D2_V2\",\n", - " min_nodes = 1, \n", - " max_nodes = 4) \n", - " aml_compute = ComputeTarget.create(ws, aml_compute_target, provisioning_config)\n", - " aml_compute.wait_for_completion(show_output=True, min_node_count=None, timeout_in_minutes=20)" + "aml_compute = ws.get_default_compute_target(\"CPU\")" ] }, { @@ -383,7 +359,7 @@ "source": [ "### Create a schedule for the pipeline using a Datastore\n", "This schedule will run when additions or modifications are made to Blobs in the Datastore.\n", - "By default, the Datastore container is monitored for changes. Use the path_on_datastore parameter to instead specify a path on the Datastore to monitor for changes. Changes made to subfolders in the container/path will not trigger the schedule.\n", + "By default, the Datastore container is monitored for changes. Use the path_on_datastore parameter to instead specify a path on the Datastore to monitor for changes. Note: the path_on_datastore will be under the container for the datastore, so the actual path monitored will be container/path_on_datastore. Changes made to subfolders in the container/path will not trigger the schedule.\n", "Note: Only Blob Datastores are supported." ] }, @@ -403,6 +379,7 @@ " datastore=datastore,\n", " wait_for_provisioning=True,\n", " description=\"Schedule Run\")\n", + " #polling_interval=5, use polling_interval to specify how often to poll for blob additions/modifications. Default value is 5 minutes.\n", " #path_on_datastore=\"file/path\") use path_on_datastore to specify a specific folder to monitor for changes.\n", "\n", "# You may want to make sure that the schedule is provisioned properly\n", @@ -451,4 +428,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-setup-versioned-pipeline-endpoints.ipynb b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-setup-versioned-pipeline-endpoints.ipynb new file mode 100644 index 00000000..353f2261 --- /dev/null +++ b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-setup-versioned-pipeline-endpoints.ipynb @@ -0,0 +1,553 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) Microsoft Corporation. All rights reserved. \n", + "Licensed under the MIT License." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-setup-versioned-pipeline-endpoints.png)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "# How to Setup a PipelineEndpoint and Submit a Pipeline Using the PipelineEndpoint.\n", + "In this notebook, we will see how to setup a PipelineEndpoint and run specific pipeline version.\n", + "\n", + "PipelineEndpoint can be used to update a published pipeline while maintaining same endpoint.\n", + "PipelineEndpoint, provides a way to keep track of [PublishedPipelines](https://docs.microsoft.com/en-us/python/api/azureml-pipeline-core/azureml.pipeline.core.publishedpipeline) using versions. PipelineEndpoint uses endpoint with version information to trigger underlying published pipeline. Pipeline endpoints are uniquely named within a workspace. \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Prerequisites and AML Basics\n", + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the [configuration Notebook](https://github.com/Azure/MachineLearningNotebooks) first if you haven't. This sets you up with a working config file that has information on your workspace, subscription id, etc.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core import Workspace\n", + "\n", + "ws = Workspace.from_config()\n", + "print(ws.name, ws.resource_group, ws.location, ws.subscription_id, sep = '\\n')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Notebook Overview\n", + "In this notebook, we provide an introduction to Azure machine learning PipelineEndpoints. It covers:\n", + "* [Create PipelineEndpoint](#Create-PipelineEndpoint), How to create PipelineEndpoint.\n", + "* [Retrieving PipelineEndpoint](#Retrieving-PipelineEndpoint), How to get specific PipelineEndpoint from worskpace by name/Id and get all [PipelineEndpoints](#Get-all-PipelineEndpoints-in-workspace) within workspace.\n", + "* [PipelineEndpoint Properties](#PipelineEndpoint-properties). How to get and set PipelineEndpoint properties, such as default version of PipelineEndpoint.\n", + "* [PipelineEndpoint Submission](#PipelineEndpoint-Submission). How to run a Pipeline using PipelineEndpoint." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Create PipelineEndpoint\n", + "Following are required input parameters to create PipelineEndpoint:\n", + "\n", + "* *workspace*: AML workspace.\n", + "* *name*: name of PipelineEndpoint, it is unique within workspace.\n", + "* *description*: description details for PipelineEndpoint.\n", + "* *pipeline*: A [Pipeline](#Steps-to-create-simple-Pipeline) or [PublishedPipeline](#Publish-Pipeline), to set default version of PipelineEndpoint. " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Initialization, Steps to create a Pipeline" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.pipeline.steps import PythonScriptStep\n", + "from azureml.pipeline.core import Pipeline\n", + "\n", + "aml_compute = ws.get_default_compute_target(\"CPU\")\n", + "\n", + "# source_directory\n", + "source_directory = '.'\n", + "# define a single step pipeline for demonstration purpose.\n", + "trainStep = PythonScriptStep(\n", + " name=\"Training_Step\",\n", + " script_name=\"train.py\", \n", + " compute_target=aml_compute_target, \n", + " source_directory=source_directory\n", + ")\n", + "print(\"TrainStep created\")\n", + "# build and validate Pipeline\n", + "pipeline = Pipeline(workspace=ws, steps=[trainStep])\n", + "print(\"Pipeline is built\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Publish Pipeline" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from datetime import datetime\n", + "\n", + "timenow = datetime.now().strftime('%m-%d-%Y-%H-%M')\n", + "\n", + "pipeline_name = timenow + \"-Pipeline\"\n", + "print(pipeline_name)\n", + "\n", + "published_pipeline = pipeline.publish(\n", + " name=pipeline_name, \n", + " description=pipeline_name)\n", + "print(\"Newly published pipeline id: {}\".format(published_pipeline.id))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Publishing PipelineEndpoint\n", + "Create PipelineEndpoint with required parameters: workspace, name, description and pipeline" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.pipeline.core import PipelineEndpoint\n", + "\n", + "pipeline_endpoint = PipelineEndpoint.publish(workspace=ws, name=\"PipelineEndpointTest\",\n", + " pipeline=pipeline, description=\"Test description Notebook\")\n", + "pipeline_endpoint" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Retrieving PipelineEndpoint\n", + "\n", + "PipelineEndpoint is uniquely defined by name and id within workspace. PipelineEndpoint in workspace can be retrived by Id or by name." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Get PipelineEndpoint by Name\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "pipeline_endpoint_by_name = PipelineEndpoint.get(workspace=ws, name=\"PipelineEndpointTest\")\n", + "pipeline_endpoint_by_name" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Get PipelineEndpoint by Id\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#get the PipelineEndpoint Id\n", + "pipeline_endpoint_by_name = PipelineEndpoint.get(workspace=ws, name=\"PipelineEndpointTest\")\n", + "endpoint_id = pipeline_endpoint_by_name.id\n", + "\n", + "pipeline_endpoint_by_id = PipelineEndpoint.get(workspace=ws, id=endpoint_id)\n", + "pipeline_endpoint_by_id" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Get all PipelineEndpoints in workspace\n", + "Returns all PipelineEndpoints within workspace" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "endpoint_list = PipelineEndpoint.get_all(workspace=ws, active_only=True)\n", + "endpoint_list" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### PipelineEndpoint properties" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Default Version of PipelineEndpoint\n", + "Default version of PipelineEndpoint starts from \"0\" and increments on addition of pipelines.\n", + "\n", + "##### Get the Default Version" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "default_version = pipeline_endpoint_by_name.get_default_version()\n", + "default_version" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Set default version \n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "pipeline_endpoint_by_name.set_default_version(\"0\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Get the Published Pipeline corresponds to specific version of PipelineEndpoint" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "pipeline = pipeline_endpoint_by_name.get_pipeline(\"0\")\n", + "pipeline" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Get default version Published Pipeline" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "pipeline = pipeline_endpoint_by_name.get_pipeline()\n", + "pipeline" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Set Published Pipeline to default version" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Set Published Pipeline to PipelineEndpoint, if exists\n", + "pipeline_endpoint_by_name.set_default(published_pipeline)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Get all Versions in PipelineEndpoint\n", + "Returns list of published pipelines and its versions" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "versions = pipeline_endpoint_by_name.get_all_versions()\n", + "\n", + "for ve in versions:\n", + " print(ve.version)\n", + " print(ve.pipeline.id)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Get all Published Pipelines in PipelineEndpoint\n", + "Returns all active pipelines in PipelineEnpoint, if active_only flag is set to True." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "pipelines = pipeline_endpoint_by_name.get_all_pipelines(active_only=True)\n", + "pipelines" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Name property of PipelineEndpoint\n", + "PipelineEndpoint is uniquely identified by name" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Set Name PipelineEndpoint" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "pipeline_endpoint_by_name.set_name(name=\"NewName\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Add Published Pipeline to PipelineEndpoint, \n", + "Adding published pipeline, if its not present in PipelineEndpoint." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "pipeline_endpoint_by_name.add(published_pipeline)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Add Published pipeline to PipelineEndpoint and set it to default version\n", + "Adding published pipeline to PipelineEndpoint if not present and set it to default" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "pipeline_endpoint_by_name.add_default(published_pipeline)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### PipelineEndpoint Submission\n", + "PipelineEndpoint triggers specific versioned pipeline or default pipeline by:\n", + "* Rest Endpoint \n", + "* Submit call." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Run Pipeline by endpoint property of PipelineEndpoint\n", + "Run specific pipeline using endpoint property of PipelineEndpoint and executing http post." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "pipeline_endpoint_by_name = PipelineEndpoint.get(workspace=ws, name=\"PipelineEndpointTest\")\n", + "\n", + "# endpoint with id \n", + "rest_endpoint_id = pipeline_endpoint_by_name.endpoint\n", + "\n", + "# for default version pipeline\n", + "rest_endpoint_id_without_version_with_id = rest_endpoint_id\n", + "\n", + "# for specific version pipeline just append version info\n", + "version=\"0\"\n", + "rest_endpoint_id_with_version = rest_endpoint_id_without_version_with_id+\"/\"+ version\n", + "print(rest_endpoint_id_with_version)\n", + "pipeline_endpoint_by_name" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# endpoint with name\n", + "rest_endpoint_name = rest_endpoint_id.split(\"Id\", 1)[0] + \"Name?name=\" + pipeline_endpoint_by_name.name\n", + "\n", + "# for default version pipeline\n", + "rest_endpoint_name_without_version = rest_endpoint_name\n", + "\n", + "# for specific version pipeline just append version info\n", + "version=\"0\"\n", + "rest_endpoint_name_with_version = rest_endpoint_name_without_version+\"&pipelineVersion=\"+ version\n", + "print(rest_endpoint_name_with_version)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "[This notebook](https://aka.ms/pl-restep-auth) shows how to authenticate to AML workspace." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core.authentication import InteractiveLoginAuthentication\n", + "import requests\n", + "\n", + "auth = InteractiveLoginAuthentication()\n", + "aad_token = auth.get_authentication_header()\n", + "\n", + "#endpoint = pipeline_endpoint_by_name.url\n", + "\n", + "print(\"You can perform HTTP POST on URL {} to trigger this pipeline\".format(rest_endpoint_name_with_version))\n", + "\n", + "# specify the param when running the pipeline\n", + "response = requests.post(rest_endpoint_name_with_version, \n", + " headers=aad_token, \n", + " json={\"ExperimentName\": \"default_pipeline\",\n", + " \"RunSource\": \"SDK\",\n", + " \"ParameterAssignments\": {\"1\": \"united\", \"2\":\"city\"}})\n", + "\n", + "run_id = response.json()[\"Id\"]\n", + "print(run_id)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Run Pipeline by Submit call of PipelineEndpoint \n", + "Run specific pipeline using Submit api of PipelineEndpoint" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# submit pipeline with specific version\n", + "run_id = pipeline_endpoint_by_name.submit(\"TestPipelineEndpoint\", pipeline_version=\"0\")\n", + "print(run_id)\n", + "\n", + "# submit pipeline with default version\n", + "run_id = pipeline_endpoint_by_name.submit(\"TestPipelineEndpoint\")\n", + "print(run_id)" + ] + } + ], + "metadata": { + "authors": [ + { + "name": "mameghwa" + } + ], + "kernelspec": { + "display_name": "Python 3.6", + "language": "python", + "name": "python36" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.2" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} \ No newline at end of file diff --git a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-use-adla-as-compute-target.ipynb b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-use-adla-as-compute-target.ipynb index 44b62bc3..18dcf054 100644 --- a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-use-adla-as-compute-target.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-use-adla-as-compute-target.ipynb @@ -12,8 +12,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-use-adla-as-compute-target.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-use-adla-as-compute-target.png)" + ] }, { "cell_type": "markdown", @@ -371,4 +371,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-use-databricks-as-compute-target.ipynb b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-use-databricks-as-compute-target.ipynb index d6b650ac..7330c80f 100644 --- a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-use-databricks-as-compute-target.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-use-databricks-as-compute-target.ipynb @@ -8,12 +8,12 @@ "Licensed under the MIT License." ] }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-use-databricks-as-compute-target.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-use-databricks-as-compute-target.png)" + ] }, { "cell_type": "markdown", @@ -404,7 +404,9 @@ "metadata": {}, "source": [ "### 1. Running the demo notebook already added to the Databricks workspace\n", - "Create a notebook in the Azure Databricks workspace, and provide the path to that notebook as the value associated with the environment variable \"DATABRICKS_NOTEBOOK_PATH\". This will then set the variable\u00c2\u00a0notebook_path\u00c2\u00a0when you run the code cell below:" + "Create a notebook in the Azure Databricks workspace, and provide the path to that notebook as the value associated with the environment variable \"DATABRICKS_NOTEBOOK_PATH\". This will then set the variable\u00c2\u00a0notebook_path\u00c2\u00a0when you run the code cell below:\n", + "\n", + "your notebook's path in Azure Databricks UI by hovering over to notebook's title. A typical path of notebook looks like this `/Users/example@databricks.com/example`. See [Databricks Workspace](https://docs.azuredatabricks.net/user-guide/workspace.html) to learn about the folder structure." ] }, { @@ -712,4 +714,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-with-automated-machine-learning-step.ipynb b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-with-automated-machine-learning-step.ipynb index 9d4c18f2..bf7795e8 100644 --- a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-with-automated-machine-learning-step.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-with-automated-machine-learning-step.ipynb @@ -8,12 +8,12 @@ "Licensed under the MIT License." ] }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-with-automated-machine-learning-step.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-with-automated-machine-learning-step.png)" + ] }, { "cell_type": "markdown", @@ -130,9 +130,7 @@ "metadata": {}, "source": [ "### Create or Attach existing AmlCompute\n", - "You will need to create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for your AutoML run. In this tutorial, you create `AmlCompute` as your training compute resource.\n", - "\n", - "**Creation of AmlCompute takes approximately 5 minutes.** If the AmlCompute with that name is already in your workspace this code will skip the creation process." + "You will need to create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for your AutoML run. In this tutorial, you get the default `AmlCompute` as your training compute resource." ] }, { @@ -141,31 +139,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Choose a name for your cluster.\n", - "amlcompute_cluster_name = \"cpucluster\"\n", - "\n", - "found = False\n", - "# Check if this compute target already exists in the workspace.\n", - "cts = ws.compute_targets\n", - "if amlcompute_cluster_name in cts and cts[amlcompute_cluster_name].type == 'AmlCompute':\n", - " found = True\n", - " print('Found existing compute target.')\n", - " compute_target = cts[amlcompute_cluster_name]\n", - " \n", - "if not found:\n", - " print('Creating a new compute target...')\n", - " provisioning_config = AmlCompute.provisioning_configuration(vm_size = \"STANDARD_D2_V2\", # for GPU, use \"STANDARD_NC6\"\n", - " #vm_priority = 'lowpriority', # optional\n", - " max_nodes = 4)\n", - "\n", - " # Create the cluster.\n", - " compute_target = ComputeTarget.create(ws, amlcompute_cluster_name, provisioning_config)\n", - " \n", - " # Can poll for a minimum number of nodes and for a specific timeout.\n", - " # If no min_node_count is provided, it will use the scale settings for the cluster.\n", - " compute_target.wait_for_completion(show_output = True, min_node_count = 1, timeout_in_minutes = 10)\n", - " \n", - " # For a more detailed view of current AmlCompute status, use get_status()." + "compute_target = ws.get_default_compute_target(\"CPU\")" ] }, { @@ -244,7 +218,7 @@ " X_train = pd.read_csv(\"/tmp/azureml_runs/bai_data/X_train.tsv\", delimiter=\"\\t\", header=None, quotechar='\"')\n", " y_train = pd.read_csv(\"/tmp/azureml_runs/bai_data/y_train.tsv\", delimiter=\"\\t\", header=None, quotechar='\"')\n", "\n", - " return { \"X\" : X_train.values, \"y\" : y_train[0].values }\n" + " return { \"X\" : X_train.values, \"y\" : y_train.values.flatten() }\n" ] }, { @@ -521,4 +495,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-with-data-dependency-steps.ipynb b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-with-data-dependency-steps.ipynb index 16e440a8..fb466dd8 100644 --- a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-with-data-dependency-steps.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-with-data-dependency-steps.ipynb @@ -8,12 +8,12 @@ "Licensed under the MIT License." ] }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-with-data-dependency-steps.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-with-data-dependency-steps.png)" + ] }, { "cell_type": "markdown", @@ -128,7 +128,7 @@ "metadata": {}, "source": [ "#### Retrieve or create a Aml compute\n", - "Azure Machine Learning Compute is a service for provisioning and managing clusters of Azure virtual machines for running machine learning workloads. Let's create a new Aml Compute in the current workspace, if it doesn't already exist. We will then run the training script on this compute target." + "Azure Machine Learning Compute is a service for provisioning and managing clusters of Azure virtual machines for running machine learning workloads. Let's get the default Aml Compute in the current workspace. We will then run the training script on this compute target." ] }, { @@ -137,22 +137,7 @@ "metadata": {}, "outputs": [], "source": [ - "from azureml.core.compute_target import ComputeTargetException\n", - "\n", - "aml_compute_target = \"aml-compute\"\n", - "try:\n", - " aml_compute = AmlCompute(ws, aml_compute_target)\n", - " print(\"found existing compute target.\")\n", - "except ComputeTargetException:\n", - " print(\"creating new compute target\")\n", - " \n", - " provisioning_config = AmlCompute.provisioning_configuration(vm_size = \"STANDARD_D2_V2\",\n", - " min_nodes = 1, \n", - " max_nodes = 4) \n", - " aml_compute = ComputeTarget.create(ws, aml_compute_target, provisioning_config)\n", - " aml_compute.wait_for_completion(show_output=True, min_node_count=None, timeout_in_minutes=20)\n", - " \n", - "print(\"Aml Compute attached\")\n" + "aml_compute = ws.get_default_compute_target(\"CPU\")\n" ] }, { @@ -297,9 +282,6 @@ "# use conda_dependencies.yml to create a conda environment in the Docker image for execution\n", "run_config.environment.python.user_managed_dependencies = False\n", "\n", - "# auto-prepare the Docker image when used for execution (if it is not already prepared)\n", - "run_config.auto_prepare_environment = True\n", - "\n", "# specify CondaDependencies obj\n", "run_config.environment.python.conda_dependencies = CondaDependencies.create(conda_packages=['scikit-learn'])" ] @@ -471,4 +453,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/machine-learning-pipelines/pipeline-batch-scoring/pipeline-batch-scoring.ipynb b/how-to-use-azureml/machine-learning-pipelines/pipeline-batch-scoring/pipeline-batch-scoring.ipynb index d48aed0b..55098085 100644 --- a/how-to-use-azureml/machine-learning-pipelines/pipeline-batch-scoring/pipeline-batch-scoring.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/pipeline-batch-scoring/pipeline-batch-scoring.ipynb @@ -8,12 +8,12 @@ "Licensed under the MIT License." ] }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/pipeline-batch-scoring/pipeline-batch-scoring.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/pipeline-batch-scoring/pipeline-batch-scoring.png)" + ] }, { "cell_type": "markdown", @@ -162,7 +162,7 @@ "metadata": {}, "source": [ "### Create and attach Compute targets\n", - "Use the below code to create and attach Compute targets. " + "Use the below code to get the default Compute target. " ] }, { @@ -171,33 +171,9 @@ "metadata": {}, "outputs": [], "source": [ - "# choose a name for your cluster\n", - "aml_compute_name = os.environ.get(\"AML_COMPUTE_NAME\", \"gpucluster\")\n", - "cluster_min_nodes = os.environ.get(\"AML_COMPUTE_MIN_NODES\", 0)\n", - "cluster_max_nodes = os.environ.get(\"AML_COMPUTE_MAX_NODES\", 1)\n", - "vm_size = os.environ.get(\"AML_COMPUTE_SKU\", \"STANDARD_NC6\")\n", + "cluster_type = os.environ.get(\"AML_CLUSTER_TYPE\", \"GPU\")\n", "\n", - "\n", - "if aml_compute_name in ws.compute_targets:\n", - " compute_target = ws.compute_targets[aml_compute_name]\n", - " if compute_target and type(compute_target) is AmlCompute:\n", - " print('found compute target. just use it. ' + aml_compute_name)\n", - "else:\n", - " print('creating a new compute target...')\n", - " provisioning_config = AmlCompute.provisioning_configuration(vm_size = vm_size, # NC6 is GPU-enabled\n", - " vm_priority = 'lowpriority', # optional\n", - " min_nodes = cluster_min_nodes, \n", - " max_nodes = cluster_max_nodes)\n", - "\n", - " # create the cluster\n", - " compute_target = ComputeTarget.create(ws, aml_compute_name, provisioning_config)\n", - " \n", - " # can poll for a minimum number of nodes and for a specific timeout. \n", - " # if no min node count is provided it will use the scale settings for the cluster\n", - " compute_target.wait_for_completion(show_output=True, min_node_count=None, timeout_in_minutes=20)\n", - " \n", - " # For a more detailed view of current Azure Machine Learning Compute status, use get_status()\n", - " print(compute_target.get_status().serialize())" + "compute_target = ws.get_default_compute_target(cluster_type)" ] }, { @@ -600,4 +576,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/machine-learning-pipelines/pipeline-style-transfer/pipeline-style-transfer.ipynb b/how-to-use-azureml/machine-learning-pipelines/pipeline-style-transfer/pipeline-style-transfer.ipynb index a53a2dbf..06af5b9c 100644 --- a/how-to-use-azureml/machine-learning-pipelines/pipeline-style-transfer/pipeline-style-transfer.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/pipeline-style-transfer/pipeline-style-transfer.ipynb @@ -9,12 +9,12 @@ "Licensed under the MIT License." ] }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/pipeline-style-transfer/pipeline-style-transfer.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/pipeline-style-transfer/pipeline-style-transfer.png)" + ] }, { "cell_type": "markdown", @@ -32,7 +32,7 @@ "metadata": {}, "source": [ "## Prerequisites\n", - "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwsie, make sure you go through the configuration Notebook located at https://github.com/Azure/MachineLearningNotebooks first if you haven't. This sets you up with a working config file that has information on your workspace, subscription id, etc. " + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the configuration Notebook located at https://github.com/Azure/MachineLearningNotebooks first if you haven't. This sets you up with a working config file that has information on your workspace, subscription id, etc. " ] }, { @@ -650,4 +650,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/manage-azureml-service/authentication-in-azureml/authentication-in-azureml.ipynb b/how-to-use-azureml/manage-azureml-service/authentication-in-azureml/authentication-in-azureml.ipynb new file mode 100644 index 00000000..4cb487ae --- /dev/null +++ b/how-to-use-azureml/manage-azureml-service/authentication-in-azureml/authentication-in-azureml.ipynb @@ -0,0 +1,260 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) Microsoft Corporation. All rights reserved.\n", + "\n", + "Licensed under the MIT License.\n", + "\n", + "## Authentication in Azure Machine Learning\n", + "\n", + "This notebook shows you how to authenticate to your Azure ML Workspace using\n", + "\n", + " 1. Interactive Login Authentication\n", + " 2. Azure CLI Authentication\n", + " 3. Service Principal Authentication\n", + " \n", + "The interactive authentication is suitable for local experimentation on your own computer. Azure CLI authentication is suitable if you are already using Azure CLI for managing Azure resources, and want to sign in only once. The Service Principal authentication is suitable for automated workflows, for example as part of Azure Devops build." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/manage-azureml-service/authentication-in-azureml/authentication-in-azureml.png)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core import Workspace" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Interactive Authentication\n", + "\n", + "Interactive authentication is the default mode when using Azure ML SDK.\n", + "\n", + "When you connect to your workspace using workspace.from_config, you will get an interactive login dialog." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ws = Workspace.from_config()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Also, if you explicitly specify the subscription ID, resource group and resource group, you will get the dialog." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ws = Workspace(subscription_id=\"my-subscription-id\",\n", + " resource_group=\"my-ml-rg\",\n", + " workspace_name=\"my-ml-workspace\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note the user you're authenticated as must have access to the subscription and resource group. If you receive an error\n", + "\n", + "```\n", + "AuthenticationException: You don't have access to xxxxxx-xxxx-xxx-xxx-xxxxxxxxxx subscription. All the subscriptions that you have access to = ...\n", + "```\n", + "\n", + "check that the you used correct login and entered the correct subscription ID." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In some cases, you may see a version of the error message containing text: ```All the subscriptions that you have access to = []```\n", + "\n", + "In such a case, you may have to specify the tenant ID of the Azure Active Directory you're using. An example would be accessing a subscription as a guest to a tenant that is not your default. You specify the tenant by explicitly instantiating _InteractiveLoginAuthentication_ with tenant ID as argument ([see instructions how to obtain tenant Id](#get-tenant-id))." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core.authentication import InteractiveLoginAuthentication\n", + "\n", + "interactive_auth = InteractiveLoginAuthentication(tenant_id=\"my-tenant-id\")\n", + "\n", + "ws = Workspace(subscription_id=\"my-subscription-id\",\n", + " resource_group=\"my-ml-rg\",\n", + " workspace_name=\"my-ml-workspace\",\n", + " auth=interactive_auth)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Azure CLI Authentication\n", + "\n", + "If you have installed azure-cli package, and used ```az login``` command to log in to your Azure Subscription, you can use _AzureCliAuthentication_ class.\n", + "\n", + "Note that interactive authentication described above won't use existing Azure CLI auth tokens. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core.authentication import AzureCliAuthentication\n", + "\n", + "cli_auth = AzureCliAuthentication()\n", + "\n", + "ws = Workspace(subscription_id=\"my-subscription-id\",\n", + " resource_group=\"my-ml-rg\",\n", + " workspace_name=\"my-ml-workspace\",\n", + " auth=cli_auth)\n", + "\n", + "print(\"Found workspace {} at location {}\".format(ws.name, ws.location))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Service Principal Authentication\n", + "\n", + "When setting up a machine learning workflow as an automated process, we recommend using Service Principal Authentication. This approach decouples the authentication from any specific user login, and allows managed access control.\n", + "\n", + "Note that you must have administrator privileges over the Azure subscription to complete these steps.\n", + "\n", + "The first step is to create a service principal. First, go to [Azure Portal](https://portal.azure.com), select **Azure Active Directory** and **App Registrations**. Then select **+New application registration**, give your service principal a name, for example _my-svc-principal_. You can leave application type as is, and specify a dummy value for Sign-on URL, such as _https://invalid_.\n", + "\n", + "Then click **Create**.\n", + "\n", + "![service principal creation]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The next step is to obtain the _Application ID_ (also called username) and create _password_ for the service principal.\n", + "\n", + "From the page for your newly created service principal, copy the _Application ID_. Then select **Settings** and **Keys**, write a description for your key, and select duration. Then click **Save**, and copy the _password_ to a secure location.\n", + "\n", + "![application id and password](images/svc-pr-2.PNG)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "\n", + "Also, you need to obtain the tenant ID of your Azure subscription. Go back to **Azure Active Directory**, select **Properties** and copy _Directory ID_.\n", + "\n", + "![tenant id](images/svc-pr-3.PNG)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Finally, you need to give the service principal permissions to access your workspace. Navigate to **Resource Groups**, to the resource group for your Machine Learning Workspace. \n", + "\n", + "Then select **Access Control (IAM)** and **Add a role assignment**. For _Role_, specify which level of access you need to grant, for example _Contributor_. Start entering your service principal name and once it is found, select it, and click **Save**.\n", + "\n", + "![add role](images/svc-pr-4.PNG)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now you are ready to use the service principal authentication. For example, to connect to your Workspace, see code below and enter your own values for tenant ID, application ID, subscription ID, resource group and workspace.\n", + "\n", + "**We strongly recommended that you do not insert the secret password to code**. Instead, you can use environment variables to pass it to your code, for example through Azure Key Vault, or through secret build variables in Azure DevOps. For local testing, you can for example use following PowerShell command to set the environment variable.\n", + "\n", + "```\n", + "$env:AZUREML_PASSWORD = \"my-password\"\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "from azureml.core.authentication import ServicePrincipalAuthentication\n", + "\n", + "svc_pr_password = os.environ.get(\"AZUREML_PASSWORD\")\n", + "\n", + "svc_pr = ServicePrincipalAuthentication(\n", + " tenant_id=\"my-tenant-id\",\n", + " service_principal_id=\"my-application-id\",\n", + " service_principal_password=svc_pr_password)\n", + "\n", + "\n", + "ws = Workspace(\n", + " subscription_id=\"my-subscription-id\",\n", + " resource_group=\"my-ml-rg\",\n", + " workspace_name=\"my-ml-workspace\",\n", + " auth=svc_pr\n", + " )\n", + "\n", + "print(\"Found workspace {} at location {}\".format(ws.name, ws.location))" + ] + } + ], + "metadata": { + "authors": [ + { + "name": "roastala" + } + ], + "kernelspec": { + "display_name": "Python 3.6", + "language": "python", + "name": "python36" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.5" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} \ No newline at end of file diff --git a/how-to-use-azureml/training-with-deep-learning/README.md b/how-to-use-azureml/training-with-deep-learning/README.md index 7bc0c072..b5200946 100644 --- a/how-to-use-azureml/training-with-deep-learning/README.md +++ b/how-to-use-azureml/training-with-deep-learning/README.md @@ -17,4 +17,5 @@ These examples show you: Learn more about how to use `Estimator` class to [train deep neural networks with Azure Machine Learning](https://docs.microsoft.com/azure/machine-learning/service/how-to-train-ml-models). -![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/README.png) + ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/README.png) + diff --git a/how-to-use-azureml/training-with-deep-learning/distributed-chainer/distributed-chainer.ipynb b/how-to-use-azureml/training-with-deep-learning/distributed-chainer/distributed-chainer.ipynb index d6d0f6f3..e3cf92fb 100644 --- a/how-to-use-azureml/training-with-deep-learning/distributed-chainer/distributed-chainer.ipynb +++ b/how-to-use-azureml/training-with-deep-learning/distributed-chainer/distributed-chainer.ipynb @@ -9,12 +9,12 @@ "Licensed under the MIT License." ] }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/distributed-chainer/distributed-chainer.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/distributed-chainer/distributed-chainer.png)" + ] }, { "cell_type": "markdown", @@ -95,10 +95,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Create or attach existing AmlCompute\n", - "You will need to create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for training your model. In this tutorial, we use Azure ML managed compute ([AmlCompute](https://docs.microsoft.com/azure/machine-learning/service/how-to-set-up-training-targets#amlcompute)) for our remote training compute resource. Specifically, the below code creates an `STANDARD_NC6` GPU cluster that autoscales from `0` to `4` nodes.\n", - "\n", - "**Creation of AmlCompute takes approximately 5 minutes.** If the AmlCompute with that name is already in your workspace, this code will skip the creation process.\n", + "## Get default AmlCompute\n", + "You can create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for training your model. In this tutorial, we use Azure ML managed compute ([AmlCompute](https://docs.microsoft.com/azure/machine-learning/service/how-to-set-up-training-targets#amlcompute)) for our remote training compute resource. Specifically, the below code gets the default compute cluster.\n", "\n", "As with other Azure services, there are limits on certain resources (e.g. AmlCompute) associated with the Azure Machine Learning service. Please read [this article](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-manage-quotas) on the default limits and how to request more quota." ] @@ -109,24 +107,7 @@ "metadata": {}, "outputs": [], "source": [ - "from azureml.core.compute import ComputeTarget, AmlCompute\n", - "from azureml.core.compute_target import ComputeTargetException\n", - "\n", - "# choose a name for your cluster\n", - "cluster_name = \"gpucluster\"\n", - "\n", - "try:\n", - " compute_target = ComputeTarget(workspace=ws, name=cluster_name)\n", - " print('Found existing compute target.')\n", - "except ComputeTargetException:\n", - " print('Creating a new compute target...')\n", - " compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_NC6',\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", + "compute_target = ws.get_default_compute_target(type=\"GPU\")\n", "\n", "# use get_status() to get a detailed status for the current AmlCompute. \n", "print(compute_target.get_status().serialize())" @@ -136,7 +117,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The above code creates GPU compute. If you instead want to create CPU compute, provide a different VM size to the `vm_size` parameter, such as `STANDARD_D2_V2`." + "The above code retrieves the default GPU compute. If you instead want to use default CPU compute, provide type=\"CPU\"." ] }, { @@ -319,4 +300,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/training-with-deep-learning/distributed-cntk-with-custom-docker/distributed-cntk-with-custom-docker.ipynb b/how-to-use-azureml/training-with-deep-learning/distributed-cntk-with-custom-docker/distributed-cntk-with-custom-docker.ipynb index 1cf731e5..3f243baa 100644 --- a/how-to-use-azureml/training-with-deep-learning/distributed-cntk-with-custom-docker/distributed-cntk-with-custom-docker.ipynb +++ b/how-to-use-azureml/training-with-deep-learning/distributed-cntk-with-custom-docker/distributed-cntk-with-custom-docker.ipynb @@ -9,12 +9,12 @@ "Licensed under the MIT License." ] }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/distributed-cntk-with-custom-docker/distributed-cntk-with-custom-docker.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/distributed-cntk-with-custom-docker/distributed-cntk-with-custom-docker.png)" + ] }, { "cell_type": "markdown", @@ -98,10 +98,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Create or Attach existing AmlCompute\n", - "You will need to create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for training your model. In this tutorial, you create `AmlCompute` as your training compute resource.\n", - "\n", - "**Creation of AmlCompute takes approximately 5 minutes.** If the AmlCompute with that name is already in your workspace this code will skip the creation process.\n", + "## Get default AmlCompute\n", + "You can create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for training your model. In this tutorial, we use default `AmlCompute` as the training compute resource.\n", "\n", "As with other Azure services, there are limits on certain resources (e.g. AmlCompute) associated with the Azure Machine Learning service. Please read [this article](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-manage-quotas) on the default limits and how to request more quota." ] @@ -112,24 +110,7 @@ "metadata": {}, "outputs": [], "source": [ - "from azureml.core.compute import ComputeTarget, AmlCompute\n", - "from azureml.core.compute_target import ComputeTargetException\n", - "\n", - "# choose a name for your cluster\n", - "cluster_name = \"gpucluster\"\n", - "\n", - "try:\n", - " compute_target = ComputeTarget(workspace=ws, name=cluster_name)\n", - " print('Found existing compute target.')\n", - "except ComputeTargetException:\n", - " print('Creating a new compute target...')\n", - " compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_NC6',\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", + "compute_target = ws.get_default_compute_target(type=\"GPU\")\n", "\n", "# use get_status() to get a detailed status for the current AmlCompute\n", "print(compute_target.get_status().serialize())" @@ -398,4 +379,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/training-with-deep-learning/distributed-pytorch-with-horovod/distributed-pytorch-with-horovod.ipynb b/how-to-use-azureml/training-with-deep-learning/distributed-pytorch-with-horovod/distributed-pytorch-with-horovod.ipynb index efedb662..021c6558 100644 --- a/how-to-use-azureml/training-with-deep-learning/distributed-pytorch-with-horovod/distributed-pytorch-with-horovod.ipynb +++ b/how-to-use-azureml/training-with-deep-learning/distributed-pytorch-with-horovod/distributed-pytorch-with-horovod.ipynb @@ -13,8 +13,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/distributed-pytorch-with-horovod/distributed-pytorch-with-horovod.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/distributed-pytorch-with-horovod/distributed-pytorch-with-horovod.png)" + ] }, { "cell_type": "markdown", @@ -96,10 +96,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Create or attach existing AmlCompute\n", - "You will need to create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for training your model. In this tutorial, we use Azure ML managed compute ([AmlCompute](https://docs.microsoft.com/azure/machine-learning/service/how-to-set-up-training-targets#amlcompute)) for our remote training compute resource. Specifically, the below code creates an `STANDARD_NC6` GPU cluster that autoscales from `0` to `4` nodes.\n", - "\n", - "**Creation of AmlCompute takes approximately 5 minutes.** If the AmlCompute with that name is already in your workspace, this code will skip the creation process.\n", + "## Get default AmlCompute\n", + "You can create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for training your model. In this tutorial, we use Azure ML managed compute ([AmlCompute](https://docs.microsoft.com/azure/machine-learning/service/how-to-set-up-training-targets#amlcompute)) for our remote training compute resource. Specifically, the below code uses the default compute in the workspace.\n", "\n", "As with other Azure services, there are limits on certain resources (e.g. AmlCompute) associated with the Azure Machine Learning service. Please read [this article](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-manage-quotas) on the default limits and how to request more quota." ] @@ -110,24 +108,7 @@ "metadata": {}, "outputs": [], "source": [ - "from azureml.core.compute import ComputeTarget, AmlCompute\n", - "from azureml.core.compute_target import ComputeTargetException\n", - "\n", - "# choose a name for your cluster\n", - "cluster_name = \"gpucluster\"\n", - "\n", - "try:\n", - " compute_target = ComputeTarget(workspace=ws, name=cluster_name)\n", - " print('Found existing compute target.')\n", - "except ComputeTargetException:\n", - " print('Creating a new compute target...')\n", - " compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_NC6',\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", + "compute_target = ws.get_default_compute_target(type=\"GPU\")\n", "\n", "# use get_status() to get a detailed status for the current AmlCompute. \n", "print(compute_target.get_status().serialize())" @@ -137,7 +118,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The above code creates GPU compute. If you instead want to create CPU compute, provide a different VM size to the `vm_size` parameter, such as `STANDARD_D2_V2`." + "The above code retrieves the default GPU compute. If you instead want to use default CPU compute, provide type=\"CPU\"." ] }, { @@ -339,4 +320,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/training-with-deep-learning/distributed-tensorflow-with-horovod/distributed-tensorflow-with-horovod.ipynb b/how-to-use-azureml/training-with-deep-learning/distributed-tensorflow-with-horovod/distributed-tensorflow-with-horovod.ipynb index e0b7e4fd..1ea1b929 100644 --- a/how-to-use-azureml/training-with-deep-learning/distributed-tensorflow-with-horovod/distributed-tensorflow-with-horovod.ipynb +++ b/how-to-use-azureml/training-with-deep-learning/distributed-tensorflow-with-horovod/distributed-tensorflow-with-horovod.ipynb @@ -9,12 +9,12 @@ "Licensed under the MIT License." ] }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/distributed-tensorflow-with-horovod/distributed-tensorflow-with-horovod.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/manage-runs/manage-runs.png)" + ] }, { "cell_type": "markdown", @@ -98,10 +98,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Create or Attach existing AmlCompute\n", - "You will need to create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for training your model. In this tutorial, you create `AmlCompute` as your training compute resource.\n", - "\n", - "**Creation of AmlCompute takes approximately 5 minutes.** If the AmlCompute with that name is already in your workspace this code will skip the creation process.\n", + "## Get default AmlCompute\n", + "You can create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for training your model. In this tutorial, you use default `AmlCompute` as your training compute resource.\n", "\n", "As with other Azure services, there are limits on certain resources (e.g. AmlCompute) associated with the Azure Machine Learning service. Please read [this article](https://docs.microsoft.com/azure/machine-learning/service/how-to-manage-quotas) on the default limits and how to request more quota." ] @@ -112,24 +110,7 @@ "metadata": {}, "outputs": [], "source": [ - "from azureml.core.compute import ComputeTarget, AmlCompute\n", - "from azureml.core.compute_target import ComputeTargetException\n", - "\n", - "# choose a name for your cluster\n", - "cluster_name = \"gpucluster\"\n", - "\n", - "try:\n", - " compute_target = ComputeTarget(workspace=ws, name=cluster_name)\n", - " print('Found existing compute target')\n", - "except ComputeTargetException:\n", - " print('Creating a new compute target...')\n", - " compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_NC6', \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", + "compute_target = ws.get_default_compute_target(\"GPU\")\n", "\n", "# use get_status() to get a detailed status for the current cluster. \n", "print(compute_target.get_status().serialize())" @@ -139,7 +120,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The above code creates a GPU cluster. If you instead want to create a CPU cluster, provide a different VM size to the `vm_size` parameter, such as `STANDARD_D2_V2`." + "The above code retrieves the default GPU compute. If you instead want to use default CPU compute, provide type=\"CPU\"." ] }, { @@ -408,4 +389,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/training-with-deep-learning/distributed-tensorflow-with-parameter-server/distributed-tensorflow-with-parameter-server.ipynb b/how-to-use-azureml/training-with-deep-learning/distributed-tensorflow-with-parameter-server/distributed-tensorflow-with-parameter-server.ipynb index 5b993ba3..43c48bae 100644 --- a/how-to-use-azureml/training-with-deep-learning/distributed-tensorflow-with-parameter-server/distributed-tensorflow-with-parameter-server.ipynb +++ b/how-to-use-azureml/training-with-deep-learning/distributed-tensorflow-with-parameter-server/distributed-tensorflow-with-parameter-server.ipynb @@ -9,12 +9,12 @@ "Licensed under the MIT License." ] }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/distributed-tensorflow-with-parameter-server/distributed-tensorflow-with-parameter-server.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/distributed-tensorflow-with-parameter-server/distributed-tensorflow-with-parameter-server.png)" + ] }, { "cell_type": "markdown", @@ -98,10 +98,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Create or Attach existing AmlCompute\n", - "You will need to create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for training your model. In this tutorial, you create `AmlCompute` as your training compute resource.\n", - "\n", - "**Creation of AmlCompute takes approximately 5 minutes.** If the AmlCompute with that name is already in your workspace this code will skip the creation process.\n", + "## Get default AmlCompute\n", + "You can create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for training your model. In this tutorial, you use default `AmlCompute` as your training compute resource.\n", "\n", "As with other Azure services, there are limits on certain resources (e.g. AmlCompute) associated with the Azure Machine Learning service. Please read [this article](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-manage-quotas) on the default limits and how to request more quota." ] @@ -112,24 +110,7 @@ "metadata": {}, "outputs": [], "source": [ - "from azureml.core.compute import ComputeTarget, AmlCompute\n", - "from azureml.core.compute_target import ComputeTargetException\n", - "\n", - "# choose a name for your cluster\n", - "cluster_name = \"gpucluster\"\n", - "\n", - "try:\n", - " compute_target = ComputeTarget(workspace=ws, name=cluster_name)\n", - " print('Found existing compute target.')\n", - "except ComputeTargetException:\n", - " print('Creating a new compute target...')\n", - " compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_NC6', \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", + "compute_target = ws.get_default_compute_target(type=\"GPU\")\n", "\n", "# use get_status() to get a detailed status for the current cluster. \n", "print(compute_target.get_status().serialize())" @@ -323,4 +304,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/training-with-deep-learning/export-run-history-to-tensorboard/export-run-history-to-tensorboard.ipynb b/how-to-use-azureml/training-with-deep-learning/export-run-history-to-tensorboard/export-run-history-to-tensorboard.ipynb index 93f20ddf..6d15a48c 100644 --- a/how-to-use-azureml/training-with-deep-learning/export-run-history-to-tensorboard/export-run-history-to-tensorboard.ipynb +++ b/how-to-use-azureml/training-with-deep-learning/export-run-history-to-tensorboard/export-run-history-to-tensorboard.ipynb @@ -13,8 +13,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/export-run-history-to-tensorboard/export-run-history-to-tensorboard.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/export-run-history-to-tensorboard/export-run-history-to-tensorboard.png)" + ] }, { "cell_type": "markdown", @@ -50,22 +50,6 @@ "print(\"SDK version:\", azureml.core.VERSION)" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Install the Azure ML TensorBoard integration package if you haven't already." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!pip install azureml-tensorboard" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -269,4 +253,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/training-with-deep-learning/how-to-use-estimator/dummy_train.py b/how-to-use-azureml/training-with-deep-learning/how-to-use-estimator/dummy_train.py index 50db4e1d..d6b723b3 100644 --- a/how-to-use-azureml/training-with-deep-learning/how-to-use-estimator/dummy_train.py +++ b/how-to-use-azureml/training-with-deep-learning/how-to-use-estimator/dummy_train.py @@ -1,14 +1,31 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. +import argparse + print("*********************************************************") print("Hello Azure ML!") +parser = argparse.ArgumentParser() +parser.add_argument('--numbers-in-sequence', type=int, dest='num_in_sequence', default=10, + help='number of fibonacci numbers in sequence') +args = parser.parse_args() +num = args.num_in_sequence + + +def fibo(n): + if n < 2: + return n + else: + return fibo(n - 1) + fibo(n - 2) + + try: from azureml.core import Run run = Run.get_context() print("Log Fibonacci numbers.") - run.log_list('Fibonacci numbers', [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]) + for i in range(0, num - 1): + run.log('Fibonacci numbers', fibo(i)) run.complete() except: print("Warning: you need to install Azure ML SDK in order to log metrics.") diff --git a/how-to-use-azureml/training-with-deep-learning/how-to-use-estimator/how-to-use-estimator.ipynb b/how-to-use-azureml/training-with-deep-learning/how-to-use-estimator/how-to-use-estimator.ipynb index c2527208..db7462b7 100644 --- a/how-to-use-azureml/training-with-deep-learning/how-to-use-estimator/how-to-use-estimator.ipynb +++ b/how-to-use-azureml/training-with-deep-learning/how-to-use-estimator/how-to-use-estimator.ipynb @@ -9,12 +9,12 @@ "Licensed under the MIT License." ] }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/how-to-use-estimator/how-to-use-estimator.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/how-to-use-estimator/how-to-use-estimator.png)" + ] }, { "cell_type": "markdown", @@ -113,18 +113,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Create or Attach existing AmlCompute\n", - "You will need to create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for training your model. In this tutorial, you create `AmlCompute` as your training compute resource." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "If we could not find the cluster with the given name, then we will create a new cluster here. We will create an `AmlCompute` cluster of `STANDARD_NC6` GPU VMs. This process is broken down into 3 steps:\n", - "1. create the configuration (this step is local and only takes a second)\n", - "2. create the cluster (this step will take about **20 seconds**)\n", - "3. provision the VMs to bring the cluster to the initial size (of 1 in this case). This step will take about **3-5 minutes** and is providing only sparse output in the process. Please make sure to wait until the call returns before moving to the next cell" + "## Get default AmlCompute\n", + "You can create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for training your model. In this tutorial, you use default `AmlCompute` as your training compute resource." ] }, { @@ -133,25 +123,7 @@ "metadata": {}, "outputs": [], "source": [ - "from azureml.core.compute import ComputeTarget, AmlCompute\n", - "from azureml.core.compute_target import ComputeTargetException\n", - "\n", - "# choose a name for your cluster\n", - "cluster_name = \"cpucluster\"\n", - "\n", - "try:\n", - " cpu_cluster = ComputeTarget(workspace=ws, name=cluster_name)\n", - " print('Found existing compute target')\n", - "except ComputeTargetException:\n", - " print('Creating a new compute target...')\n", - " compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_NC6', max_nodes=4)\n", - "\n", - " # create the cluster\n", - " cpu_cluster = ComputeTarget.create(ws, cluster_name, compute_config)\n", - "\n", - " # can poll for a minimum number of nodes and for a specific timeout. \n", - " # if no min node count is provided it uses the scale settings for the cluster\n", - " cpu_cluster.wait_for_completion(show_output=True, min_node_count=None, timeout_in_minutes=20)\n", + "cpu_cluster = ws.get_default_compute_target(\"CPU\")\n", "\n", "# use get_status() to get a detailed status for the current cluster. \n", "print(cpu_cluster.get_status().serialize())" @@ -161,7 +133,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Now that you have created the compute target, let's see what the workspace's `compute_targets` property returns. You should now see one entry named 'cpucluster' of type `AmlCompute`." + "Now that you have retrieved the compute target, let's see what the workspace's `compute_targets` property returns." ] }, { @@ -184,7 +156,7 @@ }, "source": [ "## Use a simple script\n", - "We have already created a simple \"hello world\" script. This is the script that we will submit through the estimator pattern. It prints a hello-world message, and if Azure ML SDK is installed, it will also logs an array of values ([Fibonacci numbers](https://en.wikipedia.org/wiki/Fibonacci_number))." + "We have already created a simple \"hello world\" script. This is the script that we will submit through the estimator pattern. It prints a hello-world message, and if Azure ML SDK is installed, it will also logs an array of values ([Fibonacci numbers](https://en.wikipedia.org/wiki/Fibonacci_number)). The script takes as input the number of Fibonacci numbers in the sequence to log." ] }, { @@ -235,7 +207,10 @@ "outputs": [], "source": [ "# use a conda environment, don't use Docker, on local computer\n", - "est = Estimator(source_directory='.', compute_target='local', entry_script='dummy_train.py', use_docker=False)\n", + "script_params = {\n", + " '--numbers-in-sequence': 10\n", + "}\n", + "est = Estimator(source_directory='.', script_params=script_params, compute_target='local', entry_script='dummy_train.py', use_docker=False)\n", "run = exp.submit(est)\n", "RunDetails(run).show()" ] @@ -254,7 +229,10 @@ "outputs": [], "source": [ "# use a conda environment on default Docker image in an AmlCompute cluster\n", - "est = Estimator(source_directory='.', compute_target=cpu_cluster, entry_script='dummy_train.py', use_docker=True)\n", + "script_params = {\n", + " '--numbers-in-sequence': 10\n", + "}\n", + "est = Estimator(source_directory='.', script_params=script_params, compute_target=cpu_cluster, entry_script='dummy_train.py', use_docker=True)\n", "run = exp.submit(est)\n", "RunDetails(run).show()" ] @@ -273,7 +251,11 @@ "outputs": [], "source": [ "# add a conda package\n", + "script_params = {\n", + " '--numbers-in-sequence': 10\n", + "}\n", "est = Estimator(source_directory='.', \n", + " script_params=script_params, \n", " compute_target='local', \n", " entry_script='dummy_train.py', \n", " use_docker=False, \n", @@ -313,7 +295,12 @@ "user_managed_dependencies = True\n", "\n", "# submit to a local Docker container. if you don't have Docker engine running locally, you can set compute_target to cpu_cluster.\n", - "est = Estimator(source_directory='.', compute_target='local', \n", + "script_params = {\n", + " '--numbers-in-sequence': 10\n", + "}\n", + "est = Estimator(source_directory='.', \n", + " script_params=script_params, \n", + " compute_target='local', \n", " entry_script='dummy_train.py',\n", " custom_docker_image=image_name,\n", " # uncomment below line to use your private ACR\n", @@ -332,6 +319,130 @@ "Note: if you need to cancel a run, you can follow [these instructions](https://aka.ms/aml-docs-cancel-run)." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Intelligent hyperparameter tuning\n", + "\n", + "The simple \"hello world\" script above lets the user fix the value of a parameter for the number of Fibonacci numbers in the sequence to log. Similarly, when training models, you can fix values of parameters of the training algorithm itself. E.g. the learning rate, the number of layers, the number of nodes in each layer in a neural network, etc. These adjustable parameters that govern the training process are referred to as the hyperparameters of the model. The goal of hyperparameter tuning is to search across various hyperparameter configurations and find the configuration that results in the best performance.\n", + "\n", + "\n", + "To demonstrate how Azure Machine Learning can help you automate the process of hyperarameter tuning, we will launch multiple runs with different values for numbers in the sequence. First let's define the parameter space using random sampling." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.train.hyperdrive import RandomParameterSampling, BanditPolicy, HyperDriveConfig, PrimaryMetricGoal\n", + "from azureml.train.hyperdrive import choice\n", + "\n", + "ps = RandomParameterSampling(\n", + " {\n", + " '--numbers-in-sequence': choice(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)\n", + " }\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Next, we will create a new estimator without the above numbers-in-sequence parameter since that will be passed in later. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "est = Estimator(source_directory='.', script_params={}, compute_target=cpu_cluster, entry_script='dummy_train.py', use_docker=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Next, we will look at training metrics and early termination policies. When training a model, users are interested in logging and optimizing certain metrics of the model e.g. maximize the accuracy of the model, or minimize loss. This metric is logged by the training script for each run. In our simple script above, we are logging Fibonacci numbers in a sequence. But a training script could just as easily log other metrics like accuracy or loss, which can be used to evaluate the performance of a given training run.\n", + "\n", + "The intelligent hyperparameter tuning capability in Azure Machine Learning automatically terminates poorly performing runs using an early termination policy. Early termination reduces wastage of compute resources and instead uses these resources for exploring other hyperparameter configurations. In this example, we use the BanditPolicy. This basically states to check the job every 2 iterations. If the primary metric (defined later) falls outside of the top 10% range, Azure ML will terminate the training run. This saves us from continuing to explore hyperparameters that don't show promise of helping reach our target metric." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "policy = BanditPolicy(evaluation_interval=2, slack_factor=0.1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now we are ready to configure a run configuration object for hyperparameter tuning. We need to call out the primary metric that we want the experiment to optimize. The name of the primary metric needs to exactly match the name of the metric logged by the training script and we specify that we are looking to maximize this value. Next, we control the resource budget for the experiment by setting the maximum total number of training runs to 10. We also set the maximum number of training runs to run concurrently at 4, which is the same as the number of nodes in our computer cluster." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "hdc = HyperDriveConfig(estimator=est, \n", + " hyperparameter_sampling=ps, \n", + " policy=policy, \n", + " primary_metric_name='Fibonacci numbers', \n", + " primary_metric_goal=PrimaryMetricGoal.MAXIMIZE, \n", + " max_total_runs=10,\n", + " max_concurrent_runs=4)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Finally, let's launch the hyperparameter tuning job." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "hdr = exp.submit(config=hdc)\n", + "RunDetails(hdr).show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "When all the runs complete, we can find the run with the best performance" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "best_run = hdr.get_best_run_by_primary_metric()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can register the model from the best run and use it to deploy a web service that can be used for Inferencing. Details on how how you can do this can be found in the sample folders for the ohter types of estimators.\n" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -368,4 +479,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/training-with-deep-learning/tensorboard/tensorboard.ipynb b/how-to-use-azureml/training-with-deep-learning/tensorboard/tensorboard.ipynb index 757a1a0e..751f6671 100644 --- a/how-to-use-azureml/training-with-deep-learning/tensorboard/tensorboard.ipynb +++ b/how-to-use-azureml/training-with-deep-learning/tensorboard/tensorboard.ipynb @@ -9,12 +9,12 @@ "Licensed under the MIT License." ] }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/tensorboard/tensorboard.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/tensorboard/tensorboard.png)" + ] }, { "cell_type": "markdown", @@ -51,22 +51,6 @@ "print(\"SDK version:\", azureml.core.VERSION)" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Install the Azure ML TensorBoard package." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!pip install azureml-tensorboard" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -571,4 +555,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-chainer/train-hyperparameter-tune-deploy-with-chainer.ipynb b/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-chainer/train-hyperparameter-tune-deploy-with-chainer.ipynb index b6e0493f..e6a3f48d 100644 --- a/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-chainer/train-hyperparameter-tune-deploy-with-chainer.ipynb +++ b/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-chainer/train-hyperparameter-tune-deploy-with-chainer.ipynb @@ -9,12 +9,12 @@ "Licensed under the MIT License." ] }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-chainer/train-hyperparameter-tune-deploy-with-chainer.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-chainer/train-hyperparameter-tune-deploy-with-chainer.png)" + ] }, { "cell_type": "markdown", @@ -95,10 +95,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Create or Attach existing AmlCompute\n", - "You will need to create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for training your model. In this tutorial, we use Azure ML managed compute ([AmlCompute](https://docs.microsoft.com/azure/machine-learning/service/how-to-set-up-training-targets#amlcompute)) for our remote training compute resource.\n", - "\n", - "**Creation of AmlCompute takes approximately 5 minutes.** If the AmlCompute with that name is already in your workspace, this code will skip the creation process.\n", + "## Get default AmlCompute\n", + "You can create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for training your model. In this tutorial, we use Azure ML managed compute ([AmlCompute](https://docs.microsoft.com/azure/machine-learning/service/how-to-set-up-training-targets#amlcompute)) for our remote training compute resource.\n", "\n", "As with other Azure services, there are limits on certain resources (e.g. AmlCompute) associated with the Azure Machine Learning service. Please read [this article](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-manage-quotas) on the default limits and how to request more quota." ] @@ -109,24 +107,7 @@ "metadata": {}, "outputs": [], "source": [ - "from azureml.core.compute import ComputeTarget, AmlCompute\n", - "from azureml.core.compute_target import ComputeTargetException\n", - "\n", - "# choose a name for your cluster\n", - "cluster_name = \"gpucluster\"\n", - "\n", - "try:\n", - " compute_target = ComputeTarget(workspace=ws, name=cluster_name)\n", - " print('Found existing compute target.')\n", - "except ComputeTargetException:\n", - " print('Creating a new compute target...')\n", - " compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_NC6', \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", + "compute_target = ws.get_default_compute_target(type=\"GPU\")\n", "\n", "# use get_status() to get a detailed status for the current cluster. \n", "print(compute_target.get_status().serialize())" @@ -136,7 +117,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The above code creates a GPU cluster. If you instead want to create a CPU cluster, provide a different VM size to the `vm_size` parameter, such as `STANDARD_D2_V2`." + "The above code retrieves the default GPU compute. If you instead want to use default CPU compute, provide type=\"CPU\"." ] }, { @@ -337,7 +318,7 @@ "metadata": {}, "outputs": [], "source": [ - "from azureml.train.hyperdrive.runconfig import HyperDriveRunConfig\n", + "from azureml.train.hyperdrive.runconfig import HyperDriveConfig\n", "from azureml.train.hyperdrive.sampling import RandomParameterSampling\n", "from azureml.train.hyperdrive.policy import BanditPolicy\n", "from azureml.train.hyperdrive.run import PrimaryMetricGoal\n", @@ -350,12 +331,12 @@ " }\n", ")\n", "\n", - "hyperdrive_run_config = HyperDriveRunConfig(estimator=estimator,\n", - " hyperparameter_sampling=param_sampling, \n", - " primary_metric_name='Accuracy',\n", - " primary_metric_goal=PrimaryMetricGoal.MAXIMIZE,\n", - " max_total_runs=8,\n", - " max_concurrent_runs=4)\n" + "hyperdrive_config = HyperDriveConfig(estimator=estimator,\n", + " hyperparameter_sampling=param_sampling, \n", + " primary_metric_name='Accuracy',\n", + " primary_metric_goal=PrimaryMetricGoal.MAXIMIZE,\n", + " max_total_runs=8,\n", + " max_concurrent_runs=4)\n" ] }, { @@ -372,7 +353,7 @@ "outputs": [], "source": [ "# start the HyperDrive run\n", - "hyperdrive_run = experiment.submit(hyperdrive_run_config)" + "hyperdrive_run = experiment.submit(hyperdrive_config)" ] }, { @@ -429,4 +410,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-keras/train-hyperparameter-tune-deploy-with-keras.ipynb b/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-keras/train-hyperparameter-tune-deploy-with-keras.ipynb index afe0d04e..d5ab58fc 100644 --- a/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-keras/train-hyperparameter-tune-deploy-with-keras.ipynb +++ b/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-keras/train-hyperparameter-tune-deploy-with-keras.ipynb @@ -9,12 +9,12 @@ "Licensed under the MIT License." ] }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-keras/train-hyperparameter-tune-deploy-with-keras.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-keras/train-hyperparameter-tune-deploy-with-keras.png)" + ] }, { "cell_type": "markdown", @@ -239,18 +239,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Create or Attach existing AmlCompute\n", - "You will need to create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for training your model. In this tutorial, you create `AmlCompute` as your training compute resource." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "If we could not find the cluster with the given name, then we will create a new cluster here. We will create an `AmlCompute` cluster of `STANDARD_NC6` GPU VMs. This process is broken down into 3 steps:\n", - "1. create the configuration (this step is local and only takes a second)\n", - "2. create the cluster (this step will take about **20 seconds**)\n", - "3. provision the VMs to bring the cluster to the initial size (of 1 in this case). This step will take about **3-5 minutes** and is providing only sparse output in the process. Please make sure to wait until the call returns before moving to the next cell" + "## Get default AmlCompute\n", + "You can create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for training your model. In this tutorial, you use default `AmlCompute` as your training compute resource." ] }, { @@ -259,26 +249,7 @@ "metadata": {}, "outputs": [], "source": [ - "from azureml.core.compute import ComputeTarget, AmlCompute\n", - "from azureml.core.compute_target import ComputeTargetException\n", - "\n", - "# choose a name for your cluster\n", - "cluster_name = \"gpucluster\"\n", - "\n", - "try:\n", - " compute_target = ComputeTarget(workspace=ws, name=cluster_name)\n", - " print('Found existing compute target')\n", - "except ComputeTargetException:\n", - " print('Creating a new compute target...')\n", - " compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_NC6', \n", - " max_nodes=4)\n", - "\n", - " # create the cluster\n", - " compute_target = ComputeTarget.create(ws, cluster_name, compute_config)\n", - "\n", - " # can poll for a minimum number of nodes and for a specific timeout. \n", - " # if no min node count is provided it uses the scale settings for the cluster\n", - " compute_target.wait_for_completion(show_output=True, min_node_count=None, timeout_in_minutes=20)\n", + "compute_target = ws.get_default_compute_target(type=\"GPU\")\n", "\n", "# use get_status() to get a detailed status for the current cluster. \n", "print(compute_target.get_status().serialize())" @@ -288,7 +259,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Now that you have created the compute target, let's see what the workspace's `compute_targets` property returns. You should now see one entry named \"gpucluster\" of type `AmlCompute`." + "Now that you have retrtieved the compute target, let's see what the workspace's `compute_targets` property returns." ] }, { @@ -671,7 +642,7 @@ "metadata": {}, "outputs": [], "source": [ - "from azureml.train.hyperdrive import RandomParameterSampling, BanditPolicy, HyperDriveRunConfig, PrimaryMetricGoal\n", + "from azureml.train.hyperdrive import RandomParameterSampling, BanditPolicy, HyperDriveConfig, PrimaryMetricGoal\n", "from azureml.train.hyperdrive import choice, loguniform\n", "\n", "ps = RandomParameterSampling(\n", @@ -734,13 +705,13 @@ "metadata": {}, "outputs": [], "source": [ - "hdc = HyperDriveRunConfig(estimator=est, \n", - " hyperparameter_sampling=ps, \n", - " policy=policy, \n", - " primary_metric_name='Accuracy', \n", - " primary_metric_goal=PrimaryMetricGoal.MAXIMIZE, \n", - " max_total_runs=20,\n", - " max_concurrent_runs=4)" + "hdc = HyperDriveConfig(estimator=est, \n", + " hyperparameter_sampling=ps, \n", + " policy=policy, \n", + " primary_metric_name='Accuracy', \n", + " primary_metric_goal=PrimaryMetricGoal.MAXIMIZE, \n", + " max_total_runs=20,\n", + " max_concurrent_runs=4)" ] }, { @@ -1175,4 +1146,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-tensorflow/train-hyperparameter-tune-deploy-with-tensorflow.ipynb b/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-tensorflow/train-hyperparameter-tune-deploy-with-tensorflow.ipynb index fab74177..f07dddb7 100644 --- a/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-tensorflow/train-hyperparameter-tune-deploy-with-tensorflow.ipynb +++ b/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-tensorflow/train-hyperparameter-tune-deploy-with-tensorflow.ipynb @@ -9,12 +9,12 @@ "Licensed under the MIT License." ] }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-tensorflow/train-hyperparameter-tune-deploy-with-tensorflow.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-tensorflow/train-hyperparameter-tune-deploy-with-tensorflow.png)" + ] }, { "cell_type": "markdown", @@ -261,18 +261,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Create or Attach existing AmlCompute\n", - "You will need to create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for training your model. In this tutorial, you create `AmlCompute` as your training compute resource." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "If we could not find the cluster with the given name, then we will create a new cluster here. We will create an `AmlCompute` cluster of `STANDARD_NC6` GPU VMs. This process is broken down into 3 steps:\n", - "1. create the configuration (this step is local and only takes a second)\n", - "2. create the cluster (this step will take about **20 seconds**)\n", - "3. provision the VMs to bring the cluster to the initial size (of 1 in this case). This step will take about **3-5 minutes** and is providing only sparse output in the process. Please make sure to wait until the call returns before moving to the next cell" + "## Get default AmlCompute\n", + "You can create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for training your model. In this tutorial, you use default `AmlCompute` as your training compute resource." ] }, { @@ -281,26 +271,7 @@ "metadata": {}, "outputs": [], "source": [ - "from azureml.core.compute import ComputeTarget, AmlCompute\n", - "from azureml.core.compute_target import ComputeTargetException\n", - "\n", - "# choose a name for your cluster\n", - "cluster_name = \"gpucluster\"\n", - "\n", - "try:\n", - " compute_target = ComputeTarget(workspace=ws, name=cluster_name)\n", - " print('Found existing compute target')\n", - "except ComputeTargetException:\n", - " print('Creating a new compute target...')\n", - " compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_NC6', \n", - " max_nodes=4)\n", - "\n", - " # create the cluster\n", - " compute_target = ComputeTarget.create(ws, cluster_name, compute_config)\n", - "\n", - " # can poll for a minimum number of nodes and for a specific timeout. \n", - " # if no min node count is provided it uses the scale settings for the cluster\n", - " compute_target.wait_for_completion(show_output=True, min_node_count=None, timeout_in_minutes=20)\n", + "compute_target = ws.get_default_compute_target(type=\"GPU\")\n", "\n", "# use get_status() to get a detailed status for the current cluster. \n", "print(compute_target.get_status().serialize())" @@ -310,7 +281,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Now that you have created the compute target, let's see what the workspace's `compute_targets` property returns. You should now see one entry named 'gpucluster' of type `AmlCompute`." + "Now that you have retrieved the compute target, let's see what the workspace's `compute_targets` property returns." ] }, { @@ -691,7 +662,7 @@ "metadata": {}, "outputs": [], "source": [ - "from azureml.train.hyperdrive import RandomParameterSampling, BanditPolicy, HyperDriveRunConfig, PrimaryMetricGoal\n", + "from azureml.train.hyperdrive import RandomParameterSampling, BanditPolicy, HyperDriveConfig, PrimaryMetricGoal\n", "from azureml.train.hyperdrive import choice, loguniform\n", "\n", "ps = RandomParameterSampling(\n", @@ -753,13 +724,13 @@ "metadata": {}, "outputs": [], "source": [ - "htc = HyperDriveRunConfig(estimator=est, \n", - " hyperparameter_sampling=ps, \n", - " policy=policy, \n", - " primary_metric_name='validation_acc', \n", - " primary_metric_goal=PrimaryMetricGoal.MAXIMIZE, \n", - " max_total_runs=8,\n", - " max_concurrent_runs=4)" + "htc = HyperDriveConfig(estimator=est, \n", + " hyperparameter_sampling=ps, \n", + " policy=policy, \n", + " primary_metric_name='validation_acc', \n", + " primary_metric_goal=PrimaryMetricGoal.MAXIMIZE, \n", + " max_total_runs=8,\n", + " max_concurrent_runs=4)" ] }, { @@ -1175,4 +1146,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/training/README.md b/how-to-use-azureml/training/README.md index 21b8e3e8..7e2d8ec9 100644 --- a/how-to-use-azureml/training/README.md +++ b/how-to-use-azureml/training/README.md @@ -9,4 +9,4 @@ Follow these sample notebooks to learn: 5. [Train in an HDI Spark cluster](train-in-spark): train a Spark ML model using an HDInsight Spark cluster as compute target. 6. [Logging API](logging-api): experiment with various logging functions to create runs and automatically generate graphs. - ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/README.png) + ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/README.png) \ No newline at end of file diff --git a/how-to-use-azureml/training/logging-api/logging-api.ipynb b/how-to-use-azureml/training/logging-api/logging-api.ipynb index dd0205bc..0b3aed7f 100644 --- a/how-to-use-azureml/training/logging-api/logging-api.ipynb +++ b/how-to-use-azureml/training/logging-api/logging-api.ipynb @@ -9,12 +9,12 @@ "Licensed under the MIT License." ] }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/logging-api/logging-api.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/logging-api/logging-api.png)" + ] }, { "cell_type": "markdown", @@ -271,9 +271,11 @@ "metadata": {}, "source": [ "### Logging vectors\n", - "Vectors are good for recording information such as loss curves. You can log a vector by create a list of numbers and call ``log_list()`` and supply a name and the list, or by repeatedly logging a value using the same name.\n", + "Vectors are good for recording information such as loss curves. You can log a vector by creating a list of numbers, calling ``log_list()`` and supplying a name and the list, or by repeatedly logging a value using the same name.\n", "\n", - "Vectors are presented in Run Details as a chart, and are directly comparable in experiment reports when placed in a chart. **Note:** vectors logged into the run are expected to be relatively small. Logging very large vectors into Azure ML can result in reduced performance. If you need to store large amounts of data associated with the run, you can write the data to file that will be uploaded." + "Vectors are presented in Run Details as a chart, and are directly comparable in experiment reports when placed in a chart. \n", + "\n", + "**Note:** vectors logged into the run are expected to be relatively small. Logging very large vectors into Azure ML can result in reduced performance. If you need to store large amounts of data associated with the run, you can write the data to file that will be uploaded." ] }, { @@ -304,7 +306,9 @@ "* Create a dictionary of lists where each list represents a column in the table and call ``log_table()``\n", "* Repeatedly call ``log_row()`` providing the same table name with a consistent set of named args as the column values\n", "\n", - "Tables are presented in Run Details as a chart using the first two columns of the table **Note:** tables logged into the run are expected to be relatively small. Logging very large tables into Azure ML can result in reduced performance. If you need to store large amounts of data associated with the run, you can write the data to file that will be uploaded." + "Tables are presented in Run Details as a chart using the first two columns of the table \n", + "\n", + "**Note:** tables logged into the run are expected to be relatively small. Logging very large tables into Azure ML can result in reduced performance. If you need to store large amounts of data associated with the run, you can write the data to file that will be uploaded." ] }, { @@ -365,7 +369,7 @@ "source": [ "### Uploading files\n", "\n", - "Any files that are placed in the ``.\\outputs`` directory are automatically uploaded when the run is completed. These files are also visible in the *Outputs* tab of the Run Details page. Files can also be uploaded explicitly and stored as artifacts along with the run record.\n" + "Files can also be uploaded explicitly and stored as artifacts along with the run record. These files are also visible in the *Outputs* tab of the Run Details page.\n" ] }, { @@ -374,9 +378,13 @@ "metadata": {}, "outputs": [], "source": [ - "%%writefile .\\outputs\\myfile.txt\n", + "file_name = 'outputs/myfile.txt'\n", "\n", - "This is an output file that will be automatically uploaded." + "with open(file_name, \"w\") as f:\n", + " f.write('This is an output file that will be uploaded.\\n')\n", + "\n", + "# Upload the file explicitly into artifacts \n", + "run.upload_file(name = file_name, path_or_stream = file_name)" ] }, { @@ -504,7 +512,7 @@ "## Next steps\n", "To experiment more with logging and to understand how metrics can be visualized, go back to the *Start a run* section, try changing the category and scale_factor values and going through the notebook several times. Play with the KPI, charting, and column selection options on the experiment's Run History reports page to see how the various metrics can be combined and visualized.\n", "\n", - "After learning about all of the logging options, go to the [train on remote vm](..\\train_on_remote_vm\\train_on_remote_vm.ipnyb) notebook and experiment with logging from remote compute contexts." + "After learning about all of the logging options, go to the [train on remote vm](..\\train-on-remote-vm\\train-on-remote-vm.ipynb) notebook and experiment with logging from remote compute contexts." ] } ], @@ -534,4 +542,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/training/manage-runs/manage-runs.ipynb b/how-to-use-azureml/training/manage-runs/manage-runs.ipynb index b96fc93d..ff618ef2 100644 --- a/how-to-use-azureml/training/manage-runs/manage-runs.ipynb +++ b/how-to-use-azureml/training/manage-runs/manage-runs.ipynb @@ -9,12 +9,12 @@ "Licensed under the MIT License." ] }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/manage-runs/manage-runs.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/manage-runs/manage-runs.png)" + ] }, { "cell_type": "markdown", @@ -52,7 +52,7 @@ "source": [ "## Setup\n", "\n", - "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't. Also, if you're new to Azure ML, we recommend that you go through [the tutorial](https://docs.microsoft.com/en-us/azure/machine-learning/service/tutorial-train-models-with-aml) first to learn the basic concepts.\n", + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration](../../../configuration.ipynb) Notebook first if you haven't already to establish your connection to the AzureML Workspace. Also, if you're new to Azure ML, we recommend that you go through [the tutorial](https://docs.microsoft.com/en-us/azure/machine-learning/service/tutorial-train-models-with-aml) first to learn the basic concepts.\n", "\n", "Let's first import required packages, check Azure ML SDK version, connect to your workspace and create an Experiment to hold the runs." ] @@ -599,4 +599,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/training/train-in-spark/train-in-spark.ipynb b/how-to-use-azureml/training/train-in-spark/train-in-spark.ipynb index a3fefdcf..d7b17dbf 100644 --- a/how-to-use-azureml/training/train-in-spark/train-in-spark.ipynb +++ b/how-to-use-azureml/training/train-in-spark/train-in-spark.ipynb @@ -9,12 +9,12 @@ "Licensed under the MIT License." ] }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/train-in-spark/train-in-spark.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/train-in-spark/train-in-spark.png)" + ] }, { "cell_type": "markdown", @@ -32,7 +32,7 @@ "metadata": {}, "source": [ "## Prerequisites\n", - "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't." + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration](../../../configuration.ipynb) Notebook first if you haven't already to establish your connection to the AzureML Workspace." ] }, { @@ -117,7 +117,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "**Note** You can use Docker-based execution to run the Spark job in local computer or a remote VM. Please see the `train-in-remote-vm` notebook for example on how to configure and run in Docker mode in a VM. Make sure you choose a Docker image that has Spark installed, such as `azureml.core.runconfig.DEFAULT_MMLSPARK_CPU_IMAGE`." + "**Note** You can use Docker-based execution to run the Spark job in local computer or a remote VM. Please see the `train-in-remote-vm` notebook for example on how to configure and run in Docker mode in a VM. Make sure you choose a Docker image that has Spark installed, such as `microsoft/mmlspark:0.12`." ] }, { @@ -282,4 +282,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/training/train-on-amlcompute/train-on-amlcompute.ipynb b/how-to-use-azureml/training/train-on-amlcompute/train-on-amlcompute.ipynb index 2133b9ec..a369ff98 100644 --- a/how-to-use-azureml/training/train-on-amlcompute/train-on-amlcompute.ipynb +++ b/how-to-use-azureml/training/train-on-amlcompute/train-on-amlcompute.ipynb @@ -9,12 +9,12 @@ "Licensed under the MIT License." ] }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/train-on-amlcompute/train-on-amlcompute.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/train-on-amlcompute/train-on-amlcompute.png)" + ] }, { "cell_type": "markdown", @@ -38,7 +38,7 @@ "metadata": {}, "source": [ "## Prerequisites\n", - "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't." + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration](../../../configuration.ipynb) Notebook first if you haven't already to establish your connection to the AzureML Workspace." ] }, { @@ -168,9 +168,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Provision as a run based compute target\n", + "### Get the default compute target\n", "\n", - "You can provision AmlCompute as a compute target at run-time. In this case, the compute is auto-created for your run, scales up to max_nodes that you specify, and then **deleted automatically** after the run completes." + "In this case, we use the default `AmlCompute`target from the workspace." ] }, { @@ -186,12 +186,10 @@ "# create a new runconfig object\n", "run_config = RunConfiguration()\n", "\n", - "# signal that you want to use AmlCompute to execute script.\n", - "run_config.target = \"amlcompute\"\n", + "default_compute_target = ws.get_default_compute_target(type=\"CPU\")\n", "\n", - "# AmlCompute will be created in the same region as workspace\n", - "# Set vm size for AmlCompute\n", - "run_config.amlcompute.vm_size = 'STANDARD_D2_V2'\n", + "# signal that you want to use AmlCompute to execute script.\n", + "run_config.target = default_compute_target.name\n", "\n", "# enable Docker \n", "run_config.environment.docker.enabled = True\n", @@ -202,9 +200,6 @@ "# use conda_dependencies.yml to create a conda environment in the Docker image for execution\n", "run_config.environment.python.user_managed_dependencies = False\n", "\n", - "# auto-prepare the Docker image when used for execution (if it is not already prepared)\n", - "run_config.auto_prepare_environment = True\n", - "\n", "# specify CondaDependencies obj\n", "run_config.environment.python.conda_dependencies = CondaDependencies.create(conda_packages=['scikit-learn'])\n", "\n", @@ -526,4 +521,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/training/train-on-local/train-on-local.ipynb b/how-to-use-azureml/training/train-on-local/train-on-local.ipynb index 8acf24e6..f5833223 100644 --- a/how-to-use-azureml/training/train-on-local/train-on-local.ipynb +++ b/how-to-use-azureml/training/train-on-local/train-on-local.ipynb @@ -8,35 +8,68 @@ "\n", "Licensed under the MIT License." ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/train-on-local/train-on-local.png)" - ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "# 02. Train locally\n", - "* Create or load workspace.\n", - "* Create scripts locally.\n", - "* Create `train.py` in a folder, along with a `my.lib` file.\n", - "* Configure & execute a local run in a user-managed Python environment.\n", - "* Configure & execute a local run in a system-managed Python environment.\n", - "* Configure & execute a local run in a Docker environment.\n", - "* Query run metrics to find the best model\n", - "* Register model for operationalization." + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/train-on-local/train-on-local.png)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "## Prerequisites\n", - "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't." + "# 02. Train locally\n", + "_**Train a model locally: Directly on your machine and within a Docker container**_\n", + "\n", + "---\n", + "\n", + "\n", + "## Table of contents\n", + "1. [Introduction](#intro)\n", + "1. [Pre-requisites](#pre-reqs)\n", + "1. [Initialize Workspace](#init)\n", + "1. [Create An Experiment](#exp)\n", + "1. [View training and auxiliary scripts](#view)\n", + "1. [Configure & Run](#config-run)\n", + " 1. User-managed environment\n", + " 1. Set the environment up\n", + " 1. Submit the script to run in the user-managed environment\n", + " 1. Get run history details\n", + " 1. System-managed environment\n", + " 1. Set the environment up\n", + " 1. Submit the script to run in the system-managed environment\n", + " 1. Get run history details\n", + " 1. Docker-based execution\n", + " 1. Set the environment up\n", + " 1. Submit the script to run in the system-managed environment\n", + " 1. Get run history details\n", + " 1. Use a custom Docker image\n", + "1. [Query run metrics](#query)\n", + "\n", + "---\n", + "\n", + "## 1. Introduction \n", + "\n", + "In this notebook, we will learn how to:\n", + "\n", + "* Connect to our AML workspace\n", + "* Create or load a workspace\n", + "* Configure & execute a local run in:\n", + " - a user-managed Python environment\n", + " - a system-managed Python environment\n", + " - a Docker environment\n", + "* Query run metrics to find the best model trained in the run\n", + "* Register that model for operationalization" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 2. Pre-requisites \n", + "In this notebook, we assume that you have set your Azure Machine Learning workspace. If you have not, make sure you go through the [configuration notebook](../../../configuration.ipynb) first. In the end, you should have configuration file that contains the subscription ID, resource group and name of your workspace." ] }, { @@ -55,9 +88,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Initialize Workspace\n", + "## 3. Initialize Workspace \n", "\n", - "Initialize a workspace object from persisted configuration." + "Initialize your workspace object from configuration file" ] }, { @@ -76,8 +109,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Create An Experiment\n", - "**Experiment** is a logical container in an Azure ML Workspace. It hosts run records which can include run metrics and output artifacts from your experiments." + "## 4. Create An Experiment \n", + "An experiment is a logical container in an Azure ML Workspace. It contains a series of trials called `Runs`. As such, it hosts run records such as run metrics, logs, and other output artifacts from your experiments." ] }, { @@ -95,9 +128,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## View `train.py`\n", + "## 5. View training and auxiliary scripts \n", "\n", - "`train.py` is already created for you." + "For convenience, we already created the training (`train.py`) script and supportive libraries (`mylib.py`) for you. Take a few minutes to examine both files." ] }, { @@ -110,13 +143,6 @@ " print(f.read())" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Note `train.py` also references a `mylib.py` file." - ] - }, { "cell_type": "code", "execution_count": null, @@ -131,9 +157,11 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Configure & Run\n", - "### User-managed environment\n", - "Below, we use a user-managed run, which means you are responsible to ensure all the necessary packages are available in the Python environment you choose to run the script." + "## 6. Configure & Run \n", + "### 6.A User-managed environment\n", + "\n", + "#### 6.A.a Set the environment up\n", + "When using a user-managed environment, you are responsible for ensuring that all the necessary packages are available in the Python environment you choose to run the script in." ] }, { @@ -157,8 +185,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Submit script to run in the user-managed environment\n", - "Note whole script folder is submitted for execution, including the `mylib.py` file." + "#### 6.A.b Submit the script to run in the user-managed environment\n", + "Whatever the way you manage your environment, you need to use the `ScriptRunConfig` class. It allows you to further configure your run by pointing to the `train.py` script and to the working directory, which also contains the `mylib.py` file. These inputs indeed provide the commands to execute in the run. Once the run is configured, you submit it to your experiment." ] }, { @@ -177,7 +205,11 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Get run history details" + "#### 6.A.c Get run history details\n", + "\n", + "While all calculations were run on your machine (cf. below), by using a `run` you also captured the results of your calculations into your run and experiment. You can then see them on the Azure portal, through the link displayed as output of the following cell.\n", + "\n", + "**Note**: The recording of the computation results into your run was made possible by the `run.log()` commands in the `train.py` file." ] }, { @@ -200,7 +232,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Block to wait till run finishes." + "Block any execution to wait until the run finishes." ] }, { @@ -216,8 +248,25 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### System-managed environment\n", - "You can also ask the system to build a new conda environment and execute your scripts in it. The environment is built once and will be reused in subsequent executions as long as the conda dependencies remain unchanged. " + "**Note:** All these calculations were run on your local machine, in the conda environment you defined above. You can find the results in:\n", + "- `~/.azureml/envs/azureml_xxxx` for the conda environment you just created\n", + "- `~/AppData/Local/Temp/azureml_runs/train-on-local_xxxx` for the machine learning models you trained (this path may differ depending on the platform you use). This folder also contains\n", + " - Logs (under azureml_logs/)\n", + " - Output pickled files (under outputs/)\n", + " - The configuration files (credentials, local and docker image setups)\n", + " - The train.py and mylib.py scripts\n", + " - The current notebook\n", + "\n", + "Take a few minutes to examine the output of the cell above. It shows the content of some of the log files, and extra information on the conda environment used." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 6.B System-managed environment\n", + "#### 6.B.a Set the environment up\n", + "Now, instead of managing the setup of the environment yourself, you can ask the system to build a new conda environment for you. The environment is built once, and will be reused in subsequent executions as long as the conda dependencies remain unchanged." ] }, { @@ -231,7 +280,6 @@ "run_config_system_managed = RunConfiguration()\n", "\n", "run_config_system_managed.environment.python.user_managed_dependencies = False\n", - "run_config_system_managed.auto_prepare_environment = True\n", "\n", "# Specify conda dependencies with scikit-learn\n", "cd = CondaDependencies.create(conda_packages=['scikit-learn'])\n", @@ -242,8 +290,10 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Submit script to run in the system-managed environment\n", - "A new conda environment is built based on the conda dependencies object. If you are running this for the first time, this might take up to 5 mninutes. But this conda environment is reused so long as you don't change the conda dependencies." + "#### 6.B.b Submit the script to run in the system-managed environment\n", + "A new conda environment is built based on the conda dependencies object. If you are running this for the first time, this might take up to 5 minutes.\n", + "\n", + "The commands used to execute the run are then the same as the ones you used above." ] }, { @@ -260,7 +310,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Get run history details" + "#### 6.B.c Get run history details" ] }, { @@ -272,13 +322,6 @@ "run" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Block and wait till run finishes." - ] - }, { "cell_type": "code", "execution_count": null, @@ -292,12 +335,34 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Docker-based execution\n", - "**IMPORTANT**: You must have Docker engine installed locally in order to use this execution mode. If your kernel is already running in a Docker container, such as **Azure Notebooks**, this mode will **NOT** work.\n", + "### 6.C Docker-based execution\n", + "In this section, you will train the same models, but you will do so in a Docker container, on your local machine. For this, you then need to have the Docker engine installed locally. If you don't have it yet, please follow the instructions below.\n", "\n", - "NOTE: The GPU base image must be used on Microsoft Azure Services only such as ACI, AML Compute, Azure VMs, and AKS.\n", + "#### How to install Docker\n", "\n", - "You can also ask the system to pull down a Docker image and execute your scripts in it." + "- [Linux](https://docs.docker.com/install/linux/docker-ce/ubuntu/)\n", + "- [MacOs](https://docs.docker.com/docker-for-mac/install/)\n", + "- [Windows](https://docs.docker.com/docker-for-windows/install/)\n", + "\n", + " In case of issues, troubleshooting documentation can be found [here](https://docs.docker.com/docker-for-windows/troubleshoot/#running-docker-for-windows-in-nested-virtualization-scenarios). Additionally, you can follow the steps below, if Virtualization is not enabled on your machine:\n", + " - Go to Task Manager > Performance\n", + " - Check that Virtualization is enabled\n", + " - If it is not, go to `Start > Settings > Update and security > Recovery > Advanced Startup - Restart now > Troubleshoot > Advanced options > UEFI firmware settings - restart`\n", + " - In the BIOS, go to `Advanced > System options > Click the \"Virtualization Technology (VTx)\" only > Save > Exit > Save all changes` -- This will restart the machine\n", + "\n", + "**Notes**: \n", + "- If your kernel is already running in a Docker container, such as **Azure Notebooks**, this mode will **NOT** work.\n", + "- If you use a GPU base image, it needs to be used on Microsoft Azure Services such as ACI, AML Compute, Azure VMs, or AKS.\n", + "\n", + "You can also ask the system to pull down a Docker image and execute your scripts in it.\n", + "\n", + "#### 6.C.a Set the environment up\n", + "\n", + "In the cell below, you will configure your run to execute in a Docker container. It will:\n", + "- run on a CPU\n", + "- contain a conda environment in which the scikit-learn library will be installed.\n", + "\n", + "As before, you will finish configuring your run by pointing to the `train.py` and `mylib.py` files." ] }, { @@ -308,11 +373,10 @@ "source": [ "run_config_docker = RunConfiguration()\n", "run_config_docker.environment.python.user_managed_dependencies = False\n", - "run_config_docker.auto_prepare_environment = True\n", "run_config_docker.environment.docker.enabled = True\n", "\n", "# use the default CPU-based Docker image from Azure ML\n", - "run_config_docker.environment.docker.base_image = azureml.core.runconfig.DEFAULT_CPU_IMAGE\n", + "run_config_docker.environment.docker.base_image = azureml.core.runconfig.DEFAULT_CPU_IMAGE # Reference Docker image\n", "\n", "# Specify conda dependencies with scikit-learn\n", "cd = CondaDependencies.create(conda_packages=['scikit-learn'])\n", @@ -325,8 +389,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Submit script to run in the system-managed environment\n", - "A new conda environment is built based on the conda dependencies object. If you are running this for the first time, this might take up to 5 minutes. But this conda environment is reused so long as you don't change the conda dependencies." + "#### 6.C.b Submit the script to run in the system-managed environment\n", + "\n", + "The run is now configured and ready to be executed in a Docker container. If you are running this for the first time, the Docker container will get created, as well as the conda environment inside it. This will take several minutes. Once all this is generated, however, this conda environment will be reused as long as you don't change the conda dependencies." ] }, { @@ -345,7 +410,34 @@ " else:\n", " run = exp.submit(src)\n", "else:\n", - " print(\"Docker engine not installed.\")" + " print(\"Docker engine is not installed.\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Potential issue on Windows and how to solve it\n", + "\n", + "If you are using a Windows machine, the creation of the Docker image may fail, and you may see the following error message\n", + "`docker: Error response from daemon: Drive has not been shared. Failed to launch docker container. Check that docker is running and that C:\\ on Windows and /tmp elsewhere is shared.`\n", + "\n", + "This is because the process above tries to create a linux-based, i.e. non-windows-based, Docker image. To fix this, you can:\n", + "- Open the Docker user interface\n", + "- Navigate to Settings > Shared drives\n", + "- Select C (or both C and D, if you have one)\n", + "- Apply\n", + "\n", + "When this is done, you can try and re-run the command above.\n", + "\n", + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### 6.C.c Get run history details" ] }, { @@ -354,7 +446,7 @@ "metadata": {}, "outputs": [], "source": [ - "#Get run history details\n", + "# Get run history details\n", "run" ] }, @@ -371,22 +463,51 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Use a custom Docker image\n", + "The results obtained here should be the same as those obtained before. However, take a look at the \"Execution summary\" section in the output of the cell above. Look for \"docker\". There, you should see the \"enabled\" field set to True. Compare this to the 2 prior runs (\"enabled\" was then set to False)." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### 6.C.d Use a custom Docker image\n", "\n", - "You can also specify a custom Docker image if you don't want to use the default image provided by Azure ML.\n", + "You can also specify a custom Docker image, if you don't want to use the default image provided by Azure ML.\n", "\n", + "You can either pull an image directly from Anaconda:\n", "```python\n", - "# use an image available in Docker Hub without authentication\n", + "# Use an image available in Docker Hub without authentication\n", "run_config_docker.environment.docker.base_image = \"continuumio/miniconda3\"\n", + "```\n", "\n", - "# or, use an image available in a private Azure Container Registry\n", + "Or one of the images you may already have created:\n", + "```python\n", + "# or, use an image available in your private Azure Container Registry\n", "run_config_docker.environment.docker.base_image = \"mycustomimage:1.0\"\n", "run_config_docker.environment.docker.base_image_registry.address = \"myregistry.azurecr.io\"\n", "run_config_docker.environment.docker.base_image_registry.username = \"username\"\n", "run_config_docker.environment.docker.base_image_registry.password = \"password\"\n", "```\n", "\n", - "When you are using a custom Docker image, you might already have your environment setup properly in a Python environment in the Docker image. In that case, you can skip specifying conda dependencies, and just use `user_managed_dependencies` option instead:\n", + "##### Where to find my Docker image name and registry credentials\n", + " If you do not know what the name of your Docker image or container registry is, or if you don't know how to access the username and password needed above, proceed as follows:\n", + " - Docker image name:\n", + " - In the portal, under your resource group, click on your current workspace\n", + " - Click on Experiments\n", + " - Click on Images\n", + " - Click on the image of your choice\n", + " - Copy the \"ID\" string\n", + " - In this notebook, replace \"mycustomimage:1/0\" with that ID string\n", + " - Username and password:\n", + " - In the portal, under your resource group, click on the container registry associated with your workspace\n", + " - If you have several and don't know which one you need, click on your workspace, go to Overview and click on the \"Registry\" name on the upper right of the screen\n", + " - There, go to \"Access keys\"\n", + " - Copy the username and one of the passwords\n", + " - In this notebook, replace \"username\" and \"password\" by these values\n", + "\n", + "In any case, you will need to use the lines above in place of the line marked as `# Reference Docker image` in section 6.C.a. \n", + "\n", + "When you are using your custom Docker image, you might already have your Python environment properly set up. In that case, you can skip specifying conda dependencies, and just use the `user_managed_dependencies` option instead:\n", "```python\n", "run_config_docker.environment.python.user_managed_dependencies = True\n", "# path to the Python environment in the custom Docker image\n", @@ -398,7 +519,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Query run metrics" + "## 7. Query run metrics \n", + "\n", + "Once your run has completed, you can now extract the metrics you captured by using the `get_metrics` method. As shown in the `train.py` file, these metrics are \"alpha\" and \"mse\"." ] }, { @@ -412,7 +535,7 @@ }, "outputs": [], "source": [ - "# get all metris logged in the run\n", + "# Get all metris logged in the run\n", "run.get_metrics()\n", "metrics = run.get_metrics()" ] @@ -483,7 +606,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "We know the model `ridge_0.40.pkl` is the best performing model from the earlier queries. So let's register it with the workspace." + "From the results obtained above, `ridge_0.40.pkl` is the best performing model. You can now register that particular model with the workspace. Once you have done so, go back to the portal and click on \"Models\". You should see it there." ] }, { @@ -492,7 +615,7 @@ "metadata": {}, "outputs": [], "source": [ - "# supply a model name, and the full path to the serialized model file.\n", + "# Supply a model name, and the full path to the serialized model file.\n", "model = run.register_model(model_name='best_ridge_model', model_path='./outputs/ridge_0.40.pkl')" ] }, @@ -502,14 +625,14 @@ "metadata": {}, "outputs": [], "source": [ - "print(model.name, model.version, model.url)" + "print(\"Registered model:\\n --> Name: {}\\n --> Version: {}\\n --> URL: {}\".format(model.name, model.version, model.url))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "Now you can deploy this model following the example in the 01 notebook." + "You can now deploy your model by following [this example](https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/deployment/production-deploy-to-aks/production-deploy-to-aks.ipynb)." ] } ], @@ -539,4 +662,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/training/train-on-remote-vm/train-on-remote-vm.ipynb b/how-to-use-azureml/training/train-on-remote-vm/train-on-remote-vm.ipynb index 9427db37..48772b33 100644 --- a/how-to-use-azureml/training/train-on-remote-vm/train-on-remote-vm.ipynb +++ b/how-to-use-azureml/training/train-on-remote-vm/train-on-remote-vm.ipynb @@ -9,12 +9,12 @@ "Licensed under the MIT License." ] }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/train-on-remote-vm/train-on-remote-vm.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/train-on-remote-vm/train-on-remote-vm.png)" + ] }, { "cell_type": "markdown", @@ -37,7 +37,7 @@ "metadata": {}, "source": [ "## Prerequisites\n", - "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't." + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration notebook](../../../configuration.ipynb) first if you haven't already to establish your connection to the AzureML Workspace." ] }, { @@ -645,4 +645,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/training/train-within-notebook/train-within-notebook.ipynb b/how-to-use-azureml/training/train-within-notebook/train-within-notebook.ipynb index 0f2d1d4e..3b3ecdf8 100644 --- a/how-to-use-azureml/training/train-within-notebook/train-within-notebook.ipynb +++ b/how-to-use-azureml/training/train-within-notebook/train-within-notebook.ipynb @@ -9,12 +9,12 @@ "Licensed under the MIT License." ] }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/train-within-notebook/train-within-notebook.png)" - ] + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/train-within-notebook/train-within-notebook.png)" + ] }, { "cell_type": "markdown", @@ -43,7 +43,7 @@ " 1. Deploy your webservice\n", " 1. Test your webservice\n", " 1. Clean up\n", - "1. [Next Steps](#Next%20Steps)\n", + "1. [Next Steps](#nextsteps)\n", "\n", "---\n", "\n", @@ -64,7 +64,7 @@ "---\n", "\n", "## Setup\n", - "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you have completed the [Configuration](../../../configuration.ipnyb) notebook to set up your Azure Machine Learning workspace and ensure other common prerequisites are met. From the configuration, the important sections are the workspace configuration and ACI regristration.\n", + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration](../../../configuration.ipynb) Notebook first if you haven't already to establish your connection to the AzureML Workspace. From the configuration, the important sections are the workspace configuration and ACI regristration.\n", "\n", "We will also need the following libraries install to our conda environment. If these are not installed, use the following command to do so and restart the notebook.\n", "```shell\n", @@ -163,7 +163,7 @@ "experiment = Experiment(workspace=ws, name=\"train-within-notebook\")\n", "\n", "# Create a run object in the experiment\n", - "run = experiment.start_logging()\n", + "run = experiment.start_logging()\n", "# Log the algorithm parameter alpha to the run\n", "run.log('alpha', 0.03)\n", "\n", @@ -177,7 +177,12 @@ "run.log('mse', mean_squared_error(data['test']['y'], preds))\n", "\n", "# Save the model to the outputs directory for capture\n", - "joblib.dump(value=regression_model, filename='outputs/model.pkl')\n", + "model_file_name = 'outputs/model.pkl'\n", + "\n", + "joblib.dump(value = regression_model, filename = model_file_name)\n", + "\n", + "# upload the model file explicitly into artifacts \n", + "run.upload_file(name = model_file_name, path_or_stream = model_file_name)\n", "\n", "# Complete the run\n", "run.complete()" @@ -221,8 +226,6 @@ "import numpy as np\n", "from tqdm import tqdm\n", "\n", - "model_name = \"model.pkl\"\n", - "\n", "# list of numbers from 0 to 1.0 with a 0.05 interval\n", "alphas = np.arange(0.0, 1.0, 0.05)\n", "\n", @@ -421,7 +424,7 @@ "### Describe your target compute\n", "In addition to the container, we also need to describe the type of compute we want to allocate for our webservice. In in this example we are using an [Azure Container Instance](https://azure.microsoft.com/en-us/services/container-instances/) which is a good choice for quick and cost-effective dev/test deployment scenarios. ACI instances require the number of cores you want to run and memory you need. Tags and descriptions are available for you to identify the instances in AML when viewing the Compute tab in the AML Portal.\n", "\n", - "For production workloads, it is better to use [Azure Kubernentes Service (AKS)](https://azure.microsoft.com/en-us/services/kubernetes-service/) instead. Try [this notebook](11.production-deploy-to-aks.ipynb) to see how that can be done from Azure ML.\n" + "For production workloads, it is better to use [Azure Kubernentes Service (AKS)](https://azure.microsoft.com/en-us/services/kubernetes-service/) instead. Try [this notebook](https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/deployment/production-deploy-to-aks/production-deploy-to-aks.ipynb) to see how that can be done from Azure ML.\n" ] }, { @@ -517,6 +520,9 @@ "outputs": [], "source": [ "import json\n", + "\n", + "service = ws.webservices['my-aci-svc']\n", + "\n", "# scrape the first row from the test set.\n", "test_samples = json.dumps({\"data\": X_test[0:1, :].tolist()})\n", "\n", @@ -650,7 +656,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "---\n", + "\n", "## Next Steps" ] }, @@ -668,13 +674,6 @@ "If you want to deploy models to a production cluster try the [production-deploy-to-aks](../../deployment/production-deploy-to-aks\n", ") notebook." ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { @@ -698,9 +697,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.6" + "version": "3.6.5" } }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/training/using-environments/using-environments.ipynb b/how-to-use-azureml/training/using-environments/using-environments.ipynb index df03b9d8..3a2148a3 100644 --- a/how-to-use-azureml/training/using-environments/using-environments.ipynb +++ b/how-to-use-azureml/training/using-environments/using-environments.ipynb @@ -1,371 +1,371 @@ { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Copyright (c) Microsoft Corporation. All rights reserved.\n", - "\n", - "Licensed under the MIT License" - ] - }, - { + "cells": [ + { "cell_type": "markdown", "metadata": {}, "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/using-environments/using-environments.png)" - ] + "Copyright (c) Microsoft Corporation. All rights reserved.\n", + "\n", + "Licensed under the MIT License" + ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Using environments\n", - "\n", - "\n", - "## Contents\n", - "\n", - "1. [Introduction](#Introduction)\n", - "1. [Setup](#Setup)\n", - "1. [Create environment](#Create-environment)\n", - " 1. Add Python packages\n", - " 1. Specify environment variables\n", - "1. [Submit run using environment](#Submit-run-using-environment)\n", - "1. [Register environment](#Register-environment)\n", - "1. [List and get existing environments](#List-and-get-existing-environments)\n", - "1. [Other ways to create environments](#Other-ways-to-create-environments)\n", - " 1. From existing Conda environment\n", - " 1. From Conda or pip files\n", - "1. [Docker settings](#Docker-settings)\n", - "1. [Spark and Azure Databricks settings](#Spark-and-Azure-Databricks-settings)\n", - "1. [Next steps](#Next-steps)\n", - "\n", - "## Introduction\n", - "\n", - "Azure ML environments are an encapsulation of the environment where your machine learning training happens. They define Python packages, environment variables, Docker settings and other attributes in declarative fashion. Environments are versioned: you can update them and retrieve old versions to revist and review your work.\n", - "\n", - "Environments allow you to:\n", - "* Encapsulate dependencies of your training process, such as Python packages and their versions.\n", - "* Reproduce the Python environment on your local computer in a remote run on VM or ML Compute cluster\n", - "* Reproduce your experimentation environment in production setting.\n", - "* Revisit and audit the environment in which an existing model was trained.\n", - "\n", - "Environment, compute target and training script together form run configuration: the full specification of training run.\n", - "\n", - "## Setup\n", - "\n", - "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't.\n", - "\n", - "First, let's validate Azure ML SDK version and connect to workspace." - ] - }, - { - "cell_type": "raw", - "metadata": {}, - "source": [ - "import azureml.core\n", - "from azureml.core import Workspace\n", - "\n", - "print(azureml.core.VERSION)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "ws = Workspace.from_config()\n", - "ws.get_details()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Create environment\n", - "\n", - "You can create an environment by instantiating ```Environment``` object and then setting its attributes: set of Python packages, environment variables and others.\n", - "\n", - "### Add Python packages\n", - "\n", - "The recommended way is to specify Conda packages, as they typically come with complete set of pre-built binaries." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.core import Environment\n", - "from azureml.core.environment import CondaDependencies\n", - "\n", - "myenv = Environment(name=\"myenv\")\n", - "conda_dep = CondaDependencies()\n", - "conda_dep.add_conda_package(\"scikit-learn\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "You can also add pip packages, and specify the version of package" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "conda_dep.add_pip_package(\"pillow==5.4.1\")\n", - "myenv.python.conda_dependencies=conda_dep" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Specify environment variables\n", - "\n", - "You can add environment variables to your environment. These then become available using ```os.environ.get``` in your training script." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "myenv.environment_variables = {\"MESSAGE\":\"Hello from Azure Machine Learning\"}" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Submit run using environment\n", - "\n", - "When you submit a run, you can specify which environment to use. \n", - "\n", - "On the first run in given environment, Azure ML spends some time building the environment. On the subsequent runs, Azure ML keeps track of changes and uses the existing environment, resulting in faster run completion." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.core import ScriptRunConfig, Experiment\n", - "\n", - "myexp = Experiment(workspace=ws, name = \"environment-example\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "To submit a run, create a run configuration that combines the script file and environment, and pass it to ```Experiment.submit```. In this example, the script is submitted to local computer, but you can specify other compute targets such as remote clusters as well." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "runconfig = ScriptRunConfig(source_directory=\"example\", script=\"example.py\")\n", - "runconfig.run_config.target = \"local\"\n", - "runconfig.run_config.environment = myenv\n", - "run = myexp.submit(config=runconfig)\n", - "\n", - "run.wait_for_completion(show_output=True)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Register environment\n", - "\n", - "You can manage environments by registering them. This allows you to track their versions, and reuse them in future runs. For example, once you've constructed an environment that meets your requirements, you can register it and use it in other experiments so as to standardize your workflow.\n", - "\n", - "If you register the environment with same name, the version number is increased by one. Note that Azure ML keeps track of differences between the version, so if you re-register an identical version, the version number is not increased." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "myenv.register(workspace=ws)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## List and get existing environments\n", - "\n", - "Your workspace contains a dictionary of registered environments. You can then use ```Environment.get``` to retrieve a specific environment with specific version." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "for name,env in ws.environments.items():\n", - " print(\"Name {} \\t version {}\".format(name,env.version))\n", - "\n", - "restored_environment = Environment.get(workspace=ws,name=\"myenv\",version=\"1\")\n", - "\n", - "print(\"Attributes of restored environment\")\n", - "restored_environment" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Other ways to create environments\n", - "\n", - "### From existing Conda environment\n", - "\n", - "You can create an environment from existing conda environment. This make it easy to reuse your local interactive environment in Azure ML remote runs. For example, if you've created conda environment using\n", - "```\n", - "conda create -n mycondaenv\n", - "```\n", - "you can create Azure ML environment out of that conda environment using\n", - "```\n", - "myenv = Environment.from_existing_conda_environment(name=\"myenv\",conda_environment_name=\"mycondaenv\")\n", - "```\n", - "\n", - "### From conda or pip files\n", - "\n", - "You can create environments from conda specification or pip requirements files using\n", - "```\n", - "myenv = Environment.from_conda_specification(name=\"myenv\", file_path=\"path-to-conda-specification-file\")\n", - "\n", - "myenv = Environment.from_pip_requirements(name=\"myenv\", file_path=\"path-to-pip-requirements-file\")\n", - "```\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Docker settings\n", - "\n", - "Docker container provides an efficient way to encapsulate the dependencies. When you enable Docker, Azure ML builds a Docker image and creates a Python environment within that container, given your specifications. The Docker images are reused: the first run in a new environment typically takes longer as the image is build.\n", - "\n", - "**Note:** For runs on local computer or attached virtual machine, that computer must have Docker installed and enabled. Machine Learning Compute has Docker pre-installed.\n", - "\n", - "Attribute ```docker.enabled``` controls whether to use Docker container or host OS for execution. " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "myenv.docker.enabled = True" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "You can specify custom Docker base image and registry. This allows you to customize and control in detail the guest OS in which your training run executes. whether to use GPU, whether to use shared volumes, and shm size." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "myenv.docker.base_image\n", - "myenv.docker.base_image_registry" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "You can also specify whether to use GPU or shared volumes, and shm size." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "myenv.docker.gpu_support\n", - "myenv.docker.shared_volumes\n", - "myenv.docker.shm_size" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Spark and Azure Databricks settings\n", - "\n", - "In addition to Python and Docker settings, Environment also contains attributes for Spark and Azure Databricks runs. These attributes become relevant when you submit runs on those compute targets." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Next steps\n", - "\n", - "Learn more about remote runs on different compute targets:\n", - "\n", - "* [Train on ML Compute](../../train-on-amlcompute)\n", - "\n", - "* [Train on remote VM](../../train-on-remote-vm)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "authors": [ - { - "name": "roastala" - } + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/using-environments/using-environments.png)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Using environments\n", + "\n", + "\n", + "## Contents\n", + "\n", + "1. [Introduction](#Introduction)\n", + "1. [Setup](#Setup)\n", + "1. [Create environment](#Create-environment)\n", + " 1. Add Python packages\n", + " 1. Specify environment variables\n", + "1. [Submit run using environment](#Submit-run-using-environment)\n", + "1. [Register environment](#Register-environment)\n", + "1. [List and get existing environments](#List-and-get-existing-environments)\n", + "1. [Other ways to create environments](#Other-ways-to-create-environments)\n", + " 1. From existing Conda environment\n", + " 1. From Conda or pip files\n", + "1. [Docker settings](#Docker-settings)\n", + "1. [Spark and Azure Databricks settings](#Spark-and-Azure-Databricks-settings)\n", + "1. [Next steps](#Next-steps)\n", + "\n", + "## Introduction\n", + "\n", + "Azure ML environments are an encapsulation of the environment where your machine learning training happens. They define Python packages, environment variables, Docker settings and other attributes in declarative fashion. Environments are versioned: you can update them and retrieve old versions to revist and review your work.\n", + "\n", + "Environments allow you to:\n", + "* Encapsulate dependencies of your training process, such as Python packages and their versions.\n", + "* Reproduce the Python environment on your local computer in a remote run on VM or ML Compute cluster\n", + "* Reproduce your experimentation environment in production setting.\n", + "* Revisit and audit the environment in which an existing model was trained.\n", + "\n", + "Environment, compute target and training script together form run configuration: the full specification of training run.\n", + "\n", + "## Setup\n", + "\n", + "If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, make sure you go through the [configuration notebook](../../../configuration.ipynb) first if you haven't.\n", + "\n", + "First, let's validate Azure ML SDK version and connect to workspace." + ] + }, + { + "cell_type": "raw", + "metadata": {}, + "source": [ + "import azureml.core\n", + "from azureml.core import Workspace\n", + "\n", + "print(azureml.core.VERSION)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ws = Workspace.from_config()\n", + "ws.get_details()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Create environment\n", + "\n", + "You can create an environment by instantiating ```Environment``` object and then setting its attributes: set of Python packages, environment variables and others.\n", + "\n", + "### Add Python packages\n", + "\n", + "The recommended way is to specify Conda packages, as they typically come with complete set of pre-built binaries." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core import Environment\n", + "from azureml.core.environment import CondaDependencies\n", + "\n", + "myenv = Environment(name=\"myenv\")\n", + "conda_dep = CondaDependencies()\n", + "conda_dep.add_conda_package(\"scikit-learn\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can also add pip packages, and specify the version of package" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "conda_dep.add_pip_package(\"pillow==5.4.1\")\n", + "myenv.python.conda_dependencies=conda_dep" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Specify environment variables\n", + "\n", + "You can add environment variables to your environment. These then become available using ```os.environ.get``` in your training script." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "myenv.environment_variables = {\"MESSAGE\":\"Hello from Azure Machine Learning\"}" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Submit run using environment\n", + "\n", + "When you submit a run, you can specify which environment to use. \n", + "\n", + "On the first run in given environment, Azure ML spends some time building the environment. On the subsequent runs, Azure ML keeps track of changes and uses the existing environment, resulting in faster run completion." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core import ScriptRunConfig, Experiment\n", + "\n", + "myexp = Experiment(workspace=ws, name = \"environment-example\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To submit a run, create a run configuration that combines the script file and environment, and pass it to ```Experiment.submit```. In this example, the script is submitted to local computer, but you can specify other compute targets such as remote clusters as well." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "runconfig = ScriptRunConfig(source_directory=\"example\", script=\"example.py\")\n", + "runconfig.run_config.target = \"local\"\n", + "runconfig.run_config.environment = myenv\n", + "run = myexp.submit(config=runconfig)\n", + "\n", + "run.wait_for_completion(show_output=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Register environment\n", + "\n", + "You can manage environments by registering them. This allows you to track their versions, and reuse them in future runs. For example, once you've constructed an environment that meets your requirements, you can register it and use it in other experiments so as to standardize your workflow.\n", + "\n", + "If you register the environment with same name, the version number is increased by one. Note that Azure ML keeps track of differences between the version, so if you re-register an identical version, the version number is not increased." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "myenv.register(workspace=ws)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## List and get existing environments\n", + "\n", + "Your workspace contains a dictionary of registered environments. You can then use ```Environment.get``` to retrieve a specific environment with specific version." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "for name,env in ws.environments.items():\n", + " print(\"Name {} \\t version {}\".format(name,env.version))\n", + "\n", + "restored_environment = Environment.get(workspace=ws,name=\"myenv\",version=\"1\")\n", + "\n", + "print(\"Attributes of restored environment\")\n", + "restored_environment" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Other ways to create environments\n", + "\n", + "### From existing Conda environment\n", + "\n", + "You can create an environment from existing conda environment. This make it easy to reuse your local interactive environment in Azure ML remote runs. For example, if you've created conda environment using\n", + "```\n", + "conda create -n mycondaenv\n", + "```\n", + "you can create Azure ML environment out of that conda environment using\n", + "```\n", + "myenv = Environment.from_existing_conda_environment(name=\"myenv\",conda_environment_name=\"mycondaenv\")\n", + "```\n", + "\n", + "### From conda or pip files\n", + "\n", + "You can create environments from conda specification or pip requirements files using\n", + "```\n", + "myenv = Environment.from_conda_specification(name=\"myenv\", file_path=\"path-to-conda-specification-file\")\n", + "\n", + "myenv = Environment.from_pip_requirements(name=\"myenv\", file_path=\"path-to-pip-requirements-file\")\n", + "```\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Docker settings\n", + "\n", + "Docker container provides an efficient way to encapsulate the dependencies. When you enable Docker, Azure ML builds a Docker image and creates a Python environment within that container, given your specifications. The Docker images are reused: the first run in a new environment typically takes longer as the image is build.\n", + "\n", + "**Note:** For runs on local computer or attached virtual machine, that computer must have Docker installed and enabled. Machine Learning Compute has Docker pre-installed.\n", + "\n", + "Attribute ```docker.enabled``` controls whether to use Docker container or host OS for execution. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "myenv.docker.enabled = True" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can specify custom Docker base image and registry. This allows you to customize and control in detail the guest OS in which your training run executes. whether to use GPU, whether to use shared volumes, and shm size." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "myenv.docker.base_image\n", + "myenv.docker.base_image_registry" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can also specify whether to use GPU or shared volumes, and shm size." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "myenv.docker.gpu_support\n", + "myenv.docker.shared_volumes\n", + "myenv.docker.shm_size" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Spark and Azure Databricks settings\n", + "\n", + "In addition to Python and Docker settings, Environment also contains attributes for Spark and Azure Databricks runs. These attributes become relevant when you submit runs on those compute targets." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Next steps\n", + "\n", + "Learn more about remote runs on different compute targets:\n", + "\n", + "* [Train on ML Compute](../../train-on-amlcompute)\n", + "\n", + "* [Train on remote VM](../../train-on-remote-vm)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } ], - "kernelspec": { - "display_name": "Python 3.6", - "language": "python", - "name": "python36" + "metadata": { + "authors": [ + { + "name": "roastala" + } + ], + "kernelspec": { + "display_name": "Python 3.6", + "language": "python", + "name": "python36" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.5" + } }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.5" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} + "nbformat": 4, + "nbformat_minor": 2 +} \ No newline at end of file diff --git a/how-to-use-azureml/work-with-data/dataprep/README.md b/how-to-use-azureml/work-with-data/dataprep/README.md index f8d2541d..439fb91f 100644 --- a/how-to-use-azureml/work-with-data/dataprep/README.md +++ b/how-to-use-azureml/work-with-data/dataprep/README.md @@ -15,7 +15,7 @@ You will find in this repo: - [How-To Guide Notebooks](how-to-guides) for more in-depth sample code at feature level. ## Installation -Here are the [SDK installation steps](https://docs.microsoft.com/python/api/overview/azure/dataprep/intro?view=azure-dataprep-py#install). +Here are the [SDK installation steps](https://aka.ms/aml-data-prep-installation). ## Documentation Here is more information on how to use the new Data Prep SDK: @@ -31,17 +31,40 @@ If you have any questions or feedback, send us an email at: [askamldataprep@micr ## Release Notes -### 2019-04-08 (version 1.1.1) +### 2019-04-17 (version 1.1.2) + +Note: Data Prep Python SDK will no longer install `numpy` and `pandas` packages. See [updated installation instructions](https://aka.ms/aml-data-prep-installation). New features -- You can read multiple Datastore/DataPath/DataReference sources using read_* transforms. +- You can now use the Pivot transform. + - How-to guide: [Pivot notebook](https://aka.ms/aml-data-prep-pivot-nb) +- You can now use regular expressions in native functions. + - Examples: + - `dflow.filter(dprep.RegEx('pattern').is_match(dflow['column_name']))` + - `dflow.assert_value('column_name', dprep.RegEx('pattern').is_match(dprep.value))` +- You can now use `to_upper` and `to_lower` functions in expression language. +- You can now see the number of unique values of each column in a data profile. +- For some of the commonly used reader steps, you can now pass in the `infer_column_types` argument. If it is set to `True`, Data Prep will attempt to detect and automatically convert column types. + - `inference_arguments` is now deprecated. +- You can now call `Dataflow.shape`. + +Bug fixes and improvements +- `keep_columns` now accepts an additional optional argument `validate_column_exists`, which checks if the result of `keep_columns` will contain any columns. +- All reader steps (which read from a file) now accept an additional optional argument `verify_exists`. +- Improved performance of reading from pandas dataframe and getting data profiles. +- Fixed a bug where slicing a single step from a Dataflow failed with a single index. + +### 2019-04-08 (version 1.1.1) + +New features +- You can read multiple Datastore/DataPath/DataReference sources using read_* transforms. - You can perform the following operations on columns to create a new column: division, floor, modulo, power, length. - Data Prep is now part of the Azure ML diagnostics suite and will log diagnostic information by default. - To turn this off, set this environment variable to true: DISABLE_DPREP_LOGGER Bug fixes and improvements - Improved code documentation for commonly used classes and functions. -- Fixed a bug in auto_read_file that failed to read Excel files. +- Fixed a bug in auto_read_file that failed to read Excel files. - Added option to overwrite the folder in read_pandas_dataframe. - Improved performance of dotnetcore2 dependency installation, and added support for Fedora 27/28 and Ubuntu 1804. - Improved the performance of reading from Azure Blobs. @@ -198,4 +221,4 @@ Bug fixes IMPORTANT: Please read the notice and find out more about this NYC Taxi and Limousine Commission dataset here: http://www.nyc.gov/html/tlc/html/about/trip_record_data.shtml -IMPORTANT: Please read the notice and find out more about this Chicago Police Department dataset here: https://catalog.data.gov/dataset/crimes-2001-to-present-398a4 \ No newline at end of file +IMPORTANT: Please read the notice and find out more about this Chicago Police Department dataset here: https://catalog.data.gov/dataset/crimes-2001-to-present-398a4 diff --git a/how-to-use-azureml/work-with-data/dataprep/how-to-guides/add-column-using-expression.ipynb b/how-to-use-azureml/work-with-data/dataprep/how-to-guides/add-column-using-expression.ipynb index a225aca6..04f750f5 100644 --- a/how-to-use-azureml/work-with-data/dataprep/how-to-guides/add-column-using-expression.ipynb +++ b/how-to-use-azureml/work-with-data/dataprep/how-to-guides/add-column-using-expression.ipynb @@ -99,6 +99,46 @@ "dflow_length.head(5)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### `to_upper()`\n", + "Using the to_upper() expression, add a new numeric column \"Upper Case\", which contains the length of the string in \"Primary Type\"." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "dflow_to_upper = dflow.add_column(new_column_name='Upper Case',\n", + " prior_column='Primary Type',\n", + " expression=dflow['Primary Type'].to_upper())\n", + "dflow_to_upper.head(5)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### `to_lower()`\n", + "Using the to_lower() expression, add a new numeric column \"Lower Case\", which contains the length of the string in \"Primary Type\"." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "dflow_to_lower = dflow.add_column(new_column_name='Lower Case',\n", + " prior_column='Primary Type',\n", + " expression=dflow['Primary Type'].to_lower())\n", + "dflow_to_lower.head(5)" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/how-to-use-azureml/work-with-data/dataprep/how-to-guides/data-ingestion.ipynb b/how-to-use-azureml/work-with-data/dataprep/how-to-guides/data-ingestion.ipynb index 7444938c..ed884889 100644 --- a/how-to-use-azureml/work-with-data/dataprep/how-to-guides/data-ingestion.ipynb +++ b/how-to-use-azureml/work-with-data/dataprep/how-to-guides/data-ingestion.ipynb @@ -110,7 +110,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "When reading delimited files, you can let the underlying runtime infer the parsing parameters (e.g. separator, encoding, whether to use headers, etc.) simply by not providing them. In this case, you can read a file by specifying only its location, then retrieve the first 10 rows to evaluate the result." + "When reading delimited files, the only required parameter is `path`. Other parameters (e.g. separator, encoding, whether to use headers, etc.) are available to modify default behavior.In this case, you can read a file by specifying only its location, then retrieve the first 5 rows to evaluate the result." ] }, { @@ -144,7 +144,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Now the data set contains the correct headers and the extraneous row has been skipped by read_csv. Next, look at the data types of the columns." + "Now the data set contains the correct headers and the extraneous row has been skipped by `read_csv`. Next, look at the data types of the columns." ] }, { @@ -160,8 +160,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Unfortunately, all of the columns came back as strings. This is because, by default, Data Prep will not change the type of the data. Since the data source is a text file, all values are kept as strings. In this case, however, numeric columns should be parsed as numbers. To do this, set the `inference_arguments` parameter to a new instance of the `InferenceArguments` class, which will trigger type inference to be performed.\n", - "Note that setting inference arguments at this step also requires you to choose a strategy for dealing with ambiguous dates. The example below shows the month before day option." + "Unfortunately, all of the columns came back as strings. This is because, by default, Data Prep will not change the type of the data. Since the data source is a text file, all values are kept as strings. In this case, however, numeric columns should be parsed as numbers. To do this, set the `infer_column_types` parameter to `True`, which will trigger type inference to be performed.\n" ] }, { @@ -172,7 +171,7 @@ "source": [ "dflow_inferred_types = dprep.read_csv(path='../data/crime_duplicate_headers.csv',\n", " skip_rows=1,\n", - " inference_arguments=dprep.InferenceArguments(day_first=False))\n", + " infer_column_types=True)\n", "dflow_inferred_types.dtypes" ] }, diff --git a/how-to-use-azureml/work-with-data/dataprep/how-to-guides/data-profile.ipynb b/how-to-use-azureml/work-with-data/dataprep/how-to-guides/data-profile.ipynb index d723321a..c24c3973 100644 --- a/how-to-use-azureml/work-with-data/dataprep/how-to-guides/data-profile.ipynb +++ b/how-to-use-azureml/work-with-data/dataprep/how-to-guides/data-profile.ipynb @@ -192,7 +192,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.8" + "version": "3.6.4" } }, "nbformat": 4, diff --git a/how-to-use-azureml/work-with-data/datasets/README.md b/how-to-use-azureml/work-with-data/datasets/README.md new file mode 100644 index 00000000..ad999d19 --- /dev/null +++ b/how-to-use-azureml/work-with-data/datasets/README.md @@ -0,0 +1,155 @@ +# Azure Machine Learning Datasets (preview) + +Azure Machine Learning Datasets (preview) make it easier to access and work with your data. Datasets manage data in various scenarios such as model training and pipeline creation. Using the Azure Machine Learning SDK, you can access underlying storage, explore and prepare data, manage the life cycle of different Dataset definitions, and compare between Datasets used in training and in production. + +## Create and Register Datasets + +It's easy to create Datasets from either local files, or Azure Datastores. + +```Python +from azureml.core.workspace import Workspace +from azureml.core.datastore import Datastore +from azureml.core.dataset import Dataset + +datastore_name = 'your datastore name' + +# get existing workspace +workspace = Workspace.from_config() + +# get Datastore from the workspace +dstore = Datastore.get(workspace, datastore_name) + +# create an in-memory Dataset on your local machine +dataset = Dataset.from_delimited_files(dstore.path('data/src/crime.csv')) +``` + +To consume Datasets across various scenarios in Azure Machine Learning service such as automated machine learning, model training and pipeline creation, you need to register the Datasets with your workspace. By doing so, you can also share and reuse the Datasets within your organization. + +```Python +dataset = dataset.register(workspace = workspace, + name = 'dataset_crime', + description = 'Training data' + ) +``` + +## Sampling + +Sampling can be particular useful with Datasets that are too large to efficiently analyze in full. It enables data scientists to work with a manageable amount of data to build and train machine learning models. At this time, the [`sample()`](https://docs.microsoft.com//python/api/azureml-core/azureml.core.dataset(class)?view=azure-ml-py#sample-sample-strategy--arguments-) method from the Dataset class supports Top N, Simple Random, and Stratified sampling strategies. + +After sampling, you can convert your sampled Dataset to pandas DataFrame for training. By using the native [`sample()`](https://docs.microsoft.com//python/api/azureml-core/azureml.core.dataset(class)?view=azure-ml-py#sample-sample-strategy--arguments-) method from the Dataset class, you will load the sampled data on the fly instead of loading full data into memory. + +### Top N sample + +For Top N sampling, the first n records of your Dataset are your sample. This is helpful if you are just trying to get an idea of what your data records look like or to see what fields are in your data. + +```Python +top_n_sample_dataset = dataset.sample('top_n', {'n': 5}) +top_n_sample_dataset.to_pandas_dataframe() +``` + +### Simple random sample + +In Simple Random sampling, every member of the data population has an equal chance of being selected as a part of the sample. In the `simple_random` sample strategy, the records from your Dataset are selected based on the probability specified and returns a modified Dataset. The seed parameter is optional. + +```Python +simple_random_sample_dataset = dataset.sample('simple_random', {'probability':0.3, 'seed': seed}) +simple_random_sample_dataset.to_pandas_dataframe() +``` + +### Stratified sample + +Stratified samples ensure that certain groups of a population are represented in the sample. In the `stratified` sample strategy, the population is divided into strata, or subgroups, based on similarities, and records are randomly selected from each strata according to the strata weights indicated by the `fractions` parameter. + +In the following example, we group each record by the specified columns, and include said record based on the strata X weight information in `fractions`. If a strata is not specified or the record cannot be grouped, the default weight to sample is 0. + +```Python +# take 50% of records with `Primary Type` as `THEFT` and 20% of records with `Primary Type` as `DECEPTIVE PRACTICE` into sample Dataset +fractions = {} +fractions[('THEFT',)] = 0.5 +fractions[('DECEPTIVE PRACTICE',)] = 0.2 + +sample_dataset = dataset.sample('stratified', {'columns': ['Primary Type'], 'fractions': fractions, 'seed': seed}) + +sample_dataset.to_pandas_dataframe() +``` + +## Explore with summary statistics + + Detect anomalies, missing values, or error counts with the [`get_profile()`](https://docs.microsoft.com/python/api/azureml-core/azureml.core.dataset.dataset?view=azure-ml-py#get-profile-arguments-none--generate-if-not-exist-true--workspace-none--compute-target-none-) method. This function gets the profile and summary statistics of your data, which in turn helps determine the necessary data preparation operations to apply. + +```Python +# get pre-calculated profile +# if there is no precalculated profile available or the precalculated profile is not up-to-date, this method will generate a new profile of the Dataset +dataset.get_profile() +``` + +||Type|Min|Max|Count|Missing Count|Not Missing Count|Percent missing|Error Count|Empty count|0.1% Quantile|1% Quantile|5% Quantile|25% Quantile|50% Quantile|75% Quantile|95% Quantile|99% Quantile|99.9% Quantile|Mean|Standard Deviation|Variance|Skewness|Kurtosis +-|----|---|---|-----|-------------|-----------------|---------------|-----------|-----------|-------------|-----------|-----------|------------|------------|------------|------------|------------|--------------|----|------------------|--------|--------|-------- +ID|FieldType.INTEGER|1.04986e+07|1.05351e+07|10.0|0.0|10.0|0.0|0.0|0.0|1.04986e+07|1.04992e+07|1.04986e+07|1.05166e+07|1.05209e+07|1.05259e+07|1.05351e+07|1.05351e+07|1.05351e+07|1.05195e+07|12302.7|1.51358e+08|-0.495701|-1.02814 +Case Number|FieldType.STRING|HZ239907|HZ278872|10.0|0.0|10.0|0.0|0.0|0.0|||||||||||||| +Date|FieldType.DATE|2016-04-04 23:56:00+00:00|2016-04-15 17:00:00+00:00|10.0|0.0|10.0|0.0|0.0|0.0|||||||||||||| +Block|FieldType.STRING|004XX S KILBOURN AVE|113XX S PRAIRIE AVE|10.0|0.0|10.0|0.0|0.0|0.0|||||||||||||| +IUCR|FieldType.INTEGER|810|1154|10.0|0.0|10.0|0.0|0.0|0.0|810|850|810|890|1136|1153|1154|1154|1154|1058.5|137.285|18847.2|-0.785501|-1.3543 +Primary Type|FieldType.STRING|DECEPTIVE PRACTICE|THEFT|10.0|0.0|10.0|0.0|0.0|0.0|||||||||||||| +Description|FieldType.STRING|BOGUS CHECK|OVER $500|10.0|0.0|10.0|0.0|0.0|0.0|||||||||||||| +Location Description|FieldType.STRING||SCHOOL, PUBLIC, BUILDING|10.0|0.0|10.0|0.0|0.0|1.0|||||||||||||| +Arrest|FieldType.BOOLEAN|False|False|10.0|0.0|10.0|0.0|0.0|0.0|||||||||||||| +Domestic|FieldType.BOOLEAN|False|False|10.0|0.0|10.0|0.0|0.0|0.0|||||||||||||| +Beat|FieldType.INTEGER|531|2433|10.0|0.0|10.0|0.0|0.0|0.0|531|531|531|614|1318.5|1911|2433|2433|2433|1371.1|692.094|478994|0.105418|-1.60684 +District|FieldType.INTEGER|5|24|10.0|0.0|10.0|0.0|0.0|0.0|5|5|5|6|13|19|24|24|24|13.5|6.94822|48.2778|0.0930109|-1.62325 +Ward|FieldType.INTEGER|1|48|10.0|0.0|10.0|0.0|0.0|0.0|1|5|1|9|22.5|40|48|48|48|24.5|16.2635|264.5|0.173723|-1.51271 +Community Area|FieldType.INTEGER|4|77|10.0|0.0|10.0|0.0|0.0|0.0|4|8.5|4|24|37.5|71|77|77|77|41.2|26.6366|709.511|0.112157|-1.73379 +FBI Code|FieldType.INTEGER|6|11|10.0|0.0|10.0|0.0|0.0|0.0|6|6|6|6|11|11|11|11|11|9.4|2.36643|5.6|-0.702685|-1.59582 +X Coordinate|FieldType.INTEGER|1.16309e+06|1.18336e+06|10.0|7.0|3.0|0.7|0.0|0.0|1.16309e+06|1.16309e+06|1.16309e+06|1.16401e+06|1.16678e+06|1.17921e+06|1.18336e+06|1.18336e+06|1.18336e+06|1.17108e+06|10793.5|1.165e+08|0.335126|-2.33333 +Y Coordinate|FieldType.INTEGER|1.8315e+06|1.908e+06|10.0|7.0|3.0|0.7|0.0|0.0|1.8315e+06|1.8315e+06|1.8315e+06|1.83614e+06|1.85005e+06|1.89352e+06|1.908e+06|1.908e+06|1.908e+06|1.86319e+06|39905.2|1.59243e+09|0.293465|-2.33333 +Year|FieldType.INTEGER|2016|2016|10.0|0.0|10.0|0.0|0.0|0.0|2016|2016|2016|2016|2016|2016|2016|2016|2016|2016|0|0|NaN|NaN +Updated On|FieldType.DATE|2016-05-11 15:48:00+00:00|2016-05-27 15:45:00+00:00|10.0|0.0|10.0|0.0|0.0|0.0|||||||||||||| +Latitude|FieldType.DECIMAL|41.6928|41.9032|10.0|7.0|3.0|0.7|0.0|0.0|41.6928|41.6928|41.6928|41.7057|41.7441|41.8634|41.9032|41.9032|41.9032|41.78|0.109695|0.012033|0.292478|-2.33333 +Longitude|FieldType.DECIMAL|-87.6764|-87.6043|10.0|7.0|3.0|0.7|0.0|0.0|-87.6764|-87.6764|-87.6764|-87.6734|-87.6645|-87.6194|-87.6043|-87.6043|-87.6043|-87.6484|0.0386264|0.001492|0.344429|-2.33333 +Location|FieldType.STRING||(41.903206037, -87.676361925)|10.0|0.0|10.0|0.0|0.0|7.0|||||||||||||| + + +## Training with Dataset + +Now that you have registered your Dataset, you can call up the Dataset and convert it to pandas DataFrame or Spark DataFrame easily in your train.py script. + +```Python +# Sample train.py script +import azureml.core +import pandas as pd +import datetime +import shutil +from azureml.core import Workspace, Datastore, Dataset, Experiment, Run +from sklearn.model_selection import train_test_split +from azureml.core.compute import ComputeTarget, AmlCompute +from azureml.core.compute_target import ComputeTargetException +from sklearn.tree import DecisionTreeClassifier + +run = Run.get_context() +workspace = run.experiment.workspace + +# Access Dataset registered with the workspace by name +dataset_name = 'training_data' +dataset = Dataset.get(workspace=workspace, name=dataset_name) + +ds_def = dataset.get_definition() +dataset_val, dataset_train = ds_def.random_split(percentage=0.3) +y_df = dataset_train.keep_columns(['HasDetections']).to_pandas_dataframe() +x_df = dataset_train.drop_columns(['HasDetections']).to_pandas_dataframe() +y_val = dataset_val.keep_columns(['HasDetections']).to_pandas_dataframe() +x_val = dataset_val.drop_columns(['HasDetections']).to_pandas_dataframe() + +data = {"train": {"X": x_df, "y": y_df}, + "validation": {"X": x_val, "y": y_val}} + +clf = DecisionTreeClassifier().fit(data["train"]["X"], data["train"]["y"]) +print('Accuracy of Decision Tree classifier on training set: {:.2f}'.format(clf.score(x_df, y_df))) +print('Accuracy of Decision Tree classifier on validation set: {:.2f}'.format(clf.score(x_val, y_val))) +``` + +For an end-to-end tutorial, you may refer to [Dataset tutorial](datasets-tutorial.ipynb). You will learn how to: +- Explore and prepare data for training the model. +- Register the Dataset in your workspace for easy access in training. +- Take snapshots of data to ensure models can be trained with the same data every time. +- Use registered Dataset in your training script. +- Create and use multiple Dataset definitions to ensure that updates to the definition don't break existing pipelines/scripts. \ No newline at end of file diff --git a/tutorials/README.md b/tutorials/README.md index 7262c4c1..30c81171 100644 --- a/tutorials/README.md +++ b/tutorials/README.md @@ -18,5 +18,3 @@ If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwi * [Part 2](regression-part2-automated-ml.ipynb): Train a model using Automated Machine Learning. Also find quickstarts and how-tos on the [official documentation site for Azure Machine Learning service](https://docs.microsoft.com/en-us/azure/machine-learning/service/). - -![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/tutorials/README.png) diff --git a/tutorials/img-classification-part1-training.ipynb b/tutorials/img-classification-part1-training.ipynb index a2f87b2b..f1da462c 100644 --- a/tutorials/img-classification-part1-training.ipynb +++ b/tutorials/img-classification-part1-training.ipynb @@ -9,13 +9,6 @@ "Licensed under the MIT License." ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/tutorials/img-classification-part1-training.png)" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -133,9 +126,7 @@ "metadata": {}, "source": [ "### Create or Attach existing compute resource\n", - "By using Azure Machine Learning Compute, a managed service, data scientists can train machine learning models on clusters of Azure virtual machines. Examples include VMs with GPU support. In this tutorial, you create Azure Machine Learning Compute as your training environment. The code below creates the compute clusters for you if they don't already exist in your workspace.\n", - "\n", - "**Creation of compute takes approximately 5 minutes.** If the AmlCompute with that name is already in your workspace the code will skip the creation process." + "By using Azure Machine Learning Compute, a managed service, data scientists can train machine learning models on clusters of Azure virtual machines. Examples include VMs with GPU support. In this tutorial, you use default Azure Machine Learning Compute as your training environment." ] }, { @@ -149,38 +140,10 @@ }, "outputs": [], "source": [ - "from azureml.core.compute import AmlCompute\n", - "from azureml.core.compute import ComputeTarget\n", "import os\n", "\n", - "# choose a name for your cluster\n", - "compute_name = os.environ.get(\"AML_COMPUTE_CLUSTER_NAME\", \"cpucluster\")\n", - "compute_min_nodes = os.environ.get(\"AML_COMPUTE_CLUSTER_MIN_NODES\", 0)\n", - "compute_max_nodes = os.environ.get(\"AML_COMPUTE_CLUSTER_MAX_NODES\", 4)\n", - "\n", - "# This example uses CPU VM. For using GPU VM, set SKU to STANDARD_NC6\n", - "vm_size = os.environ.get(\"AML_COMPUTE_CLUSTER_SKU\", \"STANDARD_D2_V2\")\n", - "\n", - "\n", - "if compute_name in ws.compute_targets:\n", - " compute_target = ws.compute_targets[compute_name]\n", - " if compute_target and type(compute_target) is AmlCompute:\n", - " print('found compute target. just use it. ' + compute_name)\n", - "else:\n", - " print('creating a new compute target...')\n", - " provisioning_config = AmlCompute.provisioning_configuration(vm_size = vm_size,\n", - " min_nodes = compute_min_nodes, \n", - " max_nodes = compute_max_nodes)\n", - "\n", - " # create the cluster\n", - " compute_target = ComputeTarget.create(ws, compute_name, provisioning_config)\n", - " \n", - " # can poll for a minimum number of nodes and for a specific timeout. \n", - " # if no min node count is provided it will use the scale settings for the cluster\n", - " compute_target.wait_for_completion(show_output=True, min_node_count=None, timeout_in_minutes=20)\n", - " \n", - " # For a more detailed view of current AmlCompute status, use get_status()\n", - " print(compute_target.get_status().serialize())" + "cluster_type = os.environ.get(\"AML_COMPUTE_CLUSTER_TYPE\", \"CPU\")\n", + "compute_target = ws.get_default_compute_target(cluster_type)" ] }, { @@ -692,4 +655,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file From 0d448892a36d6809b93d96f1d34bd21236caa9ab Mon Sep 17 00:00:00 2001 From: Roope Astala Date: Tue, 14 May 2019 16:03:39 -0400 Subject: [PATCH 079/108] version check --- configuration.ipynb | 2 +- how-to-use-azureml/training/logging-api/logging-api.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configuration.ipynb b/configuration.ipynb index 542e200b..7cb763b8 100644 --- a/configuration.ipynb +++ b/configuration.ipynb @@ -95,7 +95,7 @@ "source": [ "import azureml.core\n", "\n", - "print(\"This notebook was created using version 1.0.23 of the Azure ML SDK\")\n", + "print(\"This notebook was created using version 1.0.39 of the Azure ML SDK\")\n", "print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")" ] }, diff --git a/how-to-use-azureml/training/logging-api/logging-api.ipynb b/how-to-use-azureml/training/logging-api/logging-api.ipynb index 0b3aed7f..21ef594c 100644 --- a/how-to-use-azureml/training/logging-api/logging-api.ipynb +++ b/how-to-use-azureml/training/logging-api/logging-api.ipynb @@ -100,7 +100,7 @@ "\n", "# Check core SDK version number\n", "\n", - "print(\"This notebook was created using SDK version 1.0.23, you are currently running version\", azureml.core.VERSION)" + "print(\"This notebook was created using SDK version 1.0.39, you are currently running version\", azureml.core.VERSION)" ] }, { From d6ebb484a6ec1939ba885e428621f1ead87d6e46 Mon Sep 17 00:00:00 2001 From: Jeff Shepherd Date: Thu, 16 May 2019 12:27:23 -0700 Subject: [PATCH 080/108] Revert change to default amlcomputecluster to support existing resource groups --- .../auto-ml-remote-amlcompute.ipynb | 1070 +++++++++-------- 1 file changed, 546 insertions(+), 524 deletions(-) diff --git a/how-to-use-azureml/automated-machine-learning/remote-amlcompute/auto-ml-remote-amlcompute.ipynb b/how-to-use-azureml/automated-machine-learning/remote-amlcompute/auto-ml-remote-amlcompute.ipynb index d72a0fc1..aa991391 100644 --- a/how-to-use-azureml/automated-machine-learning/remote-amlcompute/auto-ml-remote-amlcompute.ipynb +++ b/how-to-use-azureml/automated-machine-learning/remote-amlcompute/auto-ml-remote-amlcompute.ipynb @@ -1,526 +1,548 @@ { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Copyright (c) Microsoft Corporation. All rights reserved.\n", - "\n", - "Licensed under the MIT License." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Automated Machine Learning\n", - "_**Remote Execution using AmlCompute**_\n", - "\n", - "## Contents\n", - "1. [Introduction](#Introduction)\n", - "1. [Setup](#Setup)\n", - "1. [Data](#Data)\n", - "1. [Train](#Train)\n", - "1. [Results](#Results)\n", - "1. [Test](#Test)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Introduction\n", - "In this example we use the scikit-learn's [digit dataset](http://scikit-learn.org/stable/datasets/index.html#optical-recognition-of-handwritten-digits-dataset) to showcase how you can use AutoML for a simple classification problem.\n", - "\n", - "Make sure you have executed the [configuration](../../../configuration.ipynb) before running this notebook.\n", - "\n", - "In this notebook you would see\n", - "1. Create an `Experiment` in an existing `Workspace`.\n", - "2. Create or Attach existing AmlCompute to a workspace.\n", - "3. Configure AutoML using `AutoMLConfig`.\n", - "4. Train the model using AmlCompute\n", - "5. Explore the results.\n", - "6. Test the best fitted model.\n", - "\n", - "In addition this notebook showcases the following features\n", - "- **Parallel** executions for iterations\n", - "- **Asynchronous** tracking of progress\n", - "- **Cancellation** of individual iterations or the entire run\n", - "- Retrieving models for any iteration or logged metric\n", - "- Specifying AutoML settings as `**kwargs`" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Setup\n", - "\n", - "As part of the setup you have already created an Azure ML `Workspace` object. For AutoML you will need to create an `Experiment` object, which is a named object in a `Workspace` used to run experiments." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import logging\n", - "import os\n", - "import csv\n", - "\n", - "from matplotlib import pyplot as plt\n", - "import numpy as np\n", - "import pandas as pd\n", - "from sklearn import datasets\n", - "\n", - "import azureml.core\n", - "from azureml.core.experiment import Experiment\n", - "from azureml.core.workspace import Workspace\n", - "from azureml.train.automl import AutoMLConfig" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "ws = Workspace.from_config()\n", - "\n", - "# Choose a name for the run history container in the workspace.\n", - "experiment_name = 'automl-remote-amlcompute'\n", - "project_folder = './project'\n", - "\n", - "experiment = Experiment(ws, experiment_name)\n", - "\n", - "output = {}\n", - "output['SDK version'] = azureml.core.VERSION\n", - "output['Subscription ID'] = ws.subscription_id\n", - "output['Workspace Name'] = ws.name\n", - "output['Resource Group'] = ws.resource_group\n", - "output['Location'] = ws.location\n", - "output['Project Directory'] = project_folder\n", - "output['Experiment Name'] = experiment.name\n", - "pd.set_option('display.max_colwidth', -1)\n", - "outputDf = pd.DataFrame(data = output, index = [''])\n", - "outputDf.T" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Create or Attach existing AmlCompute\n", - "You will need to create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for your AutoML run. In this tutorial, you attach the default `AmlCompute` as your training compute resource.\n", - "\n", - "As with other Azure services, there are limits on certain resources (e.g. AmlCompute) associated with the Azure Machine Learning service. Please read [this article](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-manage-quotas) on the default limits and how to request more quota." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "compute_target = ws.get_default_compute_target(\"CPU\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Data\n", - "For remote executions, you need to make the data accessible from the remote compute.\n", - "This can be done by uploading the data to DataStore.\n", - "In this example, we upload scikit-learn's [load_digits](http://scikit-learn.org/stable/modules/generated/sklearn.datasets.load_digits.html) data." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "data_train = datasets.load_digits()\n", - "\n", - "if not os.path.isdir('data'):\n", - " os.mkdir('data')\n", - " \n", - "if not os.path.exists(project_folder):\n", - " os.makedirs(project_folder)\n", - " \n", - "pd.DataFrame(data_train.data).to_csv(\"data/X_train.tsv\", index=False, header=False, quoting=csv.QUOTE_ALL, sep=\"\\t\")\n", - "pd.DataFrame(data_train.target).to_csv(\"data/y_train.tsv\", index=False, header=False, sep=\"\\t\")\n", - "\n", - "ds = ws.get_default_datastore()\n", - "ds.upload(src_dir='./data', target_path='bai_data', overwrite=True, show_progress=True)\n", - "\n", - "from azureml.core.runconfig import DataReferenceConfiguration\n", - "dr = DataReferenceConfiguration(datastore_name=ds.name, \n", - " path_on_datastore='bai_data', \n", - " path_on_compute='/tmp/azureml_runs',\n", - " mode='download', # download files from datastore to compute target\n", - " overwrite=False)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.core.runconfig import RunConfiguration\n", - "from azureml.core.conda_dependencies import CondaDependencies\n", - "\n", - "# create a new RunConfig object\n", - "conda_run_config = RunConfiguration(framework=\"python\")\n", - "\n", - "# Set compute target to AmlCompute\n", - "conda_run_config.target = compute_target\n", - "conda_run_config.environment.docker.enabled = True\n", - "conda_run_config.environment.docker.base_image = azureml.core.runconfig.DEFAULT_CPU_IMAGE\n", - "\n", - "# set the data reference of the run coonfiguration\n", - "conda_run_config.data_references = {ds.name: dr}\n", - "\n", - "cd = CondaDependencies.create(pip_packages=['azureml-sdk[automl]'], conda_packages=['numpy','py-xgboost<=0.80'])\n", - "conda_run_config.environment.python.conda_dependencies = cd" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "%%writefile $project_folder/get_data.py\n", - "\n", - "import pandas as pd\n", - "\n", - "def get_data():\n", - " X_train = pd.read_csv(\"/tmp/azureml_runs/bai_data/X_train.tsv\", delimiter=\"\\t\", header=None, quotechar='\"')\n", - " y_train = pd.read_csv(\"/tmp/azureml_runs/bai_data/y_train.tsv\", delimiter=\"\\t\", header=None, quotechar='\"')\n", - "\n", - " return { \"X\" : X_train.values, \"y\" : y_train[0].values }\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Train\n", - "\n", - "You can specify `automl_settings` as `**kwargs` as well. Also note that you can use a `get_data()` function for local excutions too.\n", - "\n", - "**Note:** When using AmlCompute, you can't pass Numpy arrays directly to the fit method.\n", - "\n", - "|Property|Description|\n", - "|-|-|\n", - "|**primary_metric**|This is the metric that you want to optimize. Classification supports the following primary metrics:
accuracy
AUC_weighted
average_precision_score_weighted
norm_macro_recall
precision_score_weighted|\n", - "|**iteration_timeout_minutes**|Time limit in minutes for each iteration.|\n", - "|**iterations**|Number of iterations. In each iteration AutoML trains a specific pipeline with the data.|\n", - "|**n_cross_validations**|Number of cross validation splits.|\n", - "|**max_concurrent_iterations**|Maximum number of iterations that would be executed in parallel. This should be less than the number of cores on the DSVM.|" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "automl_settings = {\n", - " \"iteration_timeout_minutes\": 10,\n", - " \"iterations\": 20,\n", - " \"n_cross_validations\": 5,\n", - " \"primary_metric\": 'AUC_weighted',\n", - " \"preprocess\": False,\n", - " \"max_concurrent_iterations\": 5,\n", - " \"verbosity\": logging.INFO\n", - "}\n", - "\n", - "automl_config = AutoMLConfig(task = 'classification',\n", - " debug_log = 'automl_errors.log',\n", - " path = project_folder,\n", - " run_configuration=conda_run_config,\n", - " data_script = project_folder + \"/get_data.py\",\n", - " **automl_settings\n", - " )\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Call the `submit` method on the experiment object and pass the run configuration. For remote runs the execution is asynchronous, so you will see the iterations get populated as they complete. You can interact with the widgets and models even when the experiment is running to retrieve the best model up to that point. Once you are satisfied with the model, you can cancel a particular iteration or the whole run.\n", - "In this example, we specify `show_output = False` to suppress console output while the run is in progress." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "remote_run = experiment.submit(automl_config, show_output = False)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "remote_run" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Results\n", - "\n", - "#### Loading executed runs\n", - "In case you need to load a previously executed run, enable the cell below and replace the `run_id` value." - ] - }, - { - "cell_type": "raw", - "metadata": {}, - "source": [ - "remote_run = AutoMLRun(experiment = experiment, run_id = 'AutoML_5db13491-c92a-4f1d-b622-8ab8d973a058')" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### Widget for Monitoring Runs\n", - "\n", - "The widget will first report a \"loading\" status while running the first iteration. After completing the first iteration, an auto-updating graph and table will be shown. The widget will refresh once per minute, so you should see the graph update as child runs complete.\n", - "\n", - "You can click on a pipeline to see run properties and output logs. Logs are also available on the DSVM under `/tmp/azureml_run/{iterationid}/azureml-logs`\n", - "\n", - "**Note:** The widget displays a link at the bottom. Use this link to open a web interface to explore the individual run details." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "remote_run" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.widgets import RunDetails\n", - "RunDetails(remote_run).show() " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Wait until the run finishes.\n", - "remote_run.wait_for_completion(show_output = True)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "#### Retrieve All Child Runs\n", - "You can also use SDK methods to fetch all the child runs and see individual metrics that we log." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "children = list(remote_run.get_children())\n", - "metricslist = {}\n", - "for run in children:\n", - " properties = run.get_properties()\n", - " metrics = {k: v for k, v in run.get_metrics().items() if isinstance(v, float)}\n", - " metricslist[int(properties['iteration'])] = metrics\n", - "\n", - "rundata = pd.DataFrame(metricslist).sort_index(1)\n", - "rundata" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Cancelling Runs\n", - "\n", - "You can cancel ongoing remote runs using the `cancel` and `cancel_iteration` functions." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Cancel the ongoing experiment and stop scheduling new iterations.\n", - "# remote_run.cancel()\n", - "\n", - "# Cancel iteration 1 and move onto iteration 2.\n", - "# remote_run.cancel_iteration(1)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Retrieve the Best Model\n", - "\n", - "Below we select the best pipeline from our iterations. The `get_output` method returns the best run and the fitted model. The Model includes the pipeline and any pre-processing. Overloads on `get_output` allow you to retrieve the best run and fitted model for *any* logged metric or for a particular *iteration*." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "best_run, fitted_model = remote_run.get_output()\n", - "print(best_run)\n", - "print(fitted_model)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### Best Model Based on Any Other Metric\n", - "Show the run and the model which has the smallest `log_loss` value:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "lookup_metric = \"log_loss\"\n", - "best_run, fitted_model = remote_run.get_output(metric = lookup_metric)\n", - "print(best_run)\n", - "print(fitted_model)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### Model from a Specific Iteration\n", - "Show the run and the model from the third iteration:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "iteration = 3\n", - "third_run, third_model = remote_run.get_output(iteration=iteration)\n", - "print(third_run)\n", - "print(third_model)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Test\n", - "\n", - "#### Load Test Data" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "digits = datasets.load_digits()\n", - "X_test = digits.data[:10, :]\n", - "y_test = digits.target[:10]\n", - "images = digits.images[:10]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### Testing Our Best Fitted Model" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Randomly select digits and test.\n", - "for index in np.random.choice(len(y_test), 2, replace = False):\n", - " print(index)\n", - " predicted = fitted_model.predict(X_test[index:index + 1])[0]\n", - " label = y_test[index]\n", - " title = \"Label value = %d Predicted value = %d \" % (label, predicted)\n", - " fig = plt.figure(1, figsize=(3,3))\n", - " ax1 = fig.add_axes((0,0,.8,.8))\n", - " ax1.set_title(title)\n", - " plt.imshow(images[index], cmap = plt.cm.gray_r, interpolation = 'nearest')\n", - " plt.show()" - ] - } - ], - "metadata": { - "authors": [ - { - "name": "savitam" - } - ], - "kernelspec": { - "display_name": "Python 3.6", - "language": "python", - "name": "python36" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.6" - } + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) Microsoft Corporation. All rights reserved.\n", + "\n", + "Licensed under the MIT License." + ] }, - "nbformat": 4, - "nbformat_minor": 2 -} \ No newline at end of file + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Automated Machine Learning\n", + "_**Remote Execution using AmlCompute**_\n", + "\n", + "## Contents\n", + "1. [Introduction](#Introduction)\n", + "1. [Setup](#Setup)\n", + "1. [Data](#Data)\n", + "1. [Train](#Train)\n", + "1. [Results](#Results)\n", + "1. [Test](#Test)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Introduction\n", + "In this example we use the scikit-learn's [digit dataset](http://scikit-learn.org/stable/datasets/index.html#optical-recognition-of-handwritten-digits-dataset) to showcase how you can use AutoML for a simple classification problem.\n", + "\n", + "Make sure you have executed the [configuration](../../../configuration.ipynb) before running this notebook.\n", + "\n", + "In this notebook you would see\n", + "1. Create an `Experiment` in an existing `Workspace`.\n", + "2. Create or Attach existing AmlCompute to a workspace.\n", + "3. Configure AutoML using `AutoMLConfig`.\n", + "4. Train the model using AmlCompute\n", + "5. Explore the results.\n", + "6. Test the best fitted model.\n", + "\n", + "In addition this notebook showcases the following features\n", + "- **Parallel** executions for iterations\n", + "- **Asynchronous** tracking of progress\n", + "- **Cancellation** of individual iterations or the entire run\n", + "- Retrieving models for any iteration or logged metric\n", + "- Specifying AutoML settings as `**kwargs`" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Setup\n", + "\n", + "As part of the setup you have already created an Azure ML `Workspace` object. For AutoML you will need to create an `Experiment` object, which is a named object in a `Workspace` used to run experiments." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import logging\n", + "import os\n", + "import csv\n", + "\n", + "from matplotlib import pyplot as plt\n", + "import numpy as np\n", + "import pandas as pd\n", + "from sklearn import datasets\n", + "\n", + "import azureml.core\n", + "from azureml.core.experiment import Experiment\n", + "from azureml.core.workspace import Workspace\n", + "from azureml.train.automl import AutoMLConfig" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ws = Workspace.from_config()\n", + "\n", + "# Choose a name for the run history container in the workspace.\n", + "experiment_name = 'automl-remote-amlcompute'\n", + "project_folder = './project'\n", + "\n", + "experiment = Experiment(ws, experiment_name)\n", + "\n", + "output = {}\n", + "output['SDK version'] = azureml.core.VERSION\n", + "output['Subscription ID'] = ws.subscription_id\n", + "output['Workspace Name'] = ws.name\n", + "output['Resource Group'] = ws.resource_group\n", + "output['Location'] = ws.location\n", + "output['Project Directory'] = project_folder\n", + "output['Experiment Name'] = experiment.name\n", + "pd.set_option('display.max_colwidth', -1)\n", + "outputDf = pd.DataFrame(data = output, index = [''])\n", + "outputDf.T" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Create or Attach existing AmlCompute\n", + "You will need to create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for your AutoML run. In this tutorial, you create an AmlCompute as your training compute resource.\n", + "\n", + "As with other Azure services, there are limits on certain resources (e.g. AmlCompute) associated with the Azure Machine Learning service. Please read [this article](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-manage-quotas) on the default limits and how to request more quota." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core.compute import AmlCompute\n", + "from azureml.core.compute import ComputeTarget\n", + "\n", + "# Choose a name for your cluster.\n", + "amlcompute_cluster_name = \"cpucluster\"\n", + "\n", + "found = False\n", + "\n", + "# Check if this compute target already exists in the workspace.\n", + "\n", + "cts = ws.compute_targets\n", + "if amlcompute_cluster_name in cts and cts[amlcompute_cluster_name].type == 'AmlCompute':\n", + " found = True\n", + " print('Found existing compute target.')\n", + " compute_target = cts[amlcompute_cluster_name]\n", + "\n", + "if not found:\n", + " print('Creating a new compute target...')\n", + " provisioning_config = AmlCompute.provisioning_configuration(vm_size = \"STANDARD_D2_V2\", # for GPU, use \"STANDARD_NC6\"\n", + " #vm_priority = 'lowpriority', # optional\n", + " max_nodes = 6)\n", + "\n", + " # Create the cluster.\\n\",\n", + " compute_target = ComputeTarget.create(ws, amlcompute_cluster_name, provisioning_config)\n", + "\n", + " # Can poll for a minimum number of nodes and for a specific timeout.\n", + " # If no min_node_count is provided, it will use the scale settings for the cluster.\n", + " compute_target.wait_for_completion(show_output = True, min_node_count = None, timeout_in_minutes = 20)\n", + "\n", + " # For a more detailed view of current AmlCompute status, use get_status()." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Data\n", + "For remote executions, you need to make the data accessible from the remote compute.\n", + "This can be done by uploading the data to DataStore.\n", + "In this example, we upload scikit-learn's [load_digits](http://scikit-learn.org/stable/modules/generated/sklearn.datasets.load_digits.html) data." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "data_train = datasets.load_digits()\n", + "\n", + "if not os.path.isdir('data'):\n", + " os.mkdir('data')\n", + " \n", + "if not os.path.exists(project_folder):\n", + " os.makedirs(project_folder)\n", + " \n", + "pd.DataFrame(data_train.data).to_csv(\"data/X_train.tsv\", index=False, header=False, quoting=csv.QUOTE_ALL, sep=\"\\t\")\n", + "pd.DataFrame(data_train.target).to_csv(\"data/y_train.tsv\", index=False, header=False, sep=\"\\t\")\n", + "\n", + "ds = ws.get_default_datastore()\n", + "ds.upload(src_dir='./data', target_path='bai_data', overwrite=True, show_progress=True)\n", + "\n", + "from azureml.core.runconfig import DataReferenceConfiguration\n", + "dr = DataReferenceConfiguration(datastore_name=ds.name, \n", + " path_on_datastore='bai_data', \n", + " path_on_compute='/tmp/azureml_runs',\n", + " mode='download', # download files from datastore to compute target\n", + " overwrite=False)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core.runconfig import RunConfiguration\n", + "from azureml.core.conda_dependencies import CondaDependencies\n", + "\n", + "# create a new RunConfig object\n", + "conda_run_config = RunConfiguration(framework=\"python\")\n", + "\n", + "# Set compute target to AmlCompute\n", + "conda_run_config.target = compute_target\n", + "conda_run_config.environment.docker.enabled = True\n", + "conda_run_config.environment.docker.base_image = azureml.core.runconfig.DEFAULT_CPU_IMAGE\n", + "\n", + "# set the data reference of the run coonfiguration\n", + "conda_run_config.data_references = {ds.name: dr}\n", + "\n", + "cd = CondaDependencies.create(pip_packages=['azureml-sdk[automl]'], conda_packages=['numpy','py-xgboost<=0.80'])\n", + "conda_run_config.environment.python.conda_dependencies = cd" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%writefile $project_folder/get_data.py\n", + "\n", + "import pandas as pd\n", + "\n", + "def get_data():\n", + " X_train = pd.read_csv(\"/tmp/azureml_runs/bai_data/X_train.tsv\", delimiter=\"\\t\", header=None, quotechar='\"')\n", + " y_train = pd.read_csv(\"/tmp/azureml_runs/bai_data/y_train.tsv\", delimiter=\"\\t\", header=None, quotechar='\"')\n", + "\n", + " return { \"X\" : X_train.values, \"y\" : y_train[0].values }\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Train\n", + "\n", + "You can specify `automl_settings` as `**kwargs` as well. Also note that you can use a `get_data()` function for local excutions too.\n", + "\n", + "**Note:** When using AmlCompute, you can't pass Numpy arrays directly to the fit method.\n", + "\n", + "|Property|Description|\n", + "|-|-|\n", + "|**primary_metric**|This is the metric that you want to optimize. Classification supports the following primary metrics:
accuracy
AUC_weighted
average_precision_score_weighted
norm_macro_recall
precision_score_weighted|\n", + "|**iteration_timeout_minutes**|Time limit in minutes for each iteration.|\n", + "|**iterations**|Number of iterations. In each iteration AutoML trains a specific pipeline with the data.|\n", + "|**n_cross_validations**|Number of cross validation splits.|\n", + "|**max_concurrent_iterations**|Maximum number of iterations that would be executed in parallel. This should be less than the number of cores on the DSVM.|" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "automl_settings = {\n", + " \"iteration_timeout_minutes\": 10,\n", + " \"iterations\": 20,\n", + " \"n_cross_validations\": 5,\n", + " \"primary_metric\": 'AUC_weighted',\n", + " \"preprocess\": False,\n", + " \"max_concurrent_iterations\": 5,\n", + " \"verbosity\": logging.INFO\n", + "}\n", + "\n", + "automl_config = AutoMLConfig(task = 'classification',\n", + " debug_log = 'automl_errors.log',\n", + " path = project_folder,\n", + " run_configuration=conda_run_config,\n", + " data_script = project_folder + \"/get_data.py\",\n", + " **automl_settings\n", + " )\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Call the `submit` method on the experiment object and pass the run configuration. For remote runs the execution is asynchronous, so you will see the iterations get populated as they complete. You can interact with the widgets and models even when the experiment is running to retrieve the best model up to that point. Once you are satisfied with the model, you can cancel a particular iteration or the whole run.\n", + "In this example, we specify `show_output = False` to suppress console output while the run is in progress." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "remote_run = experiment.submit(automl_config, show_output = False)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "remote_run" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Results\n", + "\n", + "#### Loading executed runs\n", + "In case you need to load a previously executed run, enable the cell below and replace the `run_id` value." + ] + }, + { + "cell_type": "raw", + "metadata": {}, + "source": [ + "remote_run = AutoMLRun(experiment = experiment, run_id = 'AutoML_5db13491-c92a-4f1d-b622-8ab8d973a058')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Widget for Monitoring Runs\n", + "\n", + "The widget will first report a \"loading\" status while running the first iteration. After completing the first iteration, an auto-updating graph and table will be shown. The widget will refresh once per minute, so you should see the graph update as child runs complete.\n", + "\n", + "You can click on a pipeline to see run properties and output logs. Logs are also available on the DSVM under `/tmp/azureml_run/{iterationid}/azureml-logs`\n", + "\n", + "**Note:** The widget displays a link at the bottom. Use this link to open a web interface to explore the individual run details." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "remote_run" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.widgets import RunDetails\n", + "RunDetails(remote_run).show() " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Wait until the run finishes.\n", + "remote_run.wait_for_completion(show_output = True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "#### Retrieve All Child Runs\n", + "You can also use SDK methods to fetch all the child runs and see individual metrics that we log." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "children = list(remote_run.get_children())\n", + "metricslist = {}\n", + "for run in children:\n", + " properties = run.get_properties()\n", + " metrics = {k: v for k, v in run.get_metrics().items() if isinstance(v, float)}\n", + " metricslist[int(properties['iteration'])] = metrics\n", + "\n", + "rundata = pd.DataFrame(metricslist).sort_index(1)\n", + "rundata" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Cancelling Runs\n", + "\n", + "You can cancel ongoing remote runs using the `cancel` and `cancel_iteration` functions." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Cancel the ongoing experiment and stop scheduling new iterations.\n", + "# remote_run.cancel()\n", + "\n", + "# Cancel iteration 1 and move onto iteration 2.\n", + "# remote_run.cancel_iteration(1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Retrieve the Best Model\n", + "\n", + "Below we select the best pipeline from our iterations. The `get_output` method returns the best run and the fitted model. The Model includes the pipeline and any pre-processing. Overloads on `get_output` allow you to retrieve the best run and fitted model for *any* logged metric or for a particular *iteration*." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "best_run, fitted_model = remote_run.get_output()\n", + "print(best_run)\n", + "print(fitted_model)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Best Model Based on Any Other Metric\n", + "Show the run and the model which has the smallest `log_loss` value:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "lookup_metric = \"log_loss\"\n", + "best_run, fitted_model = remote_run.get_output(metric = lookup_metric)\n", + "print(best_run)\n", + "print(fitted_model)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Model from a Specific Iteration\n", + "Show the run and the model from the third iteration:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "iteration = 3\n", + "third_run, third_model = remote_run.get_output(iteration=iteration)\n", + "print(third_run)\n", + "print(third_model)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Test\n", + "\n", + "#### Load Test Data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "digits = datasets.load_digits()\n", + "X_test = digits.data[:10, :]\n", + "y_test = digits.target[:10]\n", + "images = digits.images[:10]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Testing Our Best Fitted Model" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Randomly select digits and test.\n", + "for index in np.random.choice(len(y_test), 2, replace = False):\n", + " print(index)\n", + " predicted = fitted_model.predict(X_test[index:index + 1])[0]\n", + " label = y_test[index]\n", + " title = \"Label value = %d Predicted value = %d \" % (label, predicted)\n", + " fig = plt.figure(1, figsize=(3,3))\n", + " ax1 = fig.add_axes((0,0,.8,.8))\n", + " ax1.set_title(title)\n", + " plt.imshow(images[index], cmap = plt.cm.gray_r, interpolation = 'nearest')\n", + " plt.show()" + ] + } + ], + "metadata": { + "authors": [ + { + "name": "savitam" + } + ], + "kernelspec": { + "display_name": "Python 3.6", + "language": "python", + "name": "python36" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.6" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From dcd2d588805ea94a2fe1bba76746f2af4912bb7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Mon, 20 May 2019 14:44:43 -0700 Subject: [PATCH 081/108] Added notice on the data/telemetry --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index f42c5d97..2c816baa 100644 --- a/README.md +++ b/README.md @@ -55,4 +55,15 @@ Visit following repos to see projects contributed by Azure ML users: - [Fine tune natural language processing models using Azure Machine Learning service](https://github.com/Microsoft/AzureML-BERT) - [Fashion MNIST with Azure ML SDK](https://github.com/amynic/azureml-sdk-fashion) +## Data/Telemetry +This repository collects usage data and sends it to Mircosoft to help improve our products and services. Read Microsoft's [privacy statement to learn more](https://privacy.microsoft.com/en-US/privacystatement) + +To opt out of tracking, please go to the raw markdown or .ipynb files and remove the following line of code: + +```sh + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/README.png)" +``` +This URL will be slightly different depending on the file. + + ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/README.png) From 465a5b13b1054f2c56704ac211a79d38eff1c593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Tue, 21 May 2019 07:38:52 -0700 Subject: [PATCH 082/108] Create Licenses --- Licenses | 1 + 1 file changed, 1 insertion(+) create mode 100644 Licenses diff --git a/Licenses b/Licenses new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/Licenses @@ -0,0 +1 @@ + From cd80040dd81981135a6be473badc978d3ec23898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Tue, 21 May 2019 07:39:03 -0700 Subject: [PATCH 083/108] Delete Licenses --- Licenses | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Licenses diff --git a/Licenses b/Licenses deleted file mode 100644 index 8b137891..00000000 --- a/Licenses +++ /dev/null @@ -1 +0,0 @@ - From 486c44d157c422568f53d1bc28dc3835bd0476f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Tue, 21 May 2019 07:39:43 -0700 Subject: [PATCH 084/108] Create sdk --- Licenses/sdk | 1 + 1 file changed, 1 insertion(+) create mode 100644 Licenses/sdk diff --git a/Licenses/sdk b/Licenses/sdk new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/Licenses/sdk @@ -0,0 +1 @@ + From 6ab85a20e35da6756165a2f4c8ae184679593607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Tue, 21 May 2019 07:42:07 -0700 Subject: [PATCH 085/108] Create LICENSES --- Licenses/sdk-license/LICENSES | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Licenses/sdk-license/LICENSES diff --git a/Licenses/sdk-license/LICENSES b/Licenses/sdk-license/LICENSES new file mode 100644 index 00000000..183b10c2 --- /dev/null +++ b/Licenses/sdk-license/LICENSES @@ -0,0 +1,14 @@ + +This software is made available to you on the condition that you agree to +[your agreement][1] governing your use of Azure. +If you do not have an existing agreement governing your use of Azure, you agree that +your agreement governing use of Azure is the [Microsoft Online Subscription Agreement][2] +(which incorporates the [Online Services Terms][3]). +By using the software you agree to these terms. This software may collect data +that is transmitted to Microsoft. Please see the [Microsoft Privacy Statement][4] +to learn more about how Microsoft processes personal data. + +[1]: https://azure.microsoft.com/en-us/support/legal/ +[2]: https://azure.microsoft.com/en-us/support/legal/subscription-agreement/ +[3]: http://www.microsoftvolumelicensing.com/DocumentSearch.aspx?Mode=3&DocumentTypeId=46 +[4]: http://go.microsoft.com/fwlink/?LinkId=248681 From ffa28aa89ceabc0eeec9239f3937462b0fe70b55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Tue, 21 May 2019 07:43:06 -0700 Subject: [PATCH 086/108] Delete sdk --- Licenses/sdk | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Licenses/sdk diff --git a/Licenses/sdk b/Licenses/sdk deleted file mode 100644 index 8b137891..00000000 --- a/Licenses/sdk +++ /dev/null @@ -1 +0,0 @@ - From b9e35ea0cb3c7c1a9759e33547a298cf393bdcc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Tue, 21 May 2019 07:44:10 -0700 Subject: [PATCH 087/108] Create LICENSE --- Licenses/sdk-preview-license/LICENSE | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Licenses/sdk-preview-license/LICENSE diff --git a/Licenses/sdk-preview-license/LICENSE b/Licenses/sdk-preview-license/LICENSE new file mode 100644 index 00000000..0dd657ca --- /dev/null +++ b/Licenses/sdk-preview-license/LICENSE @@ -0,0 +1,15 @@ +This Preview is made available to you on the condition that you agree to the +[Supplemental Terms of Use for Microsoft Azure Previews][1], which supplement +[your agreement][2] governing your use of Azure. +If you do not have an existing agreement governing your use of Azure, you agree that +your agreement governing use of Azure is the [Microsoft Online Subscription Agreement][3] +(which incorporates the [Online Services Terms][4]). +By using the Preview you agree to these terms. This Preview may collect data +that is transmitted to Microsoft. Please see the [Microsoft Privacy Statement][5] +to learn more about how Microsoft processes personal data. + +[1]: https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/ +[2]: https://azure.microsoft.com/en-us/support/legal/ +[3]: https://azure.microsoft.com/en-us/support/legal/subscription-agreement/ +[4]: http://www.microsoftvolumelicensing.com/DocumentSearch.aspx?Mode=3&DocumentTypeId=46 +[5]: http://go.microsoft.com/fwlink/?LinkId=248681 From 8bba850db113f07af2782bc35e8c28d336b9a9b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Tue, 21 May 2019 07:51:28 -0700 Subject: [PATCH 088/108] moved the content in the pr.md file moved the content in the pr.md file to under 'Projects using Azure Machine Learning' --- README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/README.md b/README.md index 2c816baa..ee1a5699 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,60 @@ Visit following repos to see projects contributed by Azure ML users: - [Fine tune natural language processing models using Azure Machine Learning service](https://github.com/Microsoft/AzureML-BERT) - [Fashion MNIST with Azure ML SDK](https://github.com/amynic/azureml-sdk-fashion) + + ## Azure Machine Learning Resources & Links +## Product Documentation +- [Azure Machine Learning service](https://docs.microsoft.com/en-us/azure/machine-learning/service/) +- [Azure Machine Learning Studio](https://docs.microsoft.com/en-us/azure/machine-learning/studio/) + +## Product Team Blogs +- [What’s new in Azure Machine Learning service](https://aka.ms/aml-blog-whats-new) +- [Announcing automated ML capability in Azure Machine Learning](https://aka.ms/aml-blog-automl) +- [Experimentation using Azure Machine Learning](https://aka.ms/aml-blog-experimentation) +- [Azure AI – Making AI real for business](https://aka.ms/aml-blog-overview) + +## Community Blogs +- [Power Bat – How Spektacom is Powering the Game of Cricket with Microsoft AI](https://blogs.technet.microsoft.com/machinelearning/2018/10/11/power-bat-how-spektacom-is-powering-the-game-of-cricket-with-microsoft-ai/) + +## Ignite 2018 Public Preview Launch Sessions +- [AI with Azure Machine Learning services: Simplifying the data science process](https://myignite.techcommunity.microsoft.com/sessions/66248) +- [AI TechTalk: Azure Machine Learning SDK - a walkthrough](https://myignite.techcommunity.microsoft.com/sessions/66265) +- [AI for an intelligent cloud and intelligent edge: Discover, deploy, and manage with Azure ML services](https://myignite.techcommunity.microsoft.com/sessions/65389) +- [Generating high quality models efficiently using Automated ML and Hyperparameter Tuning](https://myignite.techcommunity.microsoft.com/sessions/66245) +- [AI for pros: Deep learning with PyTorch using the Azure Data Science Virtual Machine and scaling training with Azure ML](https://myignite.techcommunity.microsoft.com/sessions/66244) + +## Get-started Videos on YouTube +- [Get started with Python SDK](https://youtu.be/VIsXeTuW3FU) +- [Get started from Azure Portal](https://youtu.be/lCkYUHV86Mk) + + +## Third Party Articles +- [Azure’s new machine learning features embrace Python](https://www.infoworld.com/article/3306840/azure/azures-new-machine-learning-features-embrace-python.html) (InfoWorld) +- [How to use Azure ML in Windows 10](https://www.infoworld.com/article/3308381/azure/how-to-use-azure-ml-in-windows-10.html) (InfoWorld) +- [How Azure ML Streamlines Cloud-based Machine Learning](https://thenewstack.io/how-the-azure-ml-streamlines-cloud-based-machine-learning/) (The New Stack) +- [Facebook launches PyTorch 1.0 with integrations for Google Cloud, AWS, and Azure Machine Learning](https://venturebeat.com/2018/10/02/facebook-launches-pytorch-1-0-integrations-for-google-cloud-aws-and-azure-machine-learning/) (VentureBeat) +- [How Microsoft Uses Machine Learning to Help You Build Machine Learning Pipelines](https://towardsdatascience.com/how-microsoft-uses-machine-learning-to-help-you-build-machine-learning-pipelines-be75f710613b) (Towards Data Science) +- [Microsoft's Machine Learning Tools for Developers Get Smarter](https://techcrunch.com/2018/09/24/microsofts-machine-learning-tools-for-developers-get-smarter/) (TechCrunch) +- [Microsoft introduces Azure service to automatically build AI models](https://venturebeat.com/2018/09/24/microsoft-introduces-azure-service-to-automatically-build-ai-models/) (VentureBeat) + +## Community Projects +- [Use Papermill with Azure ML](https://github.com/jreynolds01/papermill_execution_azureml/) +- [Fashion MNIST](https://github.com/amynic/azureml-sdk-fashion) +- Keras on Databricks +- [Samples from CSS](https://github.com/Azure/AMLSamples) + + +## Azure Machine Learning Studio Resources +- [A-Z Machine Learning using Azure Machine Learning (AzureML)](https://www.udemy.com/machine-learning-using-azureml/) +- [Machine Learning In The Cloud With Azure Machine Learning](https://www.udemy.com/machine-learning-in-the-cloud-with-azure-machine-learning/) +- [How to Become A Data Scientist Using Azure Machine Learning](https://www.udemy.com/azure-machine-learning-introduction/) +- [Learn Azure Machine Learning from scratch](https://www.udemy.com/learn-azure-machine-learning-from-scratch/) +- [Azure Machine Learning Studio PowerShell Module](https://aka.ms/amlps) + +## Forum Help +- [Azure Machine Learning service](https://social.msdn.microsoft.com/Forums/en-US/home?forum=AzureMachineLearningService) +- [Azure Machine Learning Studio](https://social.msdn.microsoft.com/forums/azure/en-US/home?forum=MachineLearning) + ## Data/Telemetry This repository collects usage data and sends it to Mircosoft to help improve our products and services. Read Microsoft's [privacy statement to learn more](https://privacy.microsoft.com/en-US/privacystatement) From 1b7ff724f34800e405a1f6d4cb97e3879cedba35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Wed, 22 May 2019 10:03:40 -0700 Subject: [PATCH 089/108] Deleted pr.md Contents of this file moved to the README in the root directory. --- pr.md | 52 ---------------------------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 pr.md diff --git a/pr.md b/pr.md deleted file mode 100644 index 8cdfeaad..00000000 --- a/pr.md +++ /dev/null @@ -1,52 +0,0 @@ -# Azure Machine Learning Resources & Links -## Product Documentation -- [Azure Machine Learning service](https://docs.microsoft.com/en-us/azure/machine-learning/service/) -- [Azure Machine Learning Studio](https://docs.microsoft.com/en-us/azure/machine-learning/studio/) - -## Product Team Blogs -- [What’s new in Azure Machine Learning service](https://aka.ms/aml-blog-whats-new) -- [Announcing automated ML capability in Azure Machine Learning](https://aka.ms/aml-blog-automl) -- [Experimentation using Azure Machine Learning](https://aka.ms/aml-blog-experimentation) -- [Azure AI – Making AI real for business](https://aka.ms/aml-blog-overview) - -## Community Blogs -- [Power Bat – How Spektacom is Powering the Game of Cricket with Microsoft AI](https://blogs.technet.microsoft.com/machinelearning/2018/10/11/power-bat-how-spektacom-is-powering-the-game-of-cricket-with-microsoft-ai/) - -## Ignite 2018 Public Preview Launch Sessions -- [AI with Azure Machine Learning services: Simplifying the data science process](https://myignite.techcommunity.microsoft.com/sessions/66248) -- [AI TechTalk: Azure Machine Learning SDK - a walkthrough](https://myignite.techcommunity.microsoft.com/sessions/66265) -- [AI for an intelligent cloud and intelligent edge: Discover, deploy, and manage with Azure ML services](https://myignite.techcommunity.microsoft.com/sessions/65389) -- [Generating high quality models efficiently using Automated ML and Hyperparameter Tuning](https://myignite.techcommunity.microsoft.com/sessions/66245) -- [AI for pros: Deep learning with PyTorch using the Azure Data Science Virtual Machine and scaling training with Azure ML](https://myignite.techcommunity.microsoft.com/sessions/66244) - -## Get-started Videos on YouTube -- [Get started with Python SDK](https://youtu.be/VIsXeTuW3FU) -- [Get started from Azure Portal](https://youtu.be/lCkYUHV86Mk) - - -## Third Party Articles -- [Azure’s new machine learning features embrace Python](https://www.infoworld.com/article/3306840/azure/azures-new-machine-learning-features-embrace-python.html) (InfoWorld) -- [How to use Azure ML in Windows 10](https://www.infoworld.com/article/3308381/azure/how-to-use-azure-ml-in-windows-10.html) (InfoWorld) -- [How Azure ML Streamlines Cloud-based Machine Learning](https://thenewstack.io/how-the-azure-ml-streamlines-cloud-based-machine-learning/) (The New Stack) -- [Facebook launches PyTorch 1.0 with integrations for Google Cloud, AWS, and Azure Machine Learning](https://venturebeat.com/2018/10/02/facebook-launches-pytorch-1-0-integrations-for-google-cloud-aws-and-azure-machine-learning/) (VentureBeat) -- [How Microsoft Uses Machine Learning to Help You Build Machine Learning Pipelines](https://towardsdatascience.com/how-microsoft-uses-machine-learning-to-help-you-build-machine-learning-pipelines-be75f710613b) (Towards Data Science) -- [Microsoft's Machine Learning Tools for Developers Get Smarter](https://techcrunch.com/2018/09/24/microsofts-machine-learning-tools-for-developers-get-smarter/) (TechCrunch) -- [Microsoft introduces Azure service to automatically build AI models](https://venturebeat.com/2018/09/24/microsoft-introduces-azure-service-to-automatically-build-ai-models/) (VentureBeat) - -## Community Projects -- [Use Papermill with Azure ML](https://github.com/jreynolds01/papermill_execution_azureml/) -- [Fashion MNIST](https://github.com/amynic/azureml-sdk-fashion) -- Keras on Databricks -- [Samples from CSS](https://github.com/Azure/AMLSamples) - - -## Azure Machine Learning Studio Resources -- [A-Z Machine Learning using Azure Machine Learning (AzureML)](https://www.udemy.com/machine-learning-using-azureml/) -- [Machine Learning In The Cloud With Azure Machine Learning](https://www.udemy.com/machine-learning-in-the-cloud-with-azure-machine-learning/) -- [How to Become A Data Scientist Using Azure Machine Learning](https://www.udemy.com/azure-machine-learning-introduction/) -- [Learn Azure Machine Learning from scratch](https://www.udemy.com/learn-azure-machine-learning-from-scratch/) -- [Azure Machine Learning Studio PowerShell Module](https://aka.ms/amlps) - -## Forum Help -- [Azure Machine Learning service](https://social.msdn.microsoft.com/Forums/en-US/home?forum=AzureMachineLearningService) -- [Azure Machine Learning Studio](https://social.msdn.microsoft.com/forums/azure/en-US/home?forum=MachineLearning) From ae6f067c813e51e2ffb0ca03a27668f5323182cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Wed, 22 May 2019 10:04:23 -0700 Subject: [PATCH 090/108] Deleted index.html cleaning up root directory --- index.html | 52 ---------------------------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 index.html diff --git a/index.html b/index.html deleted file mode 100644 index 89471490..00000000 --- a/index.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - Azure Machine Learning - - - -

Azure Machine Learning service example notebooks

-

This repository contains example notebooks demonstrating the Azure Machine Learning Python SDK which allows you to build, train, deploy and manage machine learning solutions using Azure. The AML SDK allows you the choice of using local or cloud compute resources, while managing and maintaining the complete data science workflow from the cloud.

-
- -Azure ML workflow

Azure ML workflow

-
-

Quick installation

-
pip install azureml-sdk
-

Read more detailed instructions on how to set up your environment using Azure Notebook service, your own Jupyter notebook server, or Docker.

-

How to navigate and use the example notebooks?

-

You should always run the Configuration notebook first when setting up a notebook library on a new machine or in a new environment. It configures your notebook library to connect to an Azure Machine Learning workspace, and sets up your workspace and compute to be used by many of the other examples.

-

If you want to...

- -

Tutorials

-

The Tutorials folder contains notebooks for the tutorials described in the Azure Machine Learning documentation.

-

How to use Azure ML

-

The How to use Azure ML folder contains specific examples demonstrating the features of the Azure Machine Learning SDK

-
    -
  • Training - Examples of how to build models using Azure ML's logging and execution capabilities on local and remote compute targets
  • -
  • Training with Deep Learning - Examples demonstrating how to build deep learning models using estimators and parameter sweeps
  • -
  • Manage Azure ML Service - Examples how to perform tasks, such as authenticate against Azure ML service in different ways.
  • -
  • Automated Machine Learning - Examples using Automated Machine Learning to automatically generate optimal machine learning pipelines and models
  • -
  • Machine Learning Pipelines - Examples showing how to create and use reusable pipelines for training and batch scoring
  • -
  • Deployment - Examples showing how to deploy and manage machine learning models and solutions
  • -
  • Azure Databricks - Examples showing how to use Azure ML with Azure Databricks
  • -
-

Projects using Azure Machine Learning

-

Visit following repos to see projects contributed by Azure ML users:

- - - \ No newline at end of file From cfce0792788df0beb9063ec255d1cf4016d06c60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Wed, 22 May 2019 10:06:31 -0700 Subject: [PATCH 091/108] Rename LICENSES to LICENSE.txt --- Licenses/sdk-license/{LICENSES => LICENSE.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Licenses/sdk-license/{LICENSES => LICENSE.txt} (100%) diff --git a/Licenses/sdk-license/LICENSES b/Licenses/sdk-license/LICENSE.txt similarity index 100% rename from Licenses/sdk-license/LICENSES rename to Licenses/sdk-license/LICENSE.txt From 255edb04c0de367fca93089c971e1f49c2a067b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Wed, 22 May 2019 10:13:08 -0700 Subject: [PATCH 092/108] Rename LICENSE.txt to LICENSE --- Licenses/sdk-license/{LICENSE.txt => LICENSE} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Licenses/sdk-license/{LICENSE.txt => LICENSE} (100%) diff --git a/Licenses/sdk-license/LICENSE.txt b/Licenses/sdk-license/LICENSE similarity index 100% rename from Licenses/sdk-license/LICENSE.txt rename to Licenses/sdk-license/LICENSE From 2163cab50b97b39e7b29ac3f877be9fb301eedf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Wed, 22 May 2019 10:21:42 -0700 Subject: [PATCH 093/108] Delete LICENSE.txt --- sdk-license/LICENSE.txt | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 sdk-license/LICENSE.txt diff --git a/sdk-license/LICENSE.txt b/sdk-license/LICENSE.txt deleted file mode 100644 index bb3bf887..00000000 --- a/sdk-license/LICENSE.txt +++ /dev/null @@ -1,13 +0,0 @@ -This software is made available to you on the condition that you agree to -[your agreement][1] governing your use of Azure. -If you do not have an existing agreement governing your use of Azure, you agree that -your agreement governing use of Azure is the [Microsoft Online Subscription Agreement][2] -(which incorporates the [Online Services Terms][3]). -By using the software you agree to these terms. This software may collect data -that is transmitted to Microsoft. Please see the [Microsoft Privacy Statement][4] -to learn more about how Microsoft processes personal data. - -[1]: https://azure.microsoft.com/en-us/support/legal/ -[2]: https://azure.microsoft.com/en-us/support/legal/subscription-agreement/ -[3]: http://www.microsoftvolumelicensing.com/DocumentSearch.aspx?Mode=3&DocumentTypeId=46 -[4]: http://go.microsoft.com/fwlink/?LinkId=248681 From 42894ff81a2b0c5e0498002e7f6ec973737b1b55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Wed, 22 May 2019 10:22:05 -0700 Subject: [PATCH 094/108] Delete LICENSE.txt --- sdk-preview-license/LICENSE.txt | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 sdk-preview-license/LICENSE.txt diff --git a/sdk-preview-license/LICENSE.txt b/sdk-preview-license/LICENSE.txt deleted file mode 100644 index 0dd657ca..00000000 --- a/sdk-preview-license/LICENSE.txt +++ /dev/null @@ -1,15 +0,0 @@ -This Preview is made available to you on the condition that you agree to the -[Supplemental Terms of Use for Microsoft Azure Previews][1], which supplement -[your agreement][2] governing your use of Azure. -If you do not have an existing agreement governing your use of Azure, you agree that -your agreement governing use of Azure is the [Microsoft Online Subscription Agreement][3] -(which incorporates the [Online Services Terms][4]). -By using the Preview you agree to these terms. This Preview may collect data -that is transmitted to Microsoft. Please see the [Microsoft Privacy Statement][5] -to learn more about how Microsoft processes personal data. - -[1]: https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/ -[2]: https://azure.microsoft.com/en-us/support/legal/ -[3]: https://azure.microsoft.com/en-us/support/legal/subscription-agreement/ -[4]: http://www.microsoftvolumelicensing.com/DocumentSearch.aspx?Mode=3&DocumentTypeId=46 -[5]: http://go.microsoft.com/fwlink/?LinkId=248681 From 2a3cb690049a542233888029161baacedaf5a8df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Wed, 22 May 2019 10:41:16 -0700 Subject: [PATCH 095/108] Create configtest.ipynb --- Test setup folder/configtest.ipynb | 1 + 1 file changed, 1 insertion(+) create mode 100644 Test setup folder/configtest.ipynb diff --git a/Test setup folder/configtest.ipynb b/Test setup folder/configtest.ipynb new file mode 100644 index 00000000..9daeafb9 --- /dev/null +++ b/Test setup folder/configtest.ipynb @@ -0,0 +1 @@ +test From 59f34b7179f47fac9b52da47f6b333b72edff738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Wed, 22 May 2019 10:47:50 -0700 Subject: [PATCH 096/108] Delete configtest.ipynb --- Test setup folder/configtest.ipynb | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Test setup folder/configtest.ipynb diff --git a/Test setup folder/configtest.ipynb b/Test setup folder/configtest.ipynb deleted file mode 100644 index 9daeafb9..00000000 --- a/Test setup folder/configtest.ipynb +++ /dev/null @@ -1 +0,0 @@ -test From 0e850f09176fc58d655be034180e2a2cc12db92f Mon Sep 17 00:00:00 2001 From: Roope Astala Date: Thu, 23 May 2019 12:27:53 -0400 Subject: [PATCH 097/108] fix default cluster creation in config notebook --- configuration.ipynb | 573 ++++++++++++++++++++++---------------------- 1 file changed, 291 insertions(+), 282 deletions(-) diff --git a/configuration.ipynb b/configuration.ipynb index 7cb763b8..3736505c 100644 --- a/configuration.ipynb +++ b/configuration.ipynb @@ -1,284 +1,293 @@ { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Copyright (c) Microsoft Corporation. All rights reserved.\n", - "\n", - "Licensed under the MIT License." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Configuration\n", - "\n", - "_**Setting up your Azure Machine Learning services workspace and configuring your notebook library**_\n", - "\n", - "---\n", - "---\n", - "\n", - "## Table of Contents\n", - "\n", - "1. [Introduction](#Introduction)\n", - " 1. What is an Azure Machine Learning workspace\n", - "1. [Setup](#Setup)\n", - " 1. Azure subscription\n", - " 1. Azure ML SDK and other library installation\n", - " 1. Azure Container Instance registration\n", - "1. [Configure your Azure ML Workspace](#Configure%20your%20Azure%20ML%20workspace)\n", - " 1. Workspace parameters\n", - " 1. Access your workspace\n", - " 1. Create a new workspace\n", - "1. [Next steps](#Next%20steps)\n", - "\n", - "---\n", - "\n", - "## Introduction\n", - "\n", - "This notebook configures your library of notebooks to connect to an Azure Machine Learning (ML) workspace. In this case, a library contains all of the notebooks in the current folder and any nested folders. You can configure this notebook library to use an existing workspace or create a new workspace.\n", - "\n", - "Typically you will need to run this notebook only once per notebook library as all other notebooks will use connection information that is written here. If you want to redirect your notebook library to work with a different workspace, then you should re-run this notebook.\n", - "\n", - "In this notebook you will\n", - "* Learn about getting an Azure subscription\n", - "* Specify your workspace parameters\n", - "* Access or create your workspace\n", - "* Add a default compute cluster for your workspace\n", - "\n", - "### What is an Azure Machine Learning workspace\n", - "\n", - "An Azure ML Workspace is an Azure resource that organizes and coordinates the actions of many other Azure resources to assist in executing and sharing machine learning workflows. In particular, an Azure ML Workspace coordinates storage, databases, and compute resources providing added functionality for machine learning experimentation, deployment, inferencing, and the monitoring of deployed models." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Setup\n", - "\n", - "This section describes activities required before you can access any Azure ML services functionality." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 1. Azure Subscription\n", - "\n", - "In order to create an Azure ML Workspace, first you need access to an Azure subscription. An Azure subscription allows you to manage storage, compute, and other assets in the Azure cloud. You can [create a new subscription](https://azure.microsoft.com/en-us/free/) or access existing subscription information from the [Azure portal](https://portal.azure.com). Later in this notebook you will need information such as your subscription ID in order to create and access AML workspaces.\n", - "\n", - "### 2. Azure ML SDK and other library installation\n", - "\n", - "If you are running in your own environment, follow [SDK installation instructions](https://docs.microsoft.com/azure/machine-learning/service/how-to-configure-environment). If you are running in Azure Notebooks or another Microsoft managed environment, the SDK is already installed.\n", - "\n", - "Also install following libraries to your environment. Many of the example notebooks depend on them\n", - "\n", - "```\n", - "(myenv) $ conda install -y matplotlib tqdm scikit-learn\n", - "```\n", - "\n", - "Once installation is complete, the following cell checks the Azure ML SDK version:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "tags": [ - "install" - ] - }, - "outputs": [], - "source": [ - "import azureml.core\n", - "\n", - "print(\"This notebook was created using version 1.0.39 of the Azure ML SDK\")\n", - "print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "If you are using an older version of the SDK then this notebook was created using, you should upgrade your SDK.\n", - "\n", - "### 3. Azure Container Instance registration\n", - "Azure Machine Learning uses of [Azure Container Instance (ACI)](https://azure.microsoft.com/services/container-instances) to deploy dev/test web services. An Azure subscription needs to be registered to use ACI. If you or the subscription owner have not yet registered ACI on your subscription, you will need to use the [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest) and execute the following commands. Note that if you ran through the AML [quickstart](https://docs.microsoft.com/en-us/azure/machine-learning/service/quickstart-get-started) you have already registered ACI. \n", - "\n", - "```shell\n", - "# check to see if ACI is already registered\n", - "(myenv) $ az provider show -n Microsoft.ContainerInstance -o table\n", - "\n", - "# if ACI is not registered, run this command.\n", - "# note you need to be the subscription owner in order to execute this command successfully.\n", - "(myenv) $ az provider register -n Microsoft.ContainerInstance\n", - "```\n", - "\n", - "---" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Configure your Azure ML workspace\n", - "\n", - "### Workspace parameters\n", - "\n", - "To use an AML Workspace, you will need to import the Azure ML SDK and supply the following information:\n", - "* Your subscription id\n", - "* A resource group name\n", - "* (optional) The region that will host your workspace\n", - "* A name for your workspace\n", - "\n", - "You can get your subscription ID from the [Azure portal](https://portal.azure.com).\n", - "\n", - "You will also need access to a [_resource group_](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-overview#resource-groups), which organizes Azure resources and provides a default region for the resources in a group. You can see what resource groups to which you have access, or create a new one in the [Azure portal](https://portal.azure.com). If you don't have a resource group, the create workspace command will create one for you using the name you provide.\n", - "\n", - "The region to host your workspace will be used if you are creating a new workspace. You do not need to specify this if you are using an existing workspace. You can find the list of supported regions [here](https://azure.microsoft.com/en-us/global-infrastructure/services/?products=machine-learning-service). You should pick a region that is close to your location or that contains your data.\n", - "\n", - "The name for your workspace is unique within the subscription and should be descriptive enough to discern among other AML Workspaces. The subscription may be used only by you, or it may be used by your department or your entire enterprise, so choose a name that makes sense for your situation.\n", - "\n", - "The following cell allows you to specify your workspace parameters. This cell uses the python method `os.getenv` to read values from environment variables which is useful for automation. If no environment variable exists, the parameters will be set to the specified default values. \n", - "\n", - "If you ran the Azure Machine Learning [quickstart](https://docs.microsoft.com/en-us/azure/machine-learning/service/quickstart-get-started) in Azure Notebooks, you already have a configured workspace! You can go to your Azure Machine Learning Getting Started library, view *config.json* file, and copy-paste the values for subscription ID, resource group and workspace name below.\n", - "\n", - "Replace the default values in the cell below with your workspace parameters" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import os\n", - "\n", - "subscription_id = os.getenv(\"SUBSCRIPTION_ID\", default=\"\")\n", - "resource_group = os.getenv(\"RESOURCE_GROUP\", default=\"\")\n", - "workspace_name = os.getenv(\"WORKSPACE_NAME\", default=\"\")\n", - "workspace_region = os.getenv(\"WORKSPACE_REGION\", default=\"eastus2\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Access your workspace\n", - "\n", - "The following cell uses the Azure ML SDK to attempt to load the workspace specified by your parameters. If this cell succeeds, your notebook library will be configured to access the workspace from all notebooks using the `Workspace.from_config()` method. The cell can fail if the specified workspace doesn't exist or you don't have permissions to access it. " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.core import Workspace\n", - "\n", - "try:\n", - " ws = Workspace(subscription_id = subscription_id, resource_group = resource_group, workspace_name = workspace_name)\n", - " # write the details of the workspace to a configuration file to the notebook library\n", - " ws.write_config()\n", - " print(\"Workspace configuration succeeded. Skip the workspace creation steps below\")\n", - "except:\n", - " print(\"Workspace not accessible. Change your parameters or create a new workspace below\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Create a new workspace\n", - "\n", - "If you don't have an existing workspace and are the owner of the subscription or resource group, you can create a new workspace. If you don't have a resource group, the create workspace command will create one for you using the name you provide.\n", - "\n", - "**Note**: As with other Azure services, there are limits on certain resources (for example AmlCompute quota) associated with the Azure ML service. Please read [this article](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-manage-quotas) on the default limits and how to request more quota.\n", - "\n", - "This cell will create an Azure ML workspace for you in a subscription provided you have the correct permissions.\n", - "\n", - "This will fail if:\n", - "* You do not have permission to create a workspace in the resource group\n", - "* You do not have permission to create a resource group if it's non-existing.\n", - "* You are not a subscription owner or contributor and no Azure ML workspaces have ever been created in this subscription\n", - "\n", - "If workspace creation fails, please work with your IT admin to provide you with the appropriate permissions or to provision the required resources." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "tags": [ - "create workspace" - ] - }, - "outputs": [], - "source": [ - "from azureml.core import Workspace\n", - "\n", - "# Create the workspace using the specified parameters\n", - "ws = Workspace.create(name = workspace_name,\n", - " subscription_id = subscription_id,\n", - " resource_group = resource_group, \n", - " location = workspace_region,\n", - " create_resource_group = True,\n", - " exist_ok = True)\n", - "ws.get_details()\n", - "\n", - "# write the details of the workspace to a configuration file to the notebook library\n", - "ws.write_config()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "---\n", - "\n", - "## Next steps\n", - "\n", - "In this notebook you configured this notebook library to connect easily to an Azure ML workspace. You can copy this notebook to your own libraries to connect them to you workspace, or use it to bootstrap new workspaces completely.\n", - "\n", - "If you came here from another notebook, you can return there and complete that exercise, or you can try out the [Tutorials](./tutorials) or jump into \"how-to\" notebooks and start creating and deploying models. A good place to start is the [train within notebook](./how-to-use-azureml/training/train-within-notebook) example that walks through a simplified but complete end to end machine learning process." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "authors": [ - { - "name": "roastala" - } - ], - "kernelspec": { - "display_name": "Python 3.6", - "language": "python", - "name": "python36" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.5" - } + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) Microsoft Corporation. All rights reserved.\n", + "\n", + "Licensed under the MIT License." + ] }, - "nbformat": 4, - "nbformat_minor": 2 -} \ No newline at end of file + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/configuration.png)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Configuration\n", + "\n", + "_**Setting up your Azure Machine Learning services workspace and configuring your notebook library**_\n", + "\n", + "---\n", + "---\n", + "\n", + "## Table of Contents\n", + "\n", + "1. [Introduction](#Introduction)\n", + " 1. What is an Azure Machine Learning workspace\n", + "1. [Setup](#Setup)\n", + " 1. Azure subscription\n", + " 1. Azure ML SDK and other library installation\n", + " 1. Azure Container Instance registration\n", + "1. [Configure your Azure ML Workspace](#Configure%20your%20Azure%20ML%20workspace)\n", + " 1. Workspace parameters\n", + " 1. Access your workspace\n", + " 1. Create a new workspace\n", + "1. [Next steps](#Next%20steps)\n", + "\n", + "---\n", + "\n", + "## Introduction\n", + "\n", + "This notebook configures your library of notebooks to connect to an Azure Machine Learning (ML) workspace. In this case, a library contains all of the notebooks in the current folder and any nested folders. You can configure this notebook library to use an existing workspace or create a new workspace.\n", + "\n", + "Typically you will need to run this notebook only once per notebook library as all other notebooks will use connection information that is written here. If you want to redirect your notebook library to work with a different workspace, then you should re-run this notebook.\n", + "\n", + "In this notebook you will\n", + "* Learn about getting an Azure subscription\n", + "* Specify your workspace parameters\n", + "* Access or create your workspace\n", + "* Add a default compute cluster for your workspace\n", + "\n", + "### What is an Azure Machine Learning workspace\n", + "\n", + "An Azure ML Workspace is an Azure resource that organizes and coordinates the actions of many other Azure resources to assist in executing and sharing machine learning workflows. In particular, an Azure ML Workspace coordinates storage, databases, and compute resources providing added functionality for machine learning experimentation, deployment, inferencing, and the monitoring of deployed models." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Setup\n", + "\n", + "This section describes activities required before you can access any Azure ML services functionality." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 1. Azure Subscription\n", + "\n", + "In order to create an Azure ML Workspace, first you need access to an Azure subscription. An Azure subscription allows you to manage storage, compute, and other assets in the Azure cloud. You can [create a new subscription](https://azure.microsoft.com/en-us/free/) or access existing subscription information from the [Azure portal](https://portal.azure.com). Later in this notebook you will need information such as your subscription ID in order to create and access AML workspaces.\n", + "\n", + "### 2. Azure ML SDK and other library installation\n", + "\n", + "If you are running in your own environment, follow [SDK installation instructions](https://docs.microsoft.com/azure/machine-learning/service/how-to-configure-environment). If you are running in Azure Notebooks or another Microsoft managed environment, the SDK is already installed.\n", + "\n", + "Also install following libraries to your environment. Many of the example notebooks depend on them\n", + "\n", + "```\n", + "(myenv) $ conda install -y matplotlib tqdm scikit-learn\n", + "```\n", + "\n", + "Once installation is complete, the following cell checks the Azure ML SDK version:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "tags": [ + "install" + ] + }, + "outputs": [], + "source": [ + "import azureml.core\n", + "\n", + "print(\"This notebook was created using version 1.0.41 of the Azure ML SDK\")\n", + "print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If you are using an older version of the SDK then this notebook was created using, you should upgrade your SDK.\n", + "\n", + "### 3. Azure Container Instance registration\n", + "Azure Machine Learning uses of [Azure Container Instance (ACI)](https://azure.microsoft.com/services/container-instances) to deploy dev/test web services. An Azure subscription needs to be registered to use ACI. If you or the subscription owner have not yet registered ACI on your subscription, you will need to use the [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest) and execute the following commands. Note that if you ran through the AML [quickstart](https://docs.microsoft.com/en-us/azure/machine-learning/service/quickstart-get-started) you have already registered ACI. \n", + "\n", + "```shell\n", + "# check to see if ACI is already registered\n", + "(myenv) $ az provider show -n Microsoft.ContainerInstance -o table\n", + "\n", + "# if ACI is not registered, run this command.\n", + "# note you need to be the subscription owner in order to execute this command successfully.\n", + "(myenv) $ az provider register -n Microsoft.ContainerInstance\n", + "```\n", + "\n", + "---" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Configure your Azure ML workspace\n", + "\n", + "### Workspace parameters\n", + "\n", + "To use an AML Workspace, you will need to import the Azure ML SDK and supply the following information:\n", + "* Your subscription id\n", + "* A resource group name\n", + "* (optional) The region that will host your workspace\n", + "* A name for your workspace\n", + "\n", + "You can get your subscription ID from the [Azure portal](https://portal.azure.com).\n", + "\n", + "You will also need access to a [_resource group_](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-overview#resource-groups), which organizes Azure resources and provides a default region for the resources in a group. You can see what resource groups to which you have access, or create a new one in the [Azure portal](https://portal.azure.com). If you don't have a resource group, the create workspace command will create one for you using the name you provide.\n", + "\n", + "The region to host your workspace will be used if you are creating a new workspace. You do not need to specify this if you are using an existing workspace. You can find the list of supported regions [here](https://azure.microsoft.com/en-us/global-infrastructure/services/?products=machine-learning-service). You should pick a region that is close to your location or that contains your data.\n", + "\n", + "The name for your workspace is unique within the subscription and should be descriptive enough to discern among other AML Workspaces. The subscription may be used only by you, or it may be used by your department or your entire enterprise, so choose a name that makes sense for your situation.\n", + "\n", + "The following cell allows you to specify your workspace parameters. This cell uses the python method `os.getenv` to read values from environment variables which is useful for automation. If no environment variable exists, the parameters will be set to the specified default values. \n", + "\n", + "If you ran the Azure Machine Learning [quickstart](https://docs.microsoft.com/en-us/azure/machine-learning/service/quickstart-get-started) in Azure Notebooks, you already have a configured workspace! You can go to your Azure Machine Learning Getting Started library, view *config.json* file, and copy-paste the values for subscription ID, resource group and workspace name below.\n", + "\n", + "Replace the default values in the cell below with your workspace parameters" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "\n", + "subscription_id = os.getenv(\"SUBSCRIPTION_ID\", default=\"\")\n", + "resource_group = os.getenv(\"RESOURCE_GROUP\", default=\"\")\n", + "workspace_name = os.getenv(\"WORKSPACE_NAME\", default=\"\")\n", + "workspace_region = os.getenv(\"WORKSPACE_REGION\", default=\"eastus2\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Access your workspace\n", + "\n", + "The following cell uses the Azure ML SDK to attempt to load the workspace specified by your parameters. If this cell succeeds, your notebook library will be configured to access the workspace from all notebooks using the `Workspace.from_config()` method. The cell can fail if the specified workspace doesn't exist or you don't have permissions to access it. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core import Workspace\n", + "\n", + "try:\n", + " ws = Workspace(subscription_id = subscription_id, resource_group = resource_group, workspace_name = workspace_name)\n", + " # write the details of the workspace to a configuration file to the notebook library\n", + " ws.write_config()\n", + " print(\"Workspace configuration succeeded. Skip the workspace creation steps below\")\n", + "except:\n", + " print(\"Workspace not accessible. Change your parameters or create a new workspace below\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Create a new workspace\n", + "\n", + "If you don't have an existing workspace and are the owner of the subscription or resource group, you can create a new workspace. If you don't have a resource group, the create workspace command will create one for you using the name you provide.\n", + "\n", + "**Note**: The Workspace creation command will create default CPU and GPU compute clusters for you. As with other Azure services, there are limits on certain resources (for example AmlCompute quota) associated with the Azure ML service. Please read [this article](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-manage-quotas) on the default limits and how to request more quota.\n", + "\n", + "This cell will create an Azure ML workspace for you in a subscription provided you have the correct permissions.\n", + "\n", + "This will fail if:\n", + "* You do not have permission to create a workspace in the resource group\n", + "* You do not have permission to create a resource group if it's non-existing.\n", + "* You are not a subscription owner or contributor and no Azure ML workspaces have ever been created in this subscription\n", + "\n", + "If workspace creation fails, please work with your IT admin to provide you with the appropriate permissions or to provision the required resources." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "tags": [ + "create workspace" + ] + }, + "outputs": [], + "source": [ + "from azureml.core import Workspace\n", + "\n", + "# Create the workspace using the specified parameters\n", + "ws = Workspace.create(name = workspace_name,\n", + " subscription_id = subscription_id,\n", + " resource_group = resource_group, \n", + " location = workspace_region,\n", + " default_cpu_compute_target=Workspace.DEFAULT_CPU_CLUSTER_CONFIGURATION,\n", + " default_gpu_compute_target=Workspace.DEFAULT_GPU_CLUSTER_CONFIGURATION,\n", + " create_resource_group = True,\n", + " exist_ok = True)\n", + "ws.get_details()\n", + "\n", + "# write the details of the workspace to a configuration file to the notebook library\n", + "ws.write_config()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "---\n", + "\n", + "## Next steps\n", + "\n", + "In this notebook you configured this notebook library to connect easily to an Azure ML workspace. You can copy this notebook to your own libraries to connect them to you workspace, or use it to bootstrap new workspaces completely.\n", + "\n", + "If you came here from another notebook, you can return there and complete that exercise, or you can try out the [Tutorials](./tutorials) or jump into \"how-to\" notebooks and start creating and deploying models. A good place to start is the [train within notebook](./how-to-use-azureml/training/train-within-notebook) example that walks through a simplified but complete end to end machine learning process." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "authors": [ + { + "name": "roastala" + } + ], + "kernelspec": { + "display_name": "Python 3.6", + "language": "python", + "name": "python36" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.5" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From d2a9dbb5820cf3c33b9582f17c5f34b3c7224977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9e=20Martens?= Date: Fri, 24 May 2019 13:43:38 -0500 Subject: [PATCH 098/108] Update auto-ml-classification-with-deployment.ipynb --- .../auto-ml-classification-with-deployment.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/how-to-use-azureml/automated-machine-learning/classification-with-deployment/auto-ml-classification-with-deployment.ipynb b/how-to-use-azureml/automated-machine-learning/classification-with-deployment/auto-ml-classification-with-deployment.ipynb index bdde7dbf..db93da7c 100644 --- a/how-to-use-azureml/automated-machine-learning/classification-with-deployment/auto-ml-classification-with-deployment.ipynb +++ b/how-to-use-azureml/automated-machine-learning/classification-with-deployment/auto-ml-classification-with-deployment.ipynb @@ -18,7 +18,7 @@ "\n", "## Contents\n", "1. [Introduction](#Introduction)\n", - "1. [Setup](#Setup)\n", + "1. [Setup](#setup)\n", "1. [Train](#Train)\n", "1. [Deploy](#Deploy)\n", "1. [Test](#Test)" @@ -49,7 +49,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Setup\n", + "## Setup \n", "\n", "As part of the setup you have already created an Azure ML `Workspace` object. For AutoML you will need to create an `Experiment` object, which is a named object in a `Workspace` used to run experiments." ] @@ -500,4 +500,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 7ce5a43b58e44daabc909a4396cd0af5610c95d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9e=20Martens?= Date: Fri, 24 May 2019 13:44:35 -0500 Subject: [PATCH 099/108] Update auto-ml-classification-with-deployment.ipynb --- .../auto-ml-classification-with-deployment.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/how-to-use-azureml/automated-machine-learning/classification-with-deployment/auto-ml-classification-with-deployment.ipynb b/how-to-use-azureml/automated-machine-learning/classification-with-deployment/auto-ml-classification-with-deployment.ipynb index db93da7c..ae77bf3e 100644 --- a/how-to-use-azureml/automated-machine-learning/classification-with-deployment/auto-ml-classification-with-deployment.ipynb +++ b/how-to-use-azureml/automated-machine-learning/classification-with-deployment/auto-ml-classification-with-deployment.ipynb @@ -49,9 +49,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Setup \n", + "## Setup \n", "\n", - "As part of the setup you have already created an Azure ML `Workspace` object. For AutoML you will need to create an `Experiment` object, which is a named object in a `Workspace` used to run experiments." + "As part of the setup you have already created an Azure ML `Workspace` object. For AutoML you will need to create an `Experiment` object, which is a named object in a `Workspace` used to run experiments." ] }, { From 70fdab0a2864e5535f0c540f515829c07d9b9948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9e=20Martens?= Date: Fri, 24 May 2019 13:45:04 -0500 Subject: [PATCH 100/108] Update auto-ml-classification-with-deployment.ipynb --- .../auto-ml-classification-with-deployment.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/how-to-use-azureml/automated-machine-learning/classification-with-deployment/auto-ml-classification-with-deployment.ipynb b/how-to-use-azureml/automated-machine-learning/classification-with-deployment/auto-ml-classification-with-deployment.ipynb index ae77bf3e..9052e55c 100644 --- a/how-to-use-azureml/automated-machine-learning/classification-with-deployment/auto-ml-classification-with-deployment.ipynb +++ b/how-to-use-azureml/automated-machine-learning/classification-with-deployment/auto-ml-classification-with-deployment.ipynb @@ -51,7 +51,7 @@ "source": [ "## Setup \n", "\n", - "As part of the setup you have already created an Azure ML `Workspace` object. For AutoML you will need to create an `Experiment` object, which is a named object in a `Workspace` used to run experiments." + "As part of the setup you have already created an Azure ML `Workspace` object. For AutoML you will need to create an `Experiment` object, which is a named object in a `Workspace` used to run experiments." ] }, { From d05eec92af80b8cca96a6b330974fdbc24ad8d9f Mon Sep 17 00:00:00 2001 From: Ilya Matiach Date: Tue, 28 May 2019 16:59:59 -0400 Subject: [PATCH 101/108] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ee1a5699..dde17ad0 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ Visit following repos to see projects contributed by Azure ML users: ## Data/Telemetry -This repository collects usage data and sends it to Mircosoft to help improve our products and services. Read Microsoft's [privacy statement to learn more](https://privacy.microsoft.com/en-US/privacystatement) +This repository collects usage data and sends it to Microsoft to help improve our products and services. Read Microsoft's [privacy statement to learn more](https://privacy.microsoft.com/en-US/privacystatement) To opt out of tracking, please go to the raw markdown or .ipynb files and remove the following line of code: From db6ae679400d6cfe4a0540136be3406b6de5ce4f Mon Sep 17 00:00:00 2001 From: Roope Astala Date: Wed, 29 May 2019 10:59:59 -0400 Subject: [PATCH 102/108] version 1.0.41 --- README.md | 65 +- how-to-use-azureml/README.md | 5 +- .../automated-machine-learning/automl_env.yml | 2 +- ...to-ml-classification-with-deployment.ipynb | 13 +- .../auto-ml-classification-with-onnx.ipynb | 88 +- ...-ml-classification-with-whitelisting.ipynb | 7 + .../auto-ml-classification.ipynb | 7 + .../auto-ml-dataprep-remote-execution.ipynb | 7 + .../dataprep/auto-ml-dataprep.ipynb | 7 + .../auto-ml-exploring-previous-runs.ipynb | 7 + .../auto-ml-forecasting-bike-share.ipynb | 7 + .../auto-ml-forecasting-energy-demand.ipynb | 7 + ...to-ml-forecasting-orange-juice-sales.ipynb | 7 + ...ing-data-blacklist-early-termination.ipynb | 7 + .../auto-ml-model-explanation.ipynb | 7 + .../regression/auto-ml-regression.ipynb | 7 + .../auto-ml-remote-amlcompute.ipynb | 1097 +++++++++-------- .../remote-attach/auto-ml-remote-attach.ipynb | 7 + ...o-ml-remote-execution-with-datastore.ipynb | 7 + .../auto-ml-remote-execution.ipynb | 7 + .../sample-weight/auto-ml-sample-weight.ipynb | 7 + ...auto-ml-sparse-data-train-test-split.ipynb | 7 + .../auto-ml-subsampling-local.ipynb | 7 + how-to-use-azureml/azure-databricks/README.md | 6 +- .../amlsdk/build-model-run-history-03.ipynb | 14 + .../amlsdk/deploy-to-aci-04.ipynb | 14 + .../deploy-to-aks-existingimage-05.ipynb | 14 + .../amlsdk/ingest-data-02.ipynb | 14 + .../installation-and-configuration-01.ipynb | 14 + .../automl/automl-databricks-local-01.ipynb | 7 + ...oml-databricks-local-with-deployment.ipynb | 7 + ...nes-use-databricks-as-compute-target.ipynb | 7 + .../model-register-and-deploy.ipynb | 7 + .../onnx-convert-aml-deploy-tinyyolo.ipynb | 2 +- ...up-schedule-for-a-published-pipeline.ipynb | 7 +- how-to-use-azureml/training/README.md | 1 + .../training/logging-api/logging-api.ipynb | 2 +- .../train-on-amlcompute.ipynb | 122 +- .../train-on-local/train-on-local.ipynb | 45 +- .../train-on-remote-vm.ipynb | 121 +- how-to-use-azureml/work-with-data/README.md | 9 + .../work-with-data/dataprep/README.md | 2 + .../new-york-taxi/new-york-taxi.ipynb | 7 + .../new-york-taxi_scale-out.ipynb | 7 + .../dataprep/data/crime-full.csv | 1001 +++++++++++++++ .../getting-started/getting-started.ipynb | 7 + .../work-with-data/datasets/README.md | 6 +- .../datasets/train-dataset/train.py | 25 +- tutorials/README.md | 2 + .../img-classification-part1-training.ipynb | 7 + .../img-classification-part2-deploy.ipynb | 7 + tutorials/regression-part1-data-prep.ipynb | 7 + tutorials/regression-part2-automated-ml.ipynb | 11 +- 53 files changed, 2088 insertions(+), 803 deletions(-) create mode 100644 how-to-use-azureml/work-with-data/README.md create mode 100644 how-to-use-azureml/work-with-data/dataprep/data/crime-full.csv diff --git a/README.md b/README.md index dde17ad0..4a828187 100644 --- a/README.md +++ b/README.md @@ -55,62 +55,8 @@ Visit following repos to see projects contributed by Azure ML users: - [Fine tune natural language processing models using Azure Machine Learning service](https://github.com/Microsoft/AzureML-BERT) - [Fashion MNIST with Azure ML SDK](https://github.com/amynic/azureml-sdk-fashion) - ## Azure Machine Learning Resources & Links -## Product Documentation -- [Azure Machine Learning service](https://docs.microsoft.com/en-us/azure/machine-learning/service/) -- [Azure Machine Learning Studio](https://docs.microsoft.com/en-us/azure/machine-learning/studio/) - -## Product Team Blogs -- [What’s new in Azure Machine Learning service](https://aka.ms/aml-blog-whats-new) -- [Announcing automated ML capability in Azure Machine Learning](https://aka.ms/aml-blog-automl) -- [Experimentation using Azure Machine Learning](https://aka.ms/aml-blog-experimentation) -- [Azure AI – Making AI real for business](https://aka.ms/aml-blog-overview) - -## Community Blogs -- [Power Bat – How Spektacom is Powering the Game of Cricket with Microsoft AI](https://blogs.technet.microsoft.com/machinelearning/2018/10/11/power-bat-how-spektacom-is-powering-the-game-of-cricket-with-microsoft-ai/) - -## Ignite 2018 Public Preview Launch Sessions -- [AI with Azure Machine Learning services: Simplifying the data science process](https://myignite.techcommunity.microsoft.com/sessions/66248) -- [AI TechTalk: Azure Machine Learning SDK - a walkthrough](https://myignite.techcommunity.microsoft.com/sessions/66265) -- [AI for an intelligent cloud and intelligent edge: Discover, deploy, and manage with Azure ML services](https://myignite.techcommunity.microsoft.com/sessions/65389) -- [Generating high quality models efficiently using Automated ML and Hyperparameter Tuning](https://myignite.techcommunity.microsoft.com/sessions/66245) -- [AI for pros: Deep learning with PyTorch using the Azure Data Science Virtual Machine and scaling training with Azure ML](https://myignite.techcommunity.microsoft.com/sessions/66244) - -## Get-started Videos on YouTube -- [Get started with Python SDK](https://youtu.be/VIsXeTuW3FU) -- [Get started from Azure Portal](https://youtu.be/lCkYUHV86Mk) - - -## Third Party Articles -- [Azure’s new machine learning features embrace Python](https://www.infoworld.com/article/3306840/azure/azures-new-machine-learning-features-embrace-python.html) (InfoWorld) -- [How to use Azure ML in Windows 10](https://www.infoworld.com/article/3308381/azure/how-to-use-azure-ml-in-windows-10.html) (InfoWorld) -- [How Azure ML Streamlines Cloud-based Machine Learning](https://thenewstack.io/how-the-azure-ml-streamlines-cloud-based-machine-learning/) (The New Stack) -- [Facebook launches PyTorch 1.0 with integrations for Google Cloud, AWS, and Azure Machine Learning](https://venturebeat.com/2018/10/02/facebook-launches-pytorch-1-0-integrations-for-google-cloud-aws-and-azure-machine-learning/) (VentureBeat) -- [How Microsoft Uses Machine Learning to Help You Build Machine Learning Pipelines](https://towardsdatascience.com/how-microsoft-uses-machine-learning-to-help-you-build-machine-learning-pipelines-be75f710613b) (Towards Data Science) -- [Microsoft's Machine Learning Tools for Developers Get Smarter](https://techcrunch.com/2018/09/24/microsofts-machine-learning-tools-for-developers-get-smarter/) (TechCrunch) -- [Microsoft introduces Azure service to automatically build AI models](https://venturebeat.com/2018/09/24/microsoft-introduces-azure-service-to-automatically-build-ai-models/) (VentureBeat) - -## Community Projects -- [Use Papermill with Azure ML](https://github.com/jreynolds01/papermill_execution_azureml/) -- [Fashion MNIST](https://github.com/amynic/azureml-sdk-fashion) -- Keras on Databricks -- [Samples from CSS](https://github.com/Azure/AMLSamples) - - -## Azure Machine Learning Studio Resources -- [A-Z Machine Learning using Azure Machine Learning (AzureML)](https://www.udemy.com/machine-learning-using-azureml/) -- [Machine Learning In The Cloud With Azure Machine Learning](https://www.udemy.com/machine-learning-in-the-cloud-with-azure-machine-learning/) -- [How to Become A Data Scientist Using Azure Machine Learning](https://www.udemy.com/azure-machine-learning-introduction/) -- [Learn Azure Machine Learning from scratch](https://www.udemy.com/learn-azure-machine-learning-from-scratch/) -- [Azure Machine Learning Studio PowerShell Module](https://aka.ms/amlps) - -## Forum Help -- [Azure Machine Learning service](https://social.msdn.microsoft.com/Forums/en-US/home?forum=AzureMachineLearningService) -- [Azure Machine Learning Studio](https://social.msdn.microsoft.com/forums/azure/en-US/home?forum=MachineLearning) - - ## Data/Telemetry -This repository collects usage data and sends it to Microsoft to help improve our products and services. Read Microsoft's [privacy statement to learn more](https://privacy.microsoft.com/en-US/privacystatement) +This repository collects usage data and sends it to Mircosoft to help improve our products and services. Read Microsoft's [privacy statement to learn more](https://privacy.microsoft.com/en-US/privacystatement) To opt out of tracking, please go to the raw markdown or .ipynb files and remove the following line of code: @@ -119,5 +65,14 @@ To opt out of tracking, please go to the raw markdown or .ipynb files and remove ``` This URL will be slightly different depending on the file. +## Data/Telemetry +This repository collects usage data and sends it to Mircosoft to help improve our products and services. Read Microsoft's [privacy statement to learn more](https://privacy.microsoft.com/en-US/privacystatement) + +To opt out of tracking, please go to the raw markdown or .ipynb files and remove the following line of code: + +```sh + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/README.png)" +``` +This URL will be slightly different depending on the file. ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/README.png) diff --git a/how-to-use-azureml/README.md b/how-to-use-azureml/README.md index b1c31812..cedd4581 100644 --- a/how-to-use-azureml/README.md +++ b/how-to-use-azureml/README.md @@ -2,7 +2,7 @@ Learn how to use Azure Machine Learning services for experimentation and model management. -If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration Notebook](../configuration.ipynb) first if you haven't already to establish your connection to the AzureML Workspace. Then, run the notebooks in following recommended order. +As a pre-requisite, run the [configuration Notebook](../configuration.ipynb) notebook first to set up your Azure ML Workspace. Then, run the notebooks in following recommended order. * [train-within-notebook](./training/train-within-notebook): Train a model hile tracking run history, and learn how to deploy the model as web service to Azure Container Instance. * [train-on-local](./training/train-on-local): Learn how to submit a run to local computer and use Azure ML managed run configuration. @@ -15,6 +15,3 @@ If you are using an Azure Machine Learning Notebook VM, you are all set. Otherw * [enable-app-insights-in-production-service](./deployment/enable-app-insights-in-production-service) Learn how to use App Insights with production web service. Find quickstarts, end-to-end tutorials, and how-tos on the [official documentation site for Azure Machine Learning service](https://docs.microsoft.com/en-us/azure/machine-learning/service/). - - - ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/README.png) diff --git a/how-to-use-azureml/automated-machine-learning/automl_env.yml b/how-to-use-azureml/automated-machine-learning/automl_env.yml index 6a3cd379..0dc80e8f 100644 --- a/how-to-use-azureml/automated-machine-learning/automl_env.yml +++ b/how-to-use-azureml/automated-machine-learning/automl_env.yml @@ -10,7 +10,7 @@ dependencies: - urllib3<1.24 - scipy>=1.0.0,<=1.1.0 - scikit-learn>=0.19.0,<=0.20.3 -- pandas>=0.22.0,<0.23.0 +- pandas>=0.22.0,<=0.23.4 - py-xgboost<=0.80 - pip: diff --git a/how-to-use-azureml/automated-machine-learning/classification-with-deployment/auto-ml-classification-with-deployment.ipynb b/how-to-use-azureml/automated-machine-learning/classification-with-deployment/auto-ml-classification-with-deployment.ipynb index 9052e55c..2e00e9c3 100644 --- a/how-to-use-azureml/automated-machine-learning/classification-with-deployment/auto-ml-classification-with-deployment.ipynb +++ b/how-to-use-azureml/automated-machine-learning/classification-with-deployment/auto-ml-classification-with-deployment.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/classification-with-deployment/auto-ml-classification-with-deployment.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -18,7 +25,7 @@ "\n", "## Contents\n", "1. [Introduction](#Introduction)\n", - "1. [Setup](#setup)\n", + "1. [Setup](#Setup)\n", "1. [Train](#Train)\n", "1. [Deploy](#Deploy)\n", "1. [Test](#Test)" @@ -49,7 +56,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Setup \n", + "## Setup\n", "\n", "As part of the setup you have already created an Azure ML `Workspace` object. For AutoML you will need to create an `Experiment` object, which is a named object in a `Workspace` used to run experiments." ] @@ -500,4 +507,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/how-to-use-azureml/automated-machine-learning/classification-with-onnx/auto-ml-classification-with-onnx.ipynb b/how-to-use-azureml/automated-machine-learning/classification-with-onnx/auto-ml-classification-with-onnx.ipynb index bbd35031..a555a3a5 100644 --- a/how-to-use-azureml/automated-machine-learning/classification-with-onnx/auto-ml-classification-with-onnx.ipynb +++ b/how-to-use-azureml/automated-machine-learning/classification-with-onnx/auto-ml-classification-with-onnx.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/classification-with-onnx/auto-ml-classification-with-onnx.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -66,11 +73,12 @@ "import numpy as np\n", "import pandas as pd\n", "from sklearn import datasets\n", + "from sklearn.model_selection import train_test_split\n", "\n", "import azureml.core\n", "from azureml.core.experiment import Experiment\n", "from azureml.core.workspace import Workspace\n", - "from azureml.train.automl import AutoMLConfig" + "from azureml.train.automl import AutoMLConfig, constants" ] }, { @@ -106,7 +114,7 @@ "source": [ "## Data\n", "\n", - "This uses scikit-learn's [load_digits](http://scikit-learn.org/stable/modules/generated/sklearn.datasets.load_digits.html) method." + "This uses scikit-learn's [load_iris](https://scikit-learn.org/stable/modules/generated/sklearn.datasets.load_iris.html) method." ] }, { @@ -115,11 +123,17 @@ "metadata": {}, "outputs": [], "source": [ - "digits = datasets.load_digits()\n", + "iris = datasets.load_iris()\n", + "X_train, X_test, y_train, y_test = train_test_split(iris.data, \n", + " iris.target, \n", + " test_size=0.2, \n", + " random_state=0)\n", "\n", - "# Exclude the first 100 rows from training so that they can be used for test.\n", - "X_train = digits.data[100:,:]\n", - "y_train = digits.target[100:]" + "# Convert the X_train and X_test to pandas DataFrame and set column names,\n", + "# This is needed for initializing the input variable names of ONNX model, \n", + "# and the prediction with the ONNX model using the inference helper.\n", + "X_train = pd.DataFrame(X_train, columns=['c1', 'c2', 'c3', 'c4'])\n", + "X_test = pd.DataFrame(X_test, columns=['c1', 'c2', 'c3', 'c4'])" ] }, { @@ -155,9 +169,10 @@ " primary_metric = 'AUC_weighted',\n", " iteration_timeout_minutes = 60,\n", " iterations = 10,\n", - " verbosity = logging.INFO,\n", + " verbosity = logging.INFO, \n", " X = X_train, \n", " y = y_train,\n", + " preprocess=True,\n", " enable_onnx_compatible_models=True,\n", " path = project_folder)" ] @@ -253,6 +268,65 @@ "onnx_fl_path = \"./best_model.onnx\"\n", "OnnxConverter.save_onnx_model(onnx_mdl, onnx_fl_path)" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Predict with the ONNX model, using onnxruntime package" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import sys\n", + "import json\n", + "from azureml.automl.core.onnx_convert import OnnxConvertConstants\n", + "\n", + "if sys.version_info < OnnxConvertConstants.OnnxIncompatiblePythonVersion:\n", + " python_version_compatible = True\n", + "else:\n", + " python_version_compatible = False\n", + "\n", + "try:\n", + " import onnxruntime\n", + " from azureml.automl.core.onnx_convert import OnnxInferenceHelper \n", + " onnxrt_present = True\n", + "except ImportError:\n", + " onnxrt_present = False\n", + "\n", + "def get_onnx_res(run):\n", + " res_path = '_debug_y_trans_converter.json'\n", + " run.download_file(name=constants.MODEL_RESOURCE_PATH_ONNX, output_file_path=res_path)\n", + " with open(res_path) as f:\n", + " onnx_res = json.load(f)\n", + " return onnx_res\n", + "\n", + "if onnxrt_present and python_version_compatible: \n", + " mdl_bytes = onnx_mdl.SerializeToString()\n", + " onnx_res = get_onnx_res(best_run)\n", + "\n", + " onnxrt_helper = OnnxInferenceHelper(mdl_bytes, onnx_res)\n", + " pred_onnx, pred_prob_onnx = onnxrt_helper.predict(X_test)\n", + "\n", + " print(pred_onnx)\n", + " print(pred_prob_onnx)\n", + "else:\n", + " if not python_version_compatible:\n", + " print('Please use Python version 3.6 to run the inference helper.') \n", + " if not onnxrt_present:\n", + " print('Please install the onnxruntime package to do the prediction with ONNX model.')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/how-to-use-azureml/automated-machine-learning/classification-with-whitelisting/auto-ml-classification-with-whitelisting.ipynb b/how-to-use-azureml/automated-machine-learning/classification-with-whitelisting/auto-ml-classification-with-whitelisting.ipynb index 61c6fde0..2723a277 100644 --- a/how-to-use-azureml/automated-machine-learning/classification-with-whitelisting/auto-ml-classification-with-whitelisting.ipynb +++ b/how-to-use-azureml/automated-machine-learning/classification-with-whitelisting/auto-ml-classification-with-whitelisting.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/classification-with-whitelisting/auto-ml-classification-with-whitelisting.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/how-to-use-azureml/automated-machine-learning/classification/auto-ml-classification.ipynb b/how-to-use-azureml/automated-machine-learning/classification/auto-ml-classification.ipynb index bd4b2087..cc5fd649 100644 --- a/how-to-use-azureml/automated-machine-learning/classification/auto-ml-classification.ipynb +++ b/how-to-use-azureml/automated-machine-learning/classification/auto-ml-classification.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/classification/auto-ml-classification.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/how-to-use-azureml/automated-machine-learning/dataprep-remote-execution/auto-ml-dataprep-remote-execution.ipynb b/how-to-use-azureml/automated-machine-learning/dataprep-remote-execution/auto-ml-dataprep-remote-execution.ipynb index fbf7b09c..2cc9db13 100644 --- a/how-to-use-azureml/automated-machine-learning/dataprep-remote-execution/auto-ml-dataprep-remote-execution.ipynb +++ b/how-to-use-azureml/automated-machine-learning/dataprep-remote-execution/auto-ml-dataprep-remote-execution.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/dataprep-remote-execution/auto-ml-dataprep-remote-execution.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/how-to-use-azureml/automated-machine-learning/dataprep/auto-ml-dataprep.ipynb b/how-to-use-azureml/automated-machine-learning/dataprep/auto-ml-dataprep.ipynb index 4af365d9..c8812808 100644 --- a/how-to-use-azureml/automated-machine-learning/dataprep/auto-ml-dataprep.ipynb +++ b/how-to-use-azureml/automated-machine-learning/dataprep/auto-ml-dataprep.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/dataprep/auto-ml-dataprep.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/how-to-use-azureml/automated-machine-learning/exploring-previous-runs/auto-ml-exploring-previous-runs.ipynb b/how-to-use-azureml/automated-machine-learning/exploring-previous-runs/auto-ml-exploring-previous-runs.ipynb index 309f00d4..3e05980f 100644 --- a/how-to-use-azureml/automated-machine-learning/exploring-previous-runs/auto-ml-exploring-previous-runs.ipynb +++ b/how-to-use-azureml/automated-machine-learning/exploring-previous-runs/auto-ml-exploring-previous-runs.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/exploring-previous-runs/auto-ml-exploring-previous-runs.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/how-to-use-azureml/automated-machine-learning/forecasting-bike-share/auto-ml-forecasting-bike-share.ipynb b/how-to-use-azureml/automated-machine-learning/forecasting-bike-share/auto-ml-forecasting-bike-share.ipynb index 8053693c..6a063f5e 100644 --- a/how-to-use-azureml/automated-machine-learning/forecasting-bike-share/auto-ml-forecasting-bike-share.ipynb +++ b/how-to-use-azureml/automated-machine-learning/forecasting-bike-share/auto-ml-forecasting-bike-share.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/forecasting-bike-share/auto-ml-forecasting-bike-share.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/how-to-use-azureml/automated-machine-learning/forecasting-energy-demand/auto-ml-forecasting-energy-demand.ipynb b/how-to-use-azureml/automated-machine-learning/forecasting-energy-demand/auto-ml-forecasting-energy-demand.ipynb index bbfbc613..9e29e167 100644 --- a/how-to-use-azureml/automated-machine-learning/forecasting-energy-demand/auto-ml-forecasting-energy-demand.ipynb +++ b/how-to-use-azureml/automated-machine-learning/forecasting-energy-demand/auto-ml-forecasting-energy-demand.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/forecasting-energy-demand/auto-ml-forecasting-energy-demand.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/how-to-use-azureml/automated-machine-learning/forecasting-orange-juice-sales/auto-ml-forecasting-orange-juice-sales.ipynb b/how-to-use-azureml/automated-machine-learning/forecasting-orange-juice-sales/auto-ml-forecasting-orange-juice-sales.ipynb index e0da28d0..d157c9a7 100644 --- a/how-to-use-azureml/automated-machine-learning/forecasting-orange-juice-sales/auto-ml-forecasting-orange-juice-sales.ipynb +++ b/how-to-use-azureml/automated-machine-learning/forecasting-orange-juice-sales/auto-ml-forecasting-orange-juice-sales.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/forecasting-orange-juice-sales/auto-ml-forecasting-orange-juice-sales.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/how-to-use-azureml/automated-machine-learning/missing-data-blacklist-early-termination/auto-ml-missing-data-blacklist-early-termination.ipynb b/how-to-use-azureml/automated-machine-learning/missing-data-blacklist-early-termination/auto-ml-missing-data-blacklist-early-termination.ipynb index 6fadb639..840cdd80 100644 --- a/how-to-use-azureml/automated-machine-learning/missing-data-blacklist-early-termination/auto-ml-missing-data-blacklist-early-termination.ipynb +++ b/how-to-use-azureml/automated-machine-learning/missing-data-blacklist-early-termination/auto-ml-missing-data-blacklist-early-termination.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/missing-data-blacklist-early-termination/auto-ml-missing-data-blacklist-early-termination.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/how-to-use-azureml/automated-machine-learning/model-explanation/auto-ml-model-explanation.ipynb b/how-to-use-azureml/automated-machine-learning/model-explanation/auto-ml-model-explanation.ipynb index 3d473cc7..fff6cc0d 100644 --- a/how-to-use-azureml/automated-machine-learning/model-explanation/auto-ml-model-explanation.ipynb +++ b/how-to-use-azureml/automated-machine-learning/model-explanation/auto-ml-model-explanation.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/model-explanation/auto-ml-model-explanation.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/how-to-use-azureml/automated-machine-learning/regression/auto-ml-regression.ipynb b/how-to-use-azureml/automated-machine-learning/regression/auto-ml-regression.ipynb index bb43ea3b..804e8ff7 100644 --- a/how-to-use-azureml/automated-machine-learning/regression/auto-ml-regression.ipynb +++ b/how-to-use-azureml/automated-machine-learning/regression/auto-ml-regression.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/regression/auto-ml-regression.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/how-to-use-azureml/automated-machine-learning/remote-amlcompute/auto-ml-remote-amlcompute.ipynb b/how-to-use-azureml/automated-machine-learning/remote-amlcompute/auto-ml-remote-amlcompute.ipynb index aa991391..9af1b1c3 100644 --- a/how-to-use-azureml/automated-machine-learning/remote-amlcompute/auto-ml-remote-amlcompute.ipynb +++ b/how-to-use-azureml/automated-machine-learning/remote-amlcompute/auto-ml-remote-amlcompute.ipynb @@ -1,548 +1,555 @@ { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Copyright (c) Microsoft Corporation. All rights reserved.\n", - "\n", - "Licensed under the MIT License." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Automated Machine Learning\n", - "_**Remote Execution using AmlCompute**_\n", - "\n", - "## Contents\n", - "1. [Introduction](#Introduction)\n", - "1. [Setup](#Setup)\n", - "1. [Data](#Data)\n", - "1. [Train](#Train)\n", - "1. [Results](#Results)\n", - "1. [Test](#Test)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Introduction\n", - "In this example we use the scikit-learn's [digit dataset](http://scikit-learn.org/stable/datasets/index.html#optical-recognition-of-handwritten-digits-dataset) to showcase how you can use AutoML for a simple classification problem.\n", - "\n", - "Make sure you have executed the [configuration](../../../configuration.ipynb) before running this notebook.\n", - "\n", - "In this notebook you would see\n", - "1. Create an `Experiment` in an existing `Workspace`.\n", - "2. Create or Attach existing AmlCompute to a workspace.\n", - "3. Configure AutoML using `AutoMLConfig`.\n", - "4. Train the model using AmlCompute\n", - "5. Explore the results.\n", - "6. Test the best fitted model.\n", - "\n", - "In addition this notebook showcases the following features\n", - "- **Parallel** executions for iterations\n", - "- **Asynchronous** tracking of progress\n", - "- **Cancellation** of individual iterations or the entire run\n", - "- Retrieving models for any iteration or logged metric\n", - "- Specifying AutoML settings as `**kwargs`" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Setup\n", - "\n", - "As part of the setup you have already created an Azure ML `Workspace` object. For AutoML you will need to create an `Experiment` object, which is a named object in a `Workspace` used to run experiments." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import logging\n", - "import os\n", - "import csv\n", - "\n", - "from matplotlib import pyplot as plt\n", - "import numpy as np\n", - "import pandas as pd\n", - "from sklearn import datasets\n", - "\n", - "import azureml.core\n", - "from azureml.core.experiment import Experiment\n", - "from azureml.core.workspace import Workspace\n", - "from azureml.train.automl import AutoMLConfig" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "ws = Workspace.from_config()\n", - "\n", - "# Choose a name for the run history container in the workspace.\n", - "experiment_name = 'automl-remote-amlcompute'\n", - "project_folder = './project'\n", - "\n", - "experiment = Experiment(ws, experiment_name)\n", - "\n", - "output = {}\n", - "output['SDK version'] = azureml.core.VERSION\n", - "output['Subscription ID'] = ws.subscription_id\n", - "output['Workspace Name'] = ws.name\n", - "output['Resource Group'] = ws.resource_group\n", - "output['Location'] = ws.location\n", - "output['Project Directory'] = project_folder\n", - "output['Experiment Name'] = experiment.name\n", - "pd.set_option('display.max_colwidth', -1)\n", - "outputDf = pd.DataFrame(data = output, index = [''])\n", - "outputDf.T" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Create or Attach existing AmlCompute\n", - "You will need to create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for your AutoML run. In this tutorial, you create an AmlCompute as your training compute resource.\n", - "\n", - "As with other Azure services, there are limits on certain resources (e.g. AmlCompute) associated with the Azure Machine Learning service. Please read [this article](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-manage-quotas) on the default limits and how to request more quota." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.core.compute import AmlCompute\n", - "from azureml.core.compute import ComputeTarget\n", - "\n", - "# Choose a name for your cluster.\n", - "amlcompute_cluster_name = \"cpucluster\"\n", - "\n", - "found = False\n", - "\n", - "# Check if this compute target already exists in the workspace.\n", - "\n", - "cts = ws.compute_targets\n", - "if amlcompute_cluster_name in cts and cts[amlcompute_cluster_name].type == 'AmlCompute':\n", - " found = True\n", - " print('Found existing compute target.')\n", - " compute_target = cts[amlcompute_cluster_name]\n", - "\n", - "if not found:\n", - " print('Creating a new compute target...')\n", - " provisioning_config = AmlCompute.provisioning_configuration(vm_size = \"STANDARD_D2_V2\", # for GPU, use \"STANDARD_NC6\"\n", - " #vm_priority = 'lowpriority', # optional\n", - " max_nodes = 6)\n", - "\n", - " # Create the cluster.\\n\",\n", - " compute_target = ComputeTarget.create(ws, amlcompute_cluster_name, provisioning_config)\n", - "\n", - " # Can poll for a minimum number of nodes and for a specific timeout.\n", - " # If no min_node_count is provided, it will use the scale settings for the cluster.\n", - " compute_target.wait_for_completion(show_output = True, min_node_count = None, timeout_in_minutes = 20)\n", - "\n", - " # For a more detailed view of current AmlCompute status, use get_status()." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Data\n", - "For remote executions, you need to make the data accessible from the remote compute.\n", - "This can be done by uploading the data to DataStore.\n", - "In this example, we upload scikit-learn's [load_digits](http://scikit-learn.org/stable/modules/generated/sklearn.datasets.load_digits.html) data." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "data_train = datasets.load_digits()\n", - "\n", - "if not os.path.isdir('data'):\n", - " os.mkdir('data')\n", - " \n", - "if not os.path.exists(project_folder):\n", - " os.makedirs(project_folder)\n", - " \n", - "pd.DataFrame(data_train.data).to_csv(\"data/X_train.tsv\", index=False, header=False, quoting=csv.QUOTE_ALL, sep=\"\\t\")\n", - "pd.DataFrame(data_train.target).to_csv(\"data/y_train.tsv\", index=False, header=False, sep=\"\\t\")\n", - "\n", - "ds = ws.get_default_datastore()\n", - "ds.upload(src_dir='./data', target_path='bai_data', overwrite=True, show_progress=True)\n", - "\n", - "from azureml.core.runconfig import DataReferenceConfiguration\n", - "dr = DataReferenceConfiguration(datastore_name=ds.name, \n", - " path_on_datastore='bai_data', \n", - " path_on_compute='/tmp/azureml_runs',\n", - " mode='download', # download files from datastore to compute target\n", - " overwrite=False)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.core.runconfig import RunConfiguration\n", - "from azureml.core.conda_dependencies import CondaDependencies\n", - "\n", - "# create a new RunConfig object\n", - "conda_run_config = RunConfiguration(framework=\"python\")\n", - "\n", - "# Set compute target to AmlCompute\n", - "conda_run_config.target = compute_target\n", - "conda_run_config.environment.docker.enabled = True\n", - "conda_run_config.environment.docker.base_image = azureml.core.runconfig.DEFAULT_CPU_IMAGE\n", - "\n", - "# set the data reference of the run coonfiguration\n", - "conda_run_config.data_references = {ds.name: dr}\n", - "\n", - "cd = CondaDependencies.create(pip_packages=['azureml-sdk[automl]'], conda_packages=['numpy','py-xgboost<=0.80'])\n", - "conda_run_config.environment.python.conda_dependencies = cd" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "%%writefile $project_folder/get_data.py\n", - "\n", - "import pandas as pd\n", - "\n", - "def get_data():\n", - " X_train = pd.read_csv(\"/tmp/azureml_runs/bai_data/X_train.tsv\", delimiter=\"\\t\", header=None, quotechar='\"')\n", - " y_train = pd.read_csv(\"/tmp/azureml_runs/bai_data/y_train.tsv\", delimiter=\"\\t\", header=None, quotechar='\"')\n", - "\n", - " return { \"X\" : X_train.values, \"y\" : y_train[0].values }\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Train\n", - "\n", - "You can specify `automl_settings` as `**kwargs` as well. Also note that you can use a `get_data()` function for local excutions too.\n", - "\n", - "**Note:** When using AmlCompute, you can't pass Numpy arrays directly to the fit method.\n", - "\n", - "|Property|Description|\n", - "|-|-|\n", - "|**primary_metric**|This is the metric that you want to optimize. Classification supports the following primary metrics:
accuracy
AUC_weighted
average_precision_score_weighted
norm_macro_recall
precision_score_weighted|\n", - "|**iteration_timeout_minutes**|Time limit in minutes for each iteration.|\n", - "|**iterations**|Number of iterations. In each iteration AutoML trains a specific pipeline with the data.|\n", - "|**n_cross_validations**|Number of cross validation splits.|\n", - "|**max_concurrent_iterations**|Maximum number of iterations that would be executed in parallel. This should be less than the number of cores on the DSVM.|" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "automl_settings = {\n", - " \"iteration_timeout_minutes\": 10,\n", - " \"iterations\": 20,\n", - " \"n_cross_validations\": 5,\n", - " \"primary_metric\": 'AUC_weighted',\n", - " \"preprocess\": False,\n", - " \"max_concurrent_iterations\": 5,\n", - " \"verbosity\": logging.INFO\n", - "}\n", - "\n", - "automl_config = AutoMLConfig(task = 'classification',\n", - " debug_log = 'automl_errors.log',\n", - " path = project_folder,\n", - " run_configuration=conda_run_config,\n", - " data_script = project_folder + \"/get_data.py\",\n", - " **automl_settings\n", - " )\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Call the `submit` method on the experiment object and pass the run configuration. For remote runs the execution is asynchronous, so you will see the iterations get populated as they complete. You can interact with the widgets and models even when the experiment is running to retrieve the best model up to that point. Once you are satisfied with the model, you can cancel a particular iteration or the whole run.\n", - "In this example, we specify `show_output = False` to suppress console output while the run is in progress." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "remote_run = experiment.submit(automl_config, show_output = False)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "remote_run" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Results\n", - "\n", - "#### Loading executed runs\n", - "In case you need to load a previously executed run, enable the cell below and replace the `run_id` value." - ] - }, - { - "cell_type": "raw", - "metadata": {}, - "source": [ - "remote_run = AutoMLRun(experiment = experiment, run_id = 'AutoML_5db13491-c92a-4f1d-b622-8ab8d973a058')" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### Widget for Monitoring Runs\n", - "\n", - "The widget will first report a \"loading\" status while running the first iteration. After completing the first iteration, an auto-updating graph and table will be shown. The widget will refresh once per minute, so you should see the graph update as child runs complete.\n", - "\n", - "You can click on a pipeline to see run properties and output logs. Logs are also available on the DSVM under `/tmp/azureml_run/{iterationid}/azureml-logs`\n", - "\n", - "**Note:** The widget displays a link at the bottom. Use this link to open a web interface to explore the individual run details." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "remote_run" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from azureml.widgets import RunDetails\n", - "RunDetails(remote_run).show() " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Wait until the run finishes.\n", - "remote_run.wait_for_completion(show_output = True)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "#### Retrieve All Child Runs\n", - "You can also use SDK methods to fetch all the child runs and see individual metrics that we log." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "children = list(remote_run.get_children())\n", - "metricslist = {}\n", - "for run in children:\n", - " properties = run.get_properties()\n", - " metrics = {k: v for k, v in run.get_metrics().items() if isinstance(v, float)}\n", - " metricslist[int(properties['iteration'])] = metrics\n", - "\n", - "rundata = pd.DataFrame(metricslist).sort_index(1)\n", - "rundata" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Cancelling Runs\n", - "\n", - "You can cancel ongoing remote runs using the `cancel` and `cancel_iteration` functions." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Cancel the ongoing experiment and stop scheduling new iterations.\n", - "# remote_run.cancel()\n", - "\n", - "# Cancel iteration 1 and move onto iteration 2.\n", - "# remote_run.cancel_iteration(1)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Retrieve the Best Model\n", - "\n", - "Below we select the best pipeline from our iterations. The `get_output` method returns the best run and the fitted model. The Model includes the pipeline and any pre-processing. Overloads on `get_output` allow you to retrieve the best run and fitted model for *any* logged metric or for a particular *iteration*." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "best_run, fitted_model = remote_run.get_output()\n", - "print(best_run)\n", - "print(fitted_model)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### Best Model Based on Any Other Metric\n", - "Show the run and the model which has the smallest `log_loss` value:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "lookup_metric = \"log_loss\"\n", - "best_run, fitted_model = remote_run.get_output(metric = lookup_metric)\n", - "print(best_run)\n", - "print(fitted_model)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### Model from a Specific Iteration\n", - "Show the run and the model from the third iteration:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "iteration = 3\n", - "third_run, third_model = remote_run.get_output(iteration=iteration)\n", - "print(third_run)\n", - "print(third_model)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Test\n", - "\n", - "#### Load Test Data" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "digits = datasets.load_digits()\n", - "X_test = digits.data[:10, :]\n", - "y_test = digits.target[:10]\n", - "images = digits.images[:10]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### Testing Our Best Fitted Model" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Randomly select digits and test.\n", - "for index in np.random.choice(len(y_test), 2, replace = False):\n", - " print(index)\n", - " predicted = fitted_model.predict(X_test[index:index + 1])[0]\n", - " label = y_test[index]\n", - " title = \"Label value = %d Predicted value = %d \" % (label, predicted)\n", - " fig = plt.figure(1, figsize=(3,3))\n", - " ax1 = fig.add_axes((0,0,.8,.8))\n", - " ax1.set_title(title)\n", - " plt.imshow(images[index], cmap = plt.cm.gray_r, interpolation = 'nearest')\n", - " plt.show()" - ] - } - ], - "metadata": { - "authors": [ - { - "name": "savitam" - } + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) Microsoft Corporation. All rights reserved.\n", + "\n", + "Licensed under the MIT License." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/remote-amlcompute/auto-ml-remote-amlcompute.png)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Automated Machine Learning\n", + "_**Remote Execution using AmlCompute**_\n", + "\n", + "## Contents\n", + "1. [Introduction](#Introduction)\n", + "1. [Setup](#Setup)\n", + "1. [Data](#Data)\n", + "1. [Train](#Train)\n", + "1. [Results](#Results)\n", + "1. [Test](#Test)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Introduction\n", + "In this example we use the scikit-learn's [digit dataset](http://scikit-learn.org/stable/datasets/index.html#optical-recognition-of-handwritten-digits-dataset) to showcase how you can use AutoML for a simple classification problem.\n", + "\n", + "Make sure you have executed the [configuration](../../../configuration.ipynb) before running this notebook.\n", + "\n", + "In this notebook you would see\n", + "1. Create an `Experiment` in an existing `Workspace`.\n", + "2. Create or Attach existing AmlCompute to a workspace.\n", + "3. Configure AutoML using `AutoMLConfig`.\n", + "4. Train the model using AmlCompute\n", + "5. Explore the results.\n", + "6. Test the best fitted model.\n", + "\n", + "In addition this notebook showcases the following features\n", + "- **Parallel** executions for iterations\n", + "- **Asynchronous** tracking of progress\n", + "- **Cancellation** of individual iterations or the entire run\n", + "- Retrieving models for any iteration or logged metric\n", + "- Specifying AutoML settings as `**kwargs`" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Setup\n", + "\n", + "As part of the setup you have already created an Azure ML `Workspace` object. For AutoML you will need to create an `Experiment` object, which is a named object in a `Workspace` used to run experiments." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import logging\n", + "import os\n", + "import csv\n", + "\n", + "from matplotlib import pyplot as plt\n", + "import numpy as np\n", + "import pandas as pd\n", + "from sklearn import datasets\n", + "\n", + "import azureml.core\n", + "from azureml.core.experiment import Experiment\n", + "from azureml.core.workspace import Workspace\n", + "from azureml.train.automl import AutoMLConfig" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ws = Workspace.from_config()\n", + "\n", + "# Choose a name for the run history container in the workspace.\n", + "experiment_name = 'automl-remote-amlcompute'\n", + "project_folder = './project'\n", + "\n", + "experiment = Experiment(ws, experiment_name)\n", + "\n", + "output = {}\n", + "output['SDK version'] = azureml.core.VERSION\n", + "output['Subscription ID'] = ws.subscription_id\n", + "output['Workspace Name'] = ws.name\n", + "output['Resource Group'] = ws.resource_group\n", + "output['Location'] = ws.location\n", + "output['Project Directory'] = project_folder\n", + "output['Experiment Name'] = experiment.name\n", + "pd.set_option('display.max_colwidth', -1)\n", + "outputDf = pd.DataFrame(data = output, index = [''])\n", + "outputDf.T" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Create or Attach existing AmlCompute\n", + "You will need to create a [compute target](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture#compute-target) for your AutoML run. In this tutorial, you create an AmlCompute as your training compute resource.\n", + "\n", + "As with other Azure services, there are limits on certain resources (e.g. AmlCompute) associated with the Azure Machine Learning service. Please read [this article](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-manage-quotas) on the default limits and how to request more quota." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core.compute import AmlCompute\n", + "from azureml.core.compute import ComputeTarget\n", + "\n", + "# Choose a name for your cluster.\n", + "amlcompute_cluster_name = \"cpucluster\"\n", + "\n", + "found = False\n", + "\n", + "# Check if this compute target already exists in the workspace.\n", + "\n", + "cts = ws.compute_targets\n", + "if amlcompute_cluster_name in cts and cts[amlcompute_cluster_name].type == 'AmlCompute':\n", + " found = True\n", + " print('Found existing compute target.')\n", + " compute_target = cts[amlcompute_cluster_name]\n", + "\n", + "if not found:\n", + " print('Creating a new compute target...')\n", + " provisioning_config = AmlCompute.provisioning_configuration(vm_size = \"STANDARD_D2_V2\", # for GPU, use \"STANDARD_NC6\"\n", + " #vm_priority = 'lowpriority', # optional\n", + " max_nodes = 6)\n", + "\n", + " # Create the cluster.\\n\",\n", + " compute_target = ComputeTarget.create(ws, amlcompute_cluster_name, provisioning_config)\n", + "\n", + " # Can poll for a minimum number of nodes and for a specific timeout.\n", + " # If no min_node_count is provided, it will use the scale settings for the cluster.\n", + " compute_target.wait_for_completion(show_output = True, min_node_count = None, timeout_in_minutes = 20)\n", + "\n", + " # For a more detailed view of current AmlCompute status, use get_status()." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Data\n", + "For remote executions, you need to make the data accessible from the remote compute.\n", + "This can be done by uploading the data to DataStore.\n", + "In this example, we upload scikit-learn's [load_digits](http://scikit-learn.org/stable/modules/generated/sklearn.datasets.load_digits.html) data." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "data_train = datasets.load_digits()\n", + "\n", + "if not os.path.isdir('data'):\n", + " os.mkdir('data')\n", + " \n", + "if not os.path.exists(project_folder):\n", + " os.makedirs(project_folder)\n", + " \n", + "pd.DataFrame(data_train.data).to_csv(\"data/X_train.tsv\", index=False, header=False, quoting=csv.QUOTE_ALL, sep=\"\\t\")\n", + "pd.DataFrame(data_train.target).to_csv(\"data/y_train.tsv\", index=False, header=False, sep=\"\\t\")\n", + "\n", + "ds = ws.get_default_datastore()\n", + "ds.upload(src_dir='./data', target_path='bai_data', overwrite=True, show_progress=True)\n", + "\n", + "from azureml.core.runconfig import DataReferenceConfiguration\n", + "dr = DataReferenceConfiguration(datastore_name=ds.name, \n", + " path_on_datastore='bai_data', \n", + " path_on_compute='/tmp/azureml_runs',\n", + " mode='download', # download files from datastore to compute target\n", + " overwrite=False)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core.runconfig import RunConfiguration\n", + "from azureml.core.conda_dependencies import CondaDependencies\n", + "\n", + "# create a new RunConfig object\n", + "conda_run_config = RunConfiguration(framework=\"python\")\n", + "\n", + "# Set compute target to AmlCompute\n", + "conda_run_config.target = compute_target\n", + "conda_run_config.environment.docker.enabled = True\n", + "conda_run_config.environment.docker.base_image = azureml.core.runconfig.DEFAULT_CPU_IMAGE\n", + "\n", + "# set the data reference of the run coonfiguration\n", + "conda_run_config.data_references = {ds.name: dr}\n", + "\n", + "cd = CondaDependencies.create(pip_packages=['azureml-sdk[automl]'], conda_packages=['numpy','py-xgboost<=0.80'])\n", + "conda_run_config.environment.python.conda_dependencies = cd" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%writefile $project_folder/get_data.py\n", + "\n", + "import pandas as pd\n", + "\n", + "def get_data():\n", + " X_train = pd.read_csv(\"/tmp/azureml_runs/bai_data/X_train.tsv\", delimiter=\"\\t\", header=None, quotechar='\"')\n", + " y_train = pd.read_csv(\"/tmp/azureml_runs/bai_data/y_train.tsv\", delimiter=\"\\t\", header=None, quotechar='\"')\n", + "\n", + " return { \"X\" : X_train.values, \"y\" : y_train[0].values }\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Train\n", + "\n", + "You can specify `automl_settings` as `**kwargs` as well. Also note that you can use a `get_data()` function for local excutions too.\n", + "\n", + "**Note:** When using AmlCompute, you can't pass Numpy arrays directly to the fit method.\n", + "\n", + "|Property|Description|\n", + "|-|-|\n", + "|**primary_metric**|This is the metric that you want to optimize. Classification supports the following primary metrics:
accuracy
AUC_weighted
average_precision_score_weighted
norm_macro_recall
precision_score_weighted|\n", + "|**iteration_timeout_minutes**|Time limit in minutes for each iteration.|\n", + "|**iterations**|Number of iterations. In each iteration AutoML trains a specific pipeline with the data.|\n", + "|**n_cross_validations**|Number of cross validation splits.|\n", + "|**max_concurrent_iterations**|Maximum number of iterations that would be executed in parallel. This should be less than the number of cores on the DSVM.|" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "automl_settings = {\n", + " \"iteration_timeout_minutes\": 10,\n", + " \"iterations\": 20,\n", + " \"n_cross_validations\": 5,\n", + " \"primary_metric\": 'AUC_weighted',\n", + " \"preprocess\": False,\n", + " \"max_concurrent_iterations\": 5,\n", + " \"verbosity\": logging.INFO\n", + "}\n", + "\n", + "automl_config = AutoMLConfig(task = 'classification',\n", + " debug_log = 'automl_errors.log',\n", + " path = project_folder,\n", + " run_configuration=conda_run_config,\n", + " data_script = project_folder + \"/get_data.py\",\n", + " **automl_settings\n", + " )\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Call the `submit` method on the experiment object and pass the run configuration. For remote runs the execution is asynchronous, so you will see the iterations get populated as they complete. You can interact with the widgets and models even when the experiment is running to retrieve the best model up to that point. Once you are satisfied with the model, you can cancel a particular iteration or the whole run.\n", + "In this example, we specify `show_output = False` to suppress console output while the run is in progress." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "remote_run = experiment.submit(automl_config, show_output = False)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "remote_run" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Results\n", + "\n", + "#### Loading executed runs\n", + "In case you need to load a previously executed run, enable the cell below and replace the `run_id` value." + ] + }, + { + "cell_type": "raw", + "metadata": {}, + "source": [ + "remote_run = AutoMLRun(experiment = experiment, run_id = 'AutoML_5db13491-c92a-4f1d-b622-8ab8d973a058')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Widget for Monitoring Runs\n", + "\n", + "The widget will first report a \"loading\" status while running the first iteration. After completing the first iteration, an auto-updating graph and table will be shown. The widget will refresh once per minute, so you should see the graph update as child runs complete.\n", + "\n", + "You can click on a pipeline to see run properties and output logs. Logs are also available on the DSVM under `/tmp/azureml_run/{iterationid}/azureml-logs`\n", + "\n", + "**Note:** The widget displays a link at the bottom. Use this link to open a web interface to explore the individual run details." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "remote_run" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.widgets import RunDetails\n", + "RunDetails(remote_run).show() " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Wait until the run finishes.\n", + "remote_run.wait_for_completion(show_output = True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "#### Retrieve All Child Runs\n", + "You can also use SDK methods to fetch all the child runs and see individual metrics that we log." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "children = list(remote_run.get_children())\n", + "metricslist = {}\n", + "for run in children:\n", + " properties = run.get_properties()\n", + " metrics = {k: v for k, v in run.get_metrics().items() if isinstance(v, float)}\n", + " metricslist[int(properties['iteration'])] = metrics\n", + "\n", + "rundata = pd.DataFrame(metricslist).sort_index(1)\n", + "rundata" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Cancelling Runs\n", + "\n", + "You can cancel ongoing remote runs using the `cancel` and `cancel_iteration` functions." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Cancel the ongoing experiment and stop scheduling new iterations.\n", + "# remote_run.cancel()\n", + "\n", + "# Cancel iteration 1 and move onto iteration 2.\n", + "# remote_run.cancel_iteration(1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Retrieve the Best Model\n", + "\n", + "Below we select the best pipeline from our iterations. The `get_output` method returns the best run and the fitted model. The Model includes the pipeline and any pre-processing. Overloads on `get_output` allow you to retrieve the best run and fitted model for *any* logged metric or for a particular *iteration*." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "best_run, fitted_model = remote_run.get_output()\n", + "print(best_run)\n", + "print(fitted_model)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Best Model Based on Any Other Metric\n", + "Show the run and the model which has the smallest `log_loss` value:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "lookup_metric = \"log_loss\"\n", + "best_run, fitted_model = remote_run.get_output(metric = lookup_metric)\n", + "print(best_run)\n", + "print(fitted_model)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Model from a Specific Iteration\n", + "Show the run and the model from the third iteration:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "iteration = 3\n", + "third_run, third_model = remote_run.get_output(iteration=iteration)\n", + "print(third_run)\n", + "print(third_model)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Test\n", + "\n", + "#### Load Test Data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "digits = datasets.load_digits()\n", + "X_test = digits.data[:10, :]\n", + "y_test = digits.target[:10]\n", + "images = digits.images[:10]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Testing Our Best Fitted Model" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Randomly select digits and test.\n", + "for index in np.random.choice(len(y_test), 2, replace = False):\n", + " print(index)\n", + " predicted = fitted_model.predict(X_test[index:index + 1])[0]\n", + " label = y_test[index]\n", + " title = \"Label value = %d Predicted value = %d \" % (label, predicted)\n", + " fig = plt.figure(1, figsize=(3,3))\n", + " ax1 = fig.add_axes((0,0,.8,.8))\n", + " ax1.set_title(title)\n", + " plt.imshow(images[index], cmap = plt.cm.gray_r, interpolation = 'nearest')\n", + " plt.show()" + ] + } ], - "kernelspec": { - "display_name": "Python 3.6", - "language": "python", - "name": "python36" + "metadata": { + "authors": [ + { + "name": "savitam" + } + ], + "kernelspec": { + "display_name": "Python 3.6", + "language": "python", + "name": "python36" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.6" + } }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.6" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} + "nbformat": 4, + "nbformat_minor": 2 +} \ No newline at end of file diff --git a/how-to-use-azureml/automated-machine-learning/remote-attach/auto-ml-remote-attach.ipynb b/how-to-use-azureml/automated-machine-learning/remote-attach/auto-ml-remote-attach.ipynb index 75a10d43..24599a48 100644 --- a/how-to-use-azureml/automated-machine-learning/remote-attach/auto-ml-remote-attach.ipynb +++ b/how-to-use-azureml/automated-machine-learning/remote-attach/auto-ml-remote-attach.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/remote-attach/auto-ml-remote-attach.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/how-to-use-azureml/automated-machine-learning/remote-execution-with-datastore/auto-ml-remote-execution-with-datastore.ipynb b/how-to-use-azureml/automated-machine-learning/remote-execution-with-datastore/auto-ml-remote-execution-with-datastore.ipynb index 847c5f1d..d0cdff6d 100644 --- a/how-to-use-azureml/automated-machine-learning/remote-execution-with-datastore/auto-ml-remote-execution-with-datastore.ipynb +++ b/how-to-use-azureml/automated-machine-learning/remote-execution-with-datastore/auto-ml-remote-execution-with-datastore.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/remote-execution-with-datastore/auto-ml-remote-execution-with-datastore.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/how-to-use-azureml/automated-machine-learning/remote-execution/auto-ml-remote-execution.ipynb b/how-to-use-azureml/automated-machine-learning/remote-execution/auto-ml-remote-execution.ipynb index ab98207d..f2c78f8c 100644 --- a/how-to-use-azureml/automated-machine-learning/remote-execution/auto-ml-remote-execution.ipynb +++ b/how-to-use-azureml/automated-machine-learning/remote-execution/auto-ml-remote-execution.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/remote-execution/auto-ml-remote-execution.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/how-to-use-azureml/automated-machine-learning/sample-weight/auto-ml-sample-weight.ipynb b/how-to-use-azureml/automated-machine-learning/sample-weight/auto-ml-sample-weight.ipynb index 70e7b0d8..cdcaff88 100644 --- a/how-to-use-azureml/automated-machine-learning/sample-weight/auto-ml-sample-weight.ipynb +++ b/how-to-use-azureml/automated-machine-learning/sample-weight/auto-ml-sample-weight.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/sample-weight/auto-ml-sample-weight.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/how-to-use-azureml/automated-machine-learning/sparse-data-train-test-split/auto-ml-sparse-data-train-test-split.ipynb b/how-to-use-azureml/automated-machine-learning/sparse-data-train-test-split/auto-ml-sparse-data-train-test-split.ipynb index ac1d59fc..e0772263 100644 --- a/how-to-use-azureml/automated-machine-learning/sparse-data-train-test-split/auto-ml-sparse-data-train-test-split.ipynb +++ b/how-to-use-azureml/automated-machine-learning/sparse-data-train-test-split/auto-ml-sparse-data-train-test-split.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/sparse-data-train-test-split/auto-ml-sparse-data-train-test-split.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/how-to-use-azureml/automated-machine-learning/subsampling/auto-ml-subsampling-local.ipynb b/how-to-use-azureml/automated-machine-learning/subsampling/auto-ml-subsampling-local.ipynb index 745b5c08..b45e186a 100644 --- a/how-to-use-azureml/automated-machine-learning/subsampling/auto-ml-subsampling-local.ipynb +++ b/how-to-use-azureml/automated-machine-learning/subsampling/auto-ml-subsampling-local.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/subsampling/auto-ml-subsampling-local.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/how-to-use-azureml/azure-databricks/README.md b/how-to-use-azureml/azure-databricks/README.md index cef51274..4749c0c6 100644 --- a/how-to-use-azureml/azure-databricks/README.md +++ b/how-to-use-azureml/azure-databricks/README.md @@ -26,4 +26,8 @@ You can use Azure Databricks as a compute target from [Azure Machine Learning Pi For more on SDK concepts, please refer to [notebooks](https://github.com/Azure/MachineLearningNotebooks). -**Please let us know your feedback.** \ No newline at end of file +**Please let us know your feedback.** + + + +![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/azure-databricks/README.png) \ No newline at end of file diff --git a/how-to-use-azureml/azure-databricks/amlsdk/build-model-run-history-03.ipynb b/how-to-use-azureml/azure-databricks/amlsdk/build-model-run-history-03.ipynb index 11ef98b9..6220209b 100644 --- a/how-to-use-azureml/azure-databricks/amlsdk/build-model-run-history-03.ipynb +++ b/how-to-use-azureml/azure-databricks/amlsdk/build-model-run-history-03.ipynb @@ -11,6 +11,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/azure-databricks/amlsdk/build-model-run-history-03.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -333,6 +340,13 @@ "source": [ "dbutils.notebook.exit(\"success\")" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/azure-databricks/amlsdk/build-model-run-history-03.png)" + ] } ], "metadata": { diff --git a/how-to-use-azureml/azure-databricks/amlsdk/deploy-to-aci-04.ipynb b/how-to-use-azureml/azure-databricks/amlsdk/deploy-to-aci-04.ipynb index c3aa26d8..7c849e3f 100644 --- a/how-to-use-azureml/azure-databricks/amlsdk/deploy-to-aci-04.ipynb +++ b/how-to-use-azureml/azure-databricks/amlsdk/deploy-to-aci-04.ipynb @@ -11,6 +11,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/azure-databricks/amlsdk/deploy-to-aci-04.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -277,6 +284,13 @@ "#comment to not delete the web service\n", "myservice.delete()" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/azure-databricks/amlsdk/deploy-to-aci-04.png)" + ] } ], "metadata": { diff --git a/how-to-use-azureml/azure-databricks/amlsdk/deploy-to-aks-existingimage-05.ipynb b/how-to-use-azureml/azure-databricks/amlsdk/deploy-to-aks-existingimage-05.ipynb index bb57cb2c..77cd7a65 100644 --- a/how-to-use-azureml/azure-databricks/amlsdk/deploy-to-aks-existingimage-05.ipynb +++ b/how-to-use-azureml/azure-databricks/amlsdk/deploy-to-aks-existingimage-05.ipynb @@ -11,6 +11,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/azure-databricks/amlsdk/deploy-to-aks-existingimage-05.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -203,6 +210,13 @@ "#model.delete()\n", "aks_target.delete() " ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/azure-databricks/amlsdk/deploy-to-aks-existingimage-05.png)" + ] } ], "metadata": { diff --git a/how-to-use-azureml/azure-databricks/amlsdk/ingest-data-02.ipynb b/how-to-use-azureml/azure-databricks/amlsdk/ingest-data-02.ipynb index 5126fb23..b3fb67d6 100644 --- a/how-to-use-azureml/azure-databricks/amlsdk/ingest-data-02.ipynb +++ b/how-to-use-azureml/azure-databricks/amlsdk/ingest-data-02.ipynb @@ -11,6 +11,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/azure-databricks/amlsdk/ingest-data-02.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -139,6 +146,13 @@ "metadata": {}, "outputs": [], "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/azure-databricks/amlsdk/ingest-data-02.png)" + ] } ], "metadata": { diff --git a/how-to-use-azureml/azure-databricks/amlsdk/installation-and-configuration-01.ipynb b/how-to-use-azureml/azure-databricks/amlsdk/installation-and-configuration-01.ipynb index 4a247b67..db4e2974 100644 --- a/how-to-use-azureml/azure-databricks/amlsdk/installation-and-configuration-01.ipynb +++ b/how-to-use-azureml/azure-databricks/amlsdk/installation-and-configuration-01.ipynb @@ -11,6 +11,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/azure-databricks/amlsdk/installation-and-configuration-01.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -143,6 +150,13 @@ " 'Subscription id: ' + ws.subscription_id, \n", " 'Resource group: ' + ws.resource_group, sep = '\\n')" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/azure-databricks/amlsdk/installation-and-configuration-01.png)" + ] } ], "metadata": { diff --git a/how-to-use-azureml/azure-databricks/automl/automl-databricks-local-01.ipynb b/how-to-use-azureml/azure-databricks/automl/automl-databricks-local-01.ipynb index ff551131..d38240d6 100644 --- a/how-to-use-azureml/azure-databricks/automl/automl-databricks-local-01.ipynb +++ b/how-to-use-azureml/azure-databricks/automl/automl-databricks-local-01.ipynb @@ -660,6 +660,13 @@ "metadata": {}, "outputs": [], "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/azure-databricks/automl/automl-databricks-local-01.png)" + ] } ], "metadata": { diff --git a/how-to-use-azureml/azure-databricks/automl/automl-databricks-local-with-deployment.ipynb b/how-to-use-azureml/azure-databricks/automl/automl-databricks-local-with-deployment.ipynb index 97e35029..56b23696 100644 --- a/how-to-use-azureml/azure-databricks/automl/automl-databricks-local-with-deployment.ipynb +++ b/how-to-use-azureml/azure-databricks/automl/automl-databricks-local-with-deployment.ipynb @@ -796,6 +796,13 @@ "source": [ "myservice.delete()" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/azure-databricks/automl/automl-databricks-local-with-deployment.png)" + ] } ], "metadata": { diff --git a/how-to-use-azureml/azure-databricks/databricks-as-remote-compute-target/aml-pipelines-use-databricks-as-compute-target.ipynb b/how-to-use-azureml/azure-databricks/databricks-as-remote-compute-target/aml-pipelines-use-databricks-as-compute-target.ipynb index 4b92d211..e5b071da 100644 --- a/how-to-use-azureml/azure-databricks/databricks-as-remote-compute-target/aml-pipelines-use-databricks-as-compute-target.ipynb +++ b/how-to-use-azureml/azure-databricks/databricks-as-remote-compute-target/aml-pipelines-use-databricks-as-compute-target.ipynb @@ -677,6 +677,13 @@ "# Next: ADLA as a Compute Target\n", "To use ADLA as a compute target from Azure Machine Learning Pipeline, a AdlaStep is used. This [notebook](./aml-pipelines-use-adla-as-compute-target.ipynb) demonstrates the use of AdlaStep in Azure Machine Learning Pipeline." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/azure-databricks/databricks-as-remote-compute-target/aml-pipelines-use-databricks-as-compute-target.png)" + ] } ], "metadata": { diff --git a/how-to-use-azureml/deploy-to-cloud/model-register-and-deploy.ipynb b/how-to-use-azureml/deploy-to-cloud/model-register-and-deploy.ipynb index f17e0912..bdb88a42 100644 --- a/how-to-use-azureml/deploy-to-cloud/model-register-and-deploy.ipynb +++ b/how-to-use-azureml/deploy-to-cloud/model-register-and-deploy.ipynb @@ -9,6 +9,13 @@ "Licensed under the MIT License." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/deploy-to-cloud/model-register-and-deploy.png)" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/how-to-use-azureml/deployment/onnx/onnx-convert-aml-deploy-tinyyolo.ipynb b/how-to-use-azureml/deployment/onnx/onnx-convert-aml-deploy-tinyyolo.ipynb index 2c7d5513..9c147c3c 100644 --- a/how-to-use-azureml/deployment/onnx/onnx-convert-aml-deploy-tinyyolo.ipynb +++ b/how-to-use-azureml/deployment/onnx/onnx-convert-aml-deploy-tinyyolo.ipynb @@ -255,7 +255,7 @@ "source": [ "from azureml.core.conda_dependencies import CondaDependencies \n", "\n", - "myenv = CondaDependencies.create(pip_packages=[\"numpy\",\"onnxruntime\",\"azureml-core\"])\n", + "myenv = CondaDependencies.create(pip_packages=[\"numpy\",\"onnxruntime==0.4.0\",\"azureml-core\"])\n", "\n", "with open(\"myenv.yml\",\"w\") as f:\n", " f.write(myenv.serialize_to_string())" diff --git a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-setup-schedule-for-a-published-pipeline.ipynb b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-setup-schedule-for-a-published-pipeline.ipynb index a4317294..a85f9bc6 100644 --- a/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-setup-schedule-for-a-published-pipeline.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-setup-schedule-for-a-published-pipeline.ipynb @@ -63,7 +63,7 @@ "metadata": {}, "outputs": [], "source": [ - "aml_compute = ws.get_default_compute_target(\"CPU\")" + "aml_compute_target = ws.get_default_compute_target(\"CPU\")" ] }, { @@ -284,7 +284,10 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Disable the schedule" + "### Disable the schedule\n", + "It is important to note the best practice of disabling schedules when not in use.\n", + "The number of schedule triggers allowed per month per region per subscription is 100,000.\n", + "This is calculated using the project trigger counts for all active schedules." ] }, { diff --git a/how-to-use-azureml/training/README.md b/how-to-use-azureml/training/README.md index 7e2d8ec9..d2855843 100644 --- a/how-to-use-azureml/training/README.md +++ b/how-to-use-azureml/training/README.md @@ -8,5 +8,6 @@ Follow these sample notebooks to learn: 4. [Train on AmlCompute](train-on-amlcompute): train a model using an AmlCompute cluster as compute target. 5. [Train in an HDI Spark cluster](train-in-spark): train a Spark ML model using an HDInsight Spark cluster as compute target. 6. [Logging API](logging-api): experiment with various logging functions to create runs and automatically generate graphs. +7. [Train and hyperparameter tune on Iris Dataset with Scikit-learn](train-hyperparameter-tune-deploy-with-sklearn): train a model using the Scikit-learn estimator and tune hyperparameters with Hyperdrive. ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/training/README.png) \ No newline at end of file diff --git a/how-to-use-azureml/training/logging-api/logging-api.ipynb b/how-to-use-azureml/training/logging-api/logging-api.ipynb index 21ef594c..70d89f34 100644 --- a/how-to-use-azureml/training/logging-api/logging-api.ipynb +++ b/how-to-use-azureml/training/logging-api/logging-api.ipynb @@ -100,7 +100,7 @@ "\n", "# Check core SDK version number\n", "\n", - "print(\"This notebook was created using SDK version 1.0.39, you are currently running version\", azureml.core.VERSION)" + "print(\"This notebook was created using SDK version 1.0.41, you are currently running version\", azureml.core.VERSION)" ] }, { diff --git a/how-to-use-azureml/training/train-on-amlcompute/train-on-amlcompute.ipynb b/how-to-use-azureml/training/train-on-amlcompute/train-on-amlcompute.ipynb index a369ff98..40e57e67 100644 --- a/how-to-use-azureml/training/train-on-amlcompute/train-on-amlcompute.ipynb +++ b/how-to-use-azureml/training/train-on-amlcompute/train-on-amlcompute.ipynb @@ -164,6 +164,30 @@ "shutil.copy('train.py', project_folder)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Create environment\n", + "\n", + "Create Docker based environment with scikit-learn installed." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core import Environment\n", + "from azureml.core.conda_dependencies import CondaDependencies\n", + "\n", + "myenv = Environment(\"myenv\")\n", + "\n", + "myenv.docker.enabled = True\n", + "myenv.python.conda_dependencies = CondaDependencies.create(conda_packages=['scikit-learn'])" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -179,38 +203,32 @@ "metadata": {}, "outputs": [], "source": [ - "from azureml.core.runconfig import RunConfiguration\n", - "from azureml.core.conda_dependencies import CondaDependencies\n", + "from azureml.core import ScriptRunConfig\n", "from azureml.core.runconfig import DEFAULT_CPU_IMAGE\n", "\n", - "# create a new runconfig object\n", - "run_config = RunConfiguration()\n", + "src = ScriptRunConfig(source_directory=project_folder, script='train.py')\n", "\n", - "default_compute_target = ws.get_default_compute_target(type=\"CPU\")\n", + "# Use default compute target\n", + "src.run_config.target = ws.get_default_compute_target(type=\"CPU\").name\n", "\n", - "# signal that you want to use AmlCompute to execute script.\n", - "run_config.target = default_compute_target.name\n", - "\n", - "# enable Docker \n", - "run_config.environment.docker.enabled = True\n", - "\n", - "# set Docker base image to the default CPU-based image\n", - "run_config.environment.docker.base_image = DEFAULT_CPU_IMAGE\n", - "\n", - "# use conda_dependencies.yml to create a conda environment in the Docker image for execution\n", - "run_config.environment.python.user_managed_dependencies = False\n", - "\n", - "# specify CondaDependencies obj\n", - "run_config.environment.python.conda_dependencies = CondaDependencies.create(conda_packages=['scikit-learn'])\n", - "\n", - "# Now submit a run on AmlCompute\n", - "from azureml.core.script_run_config import ScriptRunConfig\n", - "\n", - "script_run_config = ScriptRunConfig(source_directory=project_folder,\n", - " script='train.py',\n", - " run_config=run_config)\n", - "\n", - "run = experiment.submit(script_run_config)\n", + "# Set environment\n", + "src.run_config.environment = myenv" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Submit run" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "run = experiment.submit(src)\n", "\n", "# Show run details\n", "run" @@ -292,27 +310,9 @@ "metadata": {}, "outputs": [], "source": [ - "from azureml.core.runconfig import RunConfiguration\n", - "from azureml.core.conda_dependencies import CondaDependencies\n", - "\n", - "# create a new RunConfig object\n", - "run_config = RunConfiguration(framework=\"python\")\n", - "\n", - "# Set compute target to AmlCompute target created in previous step\n", - "run_config.target = cpu_cluster.name\n", - "\n", - "# enable Docker \n", - "run_config.environment.docker.enabled = True\n", - "\n", - "# specify CondaDependencies obj\n", - "run_config.environment.python.conda_dependencies = CondaDependencies.create(conda_packages=['scikit-learn'])\n", - "\n", - "from azureml.core import Run\n", - "from azureml.core import ScriptRunConfig\n", - "\n", - "src = ScriptRunConfig(source_directory=project_folder, \n", - " script='train.py', \n", - " run_config=run_config) \n", + "# Set compute target to the one created in previous step\n", + "src.run_config.target = cpu_cluster.name\n", + " \n", "run = experiment.submit(config=src)\n", "run" ] @@ -397,27 +397,9 @@ "metadata": {}, "outputs": [], "source": [ - "from azureml.core.runconfig import RunConfiguration\n", - "from azureml.core.conda_dependencies import CondaDependencies\n", - "\n", - "# create a new RunConfig object\n", - "run_config = RunConfiguration(framework=\"python\")\n", - "\n", - "# Set compute target to AmlCompute target created in previous step\n", - "run_config.target = cpu_cluster.name\n", - "\n", - "# enable Docker \n", - "run_config.environment.docker.enabled = True\n", - "\n", - "# specify CondaDependencies obj\n", - "run_config.environment.python.conda_dependencies = CondaDependencies.create(conda_packages=['scikit-learn'])\n", - "\n", - "from azureml.core import Run\n", - "from azureml.core import ScriptRunConfig\n", - "\n", - "src = ScriptRunConfig(source_directory=project_folder, \n", - " script='train.py', \n", - " run_config=run_config) \n", + "# Set compute target to the one created in previous step\n", + "src.run_config.target = cpu_cluster.name\n", + " \n", "run = experiment.submit(config=src)\n", "run" ] diff --git a/how-to-use-azureml/training/train-on-local/train-on-local.ipynb b/how-to-use-azureml/training/train-on-local/train-on-local.ipynb index f5833223..917e14c9 100644 --- a/how-to-use-azureml/training/train-on-local/train-on-local.ipynb +++ b/how-to-use-azureml/training/train-on-local/train-on-local.ipynb @@ -170,15 +170,15 @@ "metadata": {}, "outputs": [], "source": [ - "from azureml.core.runconfig import RunConfiguration\n", + "from azureml.core import Environment\n", "\n", "# Editing a run configuration property on-fly.\n", - "run_config_user_managed = RunConfiguration()\n", + "user_managed_env = Environment(\"user-managed-env\")\n", "\n", - "run_config_user_managed.environment.python.user_managed_dependencies = True\n", + "user_managed_env.python.user_managed_dependencies = True\n", "\n", "# You can choose a specific Python environment by pointing to a Python path \n", - "#run_config.environment.python.interpreter_path = '/home/johndoe/miniconda3/envs/myenv/bin/python'" + "#user_managed_env.python.interpreter_path = '/home/johndoe/miniconda3/envs/myenv/bin/python'" ] }, { @@ -197,7 +197,16 @@ "source": [ "from azureml.core import ScriptRunConfig\n", "\n", - "src = ScriptRunConfig(source_directory='./', script='train.py', run_config=run_config_user_managed)\n", + "src = ScriptRunConfig(source_directory='./', script='train.py')\n", + "src.run_config.environment = user_managed_env" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ "run = exp.submit(src)" ] }, @@ -277,13 +286,13 @@ "source": [ "from azureml.core.conda_dependencies import CondaDependencies\n", "\n", - "run_config_system_managed = RunConfiguration()\n", + "system_managed_env = Environment(\"system-managed-env\")\n", "\n", - "run_config_system_managed.environment.python.user_managed_dependencies = False\n", + "system_managed_env.python.user_managed_dependencies = False\n", "\n", "# Specify conda dependencies with scikit-learn\n", "cd = CondaDependencies.create(conda_packages=['scikit-learn'])\n", - "run_config_system_managed.environment.python.conda_dependencies = cd" + "system_managed_env.python.conda_dependencies = cd" ] }, { @@ -302,7 +311,7 @@ "metadata": {}, "outputs": [], "source": [ - "src = ScriptRunConfig(source_directory=\"./\", script='train.py', run_config=run_config_system_managed)\n", + "src.run_config.environment = system_managed_env\n", "run = exp.submit(src)" ] }, @@ -371,18 +380,16 @@ "metadata": {}, "outputs": [], "source": [ - "run_config_docker = RunConfiguration()\n", - "run_config_docker.environment.python.user_managed_dependencies = False\n", - "run_config_docker.environment.docker.enabled = True\n", + "docker_env = Environment(\"docker-env\")\n", + "\n", + "docker_env.python.user_managed_dependencies = False\n", + "docker_env.docker.enabled = True\n", "\n", "# use the default CPU-based Docker image from Azure ML\n", - "run_config_docker.environment.docker.base_image = azureml.core.runconfig.DEFAULT_CPU_IMAGE # Reference Docker image\n", + "print(docker_env.docker.base_image)\n", "\n", "# Specify conda dependencies with scikit-learn\n", - "cd = CondaDependencies.create(conda_packages=['scikit-learn'])\n", - "run_config_docker.environment.python.conda_dependencies = cd\n", - "\n", - "src = ScriptRunConfig(source_directory=\"./\", script='train.py', run_config=run_config_docker)" + "docker_env.python.conda_dependencies = cd" ] }, { @@ -402,6 +409,8 @@ "source": [ "import subprocess\n", "\n", + "src.run_config.environment = docker_env\n", + "\n", "# Check if Docker is installed and Linux containers are enabled\n", "if subprocess.run(\"docker -v\", shell=True).returncode == 0:\n", " out = subprocess.check_output(\"docker system info\", shell=True).decode('ascii')\n", @@ -657,7 +666,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.8" + "version": "3.6.5" } }, "nbformat": 4, diff --git a/how-to-use-azureml/training/train-on-remote-vm/train-on-remote-vm.ipynb b/how-to-use-azureml/training/train-on-remote-vm/train-on-remote-vm.ipynb index 48772b33..7f3fd5ac 100644 --- a/how-to-use-azureml/training/train-on-remote-vm/train-on-remote-vm.ipynb +++ b/how-to-use-azureml/training/train-on-remote-vm/train-on-remote-vm.ipynb @@ -280,20 +280,11 @@ "metadata": {}, "outputs": [], "source": [ - "from azureml.core.runconfig import RunConfiguration\n", + "from azureml.core import Environment\n", "from azureml.core.conda_dependencies import CondaDependencies\n", "\n", - "# create a new RunConfig object\n", - "conda_run_config = RunConfiguration(framework=\"python\")\n", - "\n", - "# Set compute target to the Linux DSVM\n", - "conda_run_config.target = attached_dsvm_compute.name\n", - "\n", - "# set the data reference of the run configuration\n", - "conda_run_config.data_references = {ds.name: dr}\n", - "\n", - "# specify CondaDependencies obj\n", - "conda_run_config.environment.python.conda_dependencies = CondaDependencies.create(conda_packages=['scikit-learn'])" + "conda_env = Environment(\"conda-env\")\n", + "conda_env.python.conda_dependencies = CondaDependencies.create(conda_packages=['scikit-learn'])" ] }, { @@ -306,18 +297,14 @@ "\n", "src = ScriptRunConfig(source_directory=script_folder, \n", " script='train.py', \n", - " run_config=conda_run_config, \n", " # pass the datastore reference as a parameter to the training script\n", " arguments=['--data-folder', str(ds.as_download())] \n", " ) \n", - "run = exp.submit(config=src)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Note: if you need to cancel a run, you can follow [these instructions](https://aka.ms/aml-docs-cancel-run)." + "\n", + "src.run_config.framework = \"python\"\n", + "src.run_config.environment = conda_env\n", + "src.run_config.target = attached_dsvm_compute.name\n", + "src.run_config.data_references = {ds.name: dr}" ] }, { @@ -326,9 +313,18 @@ "metadata": {}, "outputs": [], "source": [ + "run = exp.submit(config=src)\n", + "\n", "run.wait_for_completion(show_output=True)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note: if you need to cancel a run, you can follow [these instructions](https://aka.ms/aml-docs-cancel-run)." + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -359,17 +355,7 @@ "metadata": {}, "outputs": [], "source": [ - "# create a new RunConfig object\n", - "vm_run_config = RunConfiguration(framework=\"python\")\n", - "\n", - "# Set compute target to the Linux DSVM\n", - "vm_run_config.target = attached_dsvm_compute.name\n", - "\n", - "# set the data reference of the run coonfiguration\n", - "conda_run_config.data_references = {ds.name: dr}\n", - "\n", - "# Let system know that you will configure the Python environment yourself.\n", - "vm_run_config.environment.python.user_managed_dependencies = True" + "conda_env.python.user_managed_dependencies = True" ] }, { @@ -385,11 +371,6 @@ "metadata": {}, "outputs": [], "source": [ - "src = ScriptRunConfig(source_directory=script_folder, \n", - " script='train.py', \n", - " run_config=vm_run_config,\n", - " # pass the datastore reference as a parameter to the training script\n", - " arguments=['--data-folder', str(ds.as_download())])\n", "run = exp.submit(config=src)\n", "run.wait_for_completion(show_output=True)" ] @@ -398,7 +379,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "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 use another script `train2.py` that doesn't have azureml dependencies, and submit it instead." + "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 use another script `train2.py` that doesn't have azureml or data store dependencies, and submit it instead." ] }, { @@ -411,7 +392,10 @@ "shutil.copy('./train2.py', os.path.join(script_folder, 'train2.py'))\n", "\n", "with open(os.path.join(script_folder, './train2.py'), 'r') as training_script:\n", - " print(training_script.read())" + " print(training_script.read())\n", + " \n", + "src.run_config.data_references = {}\n", + "src.script = \"train2.py\"" ] }, { @@ -427,10 +411,8 @@ "metadata": {}, "outputs": [], "source": [ - "src = ScriptRunConfig(source_directory=script_folder, \n", - " script='train2.py', \n", - " run_config=vm_run_config)\n", "run = exp.submit(config=src)\n", + "\n", "run.wait_for_completion(show_output=True)" ] }, @@ -464,24 +446,10 @@ "metadata": {}, "outputs": [], "source": [ - "# Load the \"cpu-dsvm.runconfig\" file (created by the above attach operation) in memory\n", - "docker_run_config = RunConfiguration(framework=\"python\")\n", + "conda_env.docker.enabled = True\n", + "conda_env.python.user_managed_dependencies = False\n", "\n", - "# Set compute target to the Linux DSVM\n", - "docker_run_config.target = attached_dsvm_compute.name\n", - "\n", - "# Use Docker in the remote VM\n", - "docker_run_config.environment.docker.enabled = True\n", - "\n", - "# Use CPU base image from DockerHub\n", - "docker_run_config.environment.docker.base_image = azureml.core.runconfig.DEFAULT_CPU_IMAGE\n", - "print('Base Docker image is:', docker_run_config.environment.docker.base_image)\n", - "\n", - "# set the data reference of the run coonfiguration\n", - "docker_run_config.data_references = {ds.name: dr}\n", - "\n", - "# specify CondaDependencies obj\n", - "docker_run_config.environment.python.conda_dependencies = CondaDependencies.create(conda_packages=['scikit-learn'])" + "print('Base Docker image is:', conda_env.docker.base_image)" ] }, { @@ -498,20 +466,11 @@ "metadata": {}, "outputs": [], "source": [ - "src = ScriptRunConfig(source_directory=script_folder, \n", - " script='train.py', \n", - " run_config=docker_run_config,\n", - " # pass the datastore reference as a parameter to the training script\n", - " arguments=['--data-folder', str(ds.as_download())])\n", - "run = exp.submit(config=src)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ + "src.script = \"train.py\"\n", + "src.run_config.data_references = {ds.name: dr}\n", + "\n", + "run = exp.submit(config=src)\n", + "\n", "run.wait_for_completion(show_output=True)" ] }, @@ -525,20 +484,20 @@ "\n", "```python\n", "# use an image available in Docker Hub without authentication\n", - "run_config_docker.environment.docker.base_image = \"continuumio/miniconda3\"\n", + "conda_env.docker.base_image = \"continuumio/miniconda3\"\n", "\n", "# or, use an image available in a private Azure Container Registry\n", - "run_config_docker.environment.docker.base_image = \"mycustomimage:1.0\"\n", - "run_config_docker.environment.docker.base_image_registry.address = \"myregistry.azurecr.io\"\n", - "run_config_docker.environment.docker.base_image_registry.username = \"username\"\n", - "run_config_docker.environment.docker.base_image_registry.password = \"password\"\n", + "conda_env.docker.base_image = \"mycustomimage:1.0\"\n", + "conda_env.docker.base_image_registry.address = \"myregistry.azurecr.io\"\n", + "conda_env.docker.base_image_registry.username = \"username\"\n", + "conda_env.docker.base_image_registry.password = \"password\"\n", "```\n", "\n", "When you are using a custom Docker image, you might already have your environment setup properly in a Python environment in the Docker image. In that case, you can skip specifying conda dependencies, and just use `user_managed_dependencies` option instead:\n", "```python\n", - "run_config_docker.environment.python.user_managed_dependencies = True\n", + "conda_env.python.user_managed_dependencies = True\n", "# path to the Python environment in the custom Docker image\n", - "run_config.environment.python.interpreter_path = '/opt/conda/bin/python'\n", + "conda_env.python.interpreter_path = '/opt/conda/bin/python'\n", "```" ] }, @@ -640,7 +599,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.6" + "version": "3.6.5" } }, "nbformat": 4, diff --git a/how-to-use-azureml/work-with-data/README.md b/how-to-use-azureml/work-with-data/README.md new file mode 100644 index 00000000..0b2958d0 --- /dev/null +++ b/how-to-use-azureml/work-with-data/README.md @@ -0,0 +1,9 @@ +# Work With Data Using Azure Machine Learning Service + +Azure Machine Learning Datasets (preview) make it easier to access and work with your data. Datasets manage data in various scenarios such as model training and pipeline creation. Using the Azure Machine Learning SDK, you can access underlying storage, explore and prepare data, manage the life cycle of different Dataset definitions, and compare between Datasets used in training and in production. + +- For an example of using Datasets, see the [sample](datasets). +- For advanced data preparation examples, see [dataprep](dataprep). + + +![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/work-with-data/README..png) \ No newline at end of file diff --git a/how-to-use-azureml/work-with-data/dataprep/README.md b/how-to-use-azureml/work-with-data/dataprep/README.md index 439fb91f..b6b9d429 100644 --- a/how-to-use-azureml/work-with-data/dataprep/README.md +++ b/how-to-use-azureml/work-with-data/dataprep/README.md @@ -222,3 +222,5 @@ Bug fixes IMPORTANT: Please read the notice and find out more about this NYC Taxi and Limousine Commission dataset here: http://www.nyc.gov/html/tlc/html/about/trip_record_data.shtml IMPORTANT: Please read the notice and find out more about this Chicago Police Department dataset here: https://catalog.data.gov/dataset/crimes-2001-to-present-398a4 + +![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/work-with-data/dataprep/README.png) diff --git a/how-to-use-azureml/work-with-data/dataprep/case-studies/new-york-taxi/new-york-taxi.ipynb b/how-to-use-azureml/work-with-data/dataprep/case-studies/new-york-taxi/new-york-taxi.ipynb index 16578f1a..45ab51ca 100644 --- a/how-to-use-azureml/work-with-data/dataprep/case-studies/new-york-taxi/new-york-taxi.ipynb +++ b/how-to-use-azureml/work-with-data/dataprep/case-studies/new-york-taxi/new-york-taxi.ipynb @@ -477,6 +477,13 @@ "dflow_path = path.join(mkdtemp(), \"new_york_taxi.dprep\")\n", "combined_df.save(file_path=dflow_path)" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/work-with-data/dataprep/case-studies/new-york-taxi/new-york-taxi.png)" + ] } ], "metadata": { diff --git a/how-to-use-azureml/work-with-data/dataprep/case-studies/new-york-taxi/new-york-taxi_scale-out.ipynb b/how-to-use-azureml/work-with-data/dataprep/case-studies/new-york-taxi/new-york-taxi_scale-out.ipynb index 66e5fc00..657eaa19 100644 --- a/how-to-use-azureml/work-with-data/dataprep/case-studies/new-york-taxi/new-york-taxi_scale-out.ipynb +++ b/how-to-use-azureml/work-with-data/dataprep/case-studies/new-york-taxi/new-york-taxi_scale-out.ipynb @@ -97,6 +97,13 @@ "spark_df = df.take(5).to_pandas_dataframe()\n", "spark_df.head(5)" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/work-with-data/dataprep/case-studies/new-york-taxi/new-york-taxi_scale-out.png)" + ] } ], "metadata": { diff --git a/how-to-use-azureml/work-with-data/dataprep/data/crime-full.csv b/how-to-use-azureml/work-with-data/dataprep/data/crime-full.csv new file mode 100644 index 00000000..e46bda18 --- /dev/null +++ b/how-to-use-azureml/work-with-data/dataprep/data/crime-full.csv @@ -0,0 +1,1001 @@ +ID,Case Number,Date,Block,IUCR,Primary Type,Description,Location Description,Damage Cost,Arrest,Domestic,Beat,District,Ward,Community Area,FBI Code,X Coordinate,Y Coordinate,Year,Updated On,Latitude,Longitude,Location +2705685,HJ329710,2003-04-26 00:00:00,105XX S WOOD ST,0460,BATTERY,SIMPLE,RESIDENCE,4615,False,False,2212,NA,19,72,08B,1166261,1834693,2003,ERROR,41.701967722,-87.666817049,"(41.701967722, -87.666817049)" +8367900,HT600798,2011-11-22 15:15:00,063XX S PULASKI RD,0890,THEFT,FROM BUILDING,LIBRARY,3882,False,False,813,8,13,65,06,1150746,1862490,2011,ERROR,41.778563069,-87.722907063,"(41.778563069, -87.722907063)" +8726660,HV402430,2012-07-26 19:30:00,019XX W BELMONT AVE,0610,BURGLARY,FORCIBLE ENTRY,SMALL RETAIL STORE,4566,False,False,1931,19,32,5,05,1162975,1921223,2012,ERROR,41.939485082,-87.676427052,"(41.939485082, -87.676427052)" +9103375,HW247768,2013-04-25 14:20:00,047XX S ASHLAND AVE,0460,BATTERY,SIMPLE,SIDEWALK,2469,False,False,931,9,20,61,08B,1166425,1873469,2013,ERROR,41.808370972,-87.665113707,"(41.808370972, -87.665113707)" +3807148,HL176623,2005-02-12 01:24:03,078XX S EAST END AVE,0920,MOTOR VEHICLE THEFT,ATT: AUTOMOBILE,ALLEY,989,False,False,414,4,8,43,07,1188944,1853066,2005,ERROR,41.751873397,-87.583173082,"(41.751873397, -87.583173082)" +4241820,HL534761,2005-08-07 21:12:26,068XX S MARSHFIELD AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,3807,False,False,725,7,17,67,08B,1166478,1859475,2005,ERROR,41.769968592,-87.665318117,"(41.769968592, -87.665318117)" +4824796,HM433465,2006-06-23 22:15:00,105XX S STATE ST,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,1504,False,False,512,5,34,49,14,1178075,1835093,2006,ERROR,41.702806335,-87.623545729,"(41.702806335, -87.623545729)" +8172753,HT407165,2011-07-20 17:50:00,021XX W 21ST PL,0820,THEFT,$500 AND UNDER,RESIDENCE,262,False,False,1223,12,25,31,06,1162541,1889761,2011,2011-03-08 09:56:44,41.853160001,-87.678904133,"(41.853160001, -87.678904133)" +8154927,HT390078,2011-07-10 15:50:00,046XX W NORTH AVE,0860,THEFT,RETAIL THEFT,DEPARTMENT STORE,2972,True,False,2533,25,37,25,06,1144852,1910260,2011,2011-11-07 10:34:01,41.909763298,-87.743312036,"(41.909763298, -87.743312036)" +6944181,HR349635,2009-05-30 18:13:00,015XX W 63RD ST,031A,ROBBERY,ARMED: HANDGUN,ALLEY,1296,False,False,713,7,16,67,03,1167116,1862990,2009,2009-12-06 18:29:17,41.779600581,-87.662879029,"(41.779600581, -87.662879029)" +5836733,HN643782,2007-10-12 14:00:00,027XX W SUMMERDALE AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE-GARAGE,3105,False,False,2011,20,40,4,14,1157009,1935459,2007,ERROR,41.978672864,-87.697965904,"(41.978672864, -87.697965904)" +7740163,HS548309,2010-10-04 21:30:00,057XX N WASHTENAW AVE,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,APARTMENT,594,True,False,2011,20,40,2,18,1157257,1938221,2010,2010-04-10 23:26:24,41.986246871,-87.696978408,"(41.986246871, -87.696978408)" +4984650,HM597309,2006-09-11 18:30:00,052XX S STATE ST,0890,THEFT,FROM BUILDING,"SCHOOL, PUBLIC, BUILDING",1591,False,False,232,2,3,40,06,1177212,1869954,2006,ERROR,41.798488523,-87.625655865,"(41.798488523, -87.625655865)" +3941717,HL312501,2005-04-22 08:00:00,069XX S EBERHART AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,1397,False,True,322,3,6,69,08B,1180740,1858964,2005,ERROR,41.76825049,-87.613055702,"(41.76825049, -87.613055702)" +5084563,HM687682,2006-10-28 14:30:00,022XX S PULASKI RD,0560,ASSAULT,SIMPLE,STREET,2224,False,False,1013,10,22,29,08A,1150013,1889063,2006,ERROR,41.851497405,-87.724904562,"(41.851497405, -87.724904562)" +8136835,HT371007,2011-06-28 23:20:00,011XX N CHRISTIANA AVE,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,SIDEWALK,538,True,False,1121,11,26,23,18,1153742,1907328,2011,ERROR,41.901545171,-87.710731851,"(41.901545171, -87.710731851)" +1815636,G631826,2001-10-20 18:30:00,046XX S HALSTED ST,5002,OTHER OFFENSE,OTHER VEHICLE OFFENSE,STREET,2501,True,False,921,NA,NA,NA,26,1171705,1874218,2001,ERROR,41.810312019,-87.645725963,"(41.810312019, -87.645725963)" +9276577,HW420770,2013-08-23 16:40:00,007XX S ALBANY AVE,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,STREET,658,True,False,1134,11,24,27,18,1155766,1896834,2013,ERROR,41.872708075,-87.703580324,"(41.872708075, -87.703580324)" +1603336,G368431,2001-06-24 19:52:14,001XX W CHICAGO AV,5001,OTHER OFFENSE,OTHER CRIME INVOLVING PROPERTY,PARKING LOT/GARAGE(NON.RESID.),3948,True,False,1832,NA,NA,NA,26,1175257,1905662,2001,ERROR,41.896517917,-87.631755414,"(41.896517917, -87.631755414)" +7210353,HR608426,2009-10-26 08:40:00,015XX S PULASKI RD,2024,NARCOTICS,POSS: HEROIN(WHITE),ABANDONED BUILDING,1124,True,False,1012,10,24,29,18,1149936,1891869,2009,2009-04-11 09:53:16,41.859198911,-87.725114223,"(41.859198911, -87.725114223)" +4471848,HL301576,2005-04-17 20:50:03,006XX E GRAND AVE,1330,CRIMINAL TRESPASS,TO LAND,OTHER,3257,False,False,1834,18,42,8,26,1180772,1904096,2005,2007-11-06 15:52:33,41.892095212,-87.611548469,"(41.892095212, -87.611548469)" +7637700,HS441827,2010-08-02 12:45:00,028XX W 22ND PL,1570,SEX OFFENSE,PUBLIC INDECENCY,SIDEWALK,2297,False,False,1033,10,12,30,17,1157857,1888970,2010,ERROR,41.851086084,-87.696117577,"(41.851086084, -87.696117577)" +4703044,HM309199,2006-04-24 00:00:00,012XX N CLARK ST,0820,THEFT,$500 AND UNDER,STREET,20,False,False,1821,18,42,8,06,1175274,1908508,2006,2014-04-12 12:43:35,41.904327102,-87.631607477,"(41.904327102, -87.631607477)" +3961270,HL324634,2005-04-29 08:30:00,005XX W DIVISION ST,0430,BATTERY,AGGRAVATED: OTHER DANG WEAPON,CHA HALLWAY/STAIRWELL/ELEVATOR,4726,False,False,1821,18,27,8,04B,1172300,1908305,2005,ERROR,41.903836297,-87.642537685,"(41.903836297, -87.642537685)" +2281333,HH546276,2002-07-30 13:30:00,069XX S EMERALD AVE,2014,NARCOTICS,MANU/DELIVER: HEROIN (WHITE),SIDEWALK,864,True,False,732,NA,6,68,18,1172538,1859044,2002,ERROR,41.76865457,-87.643117449,"(41.76865457, -87.643117449)" +1837655,G672065,2001-11-07 21:45:40,062XX S ST LAWRENCE AV,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,4001,True,False,313,NA,NA,NA,14,1181266,1863792,2001,ERROR,41.78148689,-87.610979035,"(41.78148689, -87.610979035)" +1842160,G679483,2001-11-11 03:30:00,021XX N CAMPBELL AV,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,1986,False,False,1431,NA,NA,NA,07,1159571,1914405,2001,ERROR,41.920846924,-87.689126006,"(41.920846924, -87.689126006)" +2636288,HJ216645,2003-03-03 20:48:00,045XX W WASHINGTON BLVD,1506,PROSTITUTION,SOLICIT ON PUBLIC WAY,STREET,1393,True,False,1113,NA,28,26,16,1146373,1900156,2003,ERROR,41.882007967,-87.737982025,"(41.882007967, -87.737982025)" +1496183,G233892,2001-04-24 09:00:00,004XX E MC FETRIDGE DR,0820,THEFT,$500 AND UNDER,PARK PROPERTY,187,False,False,133,NA,NA,NA,06,1179031,1894246,2001,2014-04-12 12:43:35,41.865106307,-87.618243723,"(41.865106307, -87.618243723)" +3931945,HL305935,2005-04-19 16:00:00,015XX N ARTESIAN AVE,0810,THEFT,OVER $500,RESIDENTIAL YARD (FRONT/BACK),1386,False,False,1423,14,1,24,06,1159834,1910187,2005,2014-04-12 12:43:35,41.909266991,-87.688276249,"(41.909266991, -87.688276249)" +5621453,HN427508,2007-06-25 13:25:00,040XX W DICKENS AVE,2022,NARCOTICS,POSS: COCAINE,STREET,2783,True,False,2525,25,30,20,18,1149318,1913614,2007,2007-01-07 02:00:46,41.918881522,-87.726818542,"(41.918881522, -87.726818542)" +1709847,G508926,2001-08-26 02:00:00,010XX N MONTICELLO AV,0460,BATTERY,SIMPLE,RESIDENCE,3761,False,True,1112,NA,NA,NA,08B,1151889,1906869,2001,ERROR,41.900322332,-87.717550266999993,"(41.900322332, -87.717550267)" +2306701,HH595350,2002-08-21 05:45:00,001XX W POLK ST,0915,MOTOR VEHICLE THEFT,"TRUCK, BUS, MOTOR HOME",STREET,1890,False,False,131,NA,2,32,07,1175097,1896746,2002,ERROR,41.872055484,-87.63261045,"(41.872055484, -87.63261045)" +6581196,HP653741,2008-10-07 03:00:00,034XX W SCHOOL ST,0820,THEFT,$500 AND UNDER,RESIDENTIAL YARD (FRONT/BACK),312,False,False,1732,17,35,21,06,1152747,1921690,2008,ERROR,41.940975485,-87.714005626,"(41.940975485, -87.714005626)" +5443942,HN272087,2007-04-08 15:44:18,059XX S LAFLIN ST,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,1938,False,False,713,7,16,67,14,1167399,1865013,2007,ERROR,41.785145883,-87.661783592,"(41.785145883, -87.661783592)" +3792137,HK836619,2004-12-30 18:30:00,131XX S VERNON AVE,2027,NARCOTICS,POSS: CRACK,RESIDENCE PORCH/HALLWAY,4455,True,False,533,5,9,54,18,1181519,1818462,2004,ERROR,41.657089903,-87.61144499,"(41.657089903, -87.61144499)" +9206054,HW352076,2013-07-07 15:00:00,016XX W 38TH ST,0486,BATTERY,DOMESTIC BATTERY SIMPLE,APARTMENT,975,True,True,912,9,11,59,08B,1165971,1879568,2013,2013-08-07 12:07:35,41.825116974,-87.666605306,"(41.825116974, -87.666605306)" +4720801,HM327230,2006-05-03 05:03:58,026XX E 73RD ST,0334,ROBBERY,ATTEMPT: ARMED-KNIFE/CUT INSTR,SIDEWALK,4270,False,False,334,3,7,43,03,1194873,1857481,2006,2006-07-05 03:57:33,41.763844577,-87.561301231,"(41.763844577, -87.561301231)" +7034576,HR441456,2009-07-21 21:05:00,107XX S HALSTED ST,0326,ROBBERY,AGGRAVATED VEHICULAR HIJACKING,GAS STATION,1442,True,False,2233,22,34,75,03,1172840,1833829,2009,ERROR,41.699454527,-87.642752065,"(41.699454527, -87.642752065)" +8348862,HT582100,2011-11-09 15:00:00,108XX S BENSLEY AVE,0560,ASSAULT,SIMPLE,SIDEWALK,844,False,False,434,4,10,51,08A,1194612,1833847,2011,ERROR,41.698997218,-87.563033068,"(41.698997218, -87.563033068)" +2882234,HJ552553,2003-08-08 22:00:00,109XX S WABASH AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE-GARAGE,664,False,False,513,5,9,49,14,1178490,1832061,2003,ERROR,41.694476704,-87.622117791,"(41.694476704, -87.622117791)" +8571720,HV245210,2011-12-26 09:00:00,038XX W NORTH AVE,0842,THEFT,AGG: FINANCIAL ID THEFT,BANK,4830,False,False,2535,25,30,23,06,1150240,1910394,2011,ERROR,41.910027597,-87.723515111,"(41.910027597, -87.723515111)" +3479397,HK551539,2004-08-11 11:00:00,014XX S CHRISTIANA AVE,0810,THEFT,OVER $500,STREET,3767,False,False,1021,10,24,29,06,1154306,1892825,2004,2014-04-12 12:43:35,41.861736212,-87.709047718,"(41.861736212, -87.709047718)" +6571624,HP644036,2008-10-23 18:10:00,003XX S PLYMOUTH CT,0340,ROBBERY,ATTEMPT: STRONGARM-NO WEAPON,STREET,3266,False,False,123,1,2,32,03,1176091,1898936,2008,2008-06-11 15:42:26,41.878042652,-87.628895109,"(41.878042652, -87.628895109)" +3425217,HK489162,2004-07-11 19:46:59,060XX S MICHIGAN AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,SIDEWALK,1195,False,True,311,3,20,40,08B,1178229,1865098,2004,ERROR,41.785140156,-87.62207368,"(41.785140156, -87.62207368)" +9297900,HW443063,2013-09-08 14:30:00,073XX S MICHIGAN AVE,0320,ROBBERY,STRONGARM - NO WEAPON,STREET,3308,False,False,323,3,6,69,03,1178393,1856302,2013,2013-02-10 11:54:38,41.760999284,-87.621739229,"(41.760999284, -87.621739229)" +5343960,HM744635,2006-11-28 07:45:00,042XX S CALUMET AVE,1506,PROSTITUTION,SOLICIT ON PUBLIC WAY,STREET,2763,True,False,214,2,3,38,16,1179097,1876982,2006,ERROR,41.81773117,-87.61852889,"(41.81773117, -87.61852889)" +7231348,HR644530,2009-11-15 13:15:00,048XX N KENMORE AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,APARTMENT,2613,True,True,2024,20,46,3,08B,1168339,1932383,2009,ERROR,41.969994063,-87.656388912,"(41.969994063, -87.656388912)" +8276922,HT511056,2011-09-23 18:15:00,076XX S CICERO AVE,0860,THEFT,RETAIL THEFT,DEPARTMENT STORE,3184,True,False,833,8,13,65,06,1145766,1853738,2011,ERROR,41.75464162,-87.741385158,"(41.75464162, -87.741385158)" +7096630,HR505081,2009-08-26 18:00:00,081XX S PAULINA ST,0460,BATTERY,SIMPLE,RESIDENCE PORCH/HALLWAY,2842,False,False,614,6,18,71,08B,1166381,1850921,2009,ERROR,41.746497306,-87.66591694,"(41.746497306, -87.66591694)" +3509426,HK586658,2004-08-28 00:00:00,083XX S KINGSTON AVE,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,606,False,False,423,4,7,46,07,1194581,1850155,2004,ERROR,41.743748652,-87.562611996,"(41.743748652, -87.562611996)" +9478072,HX130921,2014-01-21 17:00:00,068XX S WOLCOTT AVE,4387,OTHER OFFENSE,VIOLATE ORDER OF PROTECTION,RESIDENCE,1761,False,True,726,7,17,67,26,1164830,1859219,2014,ERROR,41.769301059,-87.671366222,"(41.769301059, -87.671366222)" +9320325,HW464485,2013-09-23 21:30:00,016XX E 77TH ST,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,1715,False,True,414,4,8,43,14,1188749,1854298,2013,ERROR,41.755258781,-87.583848327,"(41.755258781, -87.583848327)" +8528788,HV205948,2012-03-20 09:50:00,111XX S EWING AVE,1305,CRIMINAL DAMAGE,CRIMINAL DEFACEMENT,RESIDENCE-GARAGE,1676,False,False,433,4,10,52,14,1202171,1831712,2012,ERROR,41.692949738,-87.535428598,"(41.692949738, -87.535428598)" +4290691,HL605721,2005-09-11 14:00:00,001XX N DEARBORN ST,0810,THEFT,OVER $500,PARKING LOT/GARAGE(NON.RESID.),2621,False,False,122,1,42,32,06,1175948,1901601,2005,2014-04-12 12:43:35,41.885358785,-87.629339896,"(41.885358785, -87.629339896)" +9191309,HW336113,2013-06-25 11:28:00,013XX N ASHLAND AVE,0860,THEFT,RETAIL THEFT,DEPARTMENT STORE,3808,True,False,1433,14,1,24,06,1165434,1909298,2013,ERROR,41.906710108,-87.66772974,"(41.906710108, -87.66772974)" +6943981,HR348351,2009-05-29 22:00:00,057XX N MC VICKER AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,1332,False,False,1622,16,45,10,14,1134948,1938056,2009,ERROR,41.986219618,-87.779035389,"(41.986219618, -87.779035389)" +1432501,G153916,2001-03-18 01:15:59,023XX N HAMLIN AV,0460,BATTERY,SIMPLE,RESIDENCE,2320,True,False,2525,NA,NA,NA,08B,1150616,1915362,2001,ERROR,41.923652901,-87.722003735,"(41.923652901, -87.722003735)" +8288964,HT523191,2011-10-01 16:10:00,021XX E 70TH ST,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,STREET,4671,True,False,331,3,5,43,18,1191556,1859009,2011,2011-01-10 19:38:17,41.768118581,-87.573409074,"(41.768118581, -87.573409074)" +7910721,HT140388,2011-01-28 23:30:00,029XX W ADAMS ST,0530,ASSAULT,AGGRAVATED: OTHER DANG WEAPON,APARTMENT,4639,False,False,1124,11,2,27,04A,1156613,1898917,2011,ERROR,41.878406942,-87.700414194,"(41.878406942, -87.700414194)" +2089112,HH309698,2002-04-15 20:15:00,010XX N LAWLER AV,2027,NARCOTICS,POSS: CRACK,SIDEWALK,1200,True,False,1531,NA,NA,NA,18,1142456,1906817,2002,ERROR,41.900360209,-87.752199731,"(41.900360209, -87.752199731)" +9419206,HW562896,2013-12-08 01:39:00,011XX S CANAL ST,0810,THEFT,OVER $500,RESTAURANT,4414,False,False,124,1,2,28,06,1173358,1895046,2013,ERROR,41.867429345,-87.639045471,"(41.867429345, -87.639045471)" +8846059,HV519322,2012-10-14 20:00:00,018XX W 103RD ST,0610,BURGLARY,FORCIBLE ENTRY,OTHER,4604,False,False,2213,22,19,72,05,1165953,1836420,2012,ERROR,41.70671343,-87.667895994,"(41.70671343, -87.667895994)" +6454875,HP535283,2008-08-26 03:22:00,019XX W 19TH ST,0560,ASSAULT,SIMPLE,APARTMENT,1503,False,False,1223,12,25,31,08A,1163581,1890708,2008,ERROR,41.855736847,-87.675060338,"(41.855736847, -87.675060338)" +8223778,HT457480,2011-08-20 15:15:00,007XX E 43RD ST,0560,ASSAULT,SIMPLE,CHA PARKING LOT/GROUNDS,4240,False,False,213,2,4,38,08A,1182085,1876707,2011,ERROR,41.816907818,-87.607576648,"(41.816907818, -87.607576648)" +1622655,G400595,2001-07-09 14:55:00,035XX N HERMITAGE AV,0560,ASSAULT,SIMPLE,ALLEY,2256,False,False,1923,NA,NA,NA,08A,1164066,1923605,2001,ERROR,41.945998404,-87.672349817,"(41.945998404, -87.672349817)" +7843346,HS655355,2010-12-10 22:15:00,028XX S SPAULDING AVE,143A,WEAPONS VIOLATION,UNLAWFUL POSS OF HANDGUN,SIDEWALK,2971,True,False,1032,10,22,30,15,1154782,1885145,2010,ERROR,41.840651893,-87.707505856,"(41.840651893, -87.707505856)" +6043466,HP146623,2008-01-28 00:00:07,091XX S STONY ISLAND AVE,031A,ROBBERY,ARMED: HANDGUN,SMALL RETAIL STORE,3209,False,False,413,4,8,48,03,1188345,1844791,2008,2008-08-02 08:13:34,41.729180293,-87.585631578,"(41.729180293, -87.585631578)" +9633417,HX284237,2014-05-31 15:00:00,083XX S INGLESIDE AVE,0820,THEFT,$500 AND UNDER,APARTMENT,380,False,False,632,6,8,44,06,1183965,1849926,2014,2014-07-06 12:40:43,41.743374586,-87.601516477,"(41.743374586, -87.601516477)" +9050651,HW196019,2013-03-16 14:30:00,037XX N SEMINARY AVE,0810,THEFT,OVER $500,OTHER,3835,False,False,1923,19,44,6,06,1168275,1925255,2013,ERROR,41.950435964,-87.656831163,"(41.950435964, -87.656831163)" +1724326,G530529,2001-08-24 09:00:00,068XX N FRANCISCO AV,0810,THEFT,OVER $500,CONSTRUCTION SITE,4601,False,False,2411,NA,NA,NA,06,1155826,1945498,2001,2014-04-12 12:43:35,42.006244328,-87.70204429,"(42.006244328, -87.70204429)" +7313924,HS117962,2009-11-23 09:18:00,001XX W JACKSON BLVD,1110,DECEPTIVE PRACTICE,BOGUS CHECK,BANK,2873,True,False,112,1,2,32,11,1175229,1898922,2009,2011-03-01 19:34:38,41.878023606,-87.632060555,"(41.878023606, -87.632060555)" +8348182,HT581427,2011-11-08 17:45:00,049XX S WABASH AVE,0820,THEFT,$500 AND UNDER,"SCHOOL, PUBLIC, BUILDING",404,True,False,231,2,3,38,06,1177513,1872176,2011,2011-09-11 12:54:43,41.804579093,-87.624484847,"(41.804579093, -87.624484847)" +8457513,HV134404,2012-01-27 10:40:00,095XX S LAFAYETTE AVE,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,4775,False,False,511,5,21,49,07,1177575,1841925,2012,ERROR,41.721565569,-87.625170844,"(41.721565569, -87.625170844)" +3991779,HL277064,2005-04-05 22:00:00,004XX S CICERO AVE,1506,PROSTITUTION,SOLICIT ON PUBLIC WAY,STREET,4442,True,False,1533,15,24,25,16,1144422,1897554,2005,ERROR,41.874904679,-87.745211632,"(41.874904679, -87.745211632)" +8231576,HT460583,2011-08-03 11:00:00,025XX W 63RD ST,2825,OTHER OFFENSE,HARASSMENT BY TELEPHONE,OTHER,2479,False,False,825,8,15,66,26,1160154,1862826,2011,ERROR,41.779296661,-87.688407212,"(41.779296661, -87.688407212)" +4496745,HL799743,2005-12-20 09:05:00,073XX S SACRAMENTO AVE,0610,BURGLARY,FORCIBLE ENTRY,RESIDENCE,4808,False,False,835,8,18,66,05,1157607,1855700,2005,ERROR,41.75979389,-87.697937855,"(41.75979389, -87.697937855)" +5033246,HM641247,2006-10-04 20:00:00,080XX S LAFLIN ST,0610,BURGLARY,FORCIBLE ENTRY,RESIDENCE-GARAGE,4181,False,False,612,6,21,71,05,1167772,1851438,2006,ERROR,41.747886306,-87.660805171,"(41.747886306, -87.660805171)" +5208608,HM778355,2006-12-16 19:10:00,068XX S HALSTED ST,143A,WEAPONS VIOLATION,UNLAWFUL POSS OF HANDGUN,TAVERN/LIQUOR STORE,3007,True,False,723,7,6,68,15,1172116,1859172,2006,2007-01-01 07:32:02,41.7690151,-87.644660529,"(41.7690151, -87.644660529)" +2528826,HJ107508,2003-01-04 22:02:46,030XX W 47TH ST,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,4398,False,False,912,NA,14,58,14,1157054,1873373,2003,ERROR,41.808302333,-87.699487137,"(41.808302333, -87.699487137)" +1613083,G380569,2001-06-30 03:34:50,010XX E 133 ST,0560,ASSAULT,SIMPLE,CHA APARTMENT,4421,True,False,533,NA,NA,NA,08A,1185848,1817236,2001,ERROR,41.653625,-87.595643042,"(41.653625, -87.595643042)" +5350380,HN205637,2007-03-03 10:00:00,032XX W 63RD ST,0460,BATTERY,SIMPLE,APARTMENT,1902,False,False,823,8,15,66,08B,1155671,1862624,2007,2007-08-03 21:51:06,41.77883343,-87.704847919,"(41.77883343, -87.704847919)" +5570467,HN377874,2007-04-02 12:00:00,064XX S LANGLEY AVE,2825,OTHER OFFENSE,HARASSMENT BY TELEPHONE,RESIDENCE,4605,False,True,312,3,20,42,26,1181963,1862332,2007,ERROR,41.777464417,-87.608468819,"(41.777464417, -87.608468819)" +3864729,HL237399,2005-03-16 10:00:00,046XX S HALSTED ST,0860,THEFT,RETAIL THEFT,GROCERY FOOD STORE,3954,True,False,921,9,11,61,06,1171713,1873921,2005,ERROR,41.809496845,-87.645705337,"(41.809496845, -87.645705337)" +4208971,HL527767,2005-07-04 22:30:00,056XX S MICHIGAN AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,1863,False,True,233,2,20,40,08B,1178081,1867582,2005,ERROR,41.791959854,-87.622541015,"(41.791959854, -87.622541015)" +4616724,HM210940,2006-03-03 10:26:14,0000X W RANDOLPH ST,1330,CRIMINAL TRESPASS,TO LAND,RESTAURANT,1416,True,False,122,1,42,32,26,1175995,1901321,2006,2006-07-03 03:46:57,41.884589391,-87.629175742,"(41.884589391, -87.629175742)" +9574311,HX225021,2014-04-15 20:00:00,088XX S LOOMIS ST,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,4758,False,False,2222,22,21,71,07,1168581,1846266,2014,2014-06-05 00:39:53,41.733676216,-87.657989464,"(41.733676216, -87.657989464)" +3138687,HK129812,2004-01-16 21:30:00,115XX S YALE AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,4990,False,True,522,5,34,53,08B,1176719,1828319,2004,ERROR,41.684248043,-87.628713951,"(41.684248043, -87.628713951)" +8344443,HT528932,2011-10-05 05:00:00,052XX W SCHOOL ST,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,2954,False,False,1634,16,38,15,14,1140574,1921391,2011,2011-08-11 10:43:52,41.940387619,-87.758753823,"(41.940387619, -87.758753823)" +1796827,G622864,2001-10-15 20:30:00,030XX S GRATTEN AV,0810,THEFT,OVER $500,OTHER,2409,False,False,923,NA,NA,NA,06,1169291,1884678,2001,2014-04-12 12:43:35,41.839067958,-87.654276965,"(41.839067958, -87.654276965)" +6321465,HP407211,2008-06-21 01:00:00,013XX S KEDZIE AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,SIDEWALK,1039,False,False,1022,10,24,29,08B,1155195,1893805,2008,ERROR,41.864407654,-87.705758038,"(41.864407654, -87.705758038)" +4048269,HL397796,2005-06-04 01:00:00,106XX S HALSTED ST,0486,BATTERY,DOMESTIC BATTERY SIMPLE,VEHICLE NON-COMMERCIAL,1253,False,True,2233,22,34,73,08B,1172820,1834491,2005,ERROR,41.701271596,-87.642805861,"(41.701271596, -87.642805861)" +3192419,HK199140,2004-02-23 08:15:00,068XX S STEWART AVE,0460,BATTERY,SIMPLE,"SCHOOL, PUBLIC, BUILDING",2632,True,False,722,7,6,68,08B,1174671,1859859,2004,ERROR,41.770843786,-87.635274724,"(41.770843786, -87.635274724)" +2000440,HH198576,2002-02-20 16:32:03,064XX W DIVERSEY AV,0620,BURGLARY,UNLAWFUL ENTRY,APPLIANCE STORE,4375,False,False,2512,NA,NA,NA,05,NA,NA,2002,ERROR,NA,NA, +9584763,HX234897,2014-04-23 21:50:00,026XX N RUTHERFORD AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,APARTMENT,1333,False,False,2512,25,36,18,08B,1130931,1916809,2014,ERROR,41.927985963,-87.794301643,"(41.927985963, -87.794301643)" +6633395,HP703001,2008-11-26 10:25:55,001XX N STATE ST,0850,THEFT,ATTEMPT THEFT,SIDEWALK,1180,True,False,122,1,42,32,06,1176393,1900887,2008,2008-01-12 07:38:55,41.8833895,-87.627727352,"(41.8833895, -87.627727352)" +10025851,HY215334,2015-04-09 08:09:00,037XX N KILPATRICK AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,4106,True,True,1731,17,38,15,08B,1144437,1924607,2015,ERROR,41.949140682,-87.744474617,"(41.949140682, -87.744474617)" +4257303,HL576564,2005-08-28 00:01:00,018XX N KEDVALE AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,1447,False,False,2534,25,30,20,14,1148380,1912201,2005,ERROR,41.915022267,-87.730301385,"(41.915022267, -87.730301385)" +5994905,HP103223,2008-01-02 20:45:00,029XX W WARREN BLVD,2027,NARCOTICS,POSS: CRACK,SIDEWALK,2969,True,False,1331,12,2,27,18,1156699,1900170,2008,2008-03-01 08:43:16,41.881843556,-87.700064472,"(41.881843556, -87.700064472)" +6422343,HP506170,2008-08-05 23:00:00,008XX E 101ST ST,0820,THEFT,$500 AND UNDER,VEHICLE NON-COMMERCIAL,111,False,False,511,5,8,50,06,1183373,1838023,2008,2008-11-08 08:34:38,41.710725164,-87.604055073,"(41.710725164, -87.604055073)" +20991,HW370238,2013-07-19 21:43:00,038XX W HIRSCH ST,0110,HOMICIDE,FIRST DEGREE MURDER,STREET,3308,False,False,2535,25,30,23,01A,1150202,1908997,2013,2013-03-10 07:24:17,41.906194835,-87.723691183,"(41.906194835, -87.723691183)" +6084521,HP178194,2008-02-16 03:00:00,066XX S ASHLAND AVE,0313,ROBBERY,ARMED: OTHER DANGEROUS WEAPON,SIDEWALK,3004,False,False,725,7,17,67,03,1166856,1860593,2008,ERROR,41.773028465,-87.663900629,"(41.773028465, -87.663900629)" +10080403,HY268040,2015-05-19 11:00:00,049XX W IRVING PARK RD,0486,BATTERY,DOMESTIC BATTERY SIMPLE,APARTMENT,3481,False,True,1624,16,45,15,08B,1142440,1926175,2015,ERROR,41.95348083,-87.751776252,"(41.95348083, -87.751776252)" +6924204,HR316222,2009-05-12 09:00:00,0000X W 95TH ST,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,CTA GARAGE / OTHER PROPERTY,3480,True,False,634,6,21,49,18,1177743,1841988,2009,ERROR,41.721734655,-87.624553594,"(41.721734655, -87.624553594)" +6386680,HP461038,2008-07-18 22:43:31,045XX W HARRISON ST,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,STREET,2401,True,False,1131,11,24,26,18,1146348,1896935,2008,ERROR,41.873169637,-87.738155845,"(41.873169637, -87.738155845)" +6784849,HR199128,2009-03-04 20:12:00,066XX N CLARK ST,2170,NARCOTICS,POSSESSION OF DRUG EQUIPMENT,ALLEY,3928,True,False,2432,24,40,1,18,1164013,1944171,2009,2009-04-03 20:55:02,42.002433404,-87.671961019,"(42.002433404, -87.671961019)" +7712756,HS519770,2010-09-17 12:11:00,060XX S WESTERN AVE,0820,THEFT,$500 AND UNDER,SMALL RETAIL STORE,37,False,False,825,8,15,66,06,1161368,1864419,2010,ERROR,41.783642999,-87.683912427,"(41.783642999, -87.683912427)" +7906876,HT136770,2011-01-26 15:55:00,0000X S KOSTNER AVE,2092,NARCOTICS,SOLICIT NARCOTICS ON PUBLICWAY,SIDEWALK,4097,True,False,1113,11,28,26,26,1147028,1899356,2011,ERROR,41.87980018,-87.735597307,"(41.87980018, -87.735597307)" +7991866,HT223888,2011-03-28 19:15:00,110XX S PRINCETON AVE,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,SIDEWALK,544,True,False,513,5,34,49,18,1176291,1831621,2011,ERROR,41.693318823,-87.630182058,"(41.693318823, -87.630182058)" +7123089,HR531884,2009-09-11 18:13:00,013XX S MILLARD AVE,051A,ASSAULT,AGGRAVATED: HANDGUN,STREET,4647,True,False,1011,10,24,29,04A,1152210,1893660,2009,ERROR,41.864069113,-87.71671981,"(41.864069113, -87.71671981)" +2000324,HH200986,2002-02-21 18:47:45,014XX N AVERS AV,0460,BATTERY,SIMPLE,RESIDENCE,3701,False,True,2535,NA,NA,NA,08B,1150481,1909461,2002,ERROR,41.907462651,-87.722654169,"(41.907462651, -87.722654169)" +8240399,HT466105,2011-08-25 22:55:00,021XX N CICERO AVE,1513,PROSTITUTION,SOLICIT FOR BUSINESS,STREET,2564,True,False,2522,25,31,19,16,1144003,1913897,2011,2011-02-09 09:05:11,41.919759591,-87.746339498,"(41.919759591, -87.746339498)" +1514753,G260660,2001-05-06 18:53:39,028XX W 19 ST,143A,WEAPONS VIOLATION,UNLAWFUL POSS OF HANDGUN,STREET,3078,True,False,1022,NA,NA,NA,15,1157943,1890640,2001,2010-02-06 10:34:17,41.855666993,-87.695756427,"(41.855666993, -87.695756427)" +3724031,HK768759,2004-11-12 13:00:00,012XX S ASHLAND AVE,1120,DECEPTIVE PRACTICE,FORGERY,RESIDENCE,1595,False,False,1224,12,2,28,10,1165874,1894646,2004,ERROR,41.866494521,-87.666531674,"(41.866494521, -87.666531674)" +9095092,HW222941,2013-04-07 10:05:00,039XX S CALUMET AVE,2014,NARCOTICS,MANU/DELIVER: HEROIN (WHITE),SIDEWALK,3181,True,False,213,2,3,38,18,1179129,1878622,2013,2013-03-05 09:26:15,41.822230731,-87.618361446,"(41.822230731, -87.618361446)" +9606372,HX256322,2014-05-10 14:15:00,017XX S ASHLAND AVE,0860,THEFT,RETAIL THEFT,OTHER,824,False,False,1233,12,25,31,06,1166044,1891531,2014,ERROR,41.857943062,-87.665996477,"(41.857943062, -87.665996477)" +2080168,HH302067,2002-04-11 17:30:00,005XX S CENTRAL AV,0460,BATTERY,SIMPLE,RESIDENCE,830,False,False,1522,NA,NA,NA,08B,1139180,1897038,2002,ERROR,41.873585657,-87.764470903,"(41.873585657, -87.764470903)" +2538562,HJ119047,2003-01-10 17:30:00,030XX N MOBILE AVE,0890,THEFT,FROM BUILDING,"SCHOOL, PUBLIC, BUILDING",1800,False,False,2511,NA,36,19,06,1133838,1919613,2003,ERROR,41.935629815,-87.783553233,"(41.935629815, -87.783553233)" +5728743,HN535876,2007-08-18 03:00:00,055XX W DAKIN ST,0460,BATTERY,SIMPLE,ALLEY,3956,False,False,1633,16,38,15,08B,1138581,1925659,2007,ERROR,41.952135858,-87.765975048,"(41.952135858, -87.765975048)" +4533362,HM121306,2006-01-05 13:00:00,112XX S PERRY AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,STREET,4073,False,True,522,5,34,49,08B,1177464,1830657,2006,ERROR,41.690647109,-87.62591646,"(41.690647109, -87.62591646)" +2940341,HJ623964,2003-09-11 22:52:01,079XX S JUSTINE ST,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,3976,False,False,612,6,21,71,14,1167342,1852128,2003,ERROR,41.749788975,-87.662361113,"(41.749788975, -87.662361113)" +4022229,HL375934,2005-05-23 16:30:00,043XX W IRVING PARK RD,1320,CRIMINAL DAMAGE,TO VEHICLE,OTHER,547,False,False,1722,17,38,16,14,1146478,1926264,2005,ERROR,41.953648902,-87.736929761,"(41.953648902, -87.736929761)" +8856428,HV530199,2012-10-22 19:10:00,001XX N LA CROSSE AVE,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,RESIDENCE-GARAGE,3046,False,False,1532,15,28,25,07,1144050,1900929,2012,ERROR,41.884173077,-87.746492747,"(41.884173077, -87.746492747)" +10126995,HY315210,2015-04-01 09:00:00,099XX S WINSTON AVE,1153,DECEPTIVE PRACTICE,FINANCIAL IDENTITY THEFT OVER $ 300,RESIDENCE,3601,False,False,2213,22,21,73,11,1168775,1838907,2015,ERROR,41.713477841,-87.6574904,"(41.713477841, -87.6574904)" +7059731,HR465421,2009-08-04 10:00:00,050XX W ADDISON ST,0620,BURGLARY,UNLAWFUL ENTRY,RESIDENCE,3296,False,False,1634,16,38,15,05,1142074,1923423,2009,2009-03-09 12:45:23,41.945935898,-87.753190197,"(41.945935898, -87.753190197)" +4369628,HL653099,2005-10-04 14:15:00,0000X E 68TH ST,0610,BURGLARY,FORCIBLE ENTRY,RESIDENCE,4938,False,False,322,3,20,69,05,1178251,1859995,2005,ERROR,41.7711365,-87.622147753,"(41.7711365, -87.622147753)" +2085336,HH300310,2002-04-11 14:22:32,052XX S ASHLAND AV,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,STREET,2024,True,False,932,NA,NA,NA,18,1166514,1870200,2002,ERROR,41.79939856,-87.664880524,"(41.79939856, -87.664880524)" +2837739,HJ500794,2003-07-17 12:00:00,064XX S ASHLAND AVE,0820,THEFT,$500 AND UNDER,PARKING LOT/GARAGE(NON.RESID.),327,False,False,725,7,15,67,06,1166729,1862274,2003,2014-04-12 12:43:35,41.777644057,-87.664318242,"(41.777644057, -87.664318242)" +9359551,HW502824,2013-10-16 13:00:00,087XX S CONSTANCE AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,SIDEWALK,4794,False,False,412,4,8,48,14,1189994,1847553,2013,ERROR,41.736720026,-87.579502355,"(41.736720026, -87.579502355)" +4269836,HL586435,2005-09-01 00:00:00,099XX S BEVERLY AVE,0890,THEFT,FROM BUILDING,RESIDENCE,2317,False,True,2213,22,21,72,06,1168186,1838983,2005,ERROR,41.713699063,-87.659645355,"(41.713699063, -87.659645355)" +3579880,HK667872,2004-10-05 09:30:00,053XX S COTTAGE GROVE AVE,0610,BURGLARY,FORCIBLE ENTRY,APARTMENT,3907,False,False,2131,2,5,41,05,1182540,1869405,2004,ERROR,41.796859993,-87.606134249,"(41.796859993, -87.606134249)" +1396555,G081867,2001-02-09 10:00:00,070XX S SANGAMON ST,1812,NARCOTICS,POSS: CANNABIS MORE THAN 30GMS,STREET,2543,True,False,733,NA,NA,NA,18,1171146,1858301,2001,ERROR,41.766646226,-87.648241507,"(41.766646226, -87.648241507)" +6210516,HP298503,2008-04-23 19:00:00,088XX S COLFAX AVE,0610,BURGLARY,FORCIBLE ENTRY,RESIDENCE,3830,False,False,423,4,7,46,05,1195065,1846888,2008,2008-08-05 07:57:25,41.734771822,-87.560946053,"(41.734771822, -87.560946053)" +8335396,HT565225,2011-10-29 12:22:19,069XX S LAFAYETTE AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESTAURANT,4794,False,True,731,7,6,69,08B,1176984,1859255,2011,2011-07-11 12:45:02,41.769134515,-87.626814372,"(41.769134515, -87.626814372)" +4575638,HL791694,2005-12-15 20:55:00,006XX N TRUMBULL AVE,2024,NARCOTICS,POSS: HEROIN(WHITE),SIDEWALK,1930,True,False,1121,11,27,23,18,1153311,1903852,2005,ERROR,41.892015265,-87.712407374,"(41.892015265, -87.712407374)" +9527333,HX181612,2014-03-12 10:50:00,081XX S VINCENNES AVE,0545,ASSAULT,PRO EMP HANDS NO/MIN INJURY,"SCHOOL, PUBLIC, BUILDING",1878,True,False,622,6,21,44,08A,1174722,1850745,2014,ERROR,41.745832739,-87.635358835,"(41.745832739, -87.635358835)" +2802818,HJ444885,2003-06-21 19:30:00,029XX S STATE ST,0486,BATTERY,DOMESTIC BATTERY SIMPLE,CHA PARKING LOT/GROUNDS,4371,False,True,2113,1,3,35,08B,1176715,1885559,2003,ERROR,41.841321197,-87.627008027,"(41.841321197, -87.627008027)" +8240826,HT474337,2011-08-31 10:04:00,070XX S CLYDE AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,ALLEY,3112,True,False,331,3,5,43,08B,1191389,1858691,2011,2011-01-09 06:32:18,41.767250011,-87.574031486,"(41.767250011, -87.574031486)" +8766702,HV441335,2012-08-21 22:30:00,023XX N MILWAUKEE AVE,0620,BURGLARY,UNLAWFUL ENTRY,OTHER,4672,False,False,1414,14,35,22,05,1157125,1915354,2012,2012-03-09 18:32:27,41.923501123,-87.698087331,"(41.923501123, -87.698087331)" +9497756,HX152161,2014-02-15 11:52:00,071XX S CONSTANCE AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,APARTMENT,4239,False,True,324,3,5,43,08B,1189655,1857726,2014,ERROR,41.764643801,-87.580418177,"(41.764643801, -87.580418177)" +7234599,HR643869,2009-11-15 00:30:00,002XX W NORTH AVE,0890,THEFT,FROM BUILDING,OTHER,3514,False,False,1814,18,43,7,06,1174055,1911024,2009,2010-05-01 11:53:51,41.911258405,-87.636010015,"(41.911258405, -87.636010015)" +3179722,HK182024,2004-02-13 23:00:00,013XX W IRVING PARK RD,0810,THEFT,OVER $500,STREET,4624,False,False,1923,19,47,6,06,1166363,1926630,2004,2014-04-12 12:43:35,41.954250222,-87.663819997,"(41.954250222, -87.663819997)" +4222202,HL539526,2005-08-10 01:50:00,043XX S LAMON AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,CHA PARKING LOT/GROUNDS,4720,False,False,814,8,23,56,14,1144637,1875298,2005,ERROR,41.813827102,-87.744982032,"(41.813827102, -87.744982032)" +7219347,HR634999,2009-11-09 19:00:00,052XX S RACINE AVE,0560,ASSAULT,SIMPLE,APARTMENT,2784,False,True,934,9,16,61,08A,1169250,1870146,2009,ERROR,41.799191555,-87.654848486,"(41.799191555, -87.654848486)" +7793169,HS594082,2010-11-01 18:00:00,019XX W 95TH ST,1350,CRIMINAL TRESPASS,TO STATE SUP LAND,LIBRARY,553,False,False,2221,22,19,72,26,1164769,1841686,2010,2010-07-11 08:22:48,41.721189215,-87.672083692,"(41.721189215, -87.672083692)" +2103641,HH335780,2002-04-28 01:50:00,014XX W MARQUETTE RD,0560,ASSAULT,SIMPLE,STREET,4679,False,False,725,NA,17,67,08A,1167596,1860349,2002,ERROR,41.772343059,-87.661194963,"(41.772343059, -87.661194963)" +8223696,HT457644,2011-08-20 17:25:00,098XX S HALSTED ST,0320,ROBBERY,STRONGARM - NO WEAPON,STREET,1911,True,False,2223,22,21,73,03,1172676,1839503,2011,ERROR,41.715028437,-87.643186054,"(41.715028437, -87.643186054)" +7585036,HS388608,2010-07-01 06:25:00,003XX N OAKLEY BLVD,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,2283,False,False,1332,12,27,28,07,1160973,1902387,2010,2010-02-07 11:19:23,41.887839582,-87.684308839,"(41.887839582, -87.684308839)" +5931509,HN704677,2007-11-12 23:30:00,079XX S STATE ST,0320,ROBBERY,STRONGARM - NO WEAPON,CTA PLATFORM,3105,False,False,623,6,6,44,03,1177618,1852608,2007,2007-12-12 01:05:15,41.750880081,-87.624691153,"(41.750880081, -87.624691153)" +5710926,HN519237,2007-08-09 16:00:00,012XX N ROCKWELL ST,0890,THEFT,FROM BUILDING,RESIDENCE,3673,False,False,1423,14,26,24,06,1158874,1908481,2007,ERROR,41.904605346,-87.691849732,"(41.904605346, -87.691849732)" +3611691,HK705389,2004-10-23 13:30:00,010XX S WELLS ST,0810,THEFT,OVER $500,STREET,2968,False,False,131,1,2,32,06,1174825,1895931,2004,2014-04-12 12:43:35,41.86982516,-87.633633456,"(41.86982516, -87.633633456)" +4713760,HM209421,2006-03-02 13:48:00,072XX S PAULINA ST,2095,NARCOTICS,ATTEMPT POSSESSION NARCOTICS,STREET,2117,True,False,735,7,17,67,18,1166303,1856763,2006,ERROR,41.762530229,-87.666036716,"(41.762530229, -87.666036716)" +2607516,HJ206193,2003-02-26 14:20:00,034XX S DR MARTIN LUTHER KING JR DR,1330,CRIMINAL TRESPASS,TO LAND,DRUG STORE,3921,False,False,2122,NA,4,35,26,1179511,1882404,2003,ERROR,41.832600096,-87.616844359,"(41.832600096, -87.616844359)" +6611578,HP684171,2008-11-15 03:25:00,009XX W BELMONT AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,RESTAURANT,1170,True,False,1924,19,44,6,14,1169428,1921475,2008,ERROR,41.940038439,-87.652703194,"(41.940038439, -87.652703194)" +8020502,HT251222,2011-04-14 22:00:00,066XX S TALMAN AVE,0820,THEFT,$500 AND UNDER,STREET,490,False,False,831,8,15,66,06,1159896,1860350,2011,ERROR,41.772507471,-87.689421041,"(41.772507471, -87.689421041)" +3795590,HL160354,2005-01-28 23:00:00,036XX N MARSHFIELD AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,2815,False,False,1923,19,47,6,14,1164641,1923969,2005,ERROR,41.946985052,-87.670225966,"(41.946985052, -87.670225966)" +4925940,HM538019,2006-08-13 16:09:24,060XX S VERNON AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,OTHER,3128,True,True,313,3,20,42,08B,1180344,1865263,2006,ERROR,41.785544659,-87.61431417,"(41.785544659, -87.61431417)" +8500347,HV177396,2012-02-29 11:20:00,001XX W LAKE ST,1210,DECEPTIVE PRACTICE,THEFT OF LABOR/SERVICES,CTA GARAGE / OTHER PROPERTY,4130,True,False,113,1,42,32,11,1175354,1901695,2012,2012-01-03 08:18:16,41.885630077,-87.631518326,"(41.885630077, -87.631518326)" +2617371,HJ216694,2003-03-03 18:00:00,073XX S SOUTH SHORE DR,2820,OTHER OFFENSE,TELEPHONE THREAT,APARTMENT,1366,False,False,334,NA,7,43,26,1195387,1857193,2003,ERROR,41.76304161,-87.559426843,"(41.76304161, -87.559426843)" +7970463,HT202960,2011-02-15 17:00:00,077XX S NORMAL AVE,1110,DECEPTIVE PRACTICE,BOGUS CHECK,APARTMENT,4925,False,False,621,6,17,69,11,1174337,1853795,2011,ERROR,41.754210881,-87.636679059,"(41.754210881, -87.636679059)" +6529891,HP602686,2008-10-01 02:46:00,002XX E 35TH ST,0820,THEFT,$500 AND UNDER,SIDEWALK,496,False,False,2112,2,2,35,06,1178613,1881880,2008,ERROR,41.831182706,-87.620155187,"(41.831182706, -87.620155187)" +7957427,HT189220,2011-03-05 02:00:00,044XX N MILWAUKEE AVE,0460,BATTERY,SIMPLE,SIDEWALK,4218,False,False,1623,16,45,15,08B,1141633,1928786,2011,2011-08-03 11:36:40,41.960660635,-87.754678083,"(41.960660635, -87.754678083)" +8157874,HT373208,2011-06-30 09:40:00,038XX W MADISON ST,2027,NARCOTICS,POSS: CRACK,GROCERY FOOD STORE,4416,True,False,1122,11,28,26,18,1150456,1899690,2011,ERROR,41.880650508,-87.723001331,"(41.880650508, -87.723001331)" +3216861,HK232167,2004-03-10 18:30:00,0000X W 111TH ST,0890,THEFT,FROM BUILDING,HOSPITAL BUILDING/GROUNDS,2419,False,False,522,5,34,49,06,1177728,1831317,2004,ERROR,41.692452292,-87.624930074,"(41.692452292, -87.624930074)" +2177171,HH431013,2002-06-10 05:51:58,046XX W 82ND ST,0460,BATTERY,SIMPLE,APARTMENT,4946,False,False,834,NA,13,70,08B,1146910,1849636,2002,ERROR,41.743363318,-87.737296807,"(41.743363318, -87.737296807)" +8393994,HT626631,2011-12-10 20:40:00,076XX S NORMAL AVE,0460,BATTERY,SIMPLE,STREET,3091,False,False,621,6,17,69,08B,1174322,1854368,2011,ERROR,41.755783597,-87.636717026,"(41.755783597, -87.636717026)" +3445477,HK002362,2004-07-23 21:30:00,021XX W SUPERIOR ST,0820,THEFT,$500 AND UNDER,RESIDENCE,26,False,False,1313,12,1,24,06,1162023,1904942,2004,2014-04-12 12:43:35,41.894828854,-87.680381499,"(41.894828854, -87.680381499)" +1393385,G083313,2001-02-09 22:06:39,063XX S ALBANY AV,2027,NARCOTICS,POSS: CRACK,STREET,1258,True,False,823,NA,NA,NA,18,1156765,1862558,2001,ERROR,41.778630305,-87.700838972,"(41.778630305, -87.700838972)" +8144026,HT378531,2011-07-02 23:00:00,033XX W 63RD ST,1310,CRIMINAL DAMAGE,TO PROPERTY,OTHER,2973,False,False,823,8,15,66,14,1155411,1862617,2011,2011-05-07 14:12:04,41.778819432,-87.705801296,"(41.778819432, -87.705801296)" +1971985,HH155823,2002-01-29 15:25:27,033XX W FLOURNOY ST,0460,BATTERY,SIMPLE,STREET,4324,False,False,1134,NA,NA,NA,08B,1154134,1896793,2002,ERROR,41.872628267,-87.709573266,"(41.872628267, -87.709573266)" +8586946,HV261160,2012-04-25 19:30:00,103XX S TORRENCE AVE,0810,THEFT,OVER $500,RESIDENCE,3718,False,False,434,4,10,51,06,1195470,1836864,2012,2012-10-05 12:01:25,41.707255067,-87.559792308,"(41.707255067, -87.559792308)" +4342220,HL629648,2005-09-22 17:00:00,021XX N LAWLER AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,3886,True,False,2522,25,31,19,08B,1142418,1913633,2005,ERROR,41.919064771,-87.752169679,"(41.919064771, -87.752169679)" +9280006,HW424844,2013-08-25 21:30:00,001XX W 95TH ST,0890,THEFT,FROM BUILDING,RESTAURANT,4034,False,False,634,6,21,49,06,1176654,1841992,2013,ERROR,41.721770166,-87.628542273,"(41.721770166, -87.628542273)" +2813480,HJ464372,2003-06-30 18:40:01,005XX S COLUMBUS DR,0820,THEFT,$500 AND UNDER,PARK PROPERTY,143,True,False,124,1,2,32,06,1178319,1898125,2003,2014-04-12 12:43:35,41.875766752,-87.620739245,"(41.875766752, -87.620739245)" +3561152,HK648531,2004-09-26 04:30:45,110XX S HALSTED ST,0560,ASSAULT,SIMPLE,OTHER,4272,True,False,2233,22,34,75,08A,1172920,1831338,2004,ERROR,41.692617079,-87.642532293,"(41.692617079, -87.642532293)" +10050076,HY238761,2015-04-28 07:55:00,082XX S MARYLAND AVE,031A,ROBBERY,ARMED: HANDGUN,ALLEY,3860,False,False,631,6,8,44,03,1183383,1850376,2015,2015-05-05 12:47:16,41.744622997,-87.603634954,"(41.744622997, -87.603634954)" +8001148,HT233085,2011-04-03 23:15:00,107XX S BENSLEY AVE,2820,OTHER OFFENSE,TELEPHONE THREAT,RESIDENCE,638,False,True,434,4,10,51,26,1194521,1834420,2011,2011-06-04 13:32:13,41.700571822,-87.563347504,"(41.700571822, -87.563347504)" +6228780,HP311138,2008-05-01 15:18:59,0000X E GARFIELD BLVD,0560,ASSAULT,SIMPLE,RESTAURANT,1289,False,False,233,2,20,40,08A,1177260,1868390,2008,ERROR,41.794195672,-87.625527066,"(41.794195672, -87.625527066)" +6779900,HR184949,2009-02-23 16:00:00,010XX W GARFIELD BLVD,0820,THEFT,$500 AND UNDER,RESIDENCE,477,False,False,712,7,16,68,06,1170399,1868173,2009,2009-06-04 15:49:19,41.79375246,-87.65069229,"(41.79375246, -87.65069229)" +7426826,HS229492,2010-03-28 01:59:00,066XX N OLMSTED AVE,0460,BATTERY,SIMPLE,PARKING LOT/GARAGE(NON.RESID.),643,True,False,1612,16,41,9,08B,1124889,1943652,2010,ERROR,42.001748276,-87.815908566,"(42.001748276, -87.815908566)" +2466429,HH796219,2002-11-22 20:00:00,074XX S INDIANA AVE,2820,OTHER OFFENSE,TELEPHONE THREAT,RESIDENCE,4674,False,True,323,NA,6,69,26,1178843,1855836,2002,ERROR,41.759710302,-87.620104123,"(41.759710302, -87.620104123)" +4607990,HM202545,2006-02-26 12:00:00,069XX S CORNELL AVE,0610,BURGLARY,FORCIBLE ENTRY,APARTMENT,1838,False,False,332,3,5,43,05,1188596,1859060,2006,2006-05-03 04:52:17,41.768329782,-87.584257056,"(41.768329782, -87.584257056)" +4704001,HM309457,2006-04-22 00:00:00,043XX W 59TH ST,1305,CRIMINAL DAMAGE,CRIMINAL DEFACEMENT,RESIDENTIAL YARD (FRONT/BACK),3755,False,False,813,8,13,62,14,1148566,1865172,2006,ERROR,41.785965095,-87.730830299,"(41.785965095, -87.730830299)" +4742590,HM348904,2006-05-13 16:30:00,029XX E 80TH ST,143A,WEAPONS VIOLATION,UNLAWFUL POSS OF HANDGUN,STREET,693,True,False,422,4,7,46,15,1196921,1852523,2006,ERROR,41.75018879,-87.553959645,"(41.75018879, -87.553959645)" +6917090,HR321572,2009-05-14 22:30:00,022XX N NAGLE AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,3547,True,True,2512,25,36,19,08B,1133001,1914445,2009,2009-03-06 14:53:51,41.921462904,-87.786750394,"(41.921462904, -87.786750394)" +6072784,HP171029,2008-02-11 20:52:00,013XX S CANAL ST,1150,DECEPTIVE PRACTICE,CREDIT CARD FRAUD,GROCERY FOOD STORE,3576,False,False,131,1,2,28,11,1173296,1893975,2008,ERROR,41.864491821,-87.639304867,"(41.864491821, -87.639304867)" +8412665,HT645859,2011-12-24 07:30:00,021XX N CALIFORNIA AVE,0340,ROBBERY,ATTEMPT: STRONGARM-NO WEAPON,SIDEWALK,1132,False,False,1431,14,1,22,03,1157384,1914494,2011,2012-12-01 19:07:21,41.921135948,-87.69715911,"(41.921135948, -87.69715911)" +3341445,HK378381,2004-05-20 22:30:00,002XX E OHIO ST,0810,THEFT,OVER $500,PARKING LOT/GARAGE(NON.RESID.),3433,False,False,1834,18,42,8,06,1178331,1904297,2004,2014-04-12 12:43:35,41.892702762,-87.620506953,"(41.892702762, -87.620506953)" +6468782,HP546433,2008-09-01 02:01:30,037XX N HALSTED ST,0460,BATTERY,SIMPLE,SIDEWALK,4456,False,False,2324,19,46,6,08B,1170291,1925093,2008,2008-09-10 20:44:50,41.949947525,-87.649425319,"(41.949947525, -87.649425319)" +8339679,HT573293,2011-11-03 13:20:00,007XX E 60TH ST,1330,CRIMINAL TRESPASS,TO LAND,RESIDENCE,4190,False,False,313,3,20,42,26,1182232,1865350,2011,2011-04-11 10:08:19,41.785739862,-87.607389268,"(41.785739862, -87.607389268)" +1950234,HH139194,2002-01-18 17:00:00,009XX W HURON ST,0810,THEFT,OVER $500,OTHER,4875,False,False,1323,NA,NA,NA,06,1169707,1905109,2002,2014-04-12 12:43:35,41.895123178,-87.652155546,"(41.895123178, -87.652155546)" +7041908,HR449221,2009-07-26 01:00:00,015XX N OAKLEY BLVD,0810,THEFT,OVER $500,STREET,2985,False,False,1424,14,1,24,06,1160755,1910100,2009,ERROR,41.9090092,-87.684895322,"(41.9090092, -87.684895322)" +6768049,HR182077,2009-02-21 17:10:00,119XX S MICHIGAN AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,1367,False,False,532,5,9,53,14,1178941,1825981,2009,ERROR,41.677782065,-87.620650719,"(41.677782065, -87.620650719)" +3758036,HL123864,2005-01-14 07:45:00,068XX S CARPENTER ST,031A,ROBBERY,ARMED: HANDGUN,STREET,3785,False,False,724,7,17,68,03,1170445,1859718,2005,ERROR,41.770549943,-87.65076972,"(41.770549943, -87.65076972)" +9421792,HW565556,2013-12-10 12:10:00,065XX S SANGAMON ST,0486,BATTERY,DOMESTIC BATTERY SIMPLE,APARTMENT,3539,False,True,723,7,17,68,08B,1171144,1861336,2013,ERROR,41.774974679,-87.648160214,"(41.774974679, -87.648160214)" +7746209,HS553647,2010-10-08 08:30:00,075XX S KINGSTON AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,APARTMENT,1033,False,True,421,4,7,43,14,1194540,1855586,2010,ERROR,41.758652752,-87.562583957,"(41.758652752, -87.562583957)" +3024764,HJ733776,2003-11-01 00:00:00,086XX S HERMITAGE AVE,0610,BURGLARY,FORCIBLE ENTRY,RESIDENCE-GARAGE,4585,False,False,614,6,18,71,05,1166139,1847570,2003,ERROR,41.73730682,-87.666898779,"(41.73730682, -87.666898779)" +6155450,HP244652,2008-03-26 09:00:00,047XX S KEDVALE AVE,0820,THEFT,$500 AND UNDER,VEHICLE NON-COMMERCIAL,11,False,False,815,8,23,57,06,1149453,1872819,2008,ERROR,41.806932525,-87.727380443,"(41.806932525, -87.727380443)" +2806099,HJ459080,2003-06-28 11:01:33,052XX S MARSHFIELD AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,3964,False,False,932,9,16,61,08B,1166277,1869726,2003,ERROR,41.798102902,-87.665763163,"(41.798102902, -87.665763163)" +1454319,G168841,2001-03-24 21:20:00,014XX S LOOMIS ST,2024,NARCOTICS,POSS: HEROIN(WHITE),CHA PARKING LOT/GROUNDS,4558,True,False,1231,NA,NA,NA,18,1167225,1893379,2001,ERROR,41.862988863,-87.661608429,"(41.862988863, -87.661608429)" +5328640,HN178376,2007-02-15 17:43:21,0000X W 47TH ST,1330,CRIMINAL TRESPASS,TO LAND,PARK PROPERTY,1763,True,False,231,2,3,38,26,1176599,1873813,2007,ERROR,41.809091808,-87.627787677,"(41.809091808, -87.627787677)" +5030418,HM631435,2006-09-30 04:01:00,012XX S SAWYER AVE,0560,ASSAULT,SIMPLE,RESIDENCE,1035,True,False,1022,10,24,29,08A,1154859,1893942,2006,2006-06-10 04:52:45,41.86479033,-87.706987824,"(41.86479033, -87.706987824)" +9694653,HX345023,2014-07-14 16:10:00,038XX W CHICAGO AVE,2028,NARCOTICS,POSS: SYNTHETIC DRUGS,OTHER,1780,True,False,1112,11,27,23,18,1150812,1905031,2014,ERROR,41.89529982,-87.7215543,"(41.89529982, -87.7215543)" +2506466,HH847658,2002-12-19 09:26:25,010XX S LOOMIS ST,0460,BATTERY,SIMPLE,SIDEWALK,2190,False,False,1231,NA,2,28,08B,1167166,1895406,2002,ERROR,41.868552388,-87.661766802,"(41.868552388, -87.661766802)" +3995692,HL357532,2005-05-14 23:00:00,106XX S MACKINAW AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,4448,False,False,432,4,10,52,14,1200233,1834857,2005,ERROR,41.70162895,-87.542418081,"(41.70162895, -87.542418081)" +1406698,G119938,2001-03-01 16:31:26,023XX W MADISON ST,0320,ROBBERY,STRONGARM - NO WEAPON,STREET,1768,False,False,1332,NA,NA,NA,03,1161051,1900007,2001,ERROR,41.881307035,-87.684088522,"(41.881307035, -87.684088522)" +2063190,HH283739,2002-04-03 19:45:00,040XX N LINCOLN AV,1330,CRIMINAL TRESPASS,TO LAND,DRUG STORE,622,True,False,1912,NA,NA,NA,26,1162045,1927127,2002,ERROR,41.955705485,-87.679679583,"(41.955705485, -87.679679583)" +2187834,HH444731,2002-06-15 21:22:16,004XX E 75TH ST,0915,MOTOR VEHICLE THEFT,"TRUCK, BUS, MOTOR HOME",STREET,1461,False,False,323,NA,6,69,07,1180456,1855421,2002,ERROR,41.758534647,-87.61420526,"(41.758534647, -87.61420526)" +4856312,HM458067,2006-07-06 11:34:00,037XX S WESTERN AVE,0460,BATTERY,SIMPLE,CTA BUS,2800,False,False,913,9,12,59,08B,1161018,1879907,2006,ERROR,41.826151267,-87.684767164,"(41.826151267, -87.684767164)" +4948851,HM562638,2006-08-25 20:00:00,069XX S LOOMIS BLVD,0890,THEFT,FROM BUILDING,RESIDENCE,3312,False,False,734,7,17,67,06,1168156,1858673,2006,ERROR,41.767731872,-87.65919032,"(41.767731872, -87.65919032)" +6687849,HR102460,2009-01-02 15:29:00,105XX S EGGLESTON AVE,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,SIDEWALK,1562,False,False,2233,22,34,49,18,1175109,1835065,2009,2009-02-01 16:25:12,41.702796067,-87.634407275,"(41.702796067, -87.634407275)" +7550137,HS346624,2010-06-07 05:46:00,007XX W GARFIELD BLVD,0610,BURGLARY,FORCIBLE ENTRY,SMALL RETAIL STORE,4436,False,False,934,9,3,61,05,1172153,1868433,2010,ERROR,41.794427528,-87.644252869,"(41.794427528, -87.644252869)" +8453368,HV131074,2012-01-23 22:00:00,068XX N SHERIDAN RD,0820,THEFT,$500 AND UNDER,STREET,44,False,False,2431,24,49,1,06,1167006,1945516,2012,ERROR,42.006060138,-87.660911233,"(42.006060138, -87.660911233)" +1754134,G565506,2001-09-20 22:05:00,007XX E 111 ST,0460,BATTERY,SIMPLE,POLICE FACILITY/VEH PARKING LOT,715,False,False,531,NA,NA,NA,08B,1183305,1831462,2001,ERROR,41.692722515,-87.604507439,"(41.692722515, -87.604507439)" +2522777,HJ100697,2002-12-31 23:30:00,116XX S VINCENNES AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,2478,False,False,2234,NA,34,75,14,1165846,1827777,2002,ERROR,41.682997842,-87.668532113,"(41.682997842, -87.668532113)" +1864439,G708189,2001-11-25 13:30:00,007XX N LARAMIE AV,0325,ROBBERY,VEHICULAR HIJACKING,ALLEY,1350,False,False,1524,NA,NA,NA,03,1141513,1904551,2001,ERROR,41.894159515,-87.755719492,"(41.894159515, -87.755719492)" +6934825,HR340739,2009-05-25 21:45:00,061XX S RACINE AVE,2027,NARCOTICS,POSS: CRACK,SIDEWALK,1582,True,False,713,7,16,67,18,1169326,1864268,2009,ERROR,41.783059997,-87.654739922,"(41.783059997, -87.654739922)" +7981176,HT213299,2011-03-21 13:59:00,001XX W 35TH ST,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,CTA TRAIN,4539,True,False,924,9,11,34,18,1175731,1881812,2011,ERROR,41.831061278,-87.630731407,"(41.831061278, -87.630731407)" +4065862,HL408235,2005-06-08 22:48:24,002XX W 87TH ST,0840,THEFT,FINANCIAL ID THEFT: OVER $300,WAREHOUSE,3963,False,False,622,6,21,44,06,1176403,1847255,2005,ERROR,41.736218161,-87.629303966,"(41.736218161, -87.629303966)" +2034759,HH247819,2002-03-16 10:00:00,018XX N DRAKE AV,0930,MOTOR VEHICLE THEFT,THEFT/RECOVERY: AUTOMOBILE,STREET,776,False,False,1422,NA,NA,NA,07,1152570,1911949,2002,ERROR,41.914248882,-87.714914388,"(41.914248882, -87.714914388)" +5544920,HN356358,2007-05-21 17:00:00,090XX S LAFLIN ST,2825,OTHER OFFENSE,HARASSMENT BY TELEPHONE,RESIDENCE,3133,False,False,2222,22,21,73,26,1167966,1844587,2007,ERROR,41.729082013,-87.660290623,"(41.729082013, -87.660290623)" +4959301,HM571754,2006-08-29 22:30:00,015XX E 87TH ST,0610,BURGLARY,FORCIBLE ENTRY,SMALL RETAIL STORE,1634,True,False,412,4,8,48,05,1187761,1847553,2006,2008-02-05 01:04:48,41.736773407,-87.587683232,"(41.736773407, -87.587683232)" +7521660,HS325090,2010-05-25 00:00:00,030XX N PARKSIDE AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,3579,False,False,2514,25,31,19,14,1138129,1919810,2010,ERROR,41.93609381,-87.767778496,"(41.93609381, -87.767778496)" +4982342,HM596076,2006-09-12 00:00:00,014XX N DAMEN AVE,0820,THEFT,$500 AND UNDER,VEHICLE NON-COMMERCIAL,35,False,False,1424,14,1,24,06,1162762,1909616,2006,2014-04-12 12:43:35,41.907639198,-87.677536132,"(41.907639198, -87.677536132)" +7403488,HS205438,2010-03-13 04:25:00,080XX S MAY ST,0810,THEFT,OVER $500,STREET,2170,False,False,612,6,21,71,06,1170015,1851280,2010,ERROR,41.74740433,-87.652590689,"(41.74740433, -87.652590689)" +3140084,HK132250,2004-01-18 11:06:46,024XX N RACINE AVE,0460,BATTERY,SIMPLE,STREET,2504,False,False,1933,19,32,7,08B,1167856,1916386,2004,ERROR,41.926108075,-87.658627954,"(41.926108075, -87.658627954)" +5902358,HN700127,2007-11-10 11:00:00,003XX S WACKER DR,0810,THEFT,OVER $500,PARKING LOT/GARAGE(NON.RESID.),749,False,False,112,1,2,32,06,1174015,1898799,2007,2014-04-12 12:43:35,41.877713219,-87.636521697,"(41.877713219, -87.636521697)" +4572931,HM163096,2006-02-04 14:00:00,045XX S WESTERN AVE,0820,THEFT,$500 AND UNDER,PARKING LOT/GARAGE(NON.RESID.),42,False,False,914,9,12,61,06,1161174,1874190,2006,2014-04-12 12:43:35,41.810459905,-87.684353246,"(41.810459905, -87.684353246)" +10012442,HY202116,2015-03-28 21:12:00,050XX N FRANCISCO AVE,2093,NARCOTICS,FOUND SUSPECT NARCOTICS,APARTMENT,1022,True,False,2031,20,40,4,26,1156167,1933292,2015,2015-04-04 12:43:24,41.972743598,-87.701121216,"(41.972743598, -87.701121216)" +6554328,HN700877,2007-11-11 04:00:00,076XX S RHODES AVE,0430,BATTERY,AGGRAVATED: OTHER DANG WEAPON,STREET,4899,False,False,624,6,6,69,04B,1181189,1854379,2007,ERROR,41.755658442,-87.611550936,"(41.755658442, -87.611550936)" +4398984,HL638310,2005-10-05 11:25:00,011XX N MONTICELLO AVE,2095,NARCOTICS,ATTEMPT POSSESSION NARCOTICS,STREET,3766,True,False,1112,11,27,23,18,1151799,1907151,2005,ERROR,41.901097939,-87.717873412,"(41.901097939, -87.717873412)" +2797787,HJ448611,2003-06-23 07:00:00,057XX S ABERDEEN ST,0890,THEFT,FROM BUILDING,STREET,1540,False,False,712,7,16,68,06,1169915,1867003,2003,ERROR,41.79055238,-87.652501059,"(41.79055238, -87.652501059)" +4471342,HL761655,2005-11-29 09:57:17,071XX S LAFAYETTE AVE,1750,OFFENSE INVOLVING CHILDREN,CHILD ABUSE,RESIDENCE,3232,True,False,731,7,6,69,20,1177037,1857432,2005,ERROR,41.764130805,-87.626675,"(41.764130805, -87.626675)" +2751617,HJ389272,2003-05-27 08:16:40,028XX W 24TH BLVD,0460,BATTERY,SIMPLE,"SCHOOL, PUBLIC, BUILDING",2758,False,False,1033,NA,12,30,08B,1157546,1887831,2003,ERROR,41.847966869,-87.697289982,"(41.847966869, -87.697289982)" +8965579,HW113481,2013-01-11 03:00:00,023XX N LOWELL AVE,2820,OTHER OFFENSE,TELEPHONE THREAT,RESIDENCE,3640,False,False,2522,25,31,20,26,1146957,1915184,2013,2013-05-02 14:37:42,41.923235246,-87.735452966,"(41.923235246, -87.735452966)" +5171598,HM762872,2006-12-08 13:45:00,044XX W GLADYS AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,1177,False,True,1131,11,24,26,08B,1146659,1898021,2006,ERROR,41.876143827,-87.736986299,"(41.876143827, -87.736986299)" +5510052,HN329067,2007-05-08 00:30:00,049XX W BELDEN AVE,0890,THEFT,FROM BUILDING,APARTMENT,2656,False,True,2522,25,31,19,06,1142729,1914878,2007,ERROR,41.922475392,-87.750995953,"(41.922475392, -87.750995953)" +6808651,HR218704,2009-03-16 14:17:54,004XX N CENTRAL AVE,0460,BATTERY,SIMPLE,SIDEWALK,2744,False,False,1512,15,29,25,08B,1138919,1902473,2009,ERROR,41.888504748,-87.765297105,"(41.888504748, -87.765297105)" +4991519,HM449098,2006-07-01 22:02:41,071XX S MERRILL AVE,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,SIDEWALK,4231,True,False,333,3,5,43,18,1191746,1858246,2006,ERROR,41.766020241,-87.572737379,"(41.766020241, -87.572737379)" +4052767,HL403567,2005-06-06 19:30:00,025XX S WASHTENAW AVE,0430,BATTERY,AGGRAVATED: OTHER DANG WEAPON,STREET,3538,False,False,1034,10,12,30,04B,1158738,1886739,2005,ERROR,41.844945991,-87.692945166,"(41.844945991, -87.692945166)" +8032674,HT264580,2011-04-21 13:30:00,098XX S ELLIS AVE,0890,THEFT,FROM BUILDING,RESIDENCE,4298,False,False,511,5,8,50,06,1184583,1839875,2011,ERROR,41.715779068,-87.599566057,"(41.715779068, -87.599566057)" +6241707,HP331800,2008-05-12 08:00:00,047XX W HARRISON ST,2825,OTHER OFFENSE,HARASSMENT BY TELEPHONE,APARTMENT,3322,False,False,1131,11,24,25,26,1144898,1896892,2008,ERROR,41.873079106,-87.743480642,"(41.873079106, -87.743480642)" +3134450,HK125197,2004-01-14 12:00:00,064XX S WINCHESTER AVE,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,3991,True,False,726,7,15,67,07,1164415,1862214,2004,ERROR,41.777528496,-87.672803106,"(41.777528496, -87.672803106)" +1329888,G024689,2001-01-12 11:00:00,109XX S EDBROOKE AV,4650,OTHER OFFENSE,SEX OFFENDER: FAIL TO REGISTER,RESIDENCE,3264,True,False,513,NA,NA,NA,26,1179220,1832688,2001,ERROR,41.696180708,-87.619426047,"(41.696180708, -87.619426047)" +5756722,HN564951,2007-09-02 06:30:00,014XX W 77TH ST,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,2012,False,False,612,6,17,71,14,1167956,1853723,2007,2007-06-09 01:56:11,41.754152713,-87.660065416,"(41.754152713, -87.660065416)" +8280908,HT515268,2011-09-26 15:06:00,057XX S SACRAMENTO AVE,0610,BURGLARY,FORCIBLE ENTRY,APARTMENT,4992,False,False,824,8,14,63,05,1157396,1866517,2011,2011-01-10 09:51:22,41.789481609,-87.69841849,"(41.789481609, -87.69841849)" +7835980,HS637015,2010-11-28 22:35:00,103XX S ALBANY AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,4609,False,True,2211,22,19,74,08B,1157431,1835903,2010,2010-08-12 16:32:38,41.705471163,-87.699117536,"(41.705471163, -87.699117536)" +3607193,HK688263,2004-10-15 11:56:00,081XX S WOODLAWN AVE,0915,MOTOR VEHICLE THEFT,"TRUCK, BUS, MOTOR HOME",STREET,756,False,False,411,4,8,45,07,1185584,1851347,2004,ERROR,41.74723602,-87.595539795,"(41.74723602, -87.595539795)" +9468000,HX121120,2014-01-18 23:00:00,015XX S KEDZIE AVE,0820,THEFT,$500 AND UNDER,RESIDENCE,155,False,False,1022,10,24,29,06,1155311,1892547,2014,ERROR,41.860953237,-87.705365981,"(41.860953237, -87.705365981)" +6576153,HP648649,2008-10-25 10:30:00,041XX W POTOMAC AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,4740,False,False,2534,25,37,23,14,1148653,1908301,2008,ERROR,41.904315009,-87.729399290999993,"(41.904315009, -87.729399291)" +3864612,HL239886,2005-01-21 00:01:00,100XX W OHARE ST,0890,THEFT,FROM BUILDING,AIRPORT/AIRCRAFT,4122,False,False,1651,16,41,76,06,1100635,1934208,2005,ERROR,41.976200173,-87.905312411,"(41.976200173, -87.905312411)" +6466118,HP543667,2008-08-30 13:24:00,001XX N STATE ST,0860,THEFT,RETAIL THEFT,DEPARTMENT STORE,3056,True,False,122,1,42,32,06,1176390,1900949,2008,2008-02-09 08:07:10,41.883559699,-87.627736496,"(41.883559699, -87.627736496)" +5519425,HL290196,2005-04-12 11:30:00,010XX N RIDGEWAY AVE,2092,NARCOTICS,SOLICIT NARCOTICS ON PUBLICWAY,ALLEY,2680,True,False,1112,NA,27,23,26,NA,NA,2005,2007-08-08 02:59:32,NA,NA, +2939383,HJ625230,2003-09-11 10:00:00,021XX N DAMEN AVE,2820,OTHER OFFENSE,TELEPHONE THREAT,RESIDENCE,3838,False,False,1432,14,32,22,26,1162713,1914372,2003,ERROR,41.92069102,-87.677582552,"(41.92069102, -87.677582552)" +2424495,HH744202,2001-10-19 13:00:00,073XX S HALSTED ST,1120,DECEPTIVE PRACTICE,FORGERY,CURRENCY EXCHANGE,4149,False,False,733,NA,17,68,10,1172207,1855826,2001,ERROR,41.759831266,-87.644425197,"(41.759831266, -87.644425197)" +9212260,HW358008,2013-07-11 15:00:00,052XX W LE MOYNE ST,0810,THEFT,OVER $500,APARTMENT,4849,False,True,2532,25,37,25,06,1141354,1909518,2013,2013-12-07 09:06:47,41.907792476,-87.756180729,"(41.907792476, -87.756180729)" +4506402,HL736000,2005-11-15 03:42:50,0000X E BURTON PL,2022,NARCOTICS,POSS: COCAINE,STREET,2650,True,False,1824,18,43,8,18,1176556,1910448,2005,ERROR,41.909621673,-87.626839707,"(41.909621673, -87.626839707)" +1344183,G043772,2001-01-21 16:50:00,042XX S WENTWORTH AV,1330,CRIMINAL TRESPASS,TO LAND,GAS STATION,3960,False,False,935,NA,NA,NA,26,1175608,1876581,2001,ERROR,41.816709722,-87.631339516,"(41.816709722, -87.631339516)" +1563501,G320369,2001-06-03 04:40:00,035XX S FEDERAL ST,0460,BATTERY,SIMPLE,CHA APARTMENT,791,False,True,211,NA,NA,NA,08B,1176255,1881268,2001,ERROR,41.829556721,-87.628825201,"(41.829556721, -87.628825201)" +3340028,HK377408,2004-05-20 20:54:54,007XX S WESTERN AVE,1330,CRIMINAL TRESPASS,TO LAND,GROCERY FOOD STORE,555,True,False,1224,12,2,28,26,1160541,1896784,2004,ERROR,41.872473399,-87.68605047,"(41.872473399, -87.68605047)" +9985418,HY175099,2015-03-06 23:40:00,015XX N WELLS ST,1150,DECEPTIVE PRACTICE,CREDIT CARD FRAUD,RESTAURANT,3210,False,False,1821,18,43,8,11,1174460,1910637,2015,ERROR,41.910187414,-87.634533777,"(41.910187414, -87.634533777)" +5212650,HM793429,2006-12-24 11:45:00,041XX W VAN BUREN ST,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,1567,False,False,1132,11,24,26,14,1148616,1897735,2006,2007-02-01 06:08:05,41.875321473,-87.729808188,"(41.875321473, -87.729808188)" +10002890,HY192231,2015-03-20 16:27:00,033XX W 60TH ST,2826,OTHER OFFENSE,HARASSMENT BY ELECTRONIC MEANS,RESIDENCE,509,False,False,822,8,16,66,26,1154876,1864671,2015,ERROR,41.784466611,-87.70770788,"(41.784466611, -87.70770788)" +6237879,HP323989,2008-05-08 10:35:00,053XX S WESTERN BLVD,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,PARKING LOT/GARAGE(NON.RESID.),2025,False,False,915,9,16,63,07,1161471,1869210,2008,2008-11-05 13:01:30,41.796788001,-87.683402001,"(41.796788001, -87.683402001)" +9198183,HW343691,2013-07-01 12:30:00,078XX S LAFLIN ST,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,1113,False,False,612,6,17,71,14,1167515,1852777,2013,2013-02-07 08:31:12,41.751566217,-87.661708602,"(41.751566217, -87.661708602)" +9914993,HY104705,2015-01-05 05:00:00,045XX S DREXEL BLVD,0820,THEFT,$500 AND UNDER,APARTMENT,127,False,False,221,2,4,39,06,1182916,1875077,2015,2015-12-01 12:48:04,41.812415676,-87.604579073,"(41.812415676, -87.604579073)" +5812687,HN606869,2007-06-14 15:00:00,056XX S DORCHESTER AVE,0890,THEFT,FROM BUILDING,GAS STATION,2970,False,False,2133,2,5,41,06,1186553,1867773,2007,2007-10-10 01:49:09,41.792287561,-87.591469992,"(41.792287561, -87.591469992)" +1758189,G568662,2001-09-22 11:17:43,031XX W 26 ST,5001,OTHER OFFENSE,OTHER CRIME INVOLVING PROPERTY,PARKING LOT/GARAGE(NON.RESID.),992,True,False,1033,NA,NA,NA,26,1156100,1886534,2001,ERROR,41.844437017,-87.70263184,"(41.844437017, -87.70263184)" +6402809,HP474280,2008-07-23 16:00:00,089XX S YATES BLVD,0842,THEFT,AGG: FINANCIAL ID THEFT,RESIDENCE,1990,False,False,413,4,7,48,06,1193691,1845865,2008,2008-08-08 18:07:56,41.731998345,-87.566013112,"(41.731998345, -87.566013112)" +5475427,HN298043,2007-04-22 08:35:00,053XX S KEDZIE AVE,1513,PROSTITUTION,SOLICIT FOR BUSINESS,STREET,1380,True,False,911,9,14,63,16,1155993,1869052,2007,ERROR,41.796466324,-87.703494798,"(41.796466324, -87.703494798)" +1523992,G255343,2001-05-04 09:55:00,056XX S ROCKWELL ST,141C,WEAPONS VIOLATION,UNLAWFUL USE OTHER DANG WEAPON,"SCHOOL, PUBLIC, BUILDING",3922,True,False,824,NA,NA,NA,15,1159962,1867094,2001,ERROR,41.791012589,-87.688993852,"(41.791012589, -87.688993852)" +2921705,HJ600586,2003-09-01 01:00:00,023XX N KARLOV AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,3929,False,True,2525,25,31,20,08B,1148703,1915194,2003,ERROR,41.923229102,-87.729037228,"(41.923229102, -87.729037228)" +1854395,G695770,2001-11-19 10:10:00,066XX S PULASKI RD,0810,THEFT,OVER $500,COMMERCIAL / BUSINESS OFFICE,3532,False,False,833,NA,NA,NA,06,1150890,1860070,2001,2014-04-12 12:43:35,41.771919396,-87.722442165,"(41.771919396, -87.722442165)" +1908796,G765379,2001-12-23 04:20:00,055XX W VAN BUREN ST,0460,BATTERY,SIMPLE,RESIDENCE,1688,False,False,1522,NA,NA,NA,08B,1139450,1897421,2001,ERROR,41.874631745,-87.763470245,"(41.874631745, -87.763470245)" +8164922,HT399379,2011-07-15 23:40:00,076XX S CICERO AVE,0560,ASSAULT,SIMPLE,STREET,1389,False,False,833,8,13,65,08A,1145766,1853738,2011,ERROR,41.75464162,-87.741385158,"(41.75464162, -87.741385158)" +3254937,HK279665,2004-04-03 10:00:00,065XX N BOSWORTH AVE,0610,BURGLARY,FORCIBLE ENTRY,RESIDENCE,3491,False,False,2432,24,40,1,05,1164802,1943333,2004,ERROR,42.000117152,-87.669082287,"(42.000117152, -87.669082287)" +5390304,HN233940,2007-03-18 19:50:00,006XX N ALBANY AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,VEHICLE NON-COMMERCIAL,1362,False,True,1313,12,27,23,08B,1155550,1904304,2007,ERROR,41.893210839,-87.704172295,"(41.893210839, -87.704172295)" +8413638,HT647149,2011-12-25 17:30:00,069XX S CAMPBELL AVE,0330,ROBBERY,AGGRAVATED,SIDEWALK,1377,False,False,832,8,15,66,03,1160874,1858299,2011,ERROR,41.766859084,-87.685892542,"(41.766859084, -87.685892542)" +9527581,HX181802,2014-03-12 12:15:00,054XX S WINCHESTER AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,1147,False,True,932,9,16,61,08B,1164316,1868765,2014,ERROR,41.795507366,-87.672981591,"(41.795507366, -87.672981591)" +5133690,HM731231,2006-11-20 14:00:00,073XX N HARLEM AVE,2820,OTHER OFFENSE,TELEPHONE THREAT,RESIDENCE,2303,False,False,1611,16,41,9,26,1127349,1948389,2006,ERROR,42.014705871,-87.806751157,"(42.014705871, -87.806751157)" +1995039,HH153002,2002-01-28 07:00:00,074XX N DAMEN AV,0460,BATTERY,SIMPLE,RESIDENCE,794,False,True,2424,NA,NA,NA,08B,1161699,1949553,2002,ERROR,42.01725048,-87.680322966,"(42.01725048, -87.680322966)" +4296516,HL531043,2005-08-05 23:09:43,006XX N CENTRAL PARK AVE,2024,NARCOTICS,POSS: HEROIN(WHITE),STREET,2630,True,False,1122,11,27,23,18,1152231,1903962,2005,ERROR,41.892338494,-87.716370862,"(41.892338494, -87.716370862)" +5458813,HN287100,2007-04-16 17:45:00,051XX S ASHLAND AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,PARKING LOT/GARAGE(NON.RESID.),4687,True,True,932,9,16,61,08B,1166579,1870797,2007,ERROR,41.801035411,-87.66462512,"(41.801035411, -87.66462512)" +1556046,G312776,2001-05-30 16:45:00,014XX E 69 ST,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE PORCH/HALLWAY,1587,False,False,332,NA,NA,NA,14,1187298,1859575,2001,ERROR,41.769773909,-87.588998442,"(41.769773909, -87.588998442)" +6713807,HR129777,2009-01-19 21:00:00,020XX N MOZART ST,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,4049,False,False,1414,14,35,22,14,1157024,1913723,2009,ERROR,41.919027585,-87.698502808,"(41.919027585, -87.698502808)" +1940740,HH119927,2002-01-11 12:00:00,047XX S UNION AV,0460,BATTERY,SIMPLE,"SCHOOL, PUBLIC, BUILDING",3229,True,False,935,NA,NA,NA,08B,1172475,1873203,2002,ERROR,41.807509816,-87.642931616,"(41.807509816, -87.642931616)" +3362955,HK409648,2004-06-04 17:00:00,055XX W QUINCY ST,051A,ASSAULT,AGGRAVATED: HANDGUN,STREET,3449,False,False,1522,15,29,25,04A,1139492,1898492,2004,ERROR,41.877569945,-87.763289921,"(41.877569945, -87.763289921)" +1892993,G744161,2001-12-12 11:40:00,077XX W HOWARD ST,0840,THEFT,FINANCIAL ID THEFT: OVER $300,RESIDENCE,2824,False,False,1611,NA,NA,NA,06,1123943,1949779,2001,ERROR,42.018576967,-87.819253498,"(42.018576967, -87.819253498)" +4987543,HM599912,2006-09-13 23:41:57,032XX S LITUANICA AVE,1305,CRIMINAL DAMAGE,CRIMINAL DEFACEMENT,PARKING LOT/GARAGE(NON.RESID.),2748,True,False,924,9,11,60,14,1170787,1883697,2006,ERROR,41.836343419,-87.648816066,"(41.836343419, -87.648816066)" +8978243,HW122178,2013-01-04 11:00:00,017XX N LOTUS AVE,2825,OTHER OFFENSE,HARASSMENT BY TELEPHONE,RESIDENCE,2463,False,False,2532,25,37,25,26,1139764,1910834,2013,2013-12-02 12:25:23,41.91143294,-87.761989425,"(41.91143294, -87.761989425)" +9287934,HW432629,2013-09-01 03:30:00,023XX S HOMAN AVE,0460,BATTERY,SIMPLE,SIDEWALK,2341,False,False,1024,10,22,30,08B,1154021,1888439,2013,2013-02-09 12:27:03,41.849706206,-87.710210751,"(41.849706206, -87.710210751)" +3601383,HK694936,2004-09-18 00:00:00,002XX N KILBOURN AVE,1150,DECEPTIVE PRACTICE,CREDIT CARD FRAUD,RESIDENCE,3628,False,False,1113,11,28,26,11,1146400,1900624,2004,ERROR,41.883291699,-87.737870956,"(41.883291699, -87.737870956)" +7719567,HS527233,2010-09-21 20:50:00,051XX W WELLINGTON AVE,4387,OTHER OFFENSE,VIOLATE ORDER OF PROTECTION,RESIDENCE,3751,False,True,2521,25,31,19,26,1141674,1919503,2010,2010-11-10 15:54:50,41.935186459,-87.754757729,"(41.935186459, -87.754757729)" +6550412,HP624139,2008-10-13 00:00:37,052XX S MARSHFIELD AVE,143A,WEAPONS VIOLATION,UNLAWFUL POSS OF HANDGUN,STREET,2524,True,False,932,9,16,61,15,1166269,1870015,2008,ERROR,41.798896123,-87.66578427,"(41.798896123, -87.66578427)" +2902949,HJ579061,2003-07-16 15:58:00,046XX W 55TH ST,1206,DECEPTIVE PRACTICE,"THEFT BY LESSEE,MOTOR VEH",OTHER,4441,True,False,813,8,23,56,11,1146337,1867704,2003,ERROR,41.792955883,-87.738938839,"(41.792955883, -87.738938839)" +3505136,HK581743,2004-08-25 18:04:00,071XX W 64TH PL,2825,OTHER OFFENSE,HARASSMENT BY TELEPHONE,RESIDENCE,4733,False,False,812,8,23,64,26,1129743,1860965,2004,ERROR,41.774761494,-87.799941841,"(41.774761494, -87.799941841)" +8081212,HT310002,2011-05-23 11:30:00,046XX N SHERIDAN RD,0460,BATTERY,SIMPLE,SIDEWALK,3485,False,False,2312,19,46,3,08B,1168819,1931361,2011,ERROR,41.967179243,-87.654653712,"(41.967179243, -87.654653712)" +1652291,G430211,2001-07-22 12:15:00,012XX N PARKSIDE AV,2230,LIQUOR LAW VIOLATION,ILLEGAL CONSUMPTION BY MINOR,STREET,1369,True,False,2531,NA,NA,NA,22,1138416,1907506,2001,ERROR,41.902325047,-87.767022333,"(41.902325047, -87.767022333)" +7784284,HS576050,2010-10-21 19:27:56,008XX E 89TH ST,2027,NARCOTICS,POSS: CRACK,APARTMENT,4100,True,False,632,6,8,44,18,1183562,1846188,2010,2010-10-11 15:04:15,41.733126496,-87.603109289,"(41.733126496, -87.603109289)" +4392495,HL685535,2005-10-18 07:00:00,008XX N LATROBE AVE,0810,THEFT,OVER $500,STREET,4453,False,False,1524,15,37,25,06,1141162,1905112,2005,2014-04-12 12:43:35,41.895705443,-87.756994782,"(41.895705443, -87.756994782)" +8322510,HT548001,2011-10-17 17:30:00,067XX S CLYDE AVE,2820,OTHER OFFENSE,TELEPHONE THREAT,APARTMENT,4763,False,False,331,3,5,43,26,1191419,1860438,2011,ERROR,41.772043187,-87.573864982,"(41.772043187, -87.573864982)" +5784220,HN581658,2007-06-08 23:40:00,003XX S WASHTENAW AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,SIDEWALK,2376,False,True,1125,11,2,27,08B,1158395,1898272,2007,ERROR,41.876600753,-87.693888703,"(41.876600753, -87.693888703)" +1473650,G192572,2001-04-05 10:10:00,028XX W ARTHINGTON ST,2024,NARCOTICS,POSS: HEROIN(WHITE),STREET,1925,True,False,1135,NA,NA,NA,18,1157618,1895874,2001,ERROR,41.870036252,-87.6968069,"(41.870036252, -87.6968069)" +7157534,HR565848,2009-10-01 15:40:00,079XX S DAMEN AVE,0320,ROBBERY,STRONGARM - NO WEAPON,SIDEWALK,531,False,False,611,6,18,71,03,1164362,1852231,2009,2009-10-10 16:21:59,41.750134873,-87.673278237,"(41.750134873, -87.673278237)" +3712271,HK684159,2004-10-13 13:15:00,072XX S SOUTH CHICAGO AVE,5011,OTHER OFFENSE,LICENSE VIOLATION,RESIDENCE-GARAGE,824,False,False,323,3,5,69,26,1183382,1857501,2004,2007-11-06 15:52:33,41.764174754,-87.603417126,"(41.764174754, -87.603417126)" +1741181,G550640,2001-09-12 14:00:00,021XX W RANDOLPH ST,1750,OFFENSE INVOLVING CHILDREN,CHILD ABUSE,RESIDENCE,4543,False,True,1332,NA,NA,NA,20,1162226,1901155,2001,ERROR,41.884432772,-87.679741878,"(41.884432772, -87.679741878)" +6882076,HR288440,2009-04-25 18:00:00,046XX S RICHMOND ST,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,4485,False,False,912,9,14,58,14,1157528,1873541,2009,ERROR,41.80875374,-87.697744048,"(41.80875374, -87.697744048)" +8303183,HT520944,2011-09-30 03:15:00,002XX E 121ST PL,0486,BATTERY,DOMESTIC BATTERY SIMPLE,APARTMENT,2521,False,False,532,5,9,53,08B,1180264,1824414,2011,ERROR,41.673451854,-87.615855891,"(41.673451854, -87.615855891)" +9010374,HW157593,2013-02-15 12:30:00,051XX S CALIFORNIA AVE,0820,THEFT,$500 AND UNDER,PARKING LOT/GARAGE(NON.RESID.),94,False,False,923,9,14,63,06,1158620,1870342,2013,ERROR,41.799953035,-87.693826098,"(41.799953035, -87.693826098)" +7689122,HS495203,2010-08-31 19:00:00,003XX E OHIO ST,1150,DECEPTIVE PRACTICE,CREDIT CARD FRAUD,RESIDENCE,4329,False,False,1834,18,42,8,11,1178952,1904236,2010,ERROR,41.892521195,-87.618228164,"(41.892521195, -87.618228164)" +1438982,G153765,2001-03-17 23:38:07,062XX S ST LAWRENCE AV,1821,NARCOTICS,MANU/DEL:CANNABIS 10GM OR LESS,STREET,4128,True,False,313,NA,NA,NA,18,1181276,1863401,2001,ERROR,41.780413719,-87.610954415,"(41.780413719, -87.610954415)" +9340354,HW484281,2013-10-07 23:00:00,096XX S WENTWORTH AVE,0610,BURGLARY,FORCIBLE ENTRY,RESIDENCE-GARAGE,2824,False,False,511,5,21,49,05,1176693,1840729,2013,ERROR,41.718303448,-87.628437301,"(41.718303448, -87.628437301)" +3044554,HJ746479,2003-11-08 10:25:00,018XX W 51ST ST,2017,NARCOTICS,MANU/DELIVER:CRACK,SIDEWALK,1194,True,False,932,9,16,61,18,1165175,1870833,2003,ERROR,41.801164057,-87.669773064,"(41.801164057, -87.669773064)" +6080834,HP159980,2008-02-05 10:10:00,010XX N HUDSON AVE,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,STREET,964,True,False,1823,18,27,8,18,1172947,1907120,2008,ERROR,41.900570272,-87.640196289,"(41.900570272, -87.640196289)" +4594393,HM187557,2006-02-18 03:50:00,027XX N MILWAUKEE AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,OTHER,4685,False,False,1412,14,35,22,14,1153678,1918136,2006,2014-04-12 12:43:35,41.931204528,-87.710678708,"(41.931204528, -87.710678708)" +9681055,HX331130,2014-07-04 15:00:00,021XX W PETERSON AVE,0860,THEFT,RETAIL THEFT,DEPARTMENT STORE,4484,True,False,2413,24,40,2,06,1161031,1939882,2014,2014-11-07 12:39:31,41.990726931,-87.683051337,"(41.990726931, -87.683051337)" +6696343,HR110836,2009-01-07 19:30:00,021XX W SHAKESPEARE AVE,0320,ROBBERY,STRONGARM - NO WEAPON,STREET,3344,False,False,1432,14,32,22,03,1161425,1914413,2009,2009-03-02 19:02:28,41.920830456,-87.682313785,"(41.920830456, -87.682313785)" +7313029,HS117588,2010-01-13 00:21:00,032XX N CLARK ST,2022,NARCOTICS,POSS: COCAINE,STREET,4814,True,False,1924,19,44,6,18,1169902,1921495,2010,ERROR,41.94008298,-87.650960519,"(41.94008298, -87.650960519)" +8914447,HV587762,2012-12-03 19:40:00,077XX S ASHLAND AVE,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,SIDEWALK,4861,True,False,612,6,17,71,18,1167067,1853091,2012,2012-03-12 20:28:11,41.752437462,-87.663341352,"(41.752437462, -87.663341352)" +8813683,HV486788,2012-09-22 09:00:00,017XX E 56TH ST,0890,THEFT,FROM BUILDING,APARTMENT,3006,False,False,235,2,5,41,06,1188630,1868244,2012,ERROR,41.793530583,-87.583839014,"(41.793530583, -87.583839014)" +2915956,HJ592169,2003-08-28 08:00:00,078XX S GREENWOOD AVE,0560,ASSAULT,SIMPLE,RESIDENCE,3119,False,False,624,6,8,69,08A,1184870,1853297,2003,2007-11-06 15:52:33,41.752603788,-87.598095,"(41.752603788, -87.598095)" +5426156,HN256370,2007-03-29 18:30:00,0000X W CERMAK RD,0810,THEFT,OVER $500,STREET,1448,False,False,134,1,3,33,06,1176378,1889737,2007,2014-04-12 12:43:35,41.852793534,-87.628118788,"(41.852793534, -87.628118788)" +1331639,G028143,2001-01-12 21:00:00,034XX S KING DR,0820,THEFT,$500 AND UNDER,DRUG STORE,282,True,False,2122,NA,NA,NA,06,1179512,1882402,2001,2014-04-12 12:43:35,41.832594585,-87.616840751,"(41.832594585, -87.616840751)" +1947050,HH132691,2002-01-17 18:49:57,005XX E 44 PL,0460,BATTERY,SIMPLE,RESIDENCE,4529,False,False,222,NA,NA,NA,08B,1180563,1875665,2002,ERROR,41.814083626,-87.613191703,"(41.814083626, -87.613191703)" +2490949,HH828905,2002-12-07 18:00:00,008XX W 53RD ST,1150,DECEPTIVE PRACTICE,CREDIT CARD FRAUD,RESIDENCE,2258,False,False,934,NA,3,61,11,1171449,1869703,2002,ERROR,41.797928002,-87.646797215,"(41.797928002, -87.646797215)" +5985175,HN780490,2007-12-27 17:30:00,019XX E 79TH ST,031A,ROBBERY,ARMED: HANDGUN,OTHER,2491,True,False,414,4,8,43,03,1190626,1853018,2007,ERROR,41.751701272,-87.577010969,"(41.751701272, -87.577010969)" +2817048,HJ473101,2003-07-04 23:55:30,050XX N WESTERN AVE,0610,BURGLARY,FORCIBLE ENTRY,APARTMENT,1995,False,False,2031,20,47,4,05,1159496,1933143,2003,ERROR,41.972266669,-87.688883926,"(41.972266669, -87.688883926)" +9456119,HX108965,2014-01-10 01:04:00,075XX S LAFAYETTE AVE,2028,NARCOTICS,POSS: SYNTHETIC DRUGS,STREET,1608,True,False,623,6,6,69,18,1177099,1855191,2014,2014-12-01 00:40:28,41.757979849,-87.626515246,"(41.757979849, -87.626515246)" +2798720,HJ444156,2003-06-21 15:58:37,001XX W LAKE ST,0312,ROBBERY,ARMED:KNIFE/CUTTING INSTRUMENT,CTA PLATFORM,1268,False,False,113,1,42,32,03,1175497,1901776,2003,ERROR,41.885849135,-87.630990773,"(41.885849135, -87.630990773)" +7499449,HS302738,2010-05-11 17:56:00,045XX N BROADWAY,0486,BATTERY,DOMESTIC BATTERY SIMPLE,STREET,2688,False,False,2311,19,46,3,08B,1168079,1930569,2010,2010-12-05 14:32:35,41.965022021,-87.65739756,"(41.965022021, -87.65739756)" +3967996,HL332690,2005-05-03 13:20:00,014XX S CHRISTIANA AVE,0545,ASSAULT,PRO EMP HANDS NO/MIN INJURY,"SCHOOL, PUBLIC, BUILDING",2513,True,False,1021,10,24,29,08A,1154231,1892646,2005,ERROR,41.861246512,-87.709327807,"(41.861246512, -87.709327807)" +8209042,HT442926,2011-08-11 14:41:00,068XX S WOLCOTT AVE,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,STREET,1871,True,False,726,7,17,67,18,1164911,1859184,2011,2011-11-08 15:42:15,41.769203304,-87.6710703,"(41.769203304, -87.6710703)" +4973670,HM585353,2006-09-06 07:50:00,094XX S LAFAYETTE AVE,0810,THEFT,OVER $500,STREET,4120,False,False,634,6,21,49,06,1177555,1842613,2006,2014-04-12 12:43:35,41.723453982,-87.625223371,"(41.723453982, -87.625223371)" +1393322,G107984,2001-02-22 22:15:00,087XX S PEORIA ST,0271,CRIM SEXUAL ASSAULT,ATTEMPT AGG: HANDGUN,STREET,1517,False,False,2222,NA,NA,NA,02,1171783,1847121,2001,ERROR,41.735952909,-87.646233916,"(41.735952909, -87.646233916)" +9297259,HW442278,2013-09-07 15:30:00,059XX S ELIZABETH ST,0560,ASSAULT,SIMPLE,RESIDENCE,1658,False,False,713,7,16,67,08A,1168974,1865056,2013,2013-10-09 09:12:36,41.785229979,-87.656007708,"(41.785229979, -87.656007708)" +8764812,HV435925,2012-08-17 15:00:00,053XX S MONITOR AVE,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,2173,False,False,811,8,23,56,07,1138309,1868694,2012,ERROR,41.795821159,-87.768353304,"(41.795821159, -87.768353304)" +6872272,HR278952,2009-04-21 02:08:00,083XX S KEDZIE AVE,0610,BURGLARY,FORCIBLE ENTRY,BARBERSHOP,2575,False,False,834,8,18,70,05,1156456,1849198,2009,ERROR,41.741974607,-87.702331067,"(41.741974607, -87.702331067)" +3886460,HL262763,2005-03-29 08:00:00,062XX W DICKENS AVE,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,926,False,False,2512,25,29,19,07,1134702,1913339,2005,ERROR,41.918397987,-87.780526574,"(41.918397987, -87.780526574)" +9247581,HW393661,2013-08-04 23:33:00,083XX S DORCHESTER AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,STREET,2059,True,True,412,4,8,45,08B,1187024,1850166,2013,2013-05-08 05:38:09,41.743961235,-87.590300673,"(41.743961235, -87.590300673)" +6240467,HP328601,2008-05-09 00:00:00,038XX N PACIFIC AVE,0890,THEFT,FROM BUILDING,RESIDENCE,957,False,False,1631,16,36,17,06,1122068,1924371,2008,2008-11-05 08:02:48,41.948885353,-87.82670641,"(41.948885353, -87.82670641)" +2325815,HH620831,2002-08-29 18:30:00,009XX E 82ND ST,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,1157,False,False,631,NA,8,44,14,1184144,1850866,2002,ERROR,41.745949866,-87.600831299,"(41.745949866, -87.600831299)" +1481452,G218910,2001-04-14 10:15:00,017XX W 43 ST,0820,THEFT,$500 AND UNDER,STREET,248,False,False,914,NA,NA,NA,06,1165712,1876148,2001,2014-04-12 12:43:35,41.815737633,-87.667652714,"(41.815737633, -87.667652714)" +2193379,HH452636,2002-06-19 11:09:24,027XX E 76TH ST,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,509,False,False,421,NA,7,43,14,1195835,1855198,2002,ERROR,41.757556115,-87.557850794,"(41.757556115, -87.557850794)" +6970254,HR375030,2009-06-14 14:15:00,052XX W WOLFRAM ST,0620,BURGLARY,UNLAWFUL ENTRY,RESIDENCE,683,False,False,2514,25,31,19,05,1140877,1918484,2009,ERROR,41.932404942,-87.757711919,"(41.932404942, -87.757711919)" +7626585,HS431129,2010-07-26 19:16:00,012XX W WASHBURNE AVE,2220,LIQUOR LAW VIOLATION,ILLEGAL POSSESSION BY MINOR,STREET,4211,True,False,1231,12,2,28,22,1168368,1894493,2010,ERROR,41.866021153,-87.65738041,"(41.866021153, -87.65738041)" +8990632,HW137651,2013-01-30 12:12:00,060XX S TALMAN AVE,0610,BURGLARY,FORCIBLE ENTRY,RESIDENCE,1914,True,False,825,8,15,66,05,1159702,1864538,2013,2013-05-02 08:59:06,41.784003919,-87.690017346,"(41.784003919, -87.690017346)" +3647659,HK742033,2004-11-10 09:15:00,062XX S COTTAGE GROVE AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,STREET,3824,False,True,313,3,20,42,08B,1182595,1863841,2004,ERROR,41.781590611,-87.606105147,"(41.781590611, -87.606105147)" +6003770,HP103458,2008-01-03 00:06:00,056XX S TRIPP AVE,143A,WEAPONS VIOLATION,UNLAWFUL POSS OF HANDGUN,SIDEWALK,2815,True,False,813,8,13,62,15,1148949,1867064,2008,2008-09-01 10:07:35,41.791149667,-87.729377285,"(41.791149667, -87.729377285)" +6025842,HP129074,2008-01-02 16:00:00,069XX S KIMBARK AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,3731,False,False,321,3,5,69,14,1185895,1859153,2008,ERROR,41.768649107,-87.59415445,"(41.768649107, -87.59415445)" +4800609,HM411215,2006-05-17 20:00:00,114XX S DR MARTIN LUTHER KING JR DR,2825,OTHER OFFENSE,HARASSMENT BY TELEPHONE,RESIDENCE,3162,False,True,531,5,9,49,26,1180987,1829335,2006,ERROR,41.686939238,-87.613059096,"(41.686939238, -87.613059096)" +1666539,G443084,2001-07-27 21:11:26,048XX W FLETCHER ST,0460,BATTERY,SIMPLE,RESIDENCE,2067,True,False,2521,NA,NA,NA,08B,1143266,1920538,2001,ERROR,41.937996967,-87.748881061,"(41.937996967, -87.748881061)" +5182497,HM771133,2006-12-13 02:45:33,037XX W ROOSEVELT RD,0460,BATTERY,SIMPLE,STREET,1387,False,False,1011,10,24,29,08B,1151547,1894410,2006,2007-11-06 15:52:33,41.866140241,-87.719133978,"(41.866140241, -87.719133978)" +2653415,HJ264288,2003-03-27 17:55:45,035XX S RHODES AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,APARTMENT,1255,False,False,212,NA,4,35,08B,1180131,1881336,2003,ERROR,41.829655213,-87.614602295,"(41.829655213, -87.614602295)" +1351172,G053225,2001-01-25 20:00:00,023XX W CULLERTON ST,0820,THEFT,$500 AND UNDER,STREET,16,False,False,1223,NA,NA,NA,06,1161315,1890317,2001,2014-04-12 12:43:35,41.854711274,-87.683388522,"(41.854711274, -87.683388522)" +10107538,HY295865,2015-06-10 18:55:00,031XX W VAN BUREN ST,2024,NARCOTICS,POSS: HEROIN(WHITE),PARK PROPERTY,515,True,False,1134,11,28,27,18,1155706,1897956,2015,ERROR,41.875788166,-87.703770398,"(41.875788166, -87.703770398)" +2379764,HH688374,2002-10-02 22:17:34,012XX E 93RD ST,0560,ASSAULT,SIMPLE,OTHER,3430,False,True,413,NA,8,47,08A,1186314,1843608,2002,ERROR,41.725982183,-87.593108809,"(41.725982183, -87.593108809)" +2267732,HH544517,2002-07-29 18:20:00,024XX N MONTICELLO AVE,0460,BATTERY,SIMPLE,APARTMENT,1972,False,False,2524,NA,35,22,08B,1151599,1915885,2002,ERROR,41.925068771,-87.718378015,"(41.925068771, -87.718378015)" +9401609,HW544488,2013-11-22 15:00:00,022XX W 47TH ST,2825,OTHER OFFENSE,HARASSMENT BY TELEPHONE,RESIDENCE,1599,False,True,931,9,12,61,26,1161952,1873419,2013,ERROR,41.80832803,-87.681521068,"(41.80832803, -87.681521068)" +1724872,G526711,2001-09-02 23:30:00,008XX W BARRY AV,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,1898,False,False,1932,NA,NA,NA,07,1170165,1920835,2001,ERROR,41.938266163,-87.650013252,"(41.938266163, -87.650013252)" +7236503,HR651141,2009-11-19 12:30:00,045XX N KEDZIE AVE,0843,THEFT,ATTEMPT FINANCIAL IDENTITY THEFT,RESIDENCE,1452,False,False,1724,17,33,14,06,1154268,1930085,2009,ERROR,41.963981641,-87.708190292,"(41.963981641, -87.708190292)" +4531738,HM116986,2006-01-10 17:40:00,018XX W ADDISON ST,0460,BATTERY,SIMPLE,STREET,1107,False,False,1923,19,47,5,08B,1163300,1923889,2006,ERROR,41.94679389,-87.675157351,"(41.94679389, -87.675157351)" +6323346,HP407292,2008-06-21 01:08:00,027XX W 79TH ST,1220,DECEPTIVE PRACTICE,THEFT OF LOST/MISLAID PROP,ALLEY,1728,True,False,835,8,18,70,11,1159359,1852062,2008,ERROR,41.749774969,-87.691616189,"(41.749774969, -87.691616189)" +2811252,HJ435689,2003-06-17 19:01:00,007XX N HARDING AVE,2024,NARCOTICS,POSS: HEROIN(WHITE),SIDEWALK,3835,True,False,1112,11,27,23,18,1149954,1904935,2003,ERROR,41.895053131,-87.724708046,"(41.895053131, -87.724708046)" +10109799,HY298102,2015-06-12 13:35:00,055XX W BELMONT AVE,0560,ASSAULT,SIMPLE,ALLEY,4032,False,False,2514,25,30,19,08A,1138524,1920677,2015,ERROR,41.938465788,-87.766305737,"(41.938465788, -87.766305737)" +2122047,HH360853,2002-05-08 03:00:00,035XX W 115TH PL,0810,THEFT,OVER $500,STREET,586,False,False,2211,NA,19,74,06,1155019,1827742,2002,2014-04-12 12:43:35,41.683124226,-87.70816705,"(41.683124226, -87.70816705)" +5459179,HN286810,2007-04-14 11:00:00,017XX N SEDGWICK ST,0610,BURGLARY,FORCIBLE ENTRY,CONSTRUCTION SITE,4496,False,False,1813,18,43,7,05,1173287,1911789,2007,2007-01-05 07:13:54,41.913374701,-87.638808607,"(41.913374701, -87.638808607)" +9427739,HW571708,2013-12-15 12:19:00,038XX W 65TH PL,143A,WEAPONS VIOLATION,UNLAWFUL POSS OF HANDGUN,RESIDENCE,2456,True,False,833,8,13,65,15,1151877,1860935,2013,ERROR,41.774273798,-87.718801431,"(41.774273798, -87.718801431)" +9549159,HX200896,2014-03-23 14:00:00,0000X W WASHINGTON ST,1152,DECEPTIVE PRACTICE,ILLEGAL USE CASH CARD,BANK,506,False,False,111,1,42,32,11,1175824,1900858,2014,ERROR,41.883322741,-87.629817609,"(41.883322741, -87.629817609)" +3085284,HJ808984,2003-12-10 01:30:00,015XX W MADISON ST,031A,ROBBERY,ARMED: HANDGUN,STREET,1775,False,False,1211,12,2,28,03,1165905,1900059,2003,ERROR,41.881347579,-87.666263434,"(41.881347579, -87.666263434)" +4372149,HL665453,2005-10-10 19:30:00,037XX N RECREATION DR,0820,THEFT,$500 AND UNDER,PARK PROPERTY,375,False,False,2323,19,46,6,06,1171814,1925403,2005,2014-04-12 12:43:35,41.950764691,-87.643817819,"(41.950764691, -87.643817819)" +8955831,HW104841,2013-01-01 20:21:00,027XX W 56TH ST,2826,OTHER OFFENSE,HARASSMENT BY ELECTRONIC MEANS,RESIDENCE,4110,False,False,824,8,16,63,26,1159094,1867451,2013,2013-10-01 14:22:16,41.792010053,-87.692166871,"(41.792010053, -87.692166871)" +7846213,HS658466,2010-12-13 10:50:00,032XX W 26TH ST,031A,ROBBERY,ARMED: HANDGUN,SMALL RETAIL STORE,4184,True,False,1024,10,22,30,03,1155078,1886589,2010,2012-06-02 11:35:31,41.844608478,-87.706380961,"(41.844608478, -87.706380961)" +7357351,HS158950,2010-02-10 08:10:00,003XX S SACRAMENTO BLVD,033A,ROBBERY,ATTEMPT: ARMED-HANDGUN,STREET,3954,False,False,1124,11,28,27,03,1156394,1898275,2010,2010-06-07 20:35:42,41.876649659,-87.701235678,"(41.876649659, -87.701235678)" +8459205,HV136620,2012-01-28 22:45:00,008XX N TRIPP AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,2553,False,False,1111,11,37,23,14,1147864,1905093,2012,ERROR,41.895527127,-87.732380072,"(41.895527127, -87.732380072)" +1389813,G101962,2001-02-19 18:05:00,016XX E 74 PL,0560,ASSAULT,SIMPLE,STREET,681,False,True,324,NA,NA,NA,08A,1188468,1855950,2001,ERROR,41.75979873,-87.584825427,"(41.75979873, -87.584825427)" +7865849,HS679407,2010-12-28 12:40:00,031XX W MADISON ST,0560,ASSAULT,SIMPLE,APARTMENT,1924,False,False,1124,11,28,27,08A,1155534,1899811,2010,ERROR,41.880881934,-87.704352007,"(41.880881934, -87.704352007)" +4757789,HM369541,2006-05-23 16:00:00,017XX N WOLCOTT AVE,2820,OTHER OFFENSE,TELEPHONE THREAT,RESIDENCE,2770,False,True,1434,14,32,24,26,1163450,1911711,2006,ERROR,41.913373563,-87.674949723,"(41.913373563, -87.674949723)" +3189601,HK196709,2004-02-21 18:00:00,025XX N HARLEM AVE,0810,THEFT,OVER $500,PARKING LOT/GARAGE(NON.RESID.),1669,False,False,2512,25,36,18,06,1127702,1916103,2004,2014-04-12 12:43:35,41.9261037,-87.806183216,"(41.9261037, -87.806183216)" +4409636,HL704892,2005-10-30 15:03:19,083XX S BOND AVE,0454,BATTERY,AGG PO HANDS NO/MIN INJURY,RESIDENCE,4370,True,False,424,4,10,46,08B,1198647,1849847,2005,ERROR,41.742802579,-87.547724486,"(41.742802579, -87.547724486)" +1505171,G248949,2001-05-01 12:00:00,002XX S MICHIGAN AV,0560,ASSAULT,SIMPLE,STREET,861,False,False,123,NA,NA,NA,08A,1177284,1899473,2001,ERROR,41.879489257,-87.624498463,"(41.879489257, -87.624498463)" +4586711,HM178303,2006-02-13 02:00:53,003XX N LARAMIE AVE,0460,BATTERY,SIMPLE,RESTAURANT,1167,False,False,1532,15,28,25,08B,1141691,1901663,2006,ERROR,41.886231203,-87.755137217,"(41.886231203, -87.755137217)" +1989552,HH189521,2002-02-15 19:50:00,075XX S SAGINAW AV,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,1219,True,False,421,NA,NA,NA,07,1195277,1855344,2002,ERROR,41.757970535,-87.559890935,"(41.757970535, -87.559890935)" +3644751,HK740805,2004-11-08 17:00:00,018XX S KARLOV AVE,0810,THEFT,OVER $500,STREET,788,False,False,1012,10,24,29,06,1149319,1890548,2004,2014-04-12 12:43:35,41.855585896,-87.727413274,"(41.855585896, -87.727413274)" +8573990,HV248559,2012-04-18 23:00:00,004XX N CENTRAL PARK BLVD,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,602,False,False,1122,11,27,23,07,1152144,1902675,2012,ERROR,41.888808551,-87.716724345,"(41.888808551, -87.716724345)" +3524215,HK604674,2004-09-05 19:15:00,036XX W SHAKESPEARE AVE,2027,NARCOTICS,POSS: CRACK,SIDEWALK,4206,True,False,2525,25,26,22,18,1151518,1913999,2004,2007-11-06 15:52:33,41.919895016,-87.718725318,"(41.919895016, -87.718725318)" +1847188,G685045,2001-11-14 09:00:00,050XX S LAWNDALE AV,0620,BURGLARY,UNLAWFUL ENTRY,RESIDENCE-GARAGE,3981,False,False,821,NA,NA,NA,05,1152515,1871081,2001,ERROR,41.802103414,-87.716195637,"(41.802103414, -87.716195637)" +7342528,HS143733,2010-01-30 11:35:00,010XX W FOSTER AVE,0340,ROBBERY,ATTEMPT: STRONGARM-NO WEAPON,ALLEY,1187,False,False,2023,20,48,77,03,1168536,1934754,2010,2010-11-02 08:18:49,41.976495882,-87.655595568,"(41.976495882, -87.655595568)" +7778066,HS583693,2010-10-26 13:20:00,003XX W 117TH ST,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,4154,False,True,522,5,34,53,08B,1176304,1827385,2010,ERROR,41.681694308,-87.630261037,"(41.681694308, -87.630261037)" +1348067,G033281,2001-01-16 13:30:00,011XX N WASHTENAW AV,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,STREET,783,True,False,1311,NA,NA,NA,18,1158142,1907777,2001,ERROR,41.902688501,-87.694557839,"(41.902688501, -87.694557839)" +9251968,HW395546,2013-05-19 00:01:00,005XX E 32ND ST,0840,THEFT,FINANCIAL ID THEFT: OVER $300,RESIDENCE,2608,False,False,211,2,4,35,06,1180472,1883635,2013,2013-08-08 11:12:43,41.835955998,-87.613280481,"(41.835955998, -87.613280481)" +1866081,G710432,2001-08-30 04:15:00,055XX W NORTH AV,0610,BURGLARY,FORCIBLE ENTRY,APARTMENT,3533,False,False,2532,NA,NA,NA,05,1138844,1910120,2001,ERROR,41.909490409,-87.765386627,"(41.909490409, -87.765386627)" +3462034,HK533284,2004-08-01 00:00:00,004XX N OAKLEY BLVD,0810,THEFT,OVER $500,PARKING LOT/GARAGE(NON.RESID.),2427,False,False,1313,12,27,24,06,1161044,1902666,2004,2014-04-12 12:43:35,41.888603708,-87.684040351,"(41.888603708, -87.684040351)" +8200080,HT434131,2011-08-05 01:00:00,043XX S HONORE ST,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,3797,False,False,914,9,12,61,07,1164697,1876102,2011,2011-06-08 10:43:36,41.81563292,-87.67137723,"(41.81563292, -87.67137723)" +1532170,G282968,2001-05-15 17:00:00,008XX W CUYLER AV,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,589,False,False,2322,NA,NA,NA,07,1169953,1927283,2001,ERROR,41.955964358,-87.650603629,"(41.955964358, -87.650603629)" +8748519,HV423660,2012-08-09 23:43:00,003XX N DEARBORN ST,0460,BATTERY,SIMPLE,BAR OR TAVERN,4895,True,False,1831,18,42,8,08B,1175921,1902673,2012,2012-10-08 09:09:49,41.888301019,-87.629406752,"(41.888301019, -87.629406752)" +3064212,HJ783363,2003-11-26 12:45:00,003XX N MICHIGAN AVE,0890,THEFT,FROM BUILDING,RESTAURANT,4952,False,False,122,1,42,32,06,1177207,1902277,2003,ERROR,41.887185329,-87.624696174,"(41.887185329, -87.624696174)" +9266858,HW411605,2013-08-16 21:00:00,026XX N MOZART ST,0820,THEFT,$500 AND UNDER,STREET,2,False,False,1411,14,35,22,06,1156956,1917741,2013,ERROR,41.930054663,-87.69864338,"(41.930054663, -87.69864338)" +2563813,HJ151075,2003-01-24 17:00:00,037XX S DR MARTIN LUTHER KING JR DR,0620,BURGLARY,UNLAWFUL ENTRY,RESIDENCE-GARAGE,995,False,False,211,NA,3,35,05,1179437,1879984,2003,ERROR,41.825961127,-87.617189893,"(41.825961127, -87.617189893)" +6272130,HP360251,2008-05-27 23:19:23,078XX S CLYDE AVE,0495,BATTERY,AGGRAVATED OF A SENIOR CITIZEN,RESIDENCE,1708,True,False,414,4,8,43,04B,1191603,1853399,2008,ERROR,41.752723145,-87.573418451,"(41.752723145, -87.573418451)" +1694291,G483134,2001-08-14 15:00:00,063XX S ELLIS AV,041A,BATTERY,AGGRAVATED: HANDGUN,STREET,1918,False,False,314,NA,NA,NA,04B,1184186,1863155,2001,ERROR,41.779671095,-87.600293674,"(41.779671095, -87.600293674)" +9180052,HW325256,2013-06-19 00:05:00,063XX S DR MARTIN LUTHER KING JR DR,1210,DECEPTIVE PRACTICE,THEFT OF LABOR/SERVICES,CTA PLATFORM,2418,True,False,312,3,20,69,11,1179964,1863307,2013,ERROR,41.780185918,-87.615767262,"(41.780185918, -87.615767262)" +9280642,HW425506,2013-08-26 22:00:00,018XX N LARRABEE ST,0620,BURGLARY,UNLAWFUL ENTRY,RESIDENCE-GARAGE,2483,False,False,1813,18,43,7,05,1171935,1912782,2013,ERROR,41.916129478,-87.643746195,"(41.916129478, -87.643746195)" +4593336,HM184287,2006-02-16 10:20:00,008XX E 103RD ST,0460,BATTERY,SIMPLE,"SCHOOL, PUBLIC, BUILDING",3892,False,False,512,5,9,50,08B,1183714,1836812,2006,2006-06-03 03:53:14,41.707394098,-87.602843897,"(41.707394098, -87.602843897)" +8204247,HT438156,2011-08-08 14:10:00,092XX S CLYDE AVE,0915,MOTOR VEHICLE THEFT,"TRUCK, BUS, MOTOR HOME",STREET,845,False,False,413,4,8,48,07,1191741,1844312,2011,2011-09-08 09:44:36,41.727784247,-87.573206878,"(41.727784247, -87.573206878)" +7787558,HS589500,2010-10-27 10:00:00,070XX S PERRY AVE,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,3600,False,False,731,7,6,69,07,1176581,1858104,2010,2010-05-11 08:26:29,41.765985117,-87.628326152,"(41.765985117, -87.628326152)" +5607127,HN408670,2007-06-16 08:15:00,002XX W 106TH PL,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,4526,False,True,512,5,34,49,14,1176238,1834270,2007,ERROR,41.700589255,-87.630296938,"(41.700589255, -87.630296938)" +8287357,HT521174,2011-09-30 11:00:00,052XX W JACKSON BLVD,1310,CRIMINAL DAMAGE,TO PROPERTY,APARTMENT,2963,False,False,1522,15,29,25,14,1141368,1898125,2011,2011-01-10 10:34:37,41.876528452,-87.756410705,"(41.876528452, -87.756410705)" +2090773,HH320445,2002-04-20 19:30:00,054XX W JACKSON BL,2820,OTHER OFFENSE,TELEPHONE THREAT,APARTMENT,3689,False,False,1522,NA,NA,NA,26,1140018,1898171,2002,ERROR,41.876679476,-87.761366414,"(41.876679476, -87.761366414)" +9718774,HX368460,2014-07-31 11:30:00,042XX S CALIFORNIA AVE,0610,BURGLARY,FORCIBLE ENTRY,APARTMENT,4785,False,False,921,9,12,58,05,1158367,1876251,2014,2014-07-08 12:40:12,41.816173258,-87.694592874,"(41.816173258, -87.694592874)" +5349618,HN204723,2007-03-02 20:20:00,036XX W CORTLAND ST,0486,BATTERY,DOMESTIC BATTERY SIMPLE,APARTMENT,3550,True,False,2535,25,26,22,08B,1151444,1912332,2007,2007-08-03 21:51:06,41.915322073,-87.719041079,"(41.915322073, -87.719041079)" +9883576,HX534835,2014-12-08 06:30:00,026XX N OAK PARK AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,1739,False,False,2512,25,36,18,14,1130669,1917134,2014,ERROR,41.928882318,-87.79525692,"(41.928882318, -87.79525692)" +2130685,HH371576,2002-05-14 14:00:00,034XX N NARRAGANSETT AVE,0810,THEFT,OVER $500,"SCHOOL, PUBLIC, BUILDING",2624,False,False,1632,NA,36,17,06,1133059,1921942,2002,2014-04-12 12:43:35,41.942034525,-87.786361549,"(41.942034525, -87.786361549)" +1450362,G178877,2001-03-29 17:50:47,003XX W 52 PL,0430,BATTERY,AGGRAVATED: OTHER DANG WEAPON,STREET,3979,False,False,934,NA,NA,NA,04B,1174942,1870105,2001,ERROR,41.798953863,-87.633975858,"(41.798953863, -87.633975858)" +3802924,HL107794,2005-01-05 11:00:00,051XX S CICERO AVE,1513,PROSTITUTION,SOLICIT FOR BUSINESS,STREET,4516,True,False,814,8,23,56,16,1145182,1870371,2005,ERROR,41.800296394,-87.743107012,"(41.800296394, -87.743107012)" +6423969,HP506680,2008-08-08 17:00:00,105XX S VINCENNES AVE,0890,THEFT,FROM BUILDING,CONSTRUCTION SITE,3187,False,False,2212,22,19,72,06,1168786,1835112,2008,2008-06-09 10:53:12,41.703063528,-87.657559187,"(41.703063528, -87.657559187)" +4619517,HM216542,2006-03-06 13:00:00,032XX S KEDZIE AVE,0890,THEFT,FROM BUILDING,RESTAURANT,4455,False,False,1033,10,12,30,06,1155585,1883125,2006,2006-08-03 04:01:50,41.835092676,-87.704613393,"(41.835092676, -87.704613393)" +3896698,HL272683,2005-04-03 19:00:00,028XX N NARRAGANSETT AVE,0820,THEFT,$500 AND UNDER,PARKING LOT/GARAGE(NON.RESID.),40,False,False,2511,25,36,19,06,1133225,1917988,2005,2014-04-12 12:43:35,41.931181393,-87.785844226,"(41.931181393, -87.785844226)" +8760257,HV434693,2012-08-17 15:30:00,051XX N MILWAUKEE AVE,1345,CRIMINAL DAMAGE,TO CITY OF CHICAGO PROPERTY,POLICE FACILITY/VEH PARKING LOT,653,True,False,1623,16,45,11,14,1138481,1933660,2012,ERROR,41.974093149,-87.766147965,"(41.974093149, -87.766147965)" +5284889,HN142213,2007-01-24 07:45:00,003XX W 83RD ST,0810,THEFT,OVER $500,CONSTRUCTION SITE,3850,False,False,622,6,21,44,06,1175483,1849872,2007,2014-04-12 12:43:35,41.743420145,-87.632596441,"(41.743420145, -87.632596441)" +6146157,HP237155,2008-03-21 16:00:00,055XX W NORTH AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,PARKING LOT/GARAGE(NON.RESID.),2698,False,False,2532,25,37,25,14,1138898,1910041,2008,ERROR,41.909272642,-87.765190174,"(41.909272642, -87.765190174)" +5828373,HN638214,2007-10-09 16:00:00,013XX E 62ND ST,2092,NARCOTICS,SOLICIT NARCOTICS ON PUBLICWAY,STREET,4548,True,False,314,3,20,42,26,1185883,1864191,2007,ERROR,41.782474101,-87.594039684,"(41.782474101, -87.594039684)" +9962492,HY151390,2015-02-13 20:00:00,019XX W MORSE AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,OTHER,581,False,False,2424,24,49,1,14,1161994,1946107,2015,ERROR,42.007788395,-87.679334315,"(42.007788395, -87.679334315)" +6576639,HP649030,2008-10-26 14:44:24,026XX W CHICAGO AVE,0610,BURGLARY,FORCIBLE ENTRY,RESIDENCE-GARAGE,1628,False,False,1313,12,26,24,05,1158778,1905190,2008,2009-01-08 20:33:55,41.895576534999996,-87.692292699,"(41.895576535, -87.692292699)" +2773697,HJ394838,2003-05-29 17:10:00,008XX N AVERS AVE,2024,NARCOTICS,POSS: HEROIN(WHITE),SIDEWALK,1426,True,False,1112,NA,27,23,18,1150597,1905710,2003,ERROR,41.897167269,-87.722326187,"(41.897167269, -87.722326187)" +3455350,HK523596,2004-07-29 00:00:00,068XX W SHAKESPEARE AVE,0915,MOTOR VEHICLE THEFT,"TRUCK, BUS, MOTOR HOME",STREET,876,False,False,2512,25,36,25,07,1130189,1913566,2004,ERROR,41.919099535,-87.797102792,"(41.919099535, -87.797102792)" +1510568,G238792,2001-04-26 20:58:13,047XX W LAKE ST,2024,NARCOTICS,POSS: HEROIN(WHITE),ALLEY,1889,True,False,1113,NA,NA,NA,18,1144354,1901858,2001,ERROR,41.886716653,-87.745353037,"(41.886716653, -87.745353037)" +10002833,HY192117,2015-03-20 16:50:00,109XX S MICHIGAN AVE,0560,ASSAULT,SIMPLE,STREET,2360,False,False,513,5,9,49,08A,1178806,1832645,2015,ERROR,41.696072117,-87.620943149,"(41.696072117, -87.620943149)" +9628747,HX278675,2014-05-27 15:00:00,027XX N CLYBOURN AVE,0890,THEFT,FROM BUILDING,GROCERY FOOD STORE,2623,False,False,1931,19,32,7,06,1162878,1918140,2014,2014-03-06 12:44:29,41.931027188,-87.676870318,"(41.931027188, -87.676870318)" +9380277,HW523315,2013-11-06 16:00:00,072XX S MAPLEWOOD AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,3549,False,False,832,8,18,66,08B,1160671,1856428,2013,ERROR,41.761728977,-87.686688178,"(41.761728977, -87.686688178)" +3098367,HJ826189,2003-12-19 03:20:00,087XX S SAGINAW AVE,143A,WEAPONS VIOLATION,UNLAWFUL POSS OF HANDGUN,RESIDENCE,1560,True,False,423,4,7,46,15,1195358,1847409,2003,ERROR,41.736194269,-87.559855496,"(41.736194269, -87.559855496)" +8700475,HV376946,2012-07-11 02:30:00,013XX W LOYOLA AVE,0820,THEFT,$500 AND UNDER,RESIDENCE,179,False,False,2432,24,40,1,06,1165965,1943761,2012,ERROR,42.001266756,-87.664791595,"(42.001266756, -87.664791595)" +6309518,HP399117,2008-06-16 06:00:00,047XX S WOLCOTT AVE,0620,BURGLARY,UNLAWFUL ENTRY,RESIDENCE,2208,False,False,931,9,20,61,05,1164528,1873118,2008,ERROR,41.80744805,-87.672081377,"(41.80744805, -87.672081377)" +2246591,HH520136,2002-07-19 00:30:00,032XX W BELLE PLAINE AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,1923,False,False,1724,NA,33,16,14,1153950,1927112,2002,ERROR,41.955829898,-87.709439072,"(41.955829898, -87.709439072)" +1703748,G500124,2001-08-22 02:45:00,059XX W FULTON ST,0460,BATTERY,SIMPLE,APARTMENT,1254,False,True,1512,NA,NA,NA,08B,1136489,1901353,2001,ERROR,41.885475115,-87.774247889,"(41.885475115, -87.774247889)" +2097320,HH313066,2002-04-17 12:39:00,044XX S FEDERAL ST,1350,CRIMINAL TRESPASS,TO STATE SUP LAND,CHA PARKING LOT/GROUNDS,4334,True,False,221,NA,NA,NA,26,1176474,1875517,2002,ERROR,41.813770553,-87.628194868,"(41.813770553, -87.628194868)" +2304088,HH586111,2002-08-17 09:18:40,014XX S SPRINGFIELD AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,APARTMENT,3059,False,False,1011,NA,24,29,14,1150654,1892710,2002,ERROR,41.861492727,-87.722456686,"(41.861492727, -87.722456686)" +2503528,HH844467,2002-12-17 17:20:00,086XX S COMMERCIAL AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,VEHICLE NON-COMMERCIAL,2687,False,False,424,NA,10,46,08B,1197693,1847869,2002,ERROR,41.737398641,-87.551285747,"(41.737398641, -87.551285747)" +7702717,HS509807,2010-09-11 03:30:00,057XX S DR MARTIN LUTHER KING JR DR,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,2786,False,False,234,2,20,40,14,1179868,1866840,2010,2010-11-09 10:33:16,41.789883007,-87.616011151,"(41.789883007, -87.616011151)" +4497359,HL799972,2005-12-20 14:10:00,0000X N STATE ST,0860,THEFT,RETAIL THEFT,DEPARTMENT STORE,687,True,False,122,1,42,32,06,1176321,1900593,2005,ERROR,41.882584372,-87.628000611,"(41.882584372, -87.628000611)" +1913830,G774488,2001-11-21 17:00:00,004XX S DEARBORN ST,0810,THEFT,OVER $500,COMMERCIAL / BUSINESS OFFICE,4896,False,False,132,NA,NA,NA,06,1176036,1898446,2001,2014-04-12 12:43:35,41.876699301,-87.629111816,"(41.876699301, -87.629111816)" +7752781,HS561321,2010-10-12 19:00:00,023XX N ORCHARD ST,0810,THEFT,OVER $500,STREET,3795,False,False,1812,18,43,7,06,1171165,1916071,2010,ERROR,41.925171608,-87.646478328,"(41.925171608, -87.646478328)" +1495352,G236482,2001-04-25 08:00:00,054XX N SHERIDAN RD,2825,OTHER OFFENSE,HARASSMENT BY TELEPHONE,APARTMENT,1411,False,False,2023,NA,NA,NA,26,1168688,1936590,2001,ERROR,41.981530612,-87.654983135,"(41.981530612, -87.654983135)" +4269646,HL579828,2005-08-29 19:47:25,029XX N MONITOR AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,1280,False,True,2514,25,30,19,08B,1136910,1919097,2005,ERROR,41.934159241,-87.772275653,"(41.934159241, -87.772275653)" +8734967,HV410309,2012-06-06 09:00:00,030XX N ELSTON AVE,5002,OTHER OFFENSE,OTHER VEHICLE OFFENSE,OTHER,2621,False,False,1411,14,1,21,26,1158467,1919885,2012,2014-03-02 14:06:09,41.935907119,-87.693031988,"(41.935907119, -87.693031988)" +6183611,HP273306,2008-04-10 19:00:00,031XX N MELVINA AVE,0810,THEFT,OVER $500,STREET,2739,False,False,2511,25,36,19,06,1134469,1920529,2008,2008-12-04 08:34:56,41.938132293,-87.781212545,"(41.938132293, -87.781212545)" +7078825,HR486686,2009-08-16 11:45:00,049XX W AUGUSTA BLVD,0470,PUBLIC PEACE VIOLATION,RECKLESS CONDUCT,RESIDENTIAL YARD (FRONT/BACK),3558,True,False,1531,15,37,25,24,1143223,1906157,2009,ERROR,41.898534802,-87.749398973,"(41.898534802, -87.749398973)" +5779480,HN586714,2007-09-13 10:30:14,006XX W 61ST ST,2095,NARCOTICS,ATTEMPT POSSESSION NARCOTICS,SIDEWALK,2183,True,False,711,7,16,68,18,1172737,1864389,2007,ERROR,41.783317484,-87.642230568,"(41.783317484, -87.642230568)" +9870258,HX520700,2014-11-25 22:12:00,062XX W 64TH ST,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,990,False,False,812,8,23,64,07,1135733,1861466,2014,2014-02-12 12:51:55,41.776032284,-87.777971032,"(41.776032284, -87.777971032)" +8288909,HT523203,2011-10-01 17:20:00,048XX W FLOURNOY ST,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,STREET,2283,True,False,1533,15,24,25,18,1144395,1896558,2011,2011-01-10 18:31:03,41.872172039,-87.745335817,"(41.872172039, -87.745335817)" +8102316,HT336736,2011-06-08 11:03:00,042XX S ASHLAND AVE,0850,THEFT,ATTEMPT THEFT,PARKING LOT/GARAGE(NON.RESID.),4936,True,False,914,9,12,61,06,1166338,1876850,2011,2011-09-06 11:16:04,41.817650668,-87.665336409,"(41.817650668, -87.665336409)" +7465353,HS267327,2010-04-20 07:15:00,059XX S INDIANA AVE,0610,BURGLARY,FORCIBLE ENTRY,APARTMENT,4064,False,False,233,2,20,40,05,1178571,1865818,2010,2010-03-07 11:45:21,41.787108136,-87.620797891,"(41.787108136, -87.620797891)" +2448483,HH774056,2002-11-12 03:30:00,027XX S EMERALD AVE,0820,THEFT,$500 AND UNDER,STREET,467,False,False,923,NA,11,60,06,1171708,1886483,2002,2014-04-12 12:43:35,41.843968255,-87.645354708,"(41.843968255, -87.645354708)" +7555079,HS359022,2010-06-14 11:45:00,021XX N HUMBOLDT BLVD,0810,THEFT,OVER $500,SIDEWALK,576,False,False,1414,14,35,22,06,1156190,1914398,2010,ERROR,41.920896739,-87.701548757,"(41.920896739, -87.701548757)" +10102657,HY291732,2015-04-15 12:30:00,098XX S CHARLES ST,1153,DECEPTIVE PRACTICE,FINANCIAL IDENTITY THEFT OVER $ 300,RESIDENCE,1478,False,False,2213,22,19,72,11,1167555,1839283,2015,ERROR,41.714535835,-87.661947749,"(41.714535835, -87.661947749)" +9023020,HW170629,2013-02-26 04:45:00,119XX S PERRY AVE,031A,ROBBERY,ARMED: HANDGUN,STREET,1991,False,False,522,5,9,53,03,1177683,1825981,2013,2013-02-04 12:18:39,41.677810527,-87.625255393,"(41.677810527, -87.625255393)" +4650295,HM247617,2006-03-23 06:22:00,027XX N RUTHERFORD AVE,0930,MOTOR VEHICLE THEFT,THEFT/RECOVERY: AUTOMOBILE,STREET,3249,True,False,2512,25,36,18,07,1130917,1917271,2006,ERROR,41.929253988,-87.794342417,"(41.929253988, -87.794342417)" +7862271,HS676968,2010-12-26 15:15:00,072XX S ROCKWELL ST,2820,OTHER OFFENSE,TELEPHONE THREAT,RESIDENCE,3255,False,True,831,8,18,66,26,1160255,1856471,2010,2011-01-01 13:13:56,41.761855547,-87.688211689,"(41.761855547, -87.688211689)" +1549513,G304867,2001-05-26 17:00:00,064XX S COTTAGE GROVE,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,"SCHOOL, PUBLIC, GROUNDS",4371,False,False,312,NA,NA,NA,07,1182638,1862119,2001,ERROR,41.776864286,-87.606000899,"(41.776864286, -87.606000899)" +1455026,G184846,2001-04-01 17:12:49,083XX S VERNON AV,0560,ASSAULT,SIMPLE,RESIDENCE,544,False,False,632,NA,NA,NA,08A,1180775,1849537,2001,ERROR,41.742380976,-87.613216643,"(41.742380976, -87.613216643)" +4427823,HL724219,2005-11-08 00:00:00,014XX E 54TH ST,0620,BURGLARY,UNLAWFUL ENTRY,RESIDENCE-GARAGE,2419,False,False,2132,2,4,41,05,1186925,1869842,2005,2006-04-02 03:37:59,41.797956235,-87.590040347,"(41.797956235, -87.590040347)" +5679423,HN487410,2007-07-25 02:40:00,059XX S CAMPBELL AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,2902,True,False,824,8,16,66,14,1160764,1865105,2007,ERROR,41.785537974,-87.686107985,"(41.785537974, -87.686107985)" +7495732,HS275457,2010-04-25 14:45:00,043XX S DR MARTIN LUTHER KING JR DR,0320,ROBBERY,STRONGARM - NO WEAPON,STREET,1747,False,False,222,2,3,38,03,1179615,1876521,2010,2010-04-06 18:55:38,41.816454308,-87.616642833,"(41.816454308, -87.616642833)" +7803721,HS613635,2010-11-13 12:10:00,005XX S PULASKI RD,031A,ROBBERY,ARMED: HANDGUN,STREET,2845,False,False,1132,11,24,26,03,1149769,1897321,2010,ERROR,41.874163085,-87.725585552,"(41.874163085, -87.725585552)" +1710750,G511505,2001-08-25 23:00:00,007XX W WAVELAND AV,0810,THEFT,OVER $500,PARKING LOT/GARAGE(NON.RESID.),949,False,False,2323,NA,NA,NA,06,1170739,1924926,2001,2014-04-12 12:43:35,41.94947945,-87.647783443,"(41.94947945, -87.647783443)" +2224263,HH493721,2002-07-07 18:09:00,104XX S WABASH AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,1931,False,False,512,NA,9,49,14,1178385,1835579,2002,ERROR,41.70413297,-87.622395901,"(41.70413297, -87.622395901)" +6935102,HR333609,2009-05-21 15:30:00,100XX W OHARE ST,0560,ASSAULT,SIMPLE,AIRPORT/AIRCRAFT,3283,False,False,1651,16,41,76,08A,1100635,1934208,2009,ERROR,41.976200173,-87.905312411,"(41.976200173, -87.905312411)" +5382077,HN231591,2007-03-08 10:10:00,048XX S CHICAGO BEACH DR,2825,OTHER OFFENSE,HARASSMENT BY TELEPHONE,APARTMENT,1299,False,False,2132,2,4,39,26,1187822,1873221,2007,ERROR,41.807207115,-87.5866433,"(41.807207115, -87.5866433)" +2472765,HH804536,2002-11-26 22:00:00,045XX N MILWAUKEE AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,OTHER,4091,False,False,1623,NA,45,15,14,1140801,1930053,2002,ERROR,41.96415277,-87.757705682,"(41.96415277, -87.757705682)" +8663325,HV338303,2012-06-16 12:00:00,079XX S MAY ST,2820,OTHER OFFENSE,TELEPHONE THREAT,APARTMENT,4672,False,False,612,6,17,71,26,1169994,1852029,2012,ERROR,41.749460143,-87.652645927,"(41.749460143, -87.652645927)" +3682557,HK717624,2004-10-29 10:00:00,018XX S KARLOV AVE,2095,NARCOTICS,ATTEMPT POSSESSION NARCOTICS,CHA PARKING LOT/GROUNDS,594,True,False,1012,10,24,29,18,1149325,1890347,2004,ERROR,41.855034211,-87.727396457,"(41.855034211, -87.727396457)" +8506092,HV183131,2012-03-04 16:20:00,085XX S UNIVERSITY AVE,0560,ASSAULT,SIMPLE,RESIDENCE PORCH/HALLWAY,2189,False,False,412,4,8,45,08A,1185352,1848596,2012,2012-06-03 14:26:12,41.739692446,-87.596476215,"(41.739692446, -87.596476215)" +1536639,G279063,2001-05-15 01:15:00,069XX S MICHIGAN AV,0430,BATTERY,AGGRAVATED: OTHER DANG WEAPON,APARTMENT,3491,False,False,322,NA,NA,NA,04B,1178326,1858850,2001,ERROR,41.767992795,-87.621907549,"(41.767992795, -87.621907549)" +8590655,HV265015,2012-04-30 16:07:00,020XX W 63RD ST,1330,CRIMINAL TRESPASS,TO LAND,RESTAURANT,3738,True,False,726,7,15,67,26,1163970,1862819,2012,2012-01-05 05:05:59,41.779198065,-87.674417489,"(41.779198065, -87.674417489)" +3957643,HL229706,2005-03-12 02:50:00,038XX W 45TH PL,2022,NARCOTICS,POSS: COCAINE,SIDEWALK,1543,True,False,821,8,14,57,18,1151741,1874241,2005,ERROR,41.810790121,-87.718951399,"(41.810790121, -87.718951399)" +5944517,HN743446,2007-12-01 08:00:00,052XX W HUTCHINSON ST,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,1515,False,False,1624,16,38,15,07,1140768,1927717,2007,2007-10-12 01:03:40,41.957743188,-87.757884694,"(41.957743188, -87.757884694)" +8314963,HT548064,2011-10-18 11:20:00,039XX W WILCOX ST,0520,ASSAULT,AGGRAVATED:KNIFE/CUTTING INSTR,STREET,2006,False,False,1122,11,28,26,04A,1150350,1899010,2011,ERROR,41.878786581,-87.723408302,"(41.878786581, -87.723408302)" +2262015,HH538299,2002-07-27 00:01:00,070XX S PULASKI RD,1310,CRIMINAL DAMAGE,TO PROPERTY,SMALL RETAIL STORE,4192,False,False,833,NA,13,65,14,1150947,1857820,2002,ERROR,41.765743919,-87.722291814,"(41.765743919, -87.722291814)" +3238230,HK259979,2004-03-24 11:30:00,019XX W PRYOR AVE,2825,OTHER OFFENSE,HARASSMENT BY TELEPHONE,RESIDENCE,692,False,False,2212,22,19,75,26,1165739,1831480,2004,ERROR,41.69316178,-87.668819238,"(41.69316178, -87.668819238)" +8307337,HT541535,2011-10-13 19:10:00,016XX S DRAKE AVE,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,RESIDENCE PORCH/HALLWAY,3686,True,False,1021,10,24,29,18,1153013,1891601,2011,ERROR,41.858403118,-87.713826549,"(41.858403118, -87.713826549)" +8075720,HT308470,2011-05-22 12:18:00,030XX N LECLAIRE AVE,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,SIDEWALK,2281,True,False,2521,25,31,19,18,1141796,1919925,2011,ERROR,41.936342208,-87.754298893,"(41.936342208, -87.754298893)" +1831471,G661456,2001-11-02 23:30:30,006XX E 46 ST,0810,THEFT,OVER $500,APARTMENT,3210,False,False,222,NA,NA,NA,06,1181656,1874705,2001,2014-04-12 12:43:35,41.811424106,-87.609212194,"(41.811424106, -87.609212194)" +1577474,G323442,2001-06-04 17:25:00,005XX S DESPLAINES ST,2024,NARCOTICS,POSS: HEROIN(WHITE),STREET,4460,True,False,131,NA,NA,NA,18,1172055,1897694,2001,ERROR,41.874724464,-87.643750852,"(41.874724464, -87.643750852)" +6763360,HR180663,2009-02-20 17:00:00,028XX N CLARK ST,0810,THEFT,OVER $500,PARKING LOT/GARAGE(NON.RESID.),2537,False,False,1932,19,44,6,06,1171377,1919102,2009,ERROR,41.933484144,-87.645610016,"(41.933484144, -87.645610016)" +6307441,HP396661,2008-06-14 20:00:00,105XX S PERRY AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,4564,False,False,512,5,34,49,14,1177515,1834741,2008,ERROR,41.701853045,-87.625606891,"(41.701853045, -87.625606891)" +1963559,HH143797,2002-01-23 15:00:00,005XX W HARRISON ST,2111,NARCOTICS,SALE/DEL HYPODERMIC NEEDLE,HOTEL/MOTEL,4004,True,False,131,NA,NA,NA,26,1173114,1897625,2002,ERROR,41.874511711,-87.639864736,"(41.874511711, -87.639864736)" +4056395,HL405242,2005-06-07 01:00:00,060XX S MARSHFIELD AVE,0820,THEFT,$500 AND UNDER,CHURCH/SYNAGOGUE/PLACE OF WORSHIP,154,False,False,714,7,15,67,06,1166409,1864855,2005,2014-04-12 12:43:35,41.784733473,-87.665417872,"(41.784733473, -87.665417872)" +6587922,HP660944,2008-11-01 23:35:00,069XX N GLENWOOD AVE,0460,BATTERY,SIMPLE,SIDEWALK,4341,False,False,2431,24,49,1,08B,1165536,1945973,2008,2008-03-11 08:27:31,42.007345709,-87.666306413,"(42.007345709, -87.666306413)" +7794546,HS604138,2010-11-07 23:30:00,025XX S CALIFORNIA AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,APARTMENT,4457,False,True,1033,10,12,30,08B,1158063,1887206,2010,ERROR,41.846241276,-87.695409603,"(41.846241276, -87.695409603)" +9556953,HX208548,2014-04-02 10:30:00,023XX N KEDZIE BLVD,0890,THEFT,FROM BUILDING,RESIDENCE,1548,False,False,1413,14,26,22,06,1154602,1915578,2014,2014-05-04 00:39:46,41.924166711,-87.707351793,"(41.924166711, -87.707351793)" +4911586,HM527657,2006-08-08 09:00:00,013XX W HASTINGS ST,1150,DECEPTIVE PRACTICE,CREDIT CARD FRAUD,RESIDENCE,615,False,False,1231,12,2,28,11,1167818,1893895,2006,2006-09-09 04:19:56,41.864392058,-87.659416725,"(41.864392058, -87.659416725)" +8530103,HV207352,2012-03-21 03:28:00,037XX N DRAKE AVE,041A,BATTERY,AGGRAVATED: HANDGUN,ALLEY,1354,False,False,1732,17,35,16,04B,1152101,1924527,2012,ERROR,41.948773209,-87.716304871,"(41.948773209, -87.716304871)" +3202279,HK212812,2004-03-01 04:50:00,119XX S MICHIGAN AVE,031A,ROBBERY,ARMED: HANDGUN,STREET,4345,False,False,532,5,9,53,03,1178938,1826078,2004,ERROR,41.678048316,-87.620658763,"(41.678048316, -87.620658763)" +1535129,G277552,2001-05-14 13:00:20,070XX S RHODES AV,0460,BATTERY,SIMPLE,"SCHOOL, PUBLIC, BUILDING",895,False,False,322,NA,NA,NA,08B,1181167,1858324,2001,ERROR,41.766484442,-87.611510246,"(41.766484442, -87.611510246)" +9439829,HW583592,2013-12-22 09:00:00,010XX W COLUMBIA AVE,0890,THEFT,FROM BUILDING,RESIDENCE PORCH/HALLWAY,4348,True,False,2432,24,49,1,06,1167737,1945049,2013,ERROR,42.004762897,-87.658235361,"(42.004762897, -87.658235361)" +1486467,G222730,2001-04-19 14:30:00,007XX N MICHIGAN AV,0820,THEFT,$500 AND UNDER,DEPARTMENT STORE,255,True,False,1834,NA,NA,NA,06,1177338,1905329,2001,2014-04-12 12:43:35,41.8955572,-87.624122473,"(41.8955572, -87.624122473)" +3473591,HK542000,2004-08-07 02:10:00,0000X W MAPLE ST,0460,BATTERY,SIMPLE,STREET,4558,False,False,1824,18,42,8,08B,1176112,1907663,2004,ERROR,41.90198953,-87.628554812,"(41.90198953, -87.628554812)" +6110065,HP205470,2008-03-01 12:00:00,051XX S HYDE PARK BLVD,0810,THEFT,OVER $500,STREET,2074,False,False,2132,2,4,41,06,1188191,1871483,2008,2008-05-03 12:11:15,41.80242912,-87.585345416,"(41.80242912, -87.585345416)" +2531598,HJ111717,2002-12-27 14:00:00,005XX N STATE ST,0890,THEFT,FROM BUILDING,COMMERCIAL / BUSINESS OFFICE,3490,False,False,1834,NA,42,8,06,1176317,1903817,2002,ERROR,41.891431292,-87.62791798,"(41.891431292, -87.62791798)" +8908679,HV581869,2012-11-29 17:00:00,029XX S DR MARTIN LUTHER KING JR DR,0880,THEFT,PURSE-SNATCHING,RESIDENCE PORCH/HALLWAY,2582,False,False,133,1,4,35,06,1179425,1885823,2012,2012-02-12 14:35:58,41.841984044,-87.617055292,"(41.841984044, -87.617055292)" +8613270,HV287141,2012-02-24 09:00:00,039XX W 79TH ST,0890,THEFT,FROM BUILDING,"SCHOOL, PUBLIC, BUILDING",4666,False,False,834,8,18,70,06,1151305,1851848,2012,ERROR,41.749348763,-87.721135378,"(41.749348763, -87.721135378)" +7961115,HT185399,2011-03-02 11:00:00,017XX N WHIPPLE ST,0460,BATTERY,SIMPLE,STREET,631,False,False,1421,14,26,23,08B,1155646,1911652,2011,ERROR,41.91337247,-87.703621623,"(41.91337247, -87.703621623)" +7919740,HT148765,2011-02-05 14:25:00,075XX S YALE AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,STREET,3762,False,True,623,6,17,69,08B,1175854,1854934,2011,2011-08-02 15:08:26,41.75730259,-87.631085699,"(41.75730259, -87.631085699)" +2663371,HJ278006,2003-04-01 19:15:00,067XX S WOLCOTT AVE,2820,OTHER OFFENSE,TELEPHONE THREAT,RESIDENCE,1220,False,False,726,NA,15,67,26,1164809,1859980,2003,ERROR,41.77138979,-87.67142173,"(41.77138979, -87.67142173)" +6550942,HP624443,2008-10-12 17:30:00,071XX S LAWNDALE AVE,0810,THEFT,OVER $500,RESIDENTIAL YARD (FRONT/BACK),1714,False,False,833,8,13,65,06,1152981,1856803,2008,ERROR,41.762913214,-87.714863238,"(41.762913214, -87.714863238)" +9052143,HW197487,2013-03-18 16:14:00,006XX W CHICAGO AVE,0460,BATTERY,SIMPLE,COMMERCIAL / BUSINESS OFFICE,1207,False,True,1822,18,27,8,08B,1172179,1905661,2013,ERROR,41.896583685,-87.643060288,"(41.896583685, -87.643060288)" +2128982,HH359279,2002-05-09 08:20:00,040XX S FEDERAL ST,2095,NARCOTICS,ATTEMPT POSSESSION NARCOTICS,CHA PARKING LOT/GROUNDS,2837,True,False,214,NA,3,38,18,1176399,1878070,2002,ERROR,41.820777898,-87.628393146,"(41.820777898, -87.628393146)" +9466436,HX119098,2014-01-18 12:15:00,016XX N MAPLEWOOD AVE,0560,ASSAULT,SIMPLE,RESIDENCE,3224,True,False,1434,14,1,24,08A,1159155,1910783,2014,ERROR,41.910916447,-87.690754192,"(41.910916447, -87.690754192)" +6833293,HR212717,2009-03-12 23:27:00,067XX S PARNELL AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,APARTMENT,4242,False,False,722,7,6,68,14,1173780,1859903,2009,2009-02-04 16:12:49,41.770984325,-87.638539479,"(41.770984325, -87.638539479)" +5816963,HN621314,2007-09-30 22:18:00,033XX W 65TH ST,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,3009,True,False,823,8,15,66,14,1155444,1861367,2007,ERROR,41.775388583,-87.705713759,"(41.775388583, -87.705713759)" +8683873,HV358753,2012-06-29 14:40:00,062XX S EBERHART AVE,2024,NARCOTICS,POSS: HEROIN(WHITE),SIDEWALK,2697,True,False,313,3,20,42,18,1180607,1863977,2012,ERROR,41.782009714,-87.613389379,"(41.782009714, -87.613389379)" +9332406,HW476255,2013-10-02 09:15:00,003XX E 51ST ST,0860,THEFT,RETAIL THEFT,SMALL RETAIL STORE,1444,True,False,231,2,3,40,06,1179083,1871232,2013,2013-02-10 12:40:29,41.801952997,-87.618755627,"(41.801952997, -87.618755627)" +6106681,HP199670,2008-02-27 19:00:00,003XX W 45TH ST,0890,THEFT,FROM BUILDING,PARK PROPERTY,1877,False,False,935,9,3,37,06,1174657,1874998,2008,2008-01-03 09:26:24,41.812387089,-87.634875192,"(41.812387089, -87.634875192)" +8322735,HT556921,2011-10-24 09:45:00,016XX W MONROE ST,1320,CRIMINAL DAMAGE,TO VEHICLE,VEHICLE NON-COMMERCIAL,2411,False,True,1211,12,2,28,14,1165749,1899667,2011,2011-10-11 16:19:44,41.880275226,-87.666847435,"(41.880275226, -87.666847435)" +8806688,HV480499,2012-09-17 23:00:00,066XX S GREENWOOD AVE,0560,ASSAULT,SIMPLE,APARTMENT,661,True,True,321,3,5,42,08A,1184405,1861060,2012,ERROR,41.773917101,-87.599556337,"(41.773917101, -87.599556337)" +5649250,HN423753,2007-06-23 12:55:00,033XX W FULLERTON AVE,0820,THEFT,$500 AND UNDER,OTHER,203,False,False,1413,14,35,22,06,1153552,1915794,2007,2014-04-12 12:43:35,41.924780401,-87.711204182,"(41.924780401, -87.711204182)" +9481419,HX134548,2014-01-31 16:30:00,008XX N RIDGEWAY AVE,2024,NARCOTICS,POSS: HEROIN(WHITE),STREET,535,True,False,1112,11,27,23,18,1151276,1905276,2014,2014-05-02 00:38:42,41.895963033,-87.719843697,"(41.895963033, -87.719843697)" +7452945,HS254403,2010-04-12 18:00:00,011XX S DELANO CT E,2820,OTHER OFFENSE,TELEPHONE THREAT,RESIDENCE,4917,False,True,131,1,2,32,26,1175238,1895318,2010,ERROR,41.8681338,-87.632135611,"(41.8681338, -87.632135611)" +9863463,HX513290,2014-11-20 01:26:00,028XX W LAWRENCE AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,SIDEWALK,3692,True,False,1911,19,47,4,08B,1156822,1931722,2014,ERROR,41.968422144,-87.698755406,"(41.968422144, -87.698755406)" +3888951,HL158249,2005-02-02 13:25:00,035XX W CHICAGO AVE,2027,NARCOTICS,POSS: CRACK,RESIDENCE,2282,True,False,1121,11,27,23,18,1152516,1905145,2005,ERROR,41.895579135,-87.715292874,"(41.895579135, -87.715292874)" +5869284,HN668807,2007-10-24 23:00:00,049XX W WEST END AVE,0326,ROBBERY,AGGRAVATED VEHICULAR HIJACKING,STREET,934,False,False,1532,15,28,25,03,1143315,1900566,2007,ERROR,41.883190721,-87.749200857,"(41.883190721, -87.749200857)" +2703495,HJ328167,2003-04-27 16:00:00,053XX S MAY ST,0610,BURGLARY,FORCIBLE ENTRY,ABANDONED BUILDING,3328,False,False,934,NA,16,61,05,1169605,1869148,2003,ERROR,41.796445235,-87.653575559,"(41.796445235, -87.653575559)" +4257280,HL574185,2005-08-27 01:30:00,084XX S ELIZABETH ST,0620,BURGLARY,UNLAWFUL ENTRY,APARTMENT,2999,False,False,613,6,21,71,05,1169506,1848666,2005,ERROR,41.740242188,-87.65453137,"(41.740242188, -87.65453137)" +5932502,HN731979,2007-11-28 09:30:00,077XX S BURNHAM AVE,0460,BATTERY,SIMPLE,"SCHOOL, PUBLIC, BUILDING",3095,False,False,421,4,7,43,08B,1196020,1854375,2007,2007-11-12 01:04:21,41.755293165,-87.557200019,"(41.755293165, -87.557200019)" +6238887,HP326210,2008-05-09 08:00:00,011XX N CLARK ST,0810,THEFT,OVER $500,PARKING LOT/GARAGE(NON.RESID.),1292,False,False,1824,18,42,8,06,1175376,1907750,2008,2008-12-05 11:05:25,41.902244823,-87.631255595,"(41.902244823, -87.631255595)" +1875426,G723872,2001-12-03 03:00:00,043XX S SAWYER AV,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,4250,False,False,821,NA,NA,NA,07,1155459,1875390,2001,ERROR,41.813869382,-87.705283202,"(41.813869382, -87.705283202)" +7725847,HS533443,2010-09-25 13:18:00,023XX N LONG AVE,0810,THEFT,OVER $500,PARK PROPERTY,2755,False,False,2515,25,37,19,06,1139957,1914995,2010,ERROR,41.922847656,-87.761178414,"(41.922847656, -87.761178414)" +3451995,HK003019,2004-07-24 01:30:00,013XX N HALSTED ST,2027,NARCOTICS,POSS: CRACK,STREET,687,True,False,1822,18,27,8,18,1170807,1909089,2004,ERROR,41.906020499,-87.647998785,"(41.906020499, -87.647998785)" +4626034,HM223084,2006-03-09 20:19:52,060XX S HARPER AVE,0890,THEFT,FROM BUILDING,APARTMENT,985,False,True,314,3,5,42,06,1187444,1865041,2006,ERROR,41.784769597,-87.588289691,"(41.784769597, -87.588289691)" +2635210,HJ244826,2003-03-17 22:30:00,041XX W NORTH AVE,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,4737,False,False,2534,25,30,23,07,1148753,1910358,2003,ERROR,41.90995769,-87.728978726,"(41.90995769, -87.728978726)" +4038854,HL311429,2005-04-22 14:30:00,055XX N LINCOLN AVE,1513,PROSTITUTION,SOLICIT FOR BUSINESS,HOTEL/MOTEL,2883,True,False,2011,20,40,4,16,1158216,1936790,2005,ERROR,41.982300536,-87.693490542,"(41.982300536, -87.693490542)" +4031728,HL384570,2005-05-28 07:00:00,003XX N LATROBE AVE,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,4941,False,False,1523,15,28,25,07,1141271,1901864,2005,2007-11-06 15:52:33,41.886790527,-87.756674616,"(41.886790527, -87.756674616)" +9537378,HX190485,2014-03-19 09:02:00,118XX S PERRY AVE,0497,BATTERY,AGGRAVATED DOMESTIC BATTERY: OTHER DANG WEAPON,SIDEWALK,2791,False,True,522,5,34,53,04B,1177670,1826389,2014,2014-04-04 00:38:54,41.678930434,-87.625290705,"(41.678930434, -87.625290705)" +7080558,HR488689,2009-08-17 13:55:00,012XX W ARTHUR AVE,0850,THEFT,ATTEMPT THEFT,SIDEWALK,2422,False,False,2432,24,40,1,06,1166693,1943419,2009,ERROR,42.000312672,-87.662123274,"(42.000312672, -87.662123274)" +6119164,HP210946,2008-03-06 13:17:00,020XX N SEDGWICK ST,0460,BATTERY,SIMPLE,STREET,3739,True,False,1814,18,43,7,08B,1173293,1914116,2008,2008-10-03 08:28:03,41.919759963,-87.638717325,"(41.919759963, -87.638717325)" +5259619,HN135255,2007-01-20 17:00:00,041XX N CLARENDON AVE,0620,BURGLARY,UNLAWFUL ENTRY,RESIDENCE,2690,False,False,2322,19,46,3,05,1170144,1927369,2007,2007-12-02 06:20:13,41.956196167,-87.649898952,"(41.956196167, -87.649898952)" +9177023,HW321951,2013-06-16 23:00:00,002XX W 103RD ST,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,STREET,4706,True,False,511,5,9,49,18,1176620,1836684,2013,ERROR,41.707205049,-87.628825892,"(41.707205049, -87.628825892)" +2827497,HJ477324,2003-07-07 01:35:00,046XX N CLIFTON AVE,0460,BATTERY,SIMPLE,STREET,1471,False,False,2311,19,46,3,08B,1167640,1930699,2003,ERROR,41.965388238,-87.659007885,"(41.965388238, -87.659007885)" +3012718,HJ716464,2003-10-25 02:42:00,042XX W KAMERLING AVE,0810,THEFT,OVER $500,VEHICLE NON-COMMERCIAL,1750,False,False,2534,25,37,23,06,1147558,1908601,2003,2014-04-12 12:43:35,41.905159324,-87.733413851,"(41.905159324, -87.733413851)" +3294036,HK326749,2004-04-25 21:00:00,051XX W BLOOMINGDALE AVE,0610,BURGLARY,FORCIBLE ENTRY,RESIDENCE-GARAGE,4527,False,False,2533,25,37,25,05,1141931,1911525,2004,ERROR,41.913289233,-87.754011314,"(41.913289233, -87.754011314)" +6803317,HR213727,2009-03-12 16:00:00,0000X N STATE ST,0890,THEFT,FROM BUILDING,SMALL RETAIL STORE,4883,False,False,122,1,42,32,06,1176328,1900431,2009,ERROR,41.882139677,-87.627979796,"(41.882139677, -87.627979796)" +9971989,HY161202,2015-02-23 14:56:00,004XX E 48TH ST,0820,THEFT,$500 AND UNDER,APARTMENT,404,False,True,223,2,3,38,06,1180243,1873338,2015,2015-06-03 12:42:07,41.807705499,-87.614436883,"(41.807705499, -87.614436883)" +6271204,HP353232,2008-05-23 19:45:00,094XX S BURNSIDE AVE,0560,ASSAULT,SIMPLE,RESIDENCE,3954,False,False,633,6,9,44,08A,1182714,1842560,2008,2008-02-06 06:39:38,41.72319054,-87.60632814,"(41.72319054, -87.60632814)" +2826618,HJ482716,2003-04-01 13:00:00,034XX W CARROLL AVE,0610,BURGLARY,FORCIBLE ENTRY,RESIDENCE-GARAGE,3974,False,False,1123,11,28,27,05,1153347,1902226,2003,ERROR,41.887552644,-87.712318379,"(41.887552644, -87.712318379)" +7953888,HT186007,2011-03-02 19:00:00,007XX N WABASH AVE,0820,THEFT,$500 AND UNDER,STREET,92,False,False,1834,18,42,8,06,1176565,1905227,2011,2011-03-03 06:43:40,41.895294805,-87.626964572,"(41.895294805, -87.626964572)" +3979852,HL343037,2005-05-07 19:00:00,016XX E 50TH ST,0810,THEFT,OVER $500,STREET,749,False,False,2132,2,4,39,06,1188465,1872158,2005,2014-04-12 12:43:35,41.804274819,-87.584318985,"(41.804274819, -87.584318985)" +4101174,HL441592,2005-06-24 16:00:00,061XX S WESTERN AVE,0820,THEFT,$500 AND UNDER,PARKING LOT/GARAGE(NON.RESID.),44,False,False,825,8,15,66,06,1161471,1863600,2005,2014-04-12 12:43:35,41.781393417,-87.683557482,"(41.781393417, -87.683557482)" +2613348,HJ215734,2003-01-16 16:00:00,077XX S WESTERN AVE,0820,THEFT,$500 AND UNDER,STREET,157,False,False,835,NA,18,70,06,1161675,1853495,2003,2014-04-12 12:43:35,41.753659623,-87.683089644,"(41.753659623, -87.683089644)" +5184536,HM766200,2006-12-09 17:00:00,031XX W 31ST ST,0820,THEFT,$500 AND UNDER,STREET,311,False,False,1033,10,12,30,06,1155985,1883878,2006,2014-04-12 12:43:35,41.837150955,-87.703125393,"(41.837150955, -87.703125393)" +8230238,HT464106,2011-08-24 19:15:00,113XX S STEWART AVE,0430,BATTERY,AGGRAVATED: OTHER DANG WEAPON,RESIDENCE,3176,False,False,2233,22,34,49,04B,1175621,1829403,2011,ERROR,41.687247278,-87.632701111,"(41.687247278, -87.632701111)" +7374070,HS176750,2010-02-22 20:50:00,019XX S PULASKI RD,143A,WEAPONS VIOLATION,UNLAWFUL POSS OF HANDGUN,STREET,4263,True,False,1014,10,24,29,15,1150062,1890214,2010,ERROR,41.854654939,-87.724694776,"(41.854654939, -87.724694776)" +5274149,HN143339,2007-01-25 19:00:00,079XX S COTTAGE GROVE AVE,1330,CRIMINAL TRESPASS,TO LAND,TAVERN/LIQUOR STORE,1997,True,False,624,6,8,44,26,1182965,1852736,2007,ERROR,41.751108806,-87.605093358,"(41.751108806, -87.605093358)" +5487050,HN286402,2007-04-16 14:00:00,039XX N LAWNDALE AVE,2890,PUBLIC PEACE VIOLATION,OTHER VIOLATION,"SCHOOL, PUBLIC, BUILDING",640,True,False,1732,17,39,16,26,1150988,1925736,2007,ERROR,41.95211271,-87.720364302,"(41.95211271, -87.720364302)" +9176249,HW319713,2013-06-15 10:45:00,069XX S CRANDON AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE PORCH/HALLWAY,2794,False,True,331,3,5,43,08B,1192569,1859188,2013,ERROR,41.76858515,-87.569690199,"(41.76858515, -87.569690199)" +5970003,HN765590,2007-12-18 14:00:00,028XX N MILWAUKEE AVE,0820,THEFT,$500 AND UNDER,VEHICLE-COMMERCIAL,352,False,False,1412,14,35,21,06,1152714,1918810,2007,2014-04-12 12:43:35,41.933073195,-87.71420336,"(41.933073195, -87.71420336)" +4936885,HM544641,2006-08-16 20:30:00,095XX S INDIANA AVE,0320,ROBBERY,STRONGARM - NO WEAPON,STREET,4828,True,False,511,5,6,49,03,1179217,1841960,2006,ERROR,41.72162439,-87.619155472,"(41.72162439, -87.619155472)" +9474839,HX128512,2014-01-26 16:00:00,019XX W PETERSON AVE,0850,THEFT,ATTEMPT THEFT,RESTAURANT,3213,True,False,2413,24,40,2,06,1162040,1939914,2014,ERROR,41.990793656,-87.679339104,"(41.990793656, -87.679339104)" +7802326,HS611894,2010-11-11 18:45:00,004XX S KEDZIE AVE,0820,THEFT,$500 AND UNDER,SMALL RETAIL STORE,174,False,False,1134,11,28,27,06,1155148,1897810,2010,ERROR,41.87539874,-87.705823098,"(41.87539874, -87.705823098)" +7731223,HS539017,2010-09-28 22:26:00,007XX S CALIFORNIA AVE,2027,NARCOTICS,POSS: CRACK,SIDEWALK,4969,True,False,1135,11,2,27,18,1157851,1896880,2010,ERROR,41.872792072,-87.695924058,"(41.872792072, -87.695924058)" +5221374,HN105437,2007-01-04 02:13:58,088XX S MARSHFIELD AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,600,True,True,2221,22,21,71,08B,1166921,1846213,2007,2014-04-12 12:43:35,41.733566359,-87.664072408,"(41.733566359, -87.664072408)" +4542176,HL749208,2005-11-22 06:19:20,045XX W CERMAK RD,1506,PROSTITUTION,SOLICIT ON PUBLIC WAY,STREET,2808,True,False,1012,10,24,29,16,1146657,1889031,2005,ERROR,41.851474184,-87.737222838,"(41.851474184, -87.737222838)" +4562689,HM152355,2006-01-29 19:30:00,020XX N LAWLER AVE,0610,BURGLARY,FORCIBLE ENTRY,APARTMENT,3832,False,False,2522,25,31,19,05,1142381,1913021,2006,ERROR,41.917386066,-87.752320857,"(41.917386066, -87.752320857)" +9707558,HX357398,2014-07-23 17:30:00,020XX E 71ST ST,0554,ASSAULT,AGG PO HANDS NO/MIN INJURY,SMALL RETAIL STORE,1641,True,False,331,3,5,43,08A,1191387,1858371,2014,ERROR,41.766371955,-87.574049171,"(41.766371955, -87.574049171)" +4714041,HM227293,2006-03-11 20:25:00,065XX S WOLCOTT AVE,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,STREET,622,True,False,726,7,15,67,18,1164765,1861497,2006,ERROR,41.775553569,-87.671540228,"(41.775553569, -87.671540228)" +5921937,HN718848,2007-11-20 17:36:30,059XX S PAULINA ST,0560,ASSAULT,SIMPLE,RESIDENCE PORCH/HALLWAY,3639,False,False,714,7,15,67,08A,1165991,1865160,2007,2007-02-12 01:04:24,41.785579331,-87.66694177,"(41.785579331, -87.66694177)" +3218316,HK228080,2004-03-03 15:00:00,039XX W 79TH ST,0330,ROBBERY,AGGRAVATED,"SCHOOL, PUBLIC, GROUNDS",4389,False,False,834,8,18,70,03,1151161,1851841,2004,ERROR,41.749332365,-87.721663241,"(41.749332365, -87.721663241)" +3487515,HK557821,2004-08-14 06:20:00,006XX N LONG AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,4892,False,False,1524,15,37,25,14,1140252,1903605,2004,ERROR,41.891586777,-87.760374016,"(41.891586777, -87.760374016)" +2451451,HH777241,2002-11-13 04:00:00,084XX S DREXEL AVE,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,3522,False,False,632,6,8,44,07,1183741,1848976,2002,ERROR,41.740772908,-87.602366784,"(41.740772908, -87.602366784)" +4502366,HL808084,2005-12-24 13:00:00,066XX N ASHLAND AVE,2826,OTHER OFFENSE,HARASSMENT BY ELECTRONIC MEANS,RESIDENCE,2954,False,False,2432,24,40,1,26,1164366,1944194,2005,ERROR,42.002489027,-87.670661713,"(42.002489027, -87.670661713)" +4931618,HM406308,2006-06-10 20:45:38,026XX W 47TH ST,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,STREET,3205,True,False,911,9,12,58,18,1159669,1873369,2006,ERROR,41.808238032,-87.689895989,"(41.808238032, -87.689895989)" +3614068,HK707958,2004-10-24 23:00:00,066XX S MAY ST,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,3727,False,True,724,7,17,68,08B,1169839,1860579,2004,ERROR,41.77292581,-87.652966109,"(41.77292581, -87.652966109)" +3751122,HK756140,2004-11-17 11:30:00,071XX S VERNON AVE,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,SIDEWALK,2489,True,False,323,3,6,69,18,1180514,1858040,2004,ERROR,41.765720129,-87.613912421,"(41.765720129, -87.613912421)" +8775540,HV450164,2012-08-28 03:10:00,040XX S CALUMET AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,APARTMENT,3867,True,True,213,2,3,38,08B,1179057,1878335,2012,ERROR,41.821444824,-87.618634338,"(41.821444824, -87.618634338)" +3361951,HK409235,2004-06-04 00:01:00,022XX S WASHTENAW AVE,0820,THEFT,$500 AND UNDER,STREET,380,False,False,1034,10,28,30,06,1158665,1889279,2004,2014-04-12 12:43:35,41.851917522,-87.693143577,"(41.851917522, -87.693143577)" +6028483,HP130477,2008-01-18 08:00:00,054XX S BISHOP ST,0610,BURGLARY,FORCIBLE ENTRY,APARTMENT,4831,False,False,933,9,16,61,05,1167547,1868813,2008,2008-10-02 09:00:51,41.795570365,-87.661132024,"(41.795570365, -87.661132024)" +3491821,HK563513,2004-08-17 14:22:57,115XX S CHURCH ST,1320,CRIMINAL DAMAGE,TO VEHICLE,DRIVEWAY - RESIDENTIAL,1773,False,False,2212,22,34,75,14,1165666,1828209,2004,ERROR,41.684187135,-87.669178838,"(41.684187135, -87.669178838)" +3018372,HJ720023,2003-10-25 01:00:00,038XX W 31ST ST,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,2821,False,False,1031,10,22,30,08B,1151504,1883738,2003,ERROR,41.836855819,-87.719571859,"(41.836855819, -87.719571859)" +1354914,G057397,2001-01-28 06:00:00,105XX S TRUMBULL AV,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,1221,False,False,2211,NA,NA,NA,14,1155237,1834766,2001,ERROR,41.702395083,-87.707182113,"(41.702395083, -87.707182113)" +4569529,HM158752,2006-01-23 08:00:00,072XX S RHODES AVE,0560,ASSAULT,SIMPLE,APARTMENT,3176,False,True,323,3,6,69,08A,1181195,1857297,2006,ERROR,41.763665603,-87.611439209,"(41.763665603, -87.611439209)" +6806076,HR217090,2009-03-15 12:05:00,054XX N LINCOLN AVE,0820,THEFT,$500 AND UNDER,RESTAURANT,346,False,False,2011,20,40,4,06,1158464,1936018,2009,ERROR,41.980177046,-87.692599697,"(41.980177046, -87.692599697)" +6083955,HP180648,2008-02-17 16:45:01,049XX S LA CROSSE AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,3195,False,False,814,8,23,56,14,1144901,1871417,2008,ERROR,41.803172073,-87.744111245,"(41.803172073, -87.744111245)" +8807854,HV481114,2012-09-18 08:00:00,006XX E GRAND AVE,0810,THEFT,OVER $500,OTHER,674,False,False,1834,18,42,8,06,1180766,1904096,2012,ERROR,41.89209535,-87.611570504,"(41.89209535, -87.611570504)" +2338089,HH593976,2002-08-20 19:30:00,029XX N CENTRAL PARK AVE,2210,LIQUOR LAW VIOLATION,SELL/GIVE/DEL LIQUOR TO MINOR,TAVERN/LIQUOR STORE,3797,True,False,2523,NA,35,21,22,1151842,1919206,2002,ERROR,41.934177086,-87.717397454,"(41.934177086, -87.717397454)" +8452974,HV130354,2012-01-24 16:11:00,048XX N SHERIDAN RD,0560,ASSAULT,SIMPLE,CURRENCY EXCHANGE,2398,False,True,2024,20,46,3,08A,1168724,1932205,2012,ERROR,41.96949727,-87.654978443,"(41.96949727, -87.654978443)" +5324749,HN183465,2007-02-18 09:00:00,020XX W 70TH PL,2825,OTHER OFFENSE,HARASSMENT BY TELEPHONE,RESIDENCE,2289,True,False,735,7,17,67,26,1163866,1857860,2007,ERROR,41.765592081,-87.674937943,"(41.765592081, -87.674937943)" +1623626,G373657,2001-06-27 02:16:41,005XX W DIVISION ST,2027,NARCOTICS,POSS: CRACK,STREET,3021,True,False,1823,NA,NA,NA,18,1172307,1908305,2001,ERROR,41.903836143,-87.642511973,"(41.903836143, -87.642511973)" +6375121,HP457261,2008-07-17 01:28:39,042XX W VAN BUREN ST,0430,BATTERY,AGGRAVATED: OTHER DANG WEAPON,SIDEWALK,4906,False,False,1132,11,24,26,04B,1148391,1897730,2008,2008-01-08 22:09:13,41.875312091,-87.730634436,"(41.875312091, -87.730634436)" +3783641,HK789089,2004-12-04 10:37:29,029XX S DEARBORN ST,1822,NARCOTICS,MANU/DEL:CANNABIS OVER 10 GMS,CHA APARTMENT,2874,True,False,2113,1,3,35,18,1176498,1885030,2004,ERROR,41.839874474,-87.627820281,"(41.839874474, -87.627820281)" +4549735,HM139445,2006-01-22 23:10:00,019XX S RACINE AVE,1330,CRIMINAL TRESPASS,TO LAND,RESIDENCE PORCH/HALLWAY,1515,True,False,1233,12,25,31,26,1168712,1890864,2006,ERROR,41.856055437,-87.656222636,"(41.856055437, -87.656222636)" +2457835,HH783440,2002-11-10 12:30:00,042XX W 25TH PL,0810,THEFT,OVER $500,STREET,4867,False,False,1013,NA,22,30,06,1148465,1886754,2002,2014-04-12 12:43:35,41.845191169,-87.730645627,"(41.845191169, -87.730645627)" +6612069,HP685482,2008-11-15 20:00:00,037XX W LEXINGTON ST,2820,OTHER OFFENSE,TELEPHONE THREAT,APARTMENT,4044,False,False,1133,11,24,27,26,1151664,1896487,2008,ERROR,41.871837466,-87.718649859,"(41.871837466, -87.718649859)" +3543604,HK627013,2004-09-16 09:20:00,047XX N WINTHROP AVE,0560,ASSAULT,SIMPLE,SIDEWALK,3752,False,True,2312,19,46,3,08A,1168071,1931384,2004,ERROR,41.967258582,-87.657403334,"(41.967258582, -87.657403334)" +5036221,HM519102,2006-08-04 11:47:26,051XX W MAYPOLE AVE,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,OTHER,1726,True,False,1532,15,28,25,18,1141785,1900930,2006,ERROR,41.884218022,-87.754810169,"(41.884218022, -87.754810169)" +8417213,HT650314,2011-12-28 12:50:00,023XX W MADISON ST,2170,NARCOTICS,POSSESSION OF DRUG EQUIPMENT,STREET,2061,True,False,1332,12,2,28,18,1160516,1899992,2011,ERROR,41.881276963,-87.686053431,"(41.881276963, -87.686053431)" +1406729,G971618,2001-02-23 11:00:00,0000X W HUBBARD ST,0820,THEFT,$500 AND UNDER,TAXICAB,182,False,False,1831,NA,NA,NA,06,1176066,1903352,2001,2014-04-12 12:43:35,41.890160967,-87.628853795,"(41.890160967, -87.628853795)" +5919963,HN717978,2007-11-20 10:45:00,011XX N KEYSTONE AVE,2092,NARCOTICS,SOLICIT NARCOTICS ON PUBLICWAY,SIDEWALK,1751,True,False,1111,11,27,23,26,1149217,1907290,2007,ERROR,41.901529809,-87.727353784,"(41.901529809, -87.727353784)" +2685011,HJ285981,2003-04-07 17:30:00,002XX W 24TH PL,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,STREET,4426,True,False,2111,NA,25,34,18,1174709,1888096,2003,ERROR,41.848327956,-87.634293516,"(41.848327956, -87.634293516)" +7647393,HS452564,2010-08-08 11:11:00,044XX N BROADWAY,0870,THEFT,POCKET-PICKING,SMALL RETAIL STORE,644,False,False,2311,19,46,3,06,1168390,1929931,2010,2010-12-08 18:54:25,41.96326459,-87.656272632,"(41.96326459, -87.656272632)" +9876690,HX527338,2014-12-02 10:50:00,116XX S WALLACE ST,1365,CRIMINAL TRESPASS,TO RESIDENCE,RESIDENCE,4273,True,False,524,5,34,53,26,1174437,1827665,2014,2014-09-12 12:42:40,41.682504278,-87.637086989,"(41.682504278, -87.637086989)" +8735782,HV411396,2012-08-01 22:30:00,013XX W PRATT BLVD,1812,NARCOTICS,POSS: CANNABIS MORE THAN 30GMS,STREET,4850,True,False,2432,24,49,1,18,1166147,1945262,2012,2012-02-08 02:34:01,42.005381627,-87.664078885,"(42.005381627, -87.664078885)" +1815802,G640754,2001-10-24 17:35:00,072XX S RIDGELAND AV,0460,BATTERY,SIMPLE,SIDEWALK,3648,False,False,324,NA,NA,NA,08B,1189086,1857179,2001,ERROR,41.763156434,-87.582521182,"(41.763156434, -87.582521182)" +9048414,HW192963,2013-03-13 16:10:00,035XX E 114TH ST,0460,BATTERY,SIMPLE,STREET,1436,False,False,433,4,10,52,08B,1201622,1829943,2013,ERROR,41.688109378,-87.537498377,"(41.688109378, -87.537498377)" +4252619,HL568353,2005-08-24 10:51:19,027XX E 83RD ST,0610,BURGLARY,FORCIBLE ENTRY,SMALL RETAIL STORE,1402,False,False,423,4,7,46,05,1195865,1850505,2005,ERROR,41.744677425,-87.557895859,"(41.744677425, -87.557895859)" +7015773,HR422984,2009-07-11 07:45:00,060XX N BROADWAY,0860,THEFT,RETAIL THEFT,GROCERY FOOD STORE,3873,True,False,2433,24,48,77,06,1167253,1940103,2009,ERROR,41.991201436,-87.660159064,"(41.991201436, -87.660159064)" +7085175,HR493489,2009-08-20 03:00:00,042XX S COTTAGE GROVE AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,STREET,3060,False,False,213,2,4,38,14,1182265,1877306,2009,ERROR,41.818547345,-87.606897794,"(41.818547345, -87.606897794)" +3872852,HL239738,2005-03-11 19:30:00,007XX W 112TH ST,0915,MOTOR VEHICLE THEFT,"TRUCK, BUS, MOTOR HOME",STREET,840,False,False,2233,22,34,49,07,1173427,1830631,2005,ERROR,41.690665788,-87.640696894,"(41.690665788, -87.640696894)" +4784156,HM394717,2006-06-05 08:00:00,058XX N LINCOLN AVE,0890,THEFT,FROM BUILDING,"SCHOOL, PUBLIC, BUILDING",1276,False,False,2011,20,40,2,06,1155783,1938688,2006,2006-09-06 04:07:44,41.987558265,-87.702387107,"(41.987558265, -87.702387107)" +6149991,HP239396,2008-03-23 02:31:00,017XX N CLARK ST,0460,BATTERY,SIMPLE,BAR OR TAVERN,2251,False,False,1814,18,43,7,08B,1174666,1912148,2008,2008-08-04 17:08:11,41.914329059,-87.633731746,"(41.914329059, -87.633731746)" +2706200,HJ317376,2003-04-22 23:30:09,058XX W CHICAGO AVE,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,STREET,1400,True,False,1511,NA,29,25,18,1137385,1904788,2003,ERROR,41.894885131,-87.77087487,"(41.894885131, -87.77087487)" +3243981,HK261903,2004-03-25 07:00:00,041XX W BARRY AVE,2820,OTHER OFFENSE,TELEPHONE THREAT,APARTMENT,1844,False,False,2523,25,31,21,26,1148267,1920250,2004,ERROR,41.93711164,-87.730508643,"(41.93711164, -87.730508643)" +4670809,HM272274,2006-04-04 16:30:00,001XX W 110TH PL,0430,BATTERY,AGGRAVATED: OTHER DANG WEAPON,RESIDENCE PORCH/HALLWAY,2999,False,False,513,5,34,49,04B,1177196,1831716,2006,2006-09-04 03:54:02,41.693559196,-87.626865823,"(41.693559196, -87.626865823)" +3551830,HK636854,2004-09-20 17:00:00,016XX W HOLLYWOOD AVE,0560,ASSAULT,SIMPLE,APARTMENT,2262,False,False,2012,20,40,77,08A,1164030,1937887,2004,ERROR,41.985189571,-87.672076994,"(41.985189571, -87.672076994)" +5555385,HN360342,2007-05-20 06:00:00,071XX S SOUTH SHORE DR,0560,ASSAULT,SIMPLE,STREET,4204,False,True,334,3,7,43,08A,1194449,1858304,2007,2007-11-06 15:52:33,41.766113381,-87.562828234,"(41.766113381, -87.562828234)" +8722256,HV398745,2012-04-24 09:00:00,080XX S DREXEL AVE,2820,OTHER OFFENSE,TELEPHONE THREAT,RESIDENCE,1617,False,False,631,6,8,44,26,1183677,1851641,2012,ERROR,41.748087445,-87.602518345,"(41.748087445, -87.602518345)" +2870583,HJ537839,2003-08-03 14:50:00,044XX N HAZEL ST,0486,BATTERY,DOMESTIC BATTERY SIMPLE,VEHICLE NON-COMMERCIAL,3347,False,True,2313,19,46,3,08B,1169420,1929662,2003,ERROR,41.96250405,-87.652493562,"(41.96250405, -87.652493562)" +2202542,HH464935,2002-06-24 21:31:52,001XX W 87TH ST,1330,CRIMINAL TRESPASS,TO LAND,PARKING LOT/GARAGE(NON.RESID.),4936,True,False,622,NA,21,44,26,1176895,1847317,2002,ERROR,41.736377238,-87.627499596,"(41.736377238, -87.627499596)" +9078445,HW222090,2013-04-06 15:50:00,003XX E 60TH ST,0320,ROBBERY,STRONGARM - NO WEAPON,SIDEWALK,3449,False,False,232,2,20,40,03,1179110,1865332,2013,ERROR,41.785762231,-87.618836444,"(41.785762231, -87.618836444)" +6538835,HP612336,2008-10-06 14:30:00,012XX N MONTICELLO AVE,1563,SEX OFFENSE,CRIMINAL SEXUAL ABUSE,"SCHOOL, PUBLIC, BUILDING",1976,True,False,2535,25,26,23,17,1151767,1908135,2008,2009-03-07 13:40:43,41.90379876,-87.717965025,"(41.90379876, -87.717965025)" +1891896,G739646,2001-12-10 17:30:00,001XX W OAK ST,0460,BATTERY,SIMPLE,APARTMENT,3559,False,True,1824,NA,NA,NA,08B,1174581,1907163,2001,ERROR,41.900651882,-87.63419329,"(41.900651882, -87.63419329)" +6361408,HP448520,2008-07-12 15:30:00,038XX W POLK ST,0560,ASSAULT,SIMPLE,APARTMENT,1593,False,False,1133,11,24,26,08A,1150950,1896132,2008,ERROR,41.870877306,-87.721280557,"(41.870877306, -87.721280557)" +3347368,HK388596,2004-05-26 07:20:00,092XX S ABERDEEN ST,0460,BATTERY,SIMPLE,SIDEWALK,4671,False,False,2222,22,21,73,08B,1170580,1843176,2004,ERROR,41.725153538,-87.650755883,"(41.725153538, -87.650755883)" +9948680,HY137572,2015-02-02 10:40:00,052XX W CONGRESS PKWY,0610,BURGLARY,FORCIBLE ENTRY,APARTMENT,4151,False,False,1522,15,29,25,05,1141716,1897144,2015,2015-09-02 12:45:35,41.873830036,-87.755157207,"(41.873830036, -87.755157207)" +8157166,HT392395,2011-07-11 22:03:00,012XX N CLYBOURN AVE,0850,THEFT,ATTEMPT THEFT,SIDEWALK,2478,True,False,1821,18,27,8,06,1172815,1908509,2011,2011-12-07 09:18:42,41.904384688,-87.640639932,"(41.904384688, -87.640639932)" +5615641,HN424136,2007-06-23 16:58:43,080XX S ST LOUIS AVE,0610,BURGLARY,FORCIBLE ENTRY,RESIDENCE,754,False,False,834,8,18,70,05,1154418,1850741,2007,2007-03-08 02:38:51,41.746249624,-87.709757369,"(41.746249624, -87.709757369)" +6678841,HP753255,2008-12-27 17:05:00,052XX N SHERIDAN RD,0860,THEFT,RETAIL THEFT,GROCERY FOOD STORE,1653,True,False,2023,20,48,77,06,1168731,1935088,2008,ERROR,41.977408151,-87.654868748,"(41.977408151, -87.654868748)" +4652026,HM251430,2006-03-25 00:01:00,097XX S AVENUE L,2825,OTHER OFFENSE,HARASSMENT BY TELEPHONE,APARTMENT,1778,False,False,432,4,10,52,26,1201832,1841147,2006,2006-04-04 03:37:55,41.718848775,-87.53635002,"(41.718848775, -87.53635002)" +7172268,HR582951,2009-10-11 12:15:00,003XX W NORTH AVE,2820,OTHER OFFENSE,TELEPHONE THREAT,RESIDENCE,3748,False,False,1814,18,43,7,26,1173850,1911019,2009,ERROR,41.911249256,-87.636763258,"(41.911249256, -87.636763258)" +6920364,HR325590,2009-05-17 03:50:00,053XX S NORDICA AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE-GARAGE,1851,False,False,811,8,23,56,14,1130322,1868174,2009,ERROR,41.794534496,-87.797654615,"(41.794534496, -87.797654615)" +6413617,HP474865,2008-07-25 22:40:00,044XX W MADISON ST,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,SIDEWALK,4473,True,False,1113,11,28,26,18,1146975,1899609,2008,2008-07-08 12:18:35,41.880495455,-87.73578545,"(41.880495455, -87.73578545)" +5099538,HM702282,2006-11-05 05:30:00,039XX N SHERIDAN RD,0870,THEFT,POCKET-PICKING,CTA TRAIN,1993,False,False,2324,19,44,6,06,1168850,1926543,2006,2006-08-11 05:36:51,41.953957812,-87.654680033,"(41.953957812, -87.654680033)" +7256815,HR671119,2009-11-22 02:00:00,012XX N CLARK ST,1150,DECEPTIVE PRACTICE,CREDIT CARD FRAUD,ATM (AUTOMATIC TELLER MACHINE),2265,False,False,1821,18,42,8,11,1175274,1908508,2009,2009-04-12 14:38:56,41.904327102,-87.631607477,"(41.904327102, -87.631607477)" +5593784,HN398599,2007-06-11 15:11:00,005XX E 71ST ST,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,SIDEWALK,1097,True,False,322,3,6,69,18,1181308,1858110,2007,ERROR,41.765893956,-87.61100002,"(41.765893956, -87.61100002)" +6361346,HP448207,2008-07-11 08:30:00,051XX S HARPER AVE,0560,ASSAULT,SIMPLE,SIDEWALK,4863,False,True,2132,2,4,41,08A,1187200,1871163,2008,ERROR,41.801574625,-87.588989942,"(41.801574625, -87.588989942)" +9900148,HX550849,2014-12-21 21:00:00,033XX S INDIANA AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,3486,False,False,211,2,3,35,14,1178111,1882842,2014,ERROR,41.833833929,-87.621967815,"(41.833833929, -87.621967815)" +9176806,HW321737,2013-06-16 07:30:00,111XX S GREEN ST,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENTIAL YARD (FRONT/BACK),1833,False,False,2233,22,34,75,14,1172607,1830711,2013,ERROR,41.690903375,-87.643696617,"(41.690903375, -87.643696617)" +9255503,HW400240,2013-08-09 09:00:00,016XX W WRIGHTWOOD AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,PARKING LOT/GARAGE(NON.RESID.),2272,False,False,1931,19,32,7,14,1164679,1917284,2013,ERROR,41.928640244,-87.670276344,"(41.928640244, -87.670276344)" +8879865,HV553462,2012-11-08 14:00:00,075XX S CHAMPLAIN AVE,0880,THEFT,PURSE-SNATCHING,SIDEWALK,937,False,False,624,6,6,69,06,1181824,1855392,2012,2012-09-11 10:05:24,41.758423578,-87.609192588,"(41.758423578, -87.609192588)" +8619862,HV293402,2012-05-19 09:00:00,051XX W HURON ST,0486,BATTERY,DOMESTIC BATTERY SIMPLE,APARTMENT,3108,False,True,1532,15,28,25,08B,1142167,1904099,2012,ERROR,41.892907066,-87.753328745,"(41.892907066, -87.753328745)" +8939790,HV611318,2012-12-20 18:00:00,029XX W WASHINGTON BLVD,0610,BURGLARY,FORCIBLE ENTRY,"SCHOOL, PUBLIC, BUILDING",2123,False,False,1222,12,2,27,05,1156901,1900584,2012,2013-01-01 19:08:51,41.882975519,-87.699311498,"(41.882975519, -87.699311498)" +4471061,HL762489,2005-11-29 18:24:56,025XX S DRAKE AVE,502P,OTHER OFFENSE,FALSE/STOLEN/ALTERED TRP,ALLEY,3995,True,False,1024,10,22,30,26,1153071,1886821,2005,ERROR,41.845285083,-87.71374025,"(41.845285083, -87.71374025)" +6948596,HR354023,2009-05-08 09:00:00,002XX E GARFIELD BLVD,1152,DECEPTIVE PRACTICE,ILLEGAL USE CASH CARD,RESIDENCE,4044,False,False,232,2,3,40,11,1178909,1868644,2009,ERROR,41.794855256,-87.61947257,"(41.794855256, -87.61947257)" +3024446,HJ731807,2003-11-01 10:19:57,082XX S COMMERCIAL AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,2796,False,True,424,4,10,46,08B,1197665,1850765,2003,ERROR,41.745346184,-87.551291909,"(41.745346184, -87.551291909)" +7096237,HR504828,2009-08-26 16:56:00,019XX W 33RD ST,0860,THEFT,RETAIL THEFT,DEPARTMENT STORE,4912,True,False,922,9,11,59,06,1163768,1882841,2009,ERROR,41.834145069,-87.674595443,"(41.834145069, -87.674595443)" +5309441,HN169039,2007-02-09 18:50:00,061XX W 64TH PL,0560,ASSAULT,SIMPLE,APARTMENT,3080,False,False,812,8,13,64,08A,1136487,1861077,2007,ERROR,41.774951401,-87.775216121,"(41.774951401, -87.775216121)" +3332497,HK367263,2004-05-16 04:42:21,003XX N STATE ST,0460,BATTERY,SIMPLE,STREET,3474,True,False,1831,18,42,8,08B,1176258,1902572,2004,ERROR,41.888016277,-87.628172231,"(41.888016277, -87.628172231)" +5531805,HN344079,2007-05-15 14:45:00,080XX S COTTAGE GROVE AVE,033A,ROBBERY,ATTEMPT: ARMED-HANDGUN,SIDEWALK,4786,False,False,631,6,8,44,03,1182985,1852068,2007,2007-03-06 02:49:28,41.749275279,-87.605040789,"(41.749275279, -87.605040789)" +2251499,HH522712,2002-07-19 21:00:00,054XX N LINCOLN AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,OTHER,811,False,False,2011,NA,40,4,14,1158470,1935921,2002,ERROR,41.979910751,-87.6925803,"(41.979910751, -87.6925803)" +5009126,HM619632,2006-09-24 03:00:00,021XX N RICHMOND ST,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,1319,False,True,1414,14,35,22,08B,1156551,1914178,2006,ERROR,41.920285736,-87.700228327,"(41.920285736, -87.700228327)" +5710364,HN518757,2007-08-01 17:00:00,084XX W BRYN MAWR AVE,0890,THEFT,FROM BUILDING,OTHER,1004,False,False,1614,16,41,76,06,1119008,1936135,2007,ERROR,41.98121629,-87.837704596,"(41.98121629, -87.837704596)" +3722385,HK829243,2004-12-26 19:40:00,104XX S GREEN ST,0486,BATTERY,DOMESTIC BATTERY SIMPLE,STREET,933,False,True,2233,22,34,73,08B,1172542,1835330,2004,ERROR,41.703580052,-87.643799205,"(41.703580052, -87.643799205)" +3832461,HL203373,2005-02-26 12:35:31,002XX S HOYNE AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,4153,False,False,1211,12,2,28,14,1162403,1898857,2005,ERROR,41.878123162,-87.679156235,"(41.878123162, -87.679156235)" +8764513,HV439482,2012-08-20 20:08:00,038XX S ELLIS AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE PORCH/HALLWAY,1953,True,True,212,2,4,36,08B,1182599,1879695,2012,ERROR,41.825095178,-87.605598354,"(41.825095178, -87.605598354)" +4299664,HL609145,2005-09-13 08:30:00,014XX E 73RD ST,2820,OTHER OFFENSE,TELEPHONE THREAT,APARTMENT,1634,False,False,324,3,5,43,26,1186949,1856916,2005,ERROR,41.762485657,-87.590361895,"(41.762485657, -87.590361895)" +5945461,HN743993,2007-12-05 19:06:00,050XX W HURON ST,2092,NARCOTICS,SOLICIT NARCOTICS ON PUBLICWAY,STREET,551,True,False,1531,15,28,25,26,1142830,1904220,2007,2007-09-12 01:04:39,41.89322678,-87.750890754,"(41.89322678, -87.750890754)" +3283363,HK312676,2004-04-20 00:11:42,046XX N CLIFTON AVE,1220,DECEPTIVE PRACTICE,THEFT OF LOST/MISLAID PROP,STREET,2918,True,False,2311,19,46,3,11,1167636,1931034,2004,ERROR,41.966307576,-87.659012898,"(41.966307576, -87.659012898)" +4021146,HL375918,2005-05-24 12:46:15,107XX S EBERHART AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,2789,False,False,513,5,9,49,14,1181446,1833717,2005,ERROR,41.698953504,-87.6112443,"(41.698953504, -87.6112443)" +6928511,HR332778,2009-05-20 17:30:00,007XX W BARRY AVE,0810,THEFT,OVER $500,STREET,4362,False,False,2332,19,44,6,06,1170898,1920733,2009,ERROR,41.937970207,-87.647322338,"(41.937970207, -87.647322338)" +9938186,HY126791,2015-01-24 00:10:00,026XX W EVERGREEN AVE,1150,DECEPTIVE PRACTICE,CREDIT CARD FRAUD,RESIDENCE,3583,False,False,1423,14,26,24,11,1158479,1908916,2015,ERROR,41.905807118,-87.69328876,"(41.905807118, -87.69328876)" +2981789,HJ644907,2003-09-21 22:04:00,062XX S MORGAN ST,2027,NARCOTICS,POSS: CRACK,STREET,4061,True,False,712,7,16,68,18,1170765,1863047,2003,ERROR,41.779678145,-87.649499695,"(41.779678145, -87.649499695)" +2677516,HJ285368,2003-04-07 13:20:00,001XX W 72ND ST,2820,OTHER OFFENSE,TELEPHONE THREAT,RESIDENCE,1047,False,True,731,NA,6,69,26,1176827,1857294,2003,ERROR,41.763756849,-87.627448846,"(41.763756849, -87.627448846)" +2878862,HJ547518,2003-08-07 12:00:00,048XX W BELLE PLAINE AVE,0610,BURGLARY,FORCIBLE ENTRY,RESIDENCE,2191,False,False,1624,16,45,15,05,1143180,1926855,2003,ERROR,41.955332998,-87.749038868,"(41.955332998, -87.749038868)" +6312467,HP396461,2008-06-13 07:20:00,018XX W LAWRENCE AVE,0460,BATTERY,SIMPLE,PARKING LOT/GARAGE(NON.RESID.),4648,False,False,2032,20,47,4,08B,1163122,1931948,2008,ERROR,41.968911917,-87.675584255,"(41.968911917, -87.675584255)" +2168387,HH420999,2002-06-02 19:00:00,005XX W WILSON DR,0610,BURGLARY,FORCIBLE ENTRY,OTHER,867,False,False,2313,NA,46,3,05,1171655,1930932,2002,ERROR,41.965939938,-87.644238851,"(41.965939938, -87.644238851)" +4428519,HL721751,2005-11-07 17:35:28,003XX S CENTRAL AVE,0460,BATTERY,SIMPLE,STREET,2098,True,False,1522,15,29,25,08B,1139164,1897488,2005,ERROR,41.874820808,-87.764518699,"(41.874820808, -87.764518699)" +6253386,HP340946,2008-05-17 00:30:00,021XX W DIVISION ST,0610,BURGLARY,FORCIBLE ENTRY,RESIDENCE-GARAGE,1175,False,False,1424,14,32,24,05,1161971,1908008,2008,2008-02-06 10:11:07,41.903243283,-87.680486791,"(41.903243283, -87.680486791)" +2704055,HJ328889,2003-04-28 10:00:00,115XX S YALE AVE,2820,OTHER OFFENSE,TELEPHONE THREAT,STREET,1601,False,True,522,NA,34,53,26,1176713,1828501,2003,ERROR,41.684747613,-87.628730466,"(41.684747613, -87.628730466)" +1882196,G720932,2001-12-01 13:10:00,020XX S STATE ST,2024,NARCOTICS,POSS: HEROIN(WHITE),SIDEWALK,800,True,False,2111,NA,NA,NA,18,1176680,1890478,2001,ERROR,41.854820078,-87.626987993,"(41.854820078, -87.626987993)" +7507209,HS310705,2010-05-16 14:00:00,022XX S KOLIN AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,3702,False,True,1013,10,22,29,08B,1147967,1888437,2010,ERROR,41.849819116,-87.732430029,"(41.849819116, -87.732430029)" +5257400,HM683946,2006-10-26 19:50:02,002XX N KOSTNER AVE,2092,NARCOTICS,SOLICIT NARCOTICS ON PUBLICWAY,SIDEWALK,3908,True,False,1113,11,28,26,26,1146987,1900681,2006,ERROR,41.883436917,-87.735713976,"(41.883436917, -87.735713976)" +4144821,HL474019,2005-07-10 03:55:00,0000X W 69TH ST,033A,ROBBERY,ATTEMPT: ARMED-HANDGUN,CTA GARAGE / OTHER PROPERTY,1874,False,False,731,7,6,69,03,1177312,1859236,2005,ERROR,41.769074977,-87.62561266,"(41.769074977, -87.62561266)" +6107802,HP202858,2008-03-01 03:30:00,001XX E PERSHING RD,0890,THEFT,FROM BUILDING,HOTEL/MOTEL,2798,False,False,211,2,3,35,06,1177861,1879207,2008,2008-02-03 09:27:45,41.823864879,-87.622995394,"(41.823864879, -87.622995394)" +9057825,HW202237,2013-03-22 08:00:00,039XX N LAMON AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,2777,False,True,1634,16,45,15,14,1143003,1926071,2013,ERROR,41.953184943,-87.74970919,"(41.953184943, -87.74970919)" +10105129,HY293838,2015-06-09 11:30:00,034XX W 62ND ST,1330,CRIMINAL TRESPASS,TO LAND,RESIDENCE-GARAGE,3155,False,False,823,8,15,66,26,1154383,1863255,2015,ERROR,41.780590724,-87.709553096,"(41.780590724, -87.709553096)" +8759952,HV434029,2012-08-16 21:00:00,028XX E 128TH ST,0915,MOTOR VEHICLE THEFT,"TRUCK, BUS, MOTOR HOME",STREET,3407,False,False,433,4,10,55,07,1197309,1820733,2012,2012-04-09 11:30:20,41.662944388,-87.553592675,"(41.662944388, -87.553592675)" +7959811,HT190199,2011-03-05 19:15:00,028XX S PULASKI RD,1320,CRIMINAL DAMAGE,TO VEHICLE,VEHICLE NON-COMMERCIAL,1473,False,False,1031,10,22,30,14,1150127,1885011,2011,2011-08-03 08:38:18,41.840375986,-87.724591567,"(41.840375986, -87.724591567)" +3048313,HJ763595,2003-11-16 19:10:00,0000X N LOCKWOOD AVE,031A,ROBBERY,ARMED: HANDGUN,STREET,1950,False,False,1522,15,28,25,03,1141098,1899565,2003,ERROR,41.880484972,-87.757366589,"(41.880484972, -87.757366589)" +5843787,HN653880,2007-10-17 06:15:00,005XX W DIVERSEY PKWY,0820,THEFT,$500 AND UNDER,SIDEWALK,154,False,False,2333,19,44,6,06,1172289,1918919,2007,2014-04-12 12:43:35,41.932961861,-87.642263918,"(41.932961861, -87.642263918)" +2978407,HJ675858,2003-10-06 08:00:00,047XX N ARTESIAN AVE,0810,THEFT,OVER $500,STREET,3029,False,False,1911,19,47,4,06,1159226,1931185,2003,2014-04-12 12:43:35,41.966899389,-87.689930834,"(41.966899389, -87.689930834)" +6332578,HP413557,2008-06-21 14:00:00,060XX S HERMITAGE AVE,1750,OFFENSE INVOLVING CHILDREN,CHILD ABUSE,RESIDENCE,524,False,True,714,7,15,67,20,1165681,1864379,2008,ERROR,41.783442756,-87.66810053,"(41.783442756, -87.66810053)" +5107772,HM708459,2006-11-08 09:00:00,093XX S VINCENNES AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,DRIVEWAY - RESIDENTIAL,568,False,False,2222,22,21,73,14,1170848,1842818,2006,2006-11-11 07:40:50,41.724165299,-87.649784606,"(41.724165299, -87.649784606)" +7053138,HR458882,2009-07-31 17:50:00,053XX W CHICAGO AVE,2027,NARCOTICS,POSS: CRACK,SIDEWALK,3429,True,False,1524,15,37,25,18,1140842,1904779,2009,ERROR,41.894797544,-87.758178285,"(41.894797544, -87.758178285)" +3752876,HK761921,2004-11-19 21:59:00,035XX W VAN BUREN ST,2092,NARCOTICS,SOLICIT NARCOTICS ON PUBLICWAY,SIDEWALK,2319,True,False,1133,11,28,27,26,1152952,1897760,2004,ERROR,41.875305308,-87.713887327,"(41.875305308, -87.713887327)" +8246665,HT470888,2011-08-28 17:00:00,043XX N CALIFORNIA AVE,0610,BURGLARY,FORCIBLE ENTRY,CAR WASH,1992,False,False,1724,17,33,16,05,1156889,1928818,2011,ERROR,41.960452042,-87.698588153,"(41.960452042, -87.698588153)" +8588225,HV262806,2012-04-28 22:55:00,013XX W 15TH ST,1350,CRIMINAL TRESPASS,TO STATE SUP LAND,CHA PARKING LOT/GROUNDS,2791,True,False,1231,12,2,28,26,1167750,1892902,2012,ERROR,41.861668647,-87.659694953,"(41.861668647, -87.659694953)" +4546442,HM132623,2006-01-18 12:40:00,021XX N MELVINA AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,2714,False,False,2512,25,29,19,14,1134778,1913205,2006,ERROR,41.91802893,-87.780250515,"(41.91802893, -87.780250515)" +4972684,HM583449,2006-09-04 17:00:00,050XX S ELIZABETH ST,0460,BATTERY,SIMPLE,STREET,1534,False,False,933,9,16,61,08B,1168804,1871336,2006,2006-03-10 05:10:58,41.802466697,-87.656449709,"(41.802466697, -87.656449709)" +7723442,HS530831,2010-09-23 23:32:00,003XX W SCOTT ST,031A,ROBBERY,ARMED: HANDGUN,STREET,4018,True,False,1821,18,27,8,03,1173890,1908750,2010,2011-10-05 09:12:33,41.905022117,-87.636684012,"(41.905022117, -87.636684012)" +2773492,HJ393599,2003-05-29 03:10:00,008XX N SPRINGFIELD AVE,2027,NARCOTICS,POSS: CRACK,STREET,844,True,False,1112,NA,27,23,18,1150284,1905083,2003,ERROR,41.895452828,-87.72349217,"(41.895452828, -87.72349217)" +3692637,HK794797,2004-12-07 11:00:31,018XX W 34TH ST,0920,MOTOR VEHICLE THEFT,ATT: AUTOMOBILE,STREET,3810,False,False,922,9,11,59,07,1164352,1882114,2004,ERROR,41.832137795,-87.672473125,"(41.832137795, -87.672473125)" +4219807,HL460633,2005-07-03 19:58:47,010XX N LECLAIRE AVE,2027,NARCOTICS,POSS: CRACK,SIDEWALK,2203,True,False,1531,15,37,25,18,1142213,1906317,2005,ERROR,41.898992665,-87.753104713,"(41.898992665, -87.753104713)" +2573876,HJ163682,2003-02-03 19:00:00,038XX N PLAINFIELD AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,2418,False,False,1631,NA,36,17,14,1119989,1924864,2003,ERROR,41.950271676,-87.834338101,"(41.950271676, -87.834338101)" +4071798,HL321033,2005-04-27 11:45:00,008XX N HUDSON AVE,2027,NARCOTICS,POSS: CRACK,STREET,4486,True,False,1823,18,27,8,18,1172997,1905793,2005,ERROR,41.896927801,-87.640052025,"(41.896927801, -87.640052025)" +4818852,HM291602,2006-04-14 23:58:42,026XX W 23RD PL,2230,LIQUOR LAW VIOLATION,ILLEGAL CONSUMPTION BY MINOR,SIDEWALK,2628,False,False,1034,10,28,30,22,1158965,1888336,2006,ERROR,41.849323686,-87.69206834,"(41.849323686, -87.69206834)" +7027138,HR426417,2009-07-13 04:45:00,060XX S WABASH AVE,0620,BURGLARY,UNLAWFUL ENTRY,RESIDENCE,3907,False,False,311,3,20,40,05,1177713,1864904,2009,ERROR,41.784619498,-87.623971417,"(41.784619498, -87.623971417)" +9581848,HX232365,2014-04-21 23:03:00,015XX W SUPERIOR ST,1310,CRIMINAL DAMAGE,TO PROPERTY,APARTMENT,4430,False,False,1215,12,27,24,14,1165974,1905059,2014,ERROR,41.895066484,-87.66586726,"(41.895066484, -87.66586726)" +9174144,HW318226,2013-06-11 00:01:00,014XX W ROSEMONT AVE,0841,THEFT,FINANCIAL ID THEFT:$300 &UNDER,APARTMENT,4653,False,False,2433,24,40,77,06,1165397,1941952,2013,ERROR,41.996314969,-87.666932963,"(41.996314969, -87.666932963)" +5992602,HP100090,2008-01-01 00:30:00,063XX S DR MARTIN LUTHER KING JR DR,051A,ASSAULT,AGGRAVATED: HANDGUN,SIDEWALK,3889,False,False,312,3,20,69,04A,1179974,1862865,2008,2008-06-01 06:49:00,41.778972797,-87.615744123,"(41.778972797, -87.615744123)" +2254466,HH524868,2002-07-21 05:00:00,006XX N ST CLAIR ST,0460,BATTERY,SIMPLE,STREET,3497,False,False,1834,NA,42,8,08B,1177765,1904573,2002,ERROR,41.893473003,-87.622577223,"(41.893473003, -87.622577223)" +7861681,HS675991,2010-12-20 07:00:00,016XX W WRIGHTWOOD AVE,0890,THEFT,FROM BUILDING,RESIDENCE-GARAGE,741,False,False,1931,19,32,7,06,1164728,1917284,2010,ERROR,41.928639204,-87.670096285,"(41.928639204, -87.670096285)" +4305016,HL615231,2005-09-15 19:00:00,014XX W ESTES AVE,0820,THEFT,$500 AND UNDER,STREET,331,False,False,2423,24,49,1,06,1165114,1947454,2005,2014-04-12 12:43:35,42.011418612,-87.667816666,"(42.011418612, -87.667816666)" +6978791,HR377687,2009-06-16 05:00:00,064XX S WINCHESTER AVE,2825,OTHER OFFENSE,HARASSMENT BY TELEPHONE,RESIDENCE,4805,True,False,726,7,15,67,26,1164424,1861895,2009,ERROR,41.776652928,-87.672779095,"(41.776652928, -87.672779095)" +7951980,HT184140,2011-03-01 16:00:00,069XX S MAPLEWOOD AVE,0560,ASSAULT,SIMPLE,APARTMENT,4213,False,True,832,8,15,66,08A,1160614,1858473,2011,2011-03-03 11:09:39,41.767341932,-87.686840757,"(41.767341932, -87.686840757)" +9319944,HW463891,2013-09-23 15:24:00,007XX N MENARD AVE,0650,BURGLARY,HOME INVASION,APARTMENT,3017,False,False,1511,15,29,25,05,1137630,1904607,2013,2013-09-10 17:10:49,41.894384033,-87.769979402,"(41.894384033, -87.769979402)" +6757834,HR174805,2009-02-17 16:34:15,070XX S WENTWORTH AVE,1330,CRIMINAL TRESPASS,TO LAND,CURRENCY EXCHANGE,3968,True,False,731,7,6,69,26,1176225,1857985,2009,ERROR,41.765666567,-87.629634577,"(41.765666567, -87.629634577)" +4825337,HM438385,2006-04-20 09:00:00,023XX S LAKE SHORE DR E,0890,THEFT,FROM BUILDING,OTHER,2059,False,False,133,1,2,33,06,1180538,1889157,2006,ERROR,41.851107212,-87.612868333,"(41.851107212, -87.612868333)" +8933517,HV605679,2012-12-17 02:14:00,012XX S SPRINGFIELD AVE,0820,THEFT,$500 AND UNDER,STREET,31,False,False,1011,10,24,29,06,1150625,1893795,2012,ERROR,41.864470661,-87.722534804,"(41.864470661, -87.722534804)" +3080102,HJ805073,2003-12-04 19:00:00,043XX N KEDVALE AVE,2820,OTHER OFFENSE,TELEPHONE THREAT,APARTMENT,2862,False,True,1722,17,39,16,26,1148110,1928515,2003,ERROR,41.959794498,-87.730872135,"(41.959794498, -87.730872135)" +7734425,HS535056,2010-09-25 17:30:00,088XX S LOWE AVE,0810,THEFT,OVER $500,STREET,3573,False,False,2223,22,21,71,06,1173480,1846204,2010,2010-02-10 09:42:41,41.733399192,-87.640043801,"(41.733399192, -87.640043801)" +9596026,HX246438,2014-05-02 23:30:00,005XX N KEDZIE AVE,033A,ROBBERY,ATTEMPT: ARMED-HANDGUN,STREET,4495,False,False,1121,11,27,23,03,1154906,1903472,2014,2014-07-05 00:40:24,41.890940685,-87.706559801,"(41.890940685, -87.706559801)" +9870090,HX520069,2014-11-25 11:40:00,053XX N WESTERN AVE,0460,BATTERY,SIMPLE,NURSING HOME/RETIREMENT HOME,2515,False,False,2011,20,40,4,08B,1159335,1935518,2014,2014-02-12 12:51:55,41.978787101,-87.689410305,"(41.978787101, -87.689410305)" +8508277,HV185019,2012-03-06 08:40:00,072XX S COLES AVE,1360,CRIMINAL TRESPASS,TO VEHICLE,STREET,3879,True,False,334,3,7,43,26,1194431,1857617,2012,2012-06-03 15:34:55,41.764228646,-87.562916763,"(41.764228646, -87.562916763)" +2177946,HH431848,2002-06-03 16:00:00,041XX W 31ST ST,0840,THEFT,FINANCIAL ID THEFT: OVER $300,RESIDENCE,868,False,False,1031,NA,22,30,06,1149298,1883758,2002,ERROR,41.836953671,-87.727666121,"(41.836953671, -87.727666121)" +1986260,HH132885,2002-01-17 20:40:00,030XX W MADISON ST,1506,PROSTITUTION,SOLICIT ON PUBLIC WAY,STREET,1187,True,False,1124,NA,NA,NA,16,1156378,1899829,2002,ERROR,41.880914312,-87.701252404,"(41.880914312, -87.701252404)" +9234994,HW381728,2013-07-26 09:30:00,0000X W WACKER DR,0820,THEFT,$500 AND UNDER,SIDEWALK,318,False,False,111,1,42,32,06,1175775,1902091,2013,ERROR,41.886707265,-87.629960428,"(41.886707265, -87.629960428)" +7988307,HT219886,2011-03-25 20:58:00,009XX N MOZART ST,0486,BATTERY,DOMESTIC BATTERY SIMPLE,APARTMENT,797,True,True,1311,12,26,24,08B,1157172,1906205,2011,ERROR,41.898394561,-87.69816358,"(41.898394561, -87.69816358)" +7278970,HR694241,2009-12-17 11:00:00,041XX N GREENVIEW AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,APARTMENT,4882,False,False,1923,19,47,6,14,1165286,1927513,2009,ERROR,41.956696233,-87.66775397,"(41.956696233, -87.66775397)" +8025601,HT256918,2011-04-19 13:00:00,076XX S KINGSTON AVE,143A,WEAPONS VIOLATION,UNLAWFUL POSS OF HANDGUN,APARTMENT,2051,True,False,421,4,7,43,15,1194477,1854868,2011,ERROR,41.756684054,-87.562838411,"(41.756684054, -87.562838411)" +2962454,HJ650469,2003-09-24 11:45:00,0000X W 79TH ST,1210,DECEPTIVE PRACTICE,THEFT OF LABOR/SERVICES,OTHER,2463,True,False,623,6,6,44,11,1177482,1852588,2003,ERROR,41.750828271,-87.625190123,"(41.750828271, -87.625190123)" +3532647,HK574001,2004-08-22 14:49:40,056XX S WINCHESTER AVE,2014,NARCOTICS,MANU/DELIVER: HEROIN (WHITE),SIDEWALK,1797,True,False,715,7,15,67,18,1164271,1867524,2004,ERROR,41.792102855,-87.673181553,"(41.792102855, -87.673181553)" +3038829,HJ750788,2003-11-10 15:25:00,020XX S KOSTNER AVE,0560,ASSAULT,SIMPLE,OTHER,4836,True,False,1012,10,24,29,08A,1147406,1890054,2003,ERROR,41.854267127,-87.734447612,"(41.854267127, -87.734447612)" +9806012,HX453692,2014-10-03 13:30:00,023XX N PULASKI RD,0810,THEFT,OVER $500,PARKING LOT/GARAGE(NON.RESID.),2254,False,False,2525,25,31,20,06,1149281,1915512,2014,2014-10-10 12:36:29,41.924090526,-87.72690517,"(41.924090526, -87.72690517)" +3511264,HK589583,2004-08-29 14:30:00,022XX N CANNON DR,0820,THEFT,$500 AND UNDER,STREET,219,False,False,1814,18,43,7,06,1175058,1914939,2004,2014-04-12 12:43:35,41.921978896,-87.632207786,"(41.921978896, -87.632207786)" +5053020,HM659802,2006-10-14 14:45:00,035XX S WESTERN BLVD,0486,BATTERY,DOMESTIC BATTERY SIMPLE,APARTMENT,2470,False,False,913,9,11,59,08B,1161140,1881089,2006,ERROR,41.829392282,-87.684286808,"(41.829392282, -87.684286808)" +8357212,HT590698,2011-11-15 15:45:00,040XX W WEST END AVE,0470,PUBLIC PEACE VIOLATION,RECKLESS CONDUCT,STREET,2682,True,False,1114,11,28,26,24,1149062,1900618,2011,ERROR,41.883224133,-87.728095989,"(41.883224133, -87.728095989)" +2234104,HH504870,2002-07-12 13:00:00,016XX S SPRINGFIELD AVE,0420,BATTERY,AGGRAVATED:KNIFE/CUTTING INSTR,SIDEWALK,557,False,False,1014,NA,24,29,04B,1150624,1891627,2002,ERROR,41.858521432,-87.722595091,"(41.858521432, -87.722595091)" +5023389,HM632245,2006-09-29 19:00:00,012XX N LA SALLE DR,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,549,False,False,1821,18,43,8,14,1174869,1908585,2006,2006-03-10 05:10:58,41.904547475,-87.633092826,"(41.904547475, -87.633092826)" +4167710,HL497000,2005-07-18 14:07:00,039XX N RAVENSWOOD AVE,2820,OTHER OFFENSE,TELEPHONE THREAT,RESIDENCE,1045,False,False,1923,19,47,6,26,1163702,1926130,2005,ERROR,41.952934826,-87.673616315,"(41.952934826, -87.673616315)" +2170727,HH421736,2002-06-05 21:00:00,100XX W OHARE ST,0460,BATTERY,SIMPLE,AIRPORT/AIRCRAFT,994,False,False,1651,NA,41,76,08B,1100635,1934208,2002,ERROR,41.976200173,-87.905312411,"(41.976200173, -87.905312411)" +2294558,HH580615,2002-08-14 08:30:00,025XX N BOSWORTH AVE,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,3119,False,False,1931,NA,32,7,07,1165613,1916698,2002,ERROR,41.927012356,-87.666860956,"(41.927012356, -87.666860956)" +7991942,HT224010,2011-03-28 20:45:00,063XX S ARTESIAN AVE,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,SIDEWALK,1474,True,False,825,8,15,66,18,1161174,1862364,2011,ERROR,41.778007816,-87.684680539,"(41.778007816, -87.684680539)" +3096983,HJ825511,2003-12-18 17:20:00,075XX N CLARK ST,0860,THEFT,RETAIL THEFT,DEPARTMENT STORE,706,True,False,2422,24,49,1,06,1162974,1949868,2003,ERROR,42.018088059,-87.675622371,"(42.018088059, -87.675622371)" +2315170,HH603150,2002-08-25 01:40:00,093XX S PARNELL AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE-GARAGE,3586,False,False,2223,NA,21,73,14,1174239,1842710,2002,ERROR,41.723794372,-87.637366715,"(41.723794372, -87.637366715)" +4440071,HL737554,2005-11-15 19:05:00,032XX W 63RD ST,031A,ROBBERY,ARMED: HANDGUN,GROCERY FOOD STORE,4578,False,False,823,8,15,66,03,1155598,1862622,2005,ERROR,41.778829406,-87.705115599,"(41.778829406, -87.705115599)" +7177547,HR586223,2009-10-09 10:00:00,081XX S PAULINA ST,0610,BURGLARY,FORCIBLE ENTRY,APARTMENT,2086,False,False,614,6,18,71,05,1166467,1850703,2009,2009-10-11 13:28:08,41.745897252,-87.665608013,"(41.745897252, -87.665608013)" +3254737,HK280639,2004-03-01 00:00:00,067XX S MERRILL AVE,2820,OTHER OFFENSE,TELEPHONE THREAT,RESIDENCE,4572,False,False,331,3,5,43,26,1191738,1860941,2004,ERROR,41.773415721,-87.57267934,"(41.773415721, -87.57267934)" +3311197,HK345294,2004-05-05 21:35:00,008XX N CALIFORNIA AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,SIDEWALK,1400,True,True,1311,12,26,24,08B,1157536,1905231,2004,ERROR,41.895714416,-87.69685317,"(41.895714416, -87.69685317)" +2302106,HH588911,2002-08-17 21:00:00,041XX S CAMPBELL AVE,0620,BURGLARY,UNLAWFUL ENTRY,RESIDENCE,1887,False,False,914,NA,12,58,05,1160346,1876870,2002,ERROR,41.817831272,-87.687316372,"(41.817831272, -87.687316372)" +6488303,HP564304,2008-09-10 18:17:00,001XX W BRAYTON ST,0560,ASSAULT,SIMPLE,RESIDENCE PORCH/HALLWAY,4667,False,False,523,5,9,53,08A,1177795,1821422,2008,ERROR,41.665297395,-87.62498261,"(41.665297395, -87.62498261)" +5443072,HN275682,2006-02-01 08:00:00,006XX E 89TH ST,0840,THEFT,FINANCIAL ID THEFT: OVER $300,RESIDENCE,2116,False,False,632,6,6,44,06,1182025,1846146,2006,ERROR,41.733046889,-87.608741291,"(41.733046889, -87.608741291)" +9210579,HW356745,2013-07-05 22:00:00,100XX S PROSPECT AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,594,False,False,2213,22,19,72,14,1167485,1837705,2013,ERROR,41.710207052,-87.662249162,"(41.710207052, -87.662249162)" +9287060,HW431457,2013-08-30 19:00:00,081XX S EUCLID AVE,0890,THEFT,FROM BUILDING,APARTMENT,1161,False,False,414,4,8,46,06,1190659,1851058,2013,2013-01-09 07:31:32,41.746322062,-87.576953181,"(41.746322062, -87.576953181)" +5794196,HN603823,2007-09-21 23:33:00,078XX S EAST END AVE,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,STREET,1314,True,False,414,4,8,43,18,1188864,1853073,2007,ERROR,41.751894519,-87.583466017,"(41.751894519, -87.583466017)" +4344629,HL643695,2005-09-29 21:00:00,063XX S PULASKI RD,051A,ASSAULT,AGGRAVATED: HANDGUN,STREET,2707,False,False,813,8,13,65,04A,1150755,1862153,2005,ERROR,41.777638112,-87.722882838,"(41.777638112, -87.722882838)" +6191990,HP281294,2008-04-15 15:00:00,006XX W WAVELAND AVE,0810,THEFT,OVER $500,STREET,932,False,False,2323,19,46,6,06,1171539,1925299,2008,ERROR,41.950485378,-87.644831764,"(41.950485378, -87.644831764)" +8304880,HT539173,2011-10-12 03:00:00,056XX W WASHINGTON BLVD,1310,CRIMINAL DAMAGE,TO PROPERTY,APARTMENT,3476,False,True,1512,15,29,25,14,1138540,1900218,2011,ERROR,41.882323613,-87.766743629,"(41.882323613, -87.766743629)" +1587243,G356113,2001-06-18 20:30:00,045XX N CLARK ST,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,4800,False,False,1922,NA,NA,NA,07,1165538,1930394,2001,ERROR,41.964596441,-87.66674516,"(41.964596441, -87.66674516)" +9232964,HW379118,2013-07-25 19:00:00,060XX N FRANCISCO AVE,0460,BATTERY,SIMPLE,APARTMENT,4723,False,False,2413,24,50,2,08B,1155879,1940034,2013,ERROR,41.991249811,-87.701997517,"(41.991249811, -87.701997517)" +5382099,HN230597,2007-03-15 20:30:00,016XX N PAULINA ST,0610,BURGLARY,FORCIBLE ENTRY,APARTMENT,562,False,False,1433,14,1,24,05,1164792,1911272,2007,2007-02-08 01:58:25,41.912140543,-87.670031984,"(41.912140543, -87.670031984)" +8703573,HV379876,2012-07-12 19:30:00,040XX W LAKE ST,1210,DECEPTIVE PRACTICE,THEFT OF LABOR/SERVICES,CTA GARAGE / OTHER PROPERTY,4140,True,False,1114,11,28,26,11,1149648,1901481,2012,ERROR,41.885580938,-87.725921713,"(41.885580938, -87.725921713)" +6026181,HP129984,2008-01-17 13:00:00,029XX S LOOMIS ST,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,1082,True,False,923,9,11,60,07,1168373,1885564,2008,ERROR,41.841519091,-87.657620002,"(41.841519091, -87.657620002)" +3088718,HJ812750,2003-12-11 23:20:00,019XX N KARLOV AVE,0650,BURGLARY,HOME INVASION,RESIDENCE,2638,False,False,2534,25,30,20,05,1148701,1912536,2003,ERROR,41.915935339,-87.729113388,"(41.915935339, -87.729113388)" +3998545,HL355767,2005-05-14 10:20:57,023XX E 75TH ST,0454,BATTERY,AGG PO HANDS NO/MIN INJURY,GAS STATION,1092,True,False,334,3,7,43,08B,1193470,1855738,2005,ERROR,41.759096092,-87.566500388,"(41.759096092, -87.566500388)" +7613298,HS418212,2010-07-19 00:30:00,056XX S NEENAH AVE,0820,THEFT,$500 AND UNDER,STREET,101,False,False,811,8,23,56,06,1133641,1866435,2010,ERROR,41.789704965,-87.785524264,"(41.789704965, -87.785524264)" +6980905,HR385311,2009-06-19 20:00:00,024XX N CICERO AVE,0610,BURGLARY,FORCIBLE ENTRY,OTHER,902,False,False,2521,25,31,19,05,1143947,1915964,2009,ERROR,41.9254327,-87.746493281,"(41.9254327, -87.746493281)" +4628112,HM225198,2006-03-10 20:00:00,089XX S RIDGELAND AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,1600,False,False,413,4,8,48,14,1189473,1845824,2006,ERROR,41.731987986,-87.581466439,"(41.731987986, -87.581466439)" +9426414,HW569938,2013-12-12 11:45:00,012XX N ASHLAND AVE,031A,ROBBERY,ARMED: HANDGUN,CTA BUS STOP,2851,False,False,1424,14,1,24,03,1165544,1908172,2013,ERROR,41.903617945,-87.667357779,"(41.903617945, -87.667357779)" +5040428,HM649718,2006-10-09 02:00:00,005XX S CAMPBELL AVE,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,4722,False,False,1135,11,2,28,07,1159775,1897648,2006,ERROR,41.874860113,-87.68883898,"(41.874860113, -87.68883898)" +9176835,HW321707,2013-06-16 19:30:00,055XX W GRAND AVE,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,POLICE FACILITY/VEH PARKING LOT,3141,True,False,2515,25,29,19,18,1138769,1913443,2013,ERROR,41.918610464,-87.765581339,"(41.918610464, -87.765581339)" +9817998,HX467737,2014-10-14 15:30:00,020XX N MILWAUKEE AVE,0820,THEFT,$500 AND UNDER,OTHER,287,False,False,1431,14,1,22,06,1159346,1913460,2014,ERROR,41.918258409,-87.689978754,"(41.918258409, -87.689978754)" +1398760,G114124,2001-02-22 23:55:00,082XX S JEFFERY BL,0820,THEFT,$500 AND UNDER,PARKING LOT/GARAGE(NON.RESID.),273,False,False,414,NA,NA,NA,06,1190990,1850969,2001,2014-04-12 12:43:35,41.746069847,-87.575743214,"(41.746069847, -87.575743214)" +4410684,HL706234,2005-10-29 09:00:00,044XX N RAVENSWOOD AVE,0810,THEFT,OVER $500,STREET,3661,False,False,1922,19,47,3,06,1163617,1929327,2005,2014-04-12 12:43:35,41.961709338,-87.673838335,"(41.961709338, -87.673838335)" +3516152,HK591240,2004-08-29 15:30:00,048XX N PAULINA ST,0820,THEFT,$500 AND UNDER,STREET,171,False,False,2032,20,47,3,06,1164401,1932012,2004,2014-04-12 12:43:35,41.969060495,-87.670879593,"(41.969060495, -87.670879593)" +4894707,HM510203,2006-07-30 11:00:00,047XX N SAWYER AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,RESIDENTIAL YARD (FRONT/BACK),4021,False,False,1713,17,33,14,14,1153814,1931419,2006,2006-02-08 04:53:53,41.967651297,-87.709823827,"(41.967651297, -87.709823827)" +9622145,HX271986,2014-05-22 13:00:00,017XX N HALSTED ST,0820,THEFT,$500 AND UNDER,STREET,139,False,False,1813,18,43,7,06,1170734,1911649,2014,ERROR,41.91304688,-87.648191824,"(41.91304688, -87.648191824)" +4015702,HL308318,2005-04-21 01:56:40,042XX S PRAIRIE AVE,1506,PROSTITUTION,SOLICIT ON PUBLIC WAY,STREET,2725,True,False,214,2,3,38,16,1178699,1877152,2005,ERROR,41.81820674,-87.619983684,"(41.81820674, -87.619983684)" +3849018,HL221418,2005-03-07 20:10:00,113XX S EDBROOKE AVE,0430,BATTERY,AGGRAVATED: OTHER DANG WEAPON,STREET,1114,True,False,531,5,9,49,04B,1179176,1829999,2005,ERROR,41.68880271,-87.619668717,"(41.68880271, -87.619668717)" +6545175,HP615080,2008-10-08 08:55:39,073XX S PHILLIPS AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,APARTMENT,1777,False,True,334,3,7,43,08B,1193960,1856732,2008,2008-10-10 05:55:47,41.761811703,-87.564672045,"(41.761811703, -87.564672045)" +2948741,HJ636339,2003-09-17 19:10:00,011XX N MAYFIELD AVE,2820,OTHER OFFENSE,TELEPHONE THREAT,RESIDENCE,2818,False,True,1511,15,29,25,26,1136769,1907269,2003,ERROR,41.901704366,-87.773077802,"(41.901704366, -87.773077802)" +5845070,HN655038,2007-10-15 06:15:00,056XX W LAKE ST,0810,THEFT,OVER $500,STREET,1243,False,False,1512,15,29,25,06,1138390,1902170,2007,2014-04-12 12:43:35,41.88768287,-87.767247156,"(41.88768287, -87.767247156)" +5008839,HM618424,2006-09-23 13:20:00,017XX N HUMBOLDT BLVD,0320,ROBBERY,STRONGARM - NO WEAPON,SIDEWALK,4129,False,False,1421,14,35,23,03,1156056,1911677,2006,2006-01-10 07:25:21,41.913432802,-87.702114688,"(41.913432802, -87.702114688)" +8587110,HV261318,2012-04-27 21:40:00,084XX S MANISTEE AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,APARTMENT,4048,False,False,423,4,7,46,08B,1195995,1849774,2012,ERROR,41.742668288,-87.557443682,"(41.742668288, -87.557443682)" +7872477,HT102978,2011-01-03 10:30:00,034XX E 133RD ST,0810,THEFT,OVER $500,STREET,3405,False,False,433,4,10,55,06,1201126,1817424,2011,2011-04-01 07:20:15,41.653768523,-87.539736212,"(41.653768523, -87.539736212)" +9916472,HY105958,2014-11-26 12:00:00,030XX E 92ND ST,1110,DECEPTIVE PRACTICE,BOGUS CHECK,BANK,4969,False,False,424,4,10,46,11,1198084,1844583,2014,2015-08-01 12:39:18,41.728371838,-87.549962839,"(41.728371838, -87.549962839)" +9490762,HX144691,2014-02-07 22:00:00,055XX S ALBANY AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,3213,False,False,824,8,14,63,14,1156621,1867583,2014,2014-12-02 00:40:02,41.792422534,-87.701231458,"(41.792422534, -87.701231458)" +5857483,HN656362,2007-10-18 18:45:00,005XX E 107TH ST,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,2928,False,True,512,5,9,49,08B,1181507,1834155,2007,ERROR,41.700154031,-87.611007498,"(41.700154031, -87.611007498)" +2535237,HJ109917,2002-12-20 15:00:00,074XX S COLFAX AVE,1562,SEX OFFENSE,AGG CRIMINAL SEXUAL ABUSE,APARTMENT,4858,False,False,334,NA,7,43,17,1194702,1856124,2002,ERROR,41.76012508,-87.561972571,"(41.76012508, -87.561972571)" +8804120,HV477870,2012-09-16 03:10:00,047XX S LOOMIS BLVD,0460,BATTERY,SIMPLE,RESIDENTIAL YARD (FRONT/BACK),3213,False,False,933,9,3,61,08B,1167835,1873371,2012,ERROR,41.808071849,-87.659944973,"(41.808071849, -87.659944973)" +3273588,HK301044,2004-04-14 11:45:00,012XX S KOSTNER AVE,031A,ROBBERY,ARMED: HANDGUN,STREET,1578,False,False,1011,10,24,29,03,1147285,1893972,2004,ERROR,41.865020926,-87.734791482,"(41.865020926, -87.734791482)" +7072295,HR477075,2009-08-08 19:00:00,001XX E 47TH ST,0870,THEFT,POCKET-PICKING,BAR OR TAVERN,3597,False,False,224,2,3,38,06,1178126,1873860,2009,2009-12-08 13:56:14,41.809186244,-87.622185553,"(41.809186244, -87.622185553)" +9162055,HW306837,2013-04-09 11:00:00,068XX S CORNELL AVE,2820,OTHER OFFENSE,TELEPHONE THREAT,RESIDENCE,3084,False,True,332,3,5,43,26,1188350,1859644,2013,2013-09-06 03:34:44,41.769938203,-87.585140129,"(41.769938203, -87.585140129)" +2688193,HJ309724,2003-04-18 19:30:00,022XX N STOCKTON DR,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,2743,False,False,1814,NA,43,7,14,1174127,1915368,2003,ERROR,41.923176926,-87.635615683,"(41.923176926, -87.635615683)" +7691340,HS497006,2010-09-03 13:07:00,009XX E MARQUETTE RD,0486,BATTERY,DOMESTIC BATTERY SIMPLE,ALLEY,1215,False,True,321,3,5,42,08B,1183558,1861405,2010,2010-08-09 07:54:48,41.774883602,-87.602650487,"(41.774883602, -87.602650487)" +3282771,HK213978,2004-03-01 16:53:11,007XX W 61ST ST,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,SIDEWALK,1555,True,False,711,7,16,68,18,1172314,1864376,2004,ERROR,41.783291129,-87.643781806,"(41.783291129, -87.643781806)" +4751054,HM261185,2006-03-30 12:02:00,011XX N RIDGEWAY AVE,2095,NARCOTICS,ATTEMPT POSSESSION NARCOTICS,STREET,2426,True,False,1112,11,27,23,18,1151136,1907139,2006,ERROR,41.901078036,-87.720308999,"(41.901078036, -87.720308999)" +5962440,HN757326,2007-12-12 22:20:00,055XX W ADAMS ST,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,1914,False,False,1522,15,29,25,07,1139406,1898740,2007,2008-06-01 01:05:00,41.878252056,-87.76359965,"(41.878252056, -87.76359965)" +1834047,G670254,2001-11-06 18:00:00,013XX W ERIE ST,0560,ASSAULT,SIMPLE,STREET,3142,False,False,1324,NA,NA,NA,08A,1167244,1904514,2001,ERROR,41.89354376,-87.661218582,"(41.89354376, -87.661218582)" +3301460,HK334439,2004-04-30 13:30:00,022XX N AUSTIN AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,4380,False,True,2515,25,37,19,08B,1136060,1914635,2004,ERROR,41.921930233,-87.77550612,"(41.921930233, -87.77550612)" +2669621,HJ286771,2003-04-06 01:00:00,030XX W 55TH ST,0460,BATTERY,SIMPLE,STREET,2322,False,False,824,NA,14,63,08B,1157258,1867977,2003,ERROR,41.793490848,-87.69888499,"(41.793490848, -87.69888499)" +6369079,HP455430,2008-07-16 06:10:00,076XX S PHILLIPS AVE,0560,ASSAULT,SIMPLE,STREET,4088,False,False,421,4,7,43,08A,1193825,1854450,2008,ERROR,41.755553029,-87.565241501,"(41.755553029, -87.565241501)" +6855131,HR261020,2009-04-10 00:00:00,014XX W ERIE ST,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,3068,False,False,1324,12,27,24,14,1166896,1904503,2009,ERROR,41.893521048,-87.662496975,"(41.893521048, -87.662496975)" +4274768,HL591848,2005-09-04 20:00:00,033XX W WRIGHTWOOD AVE,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,2202,False,False,1412,14,35,22,07,1153390,1917123,2005,ERROR,41.928430509,-87.711764046,"(41.928430509, -87.711764046)" +6197251,HP285608,2008-04-17 18:30:00,030XX W FILLMORE ST,1320,CRIMINAL DAMAGE,TO VEHICLE,PARKING LOT/GARAGE(NON.RESID.),3447,True,False,1134,11,28,29,14,1155966,1895253,2008,ERROR,41.868365618,-87.702888661,"(41.868365618, -87.702888661)" +8433392,HV111791,2012-01-10 01:40:00,067XX S ST LAWRENCE AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,3287,False,True,321,3,20,42,08B,1181358,1860502,2012,ERROR,41.772456691,-87.610743096,"(41.772456691, -87.610743096)" +7505865,HS308821,2010-05-04 08:00:00,080XX S SANGAMON ST,2825,OTHER OFFENSE,HARASSMENT BY TELEPHONE,RESIDENCE,3502,False,True,621,6,21,71,26,1171334,1851481,2010,ERROR,41.747927164,-87.647751629,"(41.747927164, -87.647751629)" +7557528,HS361664,2010-06-15 19:11:00,016XX S KARLOV AVE,2027,NARCOTICS,POSS: CRACK,RESIDENCE,863,True,False,1012,10,24,29,18,1149364,1891408,2010,ERROR,41.85794497,-87.727225818,"(41.85794497, -87.727225818)" +6702067,HR108720,2009-01-06 14:45:00,004XX S KEELER AVE,0460,BATTERY,SIMPLE,"SCHOOL, PUBLIC, GROUNDS",4011,False,False,1132,11,24,26,08B,1148424,1897525,2009,ERROR,41.874748911,-87.730518558,"(41.874748911, -87.730518558)" +6400565,HP436822,2008-07-06 21:08:22,064XX S CALIFORNIA AVE,2092,NARCOTICS,SOLICIT NARCOTICS ON PUBLICWAY,SIDEWALK,1031,True,False,825,8,15,66,26,1158854,1861997,2008,2008-03-08 06:46:11,41.777048422,-87.693195807,"(41.777048422, -87.693195807)" +3736578,HL102041,2005-01-02 00:30:00,065XX S LOOMIS BLVD,0810,THEFT,OVER $500,VEHICLE NON-COMMERCIAL,1274,False,False,725,7,17,67,06,1168076,1861511,2005,2014-04-12 12:43:35,41.775521427,-87.659402042,"(41.775521427, -87.659402042)" +9845718,HX495009,2014-11-04 15:30:00,013XX W 95TH ST,0810,THEFT,OVER $500,"SCHOOL, PUBLIC, BUILDING",2826,False,False,2213,22,21,73,06,1169214,1841722,2014,2014-11-11 12:41:33,41.72119316,-87.655801492,"(41.72119316, -87.655801492)" +5253960,HN130561,2007-01-16 00:00:00,024XX N LINCOLN AVE,2825,OTHER OFFENSE,HARASSMENT BY TELEPHONE,RESIDENCE,2443,False,False,1933,19,43,7,26,1170249,1916386,2007,ERROR,41.926056068,-87.649834888,"(41.926056068, -87.649834888)" +3927220,HL299821,2005-04-16 22:55:00,009XX W 32ND PL,0460,BATTERY,SIMPLE,APARTMENT,951,False,False,924,9,11,60,08B,1170602,1883473,2005,ERROR,41.835732786,-87.64950144,"(41.835732786, -87.64950144)" +5904951,HN703395,2007-11-11 10:00:00,053XX S PULASKI RD,1152,DECEPTIVE PRACTICE,ILLEGAL USE CASH CARD,GROCERY FOOD STORE,2864,False,False,815,8,23,62,11,1150568,1868904,2007,ERROR,41.796167541,-87.723392818,"(41.796167541, -87.723392818)" +7616487,HS420429,2010-07-20 13:40:00,071XX S JEFFERY BLVD,0860,THEFT,RETAIL THEFT,SMALL RETAIL STORE,679,True,False,333,3,5,43,06,1190817,1858158,2010,ERROR,41.765801254,-87.576145268,"(41.765801254, -87.576145268)" +2377718,HH685782,2002-10-01 16:00:00,008XX S WESTERN AVE,0890,THEFT,FROM BUILDING,COMMERCIAL / BUSINESS OFFICE,3836,False,False,1224,NA,25,28,06,1160551,1896364,2002,ERROR,41.871320673,-87.686025384,"(41.871320673, -87.686025384)" +3401548,HK459731,2004-06-11 02:00:00,025XX N FRANCISCO AVE,1152,DECEPTIVE PRACTICE,ILLEGAL USE CASH CARD,BANK,3180,False,False,1414,14,35,22,11,1156577,1916550,2004,ERROR,41.92679416,-87.700068437,"(41.92679416, -87.700068437)" +4828468,HM412792,2006-06-14 02:11:58,0000X E GARFIELD BLVD,0320,ROBBERY,STRONGARM - NO WEAPON,SIDEWALK,3102,False,False,233,2,20,40,03,1177699,1868405,2006,2006-07-10 09:43:17,41.794226904,-87.62391683,"(41.794226904, -87.62391683)" +2097067,HH314898,2002-04-18 08:40:00,024XX W LAWRENCE AV,0560,ASSAULT,SIMPLE,OTHER,4703,True,False,2031,NA,NA,NA,08A,1159019,1931842,2002,ERROR,41.968706493,-87.690673825,"(41.968706493, -87.690673825)" +3603839,HK646357,2004-09-25 03:10:00,008XX N ASHLAND AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,2836,False,False,1322,12,1,24,14,1165526,1906012,2004,ERROR,41.897691137,-87.667485477,"(41.897691137, -87.667485477)" +9512342,HX167043,2014-02-27 23:16:00,064XX S CARPENTER ST,0497,BATTERY,AGGRAVATED DOMESTIC BATTERY: OTHER DANG WEAPON,RESIDENCE,4856,False,False,724,7,16,68,04B,1170455,1862310,2014,2014-03-03 00:39:23,41.777662488,-87.650657643,"(41.777662488, -87.650657643)" +4261619,HL578454,2005-08-29 09:15:00,134XX S VERNON AVE,0610,BURGLARY,FORCIBLE ENTRY,BAR OR TAVERN,1530,False,False,533,5,9,54,05,1181807,1816319,2005,ERROR,41.651202555,-87.610456918,"(41.651202555, -87.610456918)" +6432144,HP512424,2008-08-14 09:50:00,069XX S MICHIGAN AVE,2820,OTHER OFFENSE,TELEPHONE THREAT,APARTMENT,600,True,False,322,3,6,69,26,1178318,1859155,2008,ERROR,41.768829929,-87.621927626,"(41.768829929, -87.621927626)" +2698942,HJ315490,2003-04-22 05:50:00,051XX W CHICAGO AVE,0340,ROBBERY,ATTEMPT: STRONGARM-NO WEAPON,STREET,1909,False,False,1531,NA,37,25,03,1141640,1904877,2003,ERROR,41.89505175,-87.755244987,"(41.89505175, -87.755244987)" +9682603,HX333155,2014-07-06 03:15:00,037XX N PLAINFIELD AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,4490,False,True,1631,16,36,17,08B,1120024,1923862,2014,ERROR,41.9475215,-87.83423089,"(41.9475215, -87.83423089)" +6546232,HP616924,2008-10-09 08:25:00,099XX S PEORIA ST,051A,ASSAULT,AGGRAVATED: HANDGUN,RESIDENTIAL YARD (FRONT/BACK),1859,False,False,2232,22,34,73,04A,1172031,1838751,2008,ERROR,41.712979002,-87.645570329,"(41.712979002, -87.645570329)" +1881357,G729957,2001-12-05 20:38:41,119XX S INDIANA AV,0610,BURGLARY,FORCIBLE ENTRY,RESIDENCE,2478,False,False,532,NA,NA,NA,05,1179753,1826087,2001,ERROR,41.678054476,-87.617675326,"(41.678054476, -87.617675326)" +6182379,HP269231,2008-04-08 20:30:00,004XX E RANDOLPH ST,1506,PROSTITUTION,SOLICIT ON PUBLIC WAY,RESIDENCE,739,True,False,124,1,42,32,16,1179262,1901369,2008,2008-12-04 06:24:35,41.884646917,-87.617177553,"(41.884646917, -87.617177553)" +10144936,HY333549,2015-07-05 15:00:00,044XX N HARDING AVE,031A,ROBBERY,ARMED: HANDGUN,APARTMENT,1023,False,False,1723,17,39,14,03,1149292,1929511,2015,2015-12-07 12:42:46,41.962504708,-87.726500599,"(41.962504708, -87.726500599)" +7819756,HS629676,2010-11-22 19:30:00,047XX S PRINCETON AVE,0810,THEFT,OVER $500,PARK PROPERTY,1456,False,False,935,9,3,37,06,1175039,1873724,2010,ERROR,41.808882585,-87.633512079,"(41.808882585, -87.633512079)" +1863051,G706647,2001-11-24 19:41:00,019XX S SPRINGFIELD AV,143A,WEAPONS VIOLATION,UNLAWFUL POSS OF HANDGUN,ALLEY,1573,True,False,1014,NA,NA,NA,15,1150673,1889905,2001,ERROR,41.853795099,-87.722460197,"(41.853795099, -87.722460197)" +5895492,HN672912,2007-10-27 10:56:31,0000X E 103RD PL,2027,NARCOTICS,POSS: CRACK,APARTMENT,2190,False,False,512,5,9,49,18,1178109,1836390,2007,2007-09-11 09:43:39,41.706364714,-87.623382077,"(41.706364714, -87.623382077)" +9222506,HW369005,2013-07-19 01:00:00,062XX S EBERHART AVE,041A,BATTERY,AGGRAVATED: HANDGUN,SIDEWALK,2207,False,False,313,3,20,42,04B,1180607,1863944,2013,ERROR,41.781919159,-87.613390392,"(41.781919159, -87.613390392)" +9470449,HX123527,2014-01-22 11:30:00,064XX N SHERIDAN RD,0810,THEFT,OVER $500,CHA PARKING LOT/GROUNDS,3913,False,False,2432,24,40,1,06,1167086,1942670,2014,ERROR,41.998248939,-87.660699164,"(41.998248939, -87.660699164)" +4564532,HM151795,2006-01-29 12:30:00,005XX N STATE ST,0870,THEFT,POCKET-PICKING,CTA TRAIN,4085,False,False,1834,18,42,8,06,1176315,1903875,2006,2006-02-02 04:21:12,41.891590492,-87.627923574,"(41.891590492, -87.627923574)" +7288999,HR705891,2009-12-26 01:00:00,060XX S WOLCOTT AVE,0560,ASSAULT,SIMPLE,RESIDENCE,1934,True,True,714,7,15,67,08A,1164770,1864356,2009,ERROR,41.783398933,-87.671441226,"(41.783398933, -87.671441226)" +4264409,HL581667,2005-08-30 18:11:00,012XX N STATE PKWY,0610,BURGLARY,FORCIBLE ENTRY,RESIDENCE,4438,True,False,1824,18,43,8,05,1176096,1908851,2005,ERROR,41.905249818,-87.628577732,"(41.905249818, -87.628577732)" +4500033,HL801967,2005-12-20 22:30:00,027XX S KARLOV AVE,0810,THEFT,OVER $500,STREET,3640,False,False,1031,10,22,30,06,1149446,1885667,2005,2014-04-12 12:43:35,41.842189353,-87.727073599,"(41.842189353, -87.727073599)" +4521721,HM109102,2006-01-05 22:30:00,072XX S KEDZIE AVE,0281,CRIM SEXUAL ASSAULT,NON-AGGRAVATED,APARTMENT,2123,False,False,831,8,18,66,02,1156259,1856141,2006,ERROR,41.761031279,-87.702866467,"(41.761031279, -87.702866467)" +5579203,HN387749,2007-06-05 23:00:00,028XX N LAKE SHORE DR,2820,OTHER OFFENSE,TELEPHONE THREAT,RESIDENCE,1495,False,False,2333,19,44,6,26,1173893,1918915,2007,2007-10-07 01:59:11,41.932915255,-87.636369534,"(41.932915255, -87.636369534)" +4112242,HL450369,2005-06-28 17:30:00,043XX S GREENWOOD AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,3025,False,False,2123,2,4,39,14,1184277,1876379,2005,ERROR,41.815956678,-87.599546214,"(41.815956678, -87.599546214)" +3506201,HK555583,2004-08-13 16:42:00,044XX W IOWA ST,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,4369,False,False,1111,11,37,23,08B,1146528,1905586,2004,ERROR,41.896905546,-87.737274355,"(41.896905546, -87.737274355)" +2409260,HH725869,2002-10-20 01:00:00,007XX W ROSCOE ST,2825,OTHER OFFENSE,HARASSMENT BY TELEPHONE,RESTAURANT,2063,False,False,2331,NA,44,6,26,1170419,1922748,2002,ERROR,41.943509953,-87.649023628,"(41.943509953, -87.649023628)" +2203186,HH000417,2002-06-19 17:15:00,057XX S LOWE AVE,0313,ROBBERY,ARMED: OTHER DANGEROUS WEAPON,SIDEWALK,4447,False,False,711,NA,3,68,03,1172986,1866791,2002,ERROR,41.789903341,-87.641246766,"(41.789903341, -87.641246766)" +5011028,HM467142,2006-07-10 17:24:47,039XX W ARMITAGE AVE,1513,PROSTITUTION,SOLICIT FOR BUSINESS,STREET,4204,True,False,2535,25,30,20,16,1150000,1912964,2006,2006-07-10 09:43:17,41.917084599,-87.724329742,"(41.917084599, -87.724329742)" +2248732,HH525417,2002-06-08 09:00:00,014XX N WELLS ST,1120,DECEPTIVE PRACTICE,FORGERY,RESIDENCE,4807,False,False,1821,NA,27,8,10,1174403,1909875,2002,ERROR,41.908097724,-87.634765969,"(41.908097724, -87.634765969)" +5736007,HN543999,2007-08-22 14:00:45,072XX N CLARK ST,0820,THEFT,$500 AND UNDER,STREET,248,False,False,2423,24,49,1,06,1163247,1948255,2007,2014-04-12 12:43:35,42.013656195,-87.674663459,"(42.013656195, -87.674663459)" +1601570,G372788,2001-06-26 17:53:24,089XX S COTTAGE GROVE,0460,BATTERY,SIMPLE,RESIDENCE,3120,False,False,633,NA,NA,NA,08B,1183085,1845890,2001,ERROR,41.732319842,-87.604865988,"(41.732319842, -87.604865988)" +8530168,HV207435,2012-03-21 05:45:00,009XX E 130TH PL,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,4330,False,False,533,5,9,54,14,1184644,1819036,2012,ERROR,41.658592656,-87.599992356,"(41.658592656, -87.599992356)" +4862832,HM474817,2006-07-10 20:00:00,055XX S SHORE DR,2826,OTHER OFFENSE,HARASSMENT BY ELECTRONIC MEANS,RESTAURANT,2392,False,False,2132,2,5,41,26,1189509,1868821,2006,ERROR,41.795092837,-87.580597321,"(41.795092837, -87.580597321)" +4406900,HK742347,2004-11-10 11:59:00,078XX S CORNELL AVE,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,STREET,4344,True,False,411,4,8,43,18,1188552,1853522,2004,ERROR,41.753134073,-87.584595019,"(41.753134073, -87.584595019)" +3010706,HJ715145,2003-10-17 11:00:00,062XX N SACRAMENTO AVE,1120,DECEPTIVE PRACTICE,FORGERY,RESIDENCE,1790,False,False,2413,24,50,2,10,1155185,1941017,2003,ERROR,41.993961219,-87.704523692,"(41.993961219, -87.704523692)" +5557879,HN367489,2007-05-27 01:15:00,020XX N STAVE ST,143A,WEAPONS VIOLATION,UNLAWFUL POSS OF HANDGUN,SIDEWALK,4000,True,False,1431,14,1,22,15,1158880,1913340,2007,2010-02-06 10:34:17,41.917938701,-87.691694171,"(41.917938701, -87.691694171)" +3066701,HJ786859,2003-11-22 23:30:00,105XX S MICHIGAN AVE,2825,OTHER OFFENSE,HARASSMENT BY TELEPHONE,RESIDENCE,1288,False,False,512,5,9,49,26,1178884,1835024,2003,ERROR,41.702598655,-87.62058548,"(41.702598655, -87.62058548)" +6668993,HP742526,2008-12-19 22:00:00,002XX W EVERGREEN AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,2419,False,False,1821,NA,43,8,14,NA,NA,2008,1999-08-11 15:39:40,NA,NA, +6353756,HP432354,2008-07-04 05:00:00,013XX W 97TH ST,0320,ROBBERY,STRONGARM - NO WEAPON,RESIDENCE PORCH/HALLWAY,2082,False,False,2213,22,21,73,03,1168978,1840625,2008,ERROR,41.71818792,-87.656697493,"(41.71818792, -87.656697493)" +6669938,HP740347,2008-11-26 12:00:00,052XX W FOSTER AVE,0840,THEFT,FINANCIAL ID THEFT: OVER $300,RESIDENCE,1990,False,False,1623,16,45,11,06,1140701,1934124,2008,ERROR,41.97532578,-87.757972837,"(41.97532578, -87.757972837)" +4826288,HM332892,2006-05-05 20:37:41,042XX S COTTAGE GROVE AVE,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,SIDEWALK,1058,True,False,2123,2,4,36,18,1182360,1876778,2006,ERROR,41.817096269,-87.606565687,"(41.817096269, -87.606565687)" +7886005,HT116106,2011-01-12 09:30:00,054XX S HERMITAGE AVE,0610,BURGLARY,FORCIBLE ENTRY,RESIDENCE,4182,False,False,932,9,16,61,05,1165565,1868597,2011,ERROR,41.795019934,-87.668406224,"(41.795019934, -87.668406224)" +6705302,HR108700,2005-12-31 09:00:00,029XX N KEDZIE AVE,0840,THEFT,FINANCIAL ID THEFT: OVER $300,RESIDENCE,889,False,False,1411,NA,35,21,06,NA,NA,2005,ERROR,NA,NA, +8964081,HW112182,2013-01-10 00:00:00,044XX S ARCHER AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,2466,False,False,821,8,14,58,14,1155228,1874993,2013,2013-11-01 07:24:01,41.81278459,-87.706141165,"(41.81278459, -87.706141165)" +7699490,HS506358,2010-09-03 11:00:00,067XX S EAST END AVE,2820,OTHER OFFENSE,TELEPHONE THREAT,RESIDENCE,776,False,False,332,3,5,43,26,1188736,1860587,2010,ERROR,41.77251665,-87.583695111,"(41.77251665, -87.583695111)" +9180878,HW325720,2013-06-19 11:15:00,110XX S WESTERN AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,STREET,4683,False,True,2212,22,19,75,08B,1162390,1831737,2013,ERROR,41.693937278,-87.681073558,"(41.693937278, -87.681073558)" +2297694,HH568797,2002-08-09 14:50:00,050XX W WASHINGTON BLVD,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,STREET,3902,True,False,1533,NA,28,25,18,1142677,1899991,2002,ERROR,41.881624743,-87.751557974,"(41.881624743, -87.751557974)" +7644446,HS448315,2010-08-06 05:23:00,008XX W ADDISON ST,0860,THEFT,RETAIL THEFT,GAS STATION,2267,False,False,2331,19,44,6,06,1170247,1924094,2010,2010-09-08 10:51:39,41.947207196,-87.64961635,"(41.947207196, -87.64961635)" +1423522,G144180,2001-03-11 14:00:00,016XX W GREENLEAF AV,2820,OTHER OFFENSE,TELEPHONE THREAT,RESIDENCE,4093,False,True,2423,NA,NA,NA,26,1164186,1947061,2001,ERROR,42.010359958,-87.671242346,"(42.010359958, -87.671242346)" +5125870,HM723860,2006-11-16 14:00:00,011XX W WILSON AVE,0460,BATTERY,SIMPLE,"SCHOOL, PUBLIC, BUILDING",4704,True,False,2311,19,46,3,08B,1167577,1930654,2006,ERROR,41.965266117,-87.659240822,"(41.965266117, -87.659240822)" +2492829,HH829410,2002-12-10 12:59:05,041XX W 16TH ST,502R,OTHER OFFENSE,VEHICLE TITLE/REG OFFENSE,STREET,2870,True,False,1012,NA,24,29,26,1148968,1891764,2002,ERROR,41.85892954,-87.728670191,"(41.85892954, -87.728670191)" +3807185,HL176495,2005-02-11 23:40:00,053XX W HIRSCH ST,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,3180,False,False,2532,25,37,25,07,1140742,1908843,2005,ERROR,41.905951477,-87.758445541,"(41.905951477, -87.758445541)" +5654829,HN465341,2007-07-14 01:00:00,053XX S WABASH AVE,0930,MOTOR VEHICLE THEFT,THEFT/RECOVERY: AUTOMOBILE,STREET,1188,False,False,232,2,3,40,07,1177577,1869771,2007,ERROR,41.7979781,-87.624322882,"(41.7979781, -87.624322882)" +7897069,HT126881,2011-01-19 20:50:00,016XX N KIMBALL AVE,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,RESIDENCE,3699,True,False,1422,14,26,23,18,1153494,1910674,2011,ERROR,41.910731836,-87.7115537,"(41.910731836, -87.7115537)" +6053794,HP155338,2008-02-02 02:15:00,002XX N ASHLAND AVE,0560,ASSAULT,SIMPLE,TAVERN/LIQUOR STORE,4130,False,False,1333,12,27,28,08A,1165726,1901925,2008,2008-07-02 06:38:43,41.886471844,-87.666867499,"(41.886471844, -87.666867499)" +5565328,HN356933,2007-05-21 21:30:57,070XX S JEFFERY BLVD,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,VEHICLE NON-COMMERCIAL,4147,True,False,331,3,5,43,18,1190805,1858575,2007,ERROR,41.766945825,-87.576175796,"(41.766945825, -87.576175796)" +3248772,HK265125,2004-03-27 02:54:00,0000X W DIVISION ST,3710,INTERFERENCE WITH PUBLIC OFFICER,RESIST/OBSTRUCT/DISARM OFFICER,SIDEWALK,4310,True,False,1824,18,42,8,24,1175892,1908408,2004,2014-04-12 12:43:35,41.904038802,-87.629340436,"(41.904038802, -87.629340436)" +1757877,G572420,2001-09-24 01:00:00,009XX N HARDING AV,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,797,False,False,1112,NA,NA,NA,07,1149924,1905981,2001,ERROR,41.897924046,-87.72479098,"(41.897924046, -87.72479098)" +2774357,HJ418762,2003-06-09 22:26:00,017XX N TALMAN AVE,0320,ROBBERY,STRONGARM - NO WEAPON,STREET,826,False,False,1421,NA,1,24,03,1158398,1911205,2003,ERROR,41.912089977,-87.693523584,"(41.912089977, -87.693523584)" +8926173,HV598195,2012-12-11 15:00:00,001XX N KEDZIE AVE,2092,NARCOTICS,SOLICIT NARCOTICS ON PUBLICWAY,SIDEWALK,4028,True,False,1331,12,27,27,26,1155069,1900663,2012,2012-11-12 15:22:54,41.883229246,-87.706036593,"(41.883229246, -87.706036593)" +5741562,HN545599,2007-08-23 11:06:35,056XX W CORCORAN PL,0560,ASSAULT,SIMPLE,GROCERY FOOD STORE,2009,True,False,1512,15,29,25,08A,1138929,1901964,2007,ERROR,41.887107805,-87.765272755,"(41.887107805, -87.765272755)" +7388091,HS188642,2010-03-02 16:00:00,059XX W AUGUSTA BLVD,0460,BATTERY,SIMPLE,SIDEWALK,4552,False,False,1511,15,29,25,08B,1136861,1906101,2010,2010-04-03 11:52:03,41.898497579,-87.772767903,"(41.898497579, -87.772767903)" +4148394,HL472015,2005-07-09 03:00:00,004XX W 98TH ST,0486,BATTERY,DOMESTIC BATTERY SIMPLE,VEHICLE NON-COMMERCIAL,1031,False,True,2223,22,21,73,08B,1174873,1839956,2005,ERROR,41.716222926,-87.635126228,"(41.716222926, -87.635126228)" +7111964,HR520191,2009-09-04 19:15:00,040XX W LAKE ST,2024,NARCOTICS,POSS: HEROIN(WHITE),CTA PLATFORM,1207,True,False,1114,11,28,26,18,1149614,1901481,2009,2009-04-09 20:50:05,41.885581599,-87.726046569,"(41.885581599, -87.726046569)" +1498551,G234518,2001-04-24 20:15:00,005XX N COLUMBUS DR,0810,THEFT,OVER $500,STREET,1805,False,False,1834,NA,NA,NA,06,1178452,1903693,2001,2014-04-12 12:43:35,41.891042598,-87.620081013,"(41.891042598, -87.620081013)" +1470135,G198684,2001-03-30 19:30:00,049XX W WEST END AV,0460,BATTERY,SIMPLE,APARTMENT,883,False,True,1532,NA,NA,NA,08B,1143503,1900491,2001,ERROR,41.882981399,-87.748512379,"(41.882981399, -87.748512379)" +4380629,HL672144,2005-10-14 08:30:00,002XX W 87TH ST,1320,CRIMINAL DAMAGE,TO VEHICLE,PARKING LOT/GARAGE(NON.RESID.),2556,False,False,622,6,21,44,14,1176403,1847255,2005,ERROR,41.736218161,-87.629303966,"(41.736218161, -87.629303966)" +3828054,HL198936,2005-02-23 21:00:00,049XX N MILWAUKEE AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,PARKING LOT/GARAGE(NON.RESID.),1349,False,False,1623,16,45,11,14,1139081,1932636,2005,ERROR,41.971272283,-87.763966593,"(41.971272283, -87.763966593)" +5649370,HN457869,2007-07-10 15:30:00,121XX S PRINCETON AVE,0530,ASSAULT,AGGRAVATED: OTHER DANG WEAPON,STREET,2266,False,False,523,5,34,53,04A,1176434,1824279,2007,ERROR,41.673168048,-87.629877991,"(41.673168048, -87.629877991)" +1926664,G777431,2001-12-30 12:22:03,075XX S COTTAGE GROVE,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,STREET,2792,True,False,624,NA,NA,NA,18,1182916,1854849,2001,ERROR,41.756908237,-87.605207385,"(41.756908237, -87.605207385)" +3349468,HK391905,2004-05-25 15:00:00,015XX E 93RD ST,0820,THEFT,$500 AND UNDER,SIDEWALK,483,False,False,413,4,8,48,06,1187948,1843656,2004,2014-04-12 12:43:35,41.726075187,-87.587121912,"(41.726075187, -87.587121912)" +9289687,HW434804,2013-09-02 18:45:00,057XX S PRAIRIE AVE,2023,NARCOTICS,POSS: HEROIN(BRN/TAN),VACANT LOT/LAND,3421,True,False,232,2,20,40,18,1178985,1866850,2013,2013-03-09 11:05:41,41.789930619,-87.619248524,"(41.789930619, -87.619248524)" +4657553,HM172738,2006-02-09 20:15:00,001XX E WACKER DR,1505,PROSTITUTION,CALL OPERATION,HOTEL/MOTEL,2254,True,False,124,1,42,32,16,1177757,1902582,2006,2006-01-04 03:33:39,41.888009783,-87.622667166,"(41.888009783, -87.622667166)" +1848637,G686275,2001-10-17 17:00:00,031XX W 103 ST,1130,DECEPTIVE PRACTICE,FRAUD OR CONFIDENCE GAME,BANK,2485,False,False,2211,NA,NA,NA,11,1157251,1836208,2001,ERROR,41.706311774,-87.699768468,"(41.706311774, -87.699768468)" +1714907,G518024,2001-08-30 00:38:59,122XX S PEORIA ST,0326,ROBBERY,AGGRAVATED VEHICULAR HIJACKING,STREET,2852,False,False,524,NA,NA,NA,03,1172502,1823677,2001,ERROR,41.671603244,-87.644286984,"(41.671603244, -87.644286984)" +8501862,HV177514,2012-02-19 16:00:00,027XX N MOBILE AVE,5002,OTHER OFFENSE,OTHER VEHICLE OFFENSE,STREET,3247,False,False,2512,25,29,19,26,1133987,1917369,2012,ERROR,41.9294694,-87.783058569,"(41.9294694, -87.783058569)" +2788429,HJ437145,2003-06-17 08:00:00,084XX W GREGORY ST,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,3143,False,False,1614,NA,41,76,14,NA,NA,2003,ERROR,NA,NA, +7308921,HS113429,2010-01-10 10:28:00,130XX S DR MARTIN LUTHER KING JR DR,0486,BATTERY,DOMESTIC BATTERY SIMPLE,APARTMENT,4532,True,True,533,5,9,54,08B,1180948,1818658,2010,2010-11-01 05:08:49,41.657640861,-87.613528366,"(41.657640861, -87.613528366)" +9411869,HW555535,2013-11-28 08:00:00,032XX W DOUGLAS BLVD,0890,THEFT,FROM BUILDING,COMMERCIAL / BUSINESS OFFICE,2178,False,False,1022,10,24,29,06,1154818,1893309,2013,2013-02-12 13:43:47,41.86305413,-87.707155285,"(41.86305413, -87.707155285)" +6863000,HR267765,2009-04-14 15:32:00,016XX E 53RD ST,1210,DECEPTIVE PRACTICE,THEFT OF LABOR/SERVICES,TAXICAB,1052,False,False,2132,2,4,41,11,1188194,1870489,2009,ERROR,41.799701444,-87.585366136,"(41.799701444, -87.585366136)" +8079527,HT312157,2011-05-17 14:00:00,063XX N CLAREMONT AVE,0620,BURGLARY,UNLAWFUL ENTRY,APARTMENT,4304,False,False,2413,24,50,2,05,1159464,1941832,2011,ERROR,41.99611031,-87.688761143,"(41.99611031, -87.688761143)" +5959995,HN755465,2007-11-06 08:00:00,076XX S PHILLIPS AVE,1150,DECEPTIVE PRACTICE,CREDIT CARD FRAUD,BANK,3955,False,True,421,4,7,43,11,1193897,1854798,2007,2008-12-01 01:05:03,41.756506203,-87.564966253,"(41.756506203, -87.564966253)" +4579723,HM166790,2006-02-06 17:30:00,084XX S INGLESIDE AVE,0460,BATTERY,SIMPLE,SIDEWALK,2807,False,False,632,6,8,44,08B,1183976,1849454,2006,ERROR,41.74207911,-87.601490881,"(41.74207911, -87.601490881)" +5789960,HN600058,2007-09-20 10:00:00,071XX W DICKENS AVE,0820,THEFT,$500 AND UNDER,STREET,270,False,False,2512,25,36,25,06,1127875,1913121,2007,2014-04-12 12:43:35,41.917917786,-87.805614941,"(41.917917786, -87.805614941)" +4775666,HM388940,2006-05-30 13:00:00,072XX S KIMBARK AVE,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,2394,False,False,324,3,5,69,07,1186082,1857490,2006,2006-04-06 04:24:23,41.764081271,-87.593521441,"(41.764081271, -87.593521441)" +7711055,HS518043,2010-09-16 12:05:00,026XX E 79TH ST,0460,BATTERY,SIMPLE,OTHER,3669,False,False,421,4,7,43,08B,1195505,1853147,2010,ERROR,41.751936174,-87.559127815,"(41.751936174, -87.559127815)" +8137536,HT371329,2011-06-29 00:08:00,038XX W FLOURNOY ST,041A,BATTERY,AGGRAVATED: HANDGUN,RESIDENTIAL YARD (FRONT/BACK),4277,False,False,1133,11,24,26,04B,1150802,1896712,2011,ERROR,41.872471787,-87.721808751,"(41.872471787, -87.721808751)" +7387445,HS189260,2010-01-24 20:37:00,016XX W 32ND ST,2826,OTHER OFFENSE,HARASSMENT BY ELECTRONIC MEANS,RESIDENCE,3922,False,False,922,9,11,59,26,1166016,1883413,2010,2010-05-03 08:02:26,41.835667093,-87.666330688,"(41.835667093, -87.666330688)" +1834918,G668790,2001-11-05 19:00:00,015XX N SPRINGFIELD AV,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,3471,False,False,2535,NA,NA,NA,07,1150124,1910319,2001,ERROR,41.909824052,-87.723943209,"(41.909824052, -87.723943209)" +6824043,HR227480,2009-03-21 10:35:00,124XX S EMERALD AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,896,False,False,523,5,34,53,14,1173548,1822149,2009,ERROR,41.667387143,-87.640503609,"(41.667387143, -87.640503609)" +3334126,HK375058,2004-05-18 19:25:00,018XX W FARWELL AVE,2820,OTHER OFFENSE,TELEPHONE THREAT,RESIDENCE,1815,False,False,2424,24,49,1,26,1162731,1945686,2004,ERROR,42.00661768,-87.676634619,"(42.00661768, -87.676634619)" +4991479,HM599065,2006-09-13 14:20:00,004XX N STATE ST,0460,BATTERY,SIMPLE,RESTAURANT,4867,True,False,1831,18,42,8,08B,1176246,1903580,2006,ERROR,41.890782553,-87.628185879,"(41.890782553, -87.628185879)" +4779523,HM394310,2006-06-02 15:30:00,042XX N CICERO AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,VEHICLE NON-COMMERCIAL,2942,False,False,1624,16,45,15,14,1143559,1928046,2006,2006-07-06 04:08:49,41.958594104,-87.747615647,"(41.958594104, -87.747615647)" +7209980,HR625015,2009-11-04 00:05:00,012XX W DIVISION ST,2022,NARCOTICS,POSS: COCAINE,STREET,851,True,False,1323,12,27,24,18,1168223,1908112,2009,2009-04-11 01:46:02,41.903395808,-87.657518982,"(41.903395808, -87.657518982)" +4855527,HM466819,2006-07-06 21:00:00,055XX N CLARK ST,0890,THEFT,FROM BUILDING,CHURCH/SYNAGOGUE/PLACE OF WORSHIP,3503,False,False,2012,20,40,77,06,1164942,1936997,2006,ERROR,41.982728013,-87.668748145,"(41.982728013, -87.668748145)" +5216189,HN101090,2007-01-01 14:47:51,002XX E 136TH ST,0610,BURGLARY,FORCIBLE ENTRY,RESIDENCE,4188,False,False,533,5,9,54,05,1180454,1815072,2007,ERROR,41.647811613,-87.615445268,"(41.647811613, -87.615445268)" +6782563,HR197644,2009-03-03 19:00:00,076XX S CRANDON AVE,0890,THEFT,FROM BUILDING,"SCHOOL, PUBLIC, BUILDING",1821,False,False,414,4,7,43,06,1192816,1854954,2009,2009-04-03 06:03:14,41.756960706,-87.568922754,"(41.756960706, -87.568922754)" +3363754,HK410972,2004-06-05 17:27:50,110XX S AVENUE M,0560,ASSAULT,SIMPLE,STREET,4448,True,False,433,4,10,52,08A,1201506,1832221,2004,ERROR,41.694363358,-87.537846019,"(41.694363358, -87.537846019)" +9749727,HX399758,2014-08-23 16:50:00,101XX S VERNON AVE,0810,THEFT,OVER $500,RESIDENCE,4015,False,False,511,5,9,49,06,1181071,1837939,2014,ERROR,41.71054785,-87.612487964,"(41.71054785, -87.612487964)" +3810647,HL177913,2005-02-12 19:10:00,072XX N SHERIDAN RD,1365,CRIMINAL TRESPASS,TO RESIDENCE,NURSING HOME/RETIREMENT HOME,4948,True,False,2423,24,49,1,26,1166257,1947965,2005,ERROR,42.012796343,-87.66359639,"(42.012796343, -87.66359639)" +2167336,HH418150,2002-06-04 06:00:00,001XX W SUPERIOR ST,0810,THEFT,OVER $500,VEHICLE NON-COMMERCIAL,3092,False,False,1832,NA,42,8,06,1175214,1905375,2002,2014-04-12 12:43:35,41.895731339,-87.631921962,"(41.895731339, -87.631921962)" +2336983,HH635814,2002-09-08 20:00:00,086XX S ELIZABETH ST,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,1484,False,False,613,NA,21,71,14,1169547,1847226,2002,ERROR,41.736289738,-87.654422772,"(41.736289738, -87.654422772)" +2283233,HH562586,2002-08-06 12:00:00,032XX W FLOURNOY ST,2820,OTHER OFFENSE,TELEPHONE THREAT,RESIDENCE,2392,False,True,1134,NA,24,27,26,1154671,1896885,2002,ERROR,41.87287,-87.707599224,"(41.87287, -87.707599224)" +9145362,HW290799,2013-05-25 18:20:00,066XX S HALSTED ST,1330,CRIMINAL TRESPASS,TO LAND,SMALL RETAIL STORE,2918,False,False,723,7,6,68,26,1172149,1860963,2013,ERROR,41.773929092,-87.644486986,"(41.773929092, -87.644486986)" +8134619,HT369020,2011-06-27 18:35:00,094XX S WESTERN AVE,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,STREET,1575,True,False,2221,22,19,72,18,1162082,1841641,2011,ERROR,41.721121942,-87.68192693,"(41.721121942, -87.68192693)" +1662674,G451886,2001-07-31 08:30:00,077XX S CALUMET AV,0610,BURGLARY,FORCIBLE ENTRY,RESIDENCE-GARAGE,4005,False,False,623,NA,NA,NA,05,1179859,1853565,2001,ERROR,41.753455253,-87.616449881,"(41.753455253, -87.616449881)" +5926846,HN721506,2007-11-21 06:00:00,012XX W 98TH ST,0281,CRIM SEXUAL ASSAULT,NON-AGGRAVATED,RESIDENCE,3077,False,False,2213,22,21,73,02,1169700,1839736,2007,ERROR,41.715732768,-87.654078763,"(41.715732768, -87.654078763)" +2621303,HJ224035,2003-03-05 10:00:00,019XX W GREENLEAF AVE,0930,MOTOR VEHICLE THEFT,THEFT/RECOVERY: AUTOMOBILE,STREET,1523,False,False,2424,NA,49,1,07,1162189,1946919,2003,ERROR,42.010012453,-87.67859402,"(42.010012453, -87.67859402)" +2334124,HH631588,2002-09-06 21:00:00,025XX N LINDER AVE,0610,BURGLARY,FORCIBLE ENTRY,RESIDENCE-GARAGE,3020,False,False,2515,NA,30,19,05,1139329,1916155,2002,ERROR,41.926042297,-87.763457601,"(41.926042297, -87.763457601)" +8519471,HV196442,2012-03-12 21:40:00,100XX S CRANDON AVE,033A,ROBBERY,ATTEMPT: ARMED-HANDGUN,STREET,3149,False,False,431,4,7,51,03,1193441,1839086,2012,2012-11-04 16:56:10,41.713402235,-87.567149974,"(41.713402235, -87.567149974)" +2508938,HH852379,2002-12-21 02:00:00,025XX N KEDZIE BLVD,0890,THEFT,FROM BUILDING,OTHER,3585,False,False,1414,NA,35,22,06,1154663,1916875,2002,ERROR,41.92772456,-87.707092848,"(41.92772456, -87.707092848)" +4690771,HM291349,2006-04-14 20:50:00,012XX W 72ND ST,0460,BATTERY,SIMPLE,SIDEWALK,1089,False,False,734,7,17,67,08B,1169088,1857072,2006,ERROR,41.763318426,-87.655820347,"(41.763318426, -87.655820347)" +3831802,HL200488,2005-02-24 21:20:56,124XX S EGGLESTON AVE,143A,WEAPONS VIOLATION,UNLAWFUL POSS OF HANDGUN,RESIDENCE,3847,False,False,523,5,34,53,15,1175509,1822487,2005,2014-04-12 12:43:35,41.668271184,-87.633316824,"(41.668271184, -87.633316824)" +4288666,HL600343,2005-09-09 00:45:00,033XX W OGDEN AVE,2850,PUBLIC PEACE VIOLATION,BOMB THREAT,POLICE FACILITY/VEH PARKING LOT,4337,False,False,1024,10,24,29,26,1154500,1890985,2005,ERROR,41.856683172,-87.708384737,"(41.856683172, -87.708384737)" +6404121,HP476419,2008-07-26 18:15:00,068XX S CLAREMONT AVE,0530,ASSAULT,AGGRAVATED: OTHER DANG WEAPON,STREET,3421,False,True,832,8,17,66,04A,1161871,1859315,2008,2008-07-08 10:22:37,41.76962648,-87.682209929,"(41.76962648, -87.682209929)" +7629586,HS432289,2010-07-26 14:00:00,011XX W 62ND ST,0486,BATTERY,DOMESTIC BATTERY SIMPLE,APARTMENT,2636,False,True,712,7,16,68,08B,1169767,1863724,2010,ERROR,41.781557634,-87.653138853,"(41.781557634, -87.653138853)" +1504741,G234331,2001-04-24 19:30:00,027XX N SAWYER AV,2027,NARCOTICS,POSS: CRACK,SIDEWALK,4441,True,False,1412,NA,NA,NA,18,1154131,1917989,2001,ERROR,41.930792109,-87.709017944,"(41.930792109, -87.709017944)" +8748002,HV422718,2012-08-09 12:20:00,103XX S AVENUE L,0915,MOTOR VEHICLE THEFT,"TRUCK, BUS, MOTOR HOME",STREET,3008,False,False,432,4,10,52,07,1201793,1836826,2012,ERROR,41.706992596,-87.536639296,"(41.706992596, -87.536639296)" +3768741,HL139720,2005-01-23 13:30:00,035XX N ELSTON AVE,0810,THEFT,OVER $500,VEHICLE NON-COMMERCIAL,1452,False,False,1733,17,35,21,06,1154312,1923546,2005,2014-04-12 12:43:35,41.946037311,-87.708203891,"(41.946037311, -87.708203891)" +4462522,HL759778,2005-11-28 11:36:00,074XX N GREENVIEW AVE,0460,BATTERY,SIMPLE,APARTMENT,3452,False,False,2422,24,49,1,08B,1164955,1949681,2005,ERROR,42.017532926,-87.668338035,"(42.017532926, -87.668338035)" +6045601,HP146797,2008-01-26 15:00:00,006XX W WAYMAN ST,0610,BURGLARY,FORCIBLE ENTRY,CONSTRUCTION SITE,1006,False,False,1212,12,27,28,05,1171516,1902377,2008,2008-01-02 20:14:43,41.887586797,-87.645592029,"(41.887586797, -87.645592029)" +5682032,HN490569,2007-07-23 00:01:00,004XX N DEARBORN ST,1130,DECEPTIVE PRACTICE,FRAUD OR CONFIDENCE GAME,RESTAURANT,3345,False,False,1831,18,42,8,11,1175894,1903544,2007,ERROR,41.890691698,-87.629479667,"(41.890691698, -87.629479667)" +8520242,HV196949,2012-03-14 12:15:00,015XX W 45TH ST,0312,ROBBERY,ARMED:KNIFE/CUTTING INSTRUMENT,STREET,4644,False,False,924,9,3,61,03,1167048,1874840,2012,ERROR,41.812119833,-87.662789453,"(41.812119833, -87.662789453)" +8071070,HT292750,2011-05-12 17:18:00,006XX E GRAND AVE,0860,THEFT,RETAIL THEFT,OTHER,2071,True,False,1834,18,42,8,06,1180772,1904096,2011,ERROR,41.892095212,-87.611548469,"(41.892095212, -87.611548469)" +9957363,HY146143,2014-12-27 21:00:00,013XX W CHICAGO AVE,0810,THEFT,OVER $500,RESIDENCE,904,False,False,1215,12,27,24,06,1167548,1905439,2014,ERROR,41.896075483,-87.660075443,"(41.896075483, -87.660075443)" +10067136,HY256096,2015-05-11 16:00:00,087XX S BEVERLY AVE,0820,THEFT,$500 AND UNDER,STREET,466,False,False,2221,22,21,71,06,1164962,1846395,2015,ERROR,41.734107372,-87.671244102,"(41.734107372, -87.671244102)" +8115927,HT350334,2011-06-16 12:00:00,058XX N KENMORE AVE,0560,ASSAULT,SIMPLE,RESIDENCE PORCH/HALLWAY,2492,False,False,2022,20,48,77,08A,1168225,1939040,2011,ERROR,41.988263519,-87.656614711,"(41.988263519, -87.656614711)" +3295784,HK327947,2004-04-27 12:42:44,055XX W CHICAGO AVE,0860,THEFT,RETAIL THEFT,DRUG STORE,630,True,False,1524,15,37,25,06,1139149,1904830,2004,ERROR,41.894968468,-87.764395055,"(41.894968468, -87.764395055)" +4118774,HL445725,2005-06-26 18:35:00,076XX S CICERO AVE,0560,ASSAULT,SIMPLE,OTHER,3553,True,False,833,8,13,65,08A,1145766,1853738,2005,ERROR,41.75464162,-87.741385158,"(41.75464162, -87.741385158)" +4313295,HL623082,2005-09-19 22:30:00,078XX S CREGIER AVE,2820,OTHER OFFENSE,TELEPHONE THREAT,RESIDENCE,2726,False,True,414,4,8,43,26,1189530,1853090,2005,ERROR,41.751925214,-87.581024925,"(41.751925214, -87.581024925)" +5275302,HM771318,2006-12-12 14:30:00,016XX N VINE ST,0460,BATTERY,SIMPLE,CHA APARTMENT,3342,False,False,1813,18,43,7,08B,1171741,1910972,2006,2007-04-02 09:14:02,41.911167023,-87.644512341,"(41.911167023, -87.644512341)" +9571206,HX221842,2014-04-12 21:00:00,036XX W ARMITAGE AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,APARTMENT,4457,True,True,2535,25,26,22,08B,1151558,1912999,2014,ERROR,41.91715014,-87.718604687,"(41.91715014, -87.718604687)" +8225563,HT459910,2011-06-02 10:00:00,034XX N OVERHILL AVE,1120,DECEPTIVE PRACTICE,FORGERY,RESIDENCE,4580,False,True,1631,16,36,17,10,1124187,1921874,2011,ERROR,41.941998641,-87.818972224,"(41.941998641, -87.818972224)" +3698614,HK800968,2004-12-06 07:28:00,039XX W 55TH ST,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,3905,False,False,822,8,23,62,14,1151189,1867799,2004,ERROR,41.793123142,-87.721144397,"(41.793123142, -87.721144397)" +6279492,HP366498,2008-05-31 01:49:48,024XX E 77TH ST,0560,ASSAULT,SIMPLE,STREET,3375,False,False,421,4,7,43,08A,1193751,1854422,2008,2008-10-06 17:19:23,41.755478007,-87.565513603,"(41.755478007, -87.565513603)" +3809022,HL179005,2005-02-12 23:00:00,079XX S SACRAMENTO AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,4081,False,False,835,8,18,70,14,1157711,1852042,2005,ERROR,41.749753656,-87.69765575,"(41.749753656, -87.69765575)" +2448823,HH773171,2002-11-11 16:55:00,024XX W 46TH ST,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,4003,False,False,914,NA,12,58,08B,1160595,1874059,2002,ERROR,41.810112404,-87.686480579,"(41.810112404, -87.686480579)" +8784290,HV458206,2012-09-02 15:00:00,010XX W BRYN MAWR AVE,0820,THEFT,$500 AND UNDER,SIDEWALK,324,False,False,2022,20,48,77,06,1168220,1937410,2012,2012-03-09 10:10:19,41.98379087,-87.656680467,"(41.98379087, -87.656680467)" +5066596,HM672873,2006-10-21 01:10:00,063XX S ELIZABETH ST,0486,BATTERY,DOMESTIC BATTERY SIMPLE,ALLEY,1796,False,True,724,7,16,67,08B,1169122,1862553,2006,2006-04-11 05:54:38,41.778358245,-87.655537413,"(41.778358245, -87.655537413)" +9049125,HW191204,2013-03-13 19:00:00,031XX N SHEFFIELD AVE,0820,THEFT,$500 AND UNDER,STREET,247,False,False,1933,19,44,6,06,1169094,1921197,2013,ERROR,41.939282865,-87.65393884,"(41.939282865, -87.65393884)" +7764239,HS572350,2010-10-19 16:30:00,048XX N SPAULDING AVE,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,STREET,3988,True,False,1713,17,39,14,18,1153546,1931968,2010,ERROR,41.969163134,-87.710794575,"(41.969163134, -87.710794575)" +2410766,HH726508,2002-10-19 20:00:00,041XX W GRANVILLE AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,3555,False,False,1711,NA,39,12,14,1147823,1940905,2002,ERROR,41.993799031,-87.731607315,"(41.993799031, -87.731607315)" +6473955,HP548589,2008-09-02 10:38:27,002XX S LAVERGNE AVE,2017,NARCOTICS,MANU/DELIVER:CRACK,SIDEWALK,4717,True,False,1533,15,28,25,18,1143332,1898687,2008,2008-04-09 10:02:31,41.878034197,-87.749185395,"(41.878034197, -87.749185395)" +3811299,HL180923,2005-02-14 14:30:00,001XX W CERMAK RD,0890,THEFT,FROM BUILDING,RESTAURANT,4526,False,False,2111,9,25,34,06,1175413,1889712,2005,ERROR,41.852746625,-87.631661358,"(41.852746625, -87.631661358)" +8254428,HT488217,2011-09-09 08:20:00,012XX S KILDARE AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,APARTMENT,1355,True,True,1011,10,24,29,08B,1147879,1893831,2011,2011-10-09 08:30:21,41.864622619,-87.732614499,"(41.864622619, -87.732614499)" +3052579,HJ766530,2003-11-18 11:15:00,010XX W NORTH AVE,0312,ROBBERY,ARMED:KNIFE/CUTTING INSTRUMENT,SMALL RETAIL STORE,1967,False,False,1811,18,32,7,03,1169395,1910873,2003,ERROR,41.910946738,-87.653133577,"(41.910946738, -87.653133577)" +2802395,HJ456446,2003-06-26 17:00:00,014XX N MAPLEWOOD AVE,0810,THEFT,OVER $500,STREET,3051,False,False,1423,14,26,24,06,1159110,1909223,2003,2014-04-12 12:43:35,41.906636608,-87.690962425,"(41.906636608, -87.690962425)" +8467589,HV143840,2012-02-03 12:45:00,064XX S ST LAWRENCE AVE,1330,CRIMINAL TRESPASS,TO LAND,RESIDENCE-GARAGE,2128,False,False,312,3,20,42,26,1181306,1862283,2012,2012-05-02 07:39:28,41.777345128,-87.610878867,"(41.777345128, -87.610878867)" +8672044,HV346931,2012-06-22 02:30:00,002XX N ASHLAND AVE,0820,THEFT,$500 AND UNDER,STREET,66,False,False,1333,12,27,28,06,1165729,1901839,2012,ERROR,41.88623579,-87.666858935,"(41.88623579, -87.666858935)" +2087824,HH307538,2002-04-14 17:00:00,112XX S CORLISS AV,0820,THEFT,$500 AND UNDER,PARKING LOT/GARAGE(NON.RESID.),121,False,False,531,NA,NA,NA,06,1184357,1830749,2002,2014-04-12 12:43:35,41.690741459,-87.60067812,"(41.690741459, -87.60067812)" +8209337,HT443374,2011-08-11 18:35:00,079XX S HALSTED ST,031A,ROBBERY,ARMED: HANDGUN,ATM (AUTOMATIC TELLER MACHINE),1050,False,False,621,6,17,71,03,1172299,1852411,2011,ERROR,41.750458051,-87.644188274,"(41.750458051, -87.644188274)" +8256672,HT490030,2011-09-10 01:45:00,116XX S DOTY AVE W,0460,BATTERY,SIMPLE,PARKING LOT/GARAGE(NON.RESID.),2252,False,False,532,5,9,54,08B,1183932,1827765,2011,2011-11-09 06:14:39,41.68256287,-87.602326758,"(41.68256287, -87.602326758)" +5916746,HN714104,2007-11-18 02:00:00,026XX W CORTLAND ST,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,644,False,False,1421,14,1,22,14,1158683,1912488,2007,ERROR,41.91560479,-87.692441353,"(41.91560479, -87.692441353)" +8191615,HT405749,2011-07-19 18:00:00,009XX W WINONA ST,2032,NARCOTICS,MANU/DELIVER: METHAMPHETAMINES,RESIDENCE,2116,True,False,2024,20,48,3,18,1169251,1934368,2011,2011-01-08 11:42:26,41.975421135,-87.652977507,"(41.975421135, -87.652977507)" +2973180,HJ659852,2003-09-28 22:39:00,097XX S HARVARD AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,3610,False,True,511,5,21,49,08B,1175644,1839981,2003,ERROR,41.716274337,-87.632301694,"(41.716274337, -87.632301694)" +2653149,HJ262801,2003-03-26 22:50:00,083XX S ELLIS AVE,0610,BURGLARY,FORCIBLE ENTRY,APARTMENT,721,False,False,632,NA,8,44,05,1184303,1849697,2003,ERROR,41.742738291,-87.600285187,"(41.742738291, -87.600285187)" +2813880,HJ468442,2003-07-02 17:55:00,103XX S CHARLES ST,0930,MOTOR VEHICLE THEFT,THEFT/RECOVERY: AUTOMOBILE,OTHER,1416,False,False,2212,22,19,72,07,1168443,1836435,2003,ERROR,41.70670143,-87.658777228,"(41.70670143, -87.658777228)" +6853270,HR212470,2009-03-12 20:24:00,014XX W 63RD ST,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,STREET,3705,True,False,725,7,16,67,18,1167591,1862923,2009,ERROR,41.779406548,-87.661139539,"(41.779406548, -87.661139539)" +4345470,HL643338,2005-09-29 12:30:00,054XX S WENTWORTH AVE,0860,THEFT,RETAIL THEFT,SMALL RETAIL STORE,3555,True,False,232,2,3,37,06,1175924,1869100,2005,ERROR,41.796174063,-87.6304048,"(41.796174063, -87.6304048)" +3145808,HK138334,2004-01-20 14:45:00,001XX W 104TH ST,1750,OFFENSE INVOLVING CHILDREN,CHILD ABUSE,RESIDENCE,1034,False,True,512,5,34,49,20,1177238,1836035,2004,ERROR,41.705410205,-87.626582292,"(41.705410205, -87.626582292)" +2564500,HJ117629,2003-01-10 06:30:00,046XX S SACRAMENTO AVE,1513,PROSTITUTION,SOLICIT FOR BUSINESS,STREET,4870,True,False,912,NA,14,58,16,1157201,1873342,2003,ERROR,41.808214288,-87.698948812,"(41.808214288, -87.698948812)" +2168460,HH416094,2002-05-31 17:00:00,063XX S ROCKWELL ST,0460,BATTERY,SIMPLE,STREET,1695,False,False,825,NA,15,66,08B,1160083,1862752,2002,ERROR,41.779095055,-87.688669541,"(41.779095055, -87.688669541)" +3960086,HL326851,2005-04-30 08:50:00,017XX W HOWARD ST,0860,THEFT,RETAIL THEFT,GROCERY FOOD STORE,1739,False,False,2422,24,49,1,06,1163125,1950306,2005,ERROR,42.019286753,-87.675054325,"(42.019286753, -87.675054325)" +7233563,HR577284,2009-10-03 04:35:00,047XX S KILPATRICK AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,2783,False,False,815,8,23,56,14,1145784,1872768,2009,ERROR,41.80686277,-87.740838663,"(41.80686277, -87.740838663)" +5041658,HM636747,2006-10-02 22:15:00,015XX N CALIFORNIA AVE,0560,ASSAULT,SIMPLE,STREET,4574,False,True,1423,14,26,24,08A,1157485,1910358,2006,ERROR,41.90978438,-87.696900782,"(41.90978438, -87.696900782)" +1848119,G681456,2001-11-12 15:00:00,045XX S DAMEN AV,0820,THEFT,$500 AND UNDER,DEPARTMENT STORE,255,True,False,914,NA,NA,NA,06,1163704,1874123,2001,2014-04-12 12:43:35,41.810223247,-87.675075347999993,"(41.810223247, -87.675075348)" +3152831,HK148739,2004-01-26 19:00:00,008XX W 52ND ST,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,4518,False,False,934,9,3,61,07,1171851,1870417,2004,ERROR,41.799878475,-87.64530206,"(41.799878475, -87.64530206)" +3800712,HL168190,2005-02-06 18:00:00,026XX W 74TH ST,0460,BATTERY,SIMPLE,STREET,4990,False,False,835,8,18,66,08B,1159986,1855543,2005,ERROR,41.759314508,-87.689223078,"(41.759314508, -87.689223078)" +4838698,HM450854,2006-07-02 20:22:36,066XX S DAMEN AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,RESIDENCE,3325,False,True,726,7,15,67,08B,1164211,1860657,2006,2006-08-07 04:09:46,41.773260178,-87.673594762,"(41.773260178, -87.673594762)" +4567800,HM152622,2006-01-30 01:05:00,062XX S PULASKI RD,0486,BATTERY,DOMESTIC BATTERY SIMPLE,APARTMENT,2362,True,True,823,8,13,65,08B,1150823,1862618,2006,2006-04-02 03:37:59,41.778912821,-87.72262144,"(41.778912821, -87.72262144)" +4954048,HM567985,2006-08-28 19:00:00,039XX W NORTH AVE,0820,THEFT,$500 AND UNDER,RESTAURANT,63,False,False,2535,25,30,23,06,1149603,1910380,2006,2014-04-12 12:43:35,41.910001584,-87.725855574,"(41.910001584, -87.725855574)" +6442605,HP523830,2008-08-19 19:15:00,022XX N STOCKTON DR,0810,THEFT,OVER $500,STREET,4144,False,False,1814,18,43,7,06,1174044,1915453,2008,ERROR,41.923412022,-87.635918111,"(41.923412022, -87.635918111)" +8013905,HT245828,2011-04-12 01:00:00,117XX S ASHLAND AVE,0325,ROBBERY,VEHICULAR HIJACKING,STREET,3478,False,False,524,5,34,53,03,1167822,1827065,2011,ERROR,41.681001922,-87.66131902,"(41.681001922, -87.66131902)" +2134668,HH365544,2002-05-11 19:52:00,012XX W 69TH ST,2111,NARCOTICS,SALE/DEL HYPODERMIC NEEDLE,STREET,3604,True,False,724,NA,17,67,26,1169493,1859073,2002,ERROR,41.768800662,-87.654278043,"(41.768800662, -87.654278043)" +5610513,HN414573,2007-06-19 04:45:00,050XX W DICKENS AVE,1320,CRIMINAL DAMAGE,TO VEHICLE,STREET,1912,False,False,2522,25,31,19,14,1142601,1913456,2007,ERROR,41.918575659,-87.75150172,"(41.918575659, -87.75150172)" +8573841,HV248444,2012-04-19 00:45:00,048XX S MICHIGAN AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,OTHER,1936,False,False,224,2,3,38,14,1178018,1872850,2012,ERROR,41.806417165,-87.622612308,"(41.806417165, -87.622612308)" +1561696,G322059,2001-06-04 02:17:00,051XX S WESTERN AV,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,OTHER,1450,True,False,915,NA,NA,NA,07,1161425,1870775,2001,ERROR,41.801083515,-87.683527305,"(41.801083515, -87.683527305)" +3927547,HL299959,2005-04-17 00:05:00,106XX S PERRY AVE,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,4821,False,False,512,5,34,49,14,1177525,1834390,2005,ERROR,41.700889625,-87.625580837,"(41.700889625, -87.625580837)" +4652877,HM250481,2006-03-24 14:50:00,006XX N AVERS AVE,0430,BATTERY,AGGRAVATED: OTHER DANG WEAPON,STREET,3812,False,False,1122,11,27,23,04B,1150574,1903795,2006,ERROR,41.891912762,-87.722460741,"(41.891912762, -87.722460741)" +5843579,HN653528,2007-10-15 01:00:00,021XX E 83RD ST,1310,CRIMINAL DAMAGE,TO PROPERTY,RESIDENCE,1948,False,False,414,4,8,46,14,1191722,1850396,2007,ERROR,41.744479768,-87.573079607,"(41.744479768, -87.573079607)" +3203166,HK216335,2004-03-02 13:30:00,003XX N OAKLEY BLVD,0810,THEFT,OVER $500,STREET,4568,False,False,1332,12,27,28,06,1160987,1901959,2004,2014-04-12 12:43:35,41.886664822,-87.684269315,"(41.886664822, -87.684269315)" +1606977,G378687,2001-06-29 10:15:00,0000X W RANDOLPH ST,0560,ASSAULT,SIMPLE,OTHER,3282,False,True,122,NA,NA,NA,08A,1176018,1901322,2001,ERROR,41.884591617,-87.629091254,"(41.884591617, -87.629091254)" +4840076,HM452107,2006-07-03 13:00:00,040XX W 26TH ST,1210,DECEPTIVE PRACTICE,THEFT OF LABOR/SERVICES,CTA BUS,3532,True,False,1013,10,22,30,11,1150073,1886464,2006,2006-06-07 04:48:17,41.844364255,-87.724751946,"(41.844364255, -87.724751946)" +2414638,HH721521,2002-10-18 01:45:00,057XX S NEWCASTLE AVE,0560,ASSAULT,SIMPLE,RESIDENCE,4205,True,True,811,NA,23,56,08A,1131678,1865389,2002,ERROR,41.786868643,-87.792746288,"(41.786868643, -87.792746288)" +9984576,HY173853,2015-03-06 12:20:00,036XX S PAULINA ST,0486,BATTERY,DOMESTIC BATTERY SIMPLE,APARTMENT,2794,True,True,912,9,11,59,08B,1165657,1880409,2015,ERROR,41.827431448,-87.667733383,"(41.827431448, -87.667733383)" +4690605,HM294209,2006-04-15 23:30:00,035XX W DIVERSEY AVE,0810,THEFT,OVER $500,VEHICLE NON-COMMERCIAL,4065,False,False,1412,14,35,21,06,1152451,1918432,2006,2014-04-12 12:43:35,41.93204114,-87.715179885,"(41.93204114, -87.715179885)" +9817517,HX467213,2014-10-14 12:15:00,023XX S MICHIGAN AVE,0560,ASSAULT,SIMPLE,APARTMENT,592,False,False,131,1,2,33,08A,1177532,1889067,2014,ERROR,41.850928923,-87.623903608,"(41.850928923, -87.623903608)" +4924804,HM540163,2006-08-14 05:20:00,040XX W POTOMAC AVE,0820,THEFT,$500 AND UNDER,VEHICLE NON-COMMERCIAL,295,False,False,2534,25,27,23,06,1149398,1908322,2006,2014-04-12 12:43:35,41.90435821,-87.726662138,"(41.90435821, -87.726662138)" +5819771,HN629390,2007-10-04 22:30:00,087XX S SAGINAW AVE,0430,BATTERY,AGGRAVATED: OTHER DANG WEAPON,STREET,2737,False,False,423,4,7,46,04B,1195348,1847736,2007,ERROR,41.737091832,-87.559881365,"(41.737091832, -87.559881365)" +4431290,HL717454,2005-11-05 14:30:00,001XX W LAKE ST,0870,THEFT,POCKET-PICKING,CTA PLATFORM,1953,False,False,113,1,42,32,06,1175460,1901776,2005,ERROR,41.885849966,-87.631126643,"(41.885849966, -87.631126643)" +3020488,HJ684755,2003-10-10 16:45:00,075XX S MORGAN ST,1811,NARCOTICS,POSS: CANNABIS 30GMS OR LESS,STREET,865,True,False,612,6,17,71,18,1170904,1855024,2003,ERROR,41.75765901,-87.649224054,"(41.75765901, -87.649224054)" +7534781,HS338561,2010-06-01 17:30:00,015XX N CICERO AVE,0486,BATTERY,DOMESTIC BATTERY SIMPLE,DEPARTMENT STORE,1334,False,True,2533,25,37,25,08B,1144129,1910138,2010,2010-06-06 10:23:35,41.909442134,-87.745971135,"(41.909442134, -87.745971135)" +8552792,HV228661,2012-04-03 00:00:00,053XX W FOSTER AVE,1720,OFFENSE INVOLVING CHILDREN,CONTRIBUTE DELINQUENCY OF A CHILD,APARTMENT,3251,False,False,1623,16,45,11,20,1139799,1934106,2012,ERROR,41.975292963,-87.761290293,"(41.975292963, -87.761290293)" +2489010,HH826679,2002-11-30 21:00:00,023XX S LAKE SHORE DR E,0890,THEFT,FROM BUILDING,OTHER,2775,False,False,133,NA,2,33,06,NA,NA,2002,ERROR,NA,NA, +2690599,HJ311147,2003-04-19 21:46:00,059XX S ADA ST,0486,BATTERY,DOMESTIC BATTERY SIMPLE,APARTMENT,4856,False,True,713,NA,16,67,08B,1168389,1865153,2003,ERROR,41.785508785,-87.658149785,"(41.785508785, -87.658149785)" +3823642,HL190768,2005-02-19 15:30:00,028XX N MOZART ST,0910,MOTOR VEHICLE THEFT,AUTOMOBILE,STREET,2877,False,False,1411,14,35,21,07,1156853,1918544,2005,ERROR,41.932260245,-87.699000048,"(41.932260245, -87.699000048)" diff --git a/how-to-use-azureml/work-with-data/dataprep/tutorials/getting-started/getting-started.ipynb b/how-to-use-azureml/work-with-data/dataprep/tutorials/getting-started/getting-started.ipynb index 23ad7a4c..3881b8d8 100644 --- a/how-to-use-azureml/work-with-data/dataprep/tutorials/getting-started/getting-started.ipynb +++ b/how-to-use-azureml/work-with-data/dataprep/tutorials/getting-started/getting-started.ipynb @@ -404,6 +404,13 @@ "* [Sample your data](../../how-to-guides/subsetting-sampling.ipynb)\n", "* [Reference and link between Dataflows](../../how-to-guides/join.ipynb)" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/work-with-data/dataprep/tutorials/getting-started/getting-started.png)" + ] } ], "metadata": { diff --git a/how-to-use-azureml/work-with-data/datasets/README.md b/how-to-use-azureml/work-with-data/datasets/README.md index ad999d19..daa2269d 100644 --- a/how-to-use-azureml/work-with-data/datasets/README.md +++ b/how-to-use-azureml/work-with-data/datasets/README.md @@ -152,4 +152,8 @@ For an end-to-end tutorial, you may refer to [Dataset tutorial](datasets-tutoria - Register the Dataset in your workspace for easy access in training. - Take snapshots of data to ensure models can be trained with the same data every time. - Use registered Dataset in your training script. -- Create and use multiple Dataset definitions to ensure that updates to the definition don't break existing pipelines/scripts. \ No newline at end of file +- Create and use multiple Dataset definitions to ensure that updates to the definition don't break existing pipelines/scripts. + + + +![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/work-with-data/datasets/README.png) \ No newline at end of file diff --git a/how-to-use-azureml/work-with-data/datasets/train-dataset/train.py b/how-to-use-azureml/work-with-data/datasets/train-dataset/train.py index fb33937f..ab48c02f 100644 --- a/how-to-use-azureml/work-with-data/datasets/train-dataset/train.py +++ b/how-to-use-azureml/work-with-data/datasets/train-dataset/train.py @@ -15,22 +15,25 @@ from sklearn.tree import DecisionTreeClassifier run = Run.get_context() workspace = run.experiment.workspace -dataset_name = 'training_data' +dataset_name = 'clean_Titanic_tutorial' + +snapshot_name = 'train_snapshot' dataset = Dataset.get(workspace=workspace, name=dataset_name) -dflow = dataset.get_definition() -dflow_val, dflow_train = dflow.random_split(percentage=0.3) +df = dataset.get_snapshot(snapshot_name=snapshot_name).to_pandas_dataframe() -y_df = dflow_train.keep_columns(['HasDetections']).to_pandas_dataframe() -x_df = dflow_train.drop_columns(['HasDetections']).to_pandas_dataframe() -y_val = dflow_val.keep_columns(['HasDetections']).to_pandas_dataframe() -x_val = dflow_val.drop_columns(['HasDetections']).to_pandas_dataframe() +x_col = ['Pclass', 'Sex', 'SibSp', 'Parch'] +y_col = ['Survived'] +x_df = df.loc[:, x_col] +y_df = df.loc[:, y_col] -data = {"train": {"X": x_df, "y": y_df}, +x_train, x_test, y_train, y_test = train_test_split(x_df, y_df, test_size=0.2, random_state=223) - "validation": {"X": x_val, "y": y_val}} +data = {"train": {"X": x_train, "y": y_train}, + + "test": {"X": x_test, "y": y_test}} clf = DecisionTreeClassifier().fit(data["train"]["X"], data["train"]["y"]) -print('Accuracy of Decision Tree classifier on training set: {:.2f}'.format(clf.score(x_df, y_df))) -print('Accuracy of Decision Tree classifier on validation set: {:.2f}'.format(clf.score(x_val, y_val))) +print('Accuracy of Decision Tree classifier on training set: {:.2f}'.format(clf.score(x_train, y_train))) +print('Accuracy of Decision Tree classifier on test set: {:.2f}'.format(clf.score(x_test, y_test))) diff --git a/tutorials/README.md b/tutorials/README.md index 30c81171..dbcb5c1e 100644 --- a/tutorials/README.md +++ b/tutorials/README.md @@ -18,3 +18,5 @@ If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwi * [Part 2](regression-part2-automated-ml.ipynb): Train a model using Automated Machine Learning. Also find quickstarts and how-tos on the [official documentation site for Azure Machine Learning service](https://docs.microsoft.com/en-us/azure/machine-learning/service/). + +![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/tutorials/README.png) \ No newline at end of file diff --git a/tutorials/img-classification-part1-training.ipynb b/tutorials/img-classification-part1-training.ipynb index f1da462c..d1683604 100644 --- a/tutorials/img-classification-part1-training.ipynb +++ b/tutorials/img-classification-part1-training.ipynb @@ -626,6 +626,13 @@ "\n", "> [Tutorial 2 - Deploy models](img-classification-part2-deploy.ipynb)" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/tutorials/img-classification-part1-training.png)" + ] } ], "metadata": { diff --git a/tutorials/img-classification-part2-deploy.ipynb b/tutorials/img-classification-part2-deploy.ipynb index a26b9ef1..acb0f951 100644 --- a/tutorials/img-classification-part2-deploy.ipynb +++ b/tutorials/img-classification-part2-deploy.ipynb @@ -587,6 +587,13 @@ " \n", "You can also try out the [regression tutorial](regression-part1-data-prep.ipynb)." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/tutorials/img-classification-part2-deploy.png)" + ] } ], "metadata": { diff --git a/tutorials/regression-part1-data-prep.ipynb b/tutorials/regression-part1-data-prep.ipynb index 9e878b1c..5813cdfc 100644 --- a/tutorials/regression-part1-data-prep.ipynb +++ b/tutorials/regression-part1-data-prep.ipynb @@ -599,6 +599,13 @@ "\n", "> [Tutorial #2: Train regression model](regression-part2-automated-ml.ipynb)" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/tutorials/regression-part1-data-prep.png)" + ] } ], "metadata": { diff --git a/tutorials/regression-part2-automated-ml.ipynb b/tutorials/regression-part2-automated-ml.ipynb index ee8ed8ea..10a9d354 100644 --- a/tutorials/regression-part2-automated-ml.ipynb +++ b/tutorials/regression-part2-automated-ml.ipynb @@ -25,7 +25,7 @@ "> * Run the model locally with custom parameters\n", "> * Explore the results\n", "\n", - "If you don\u00e2\u20ac\u2122t have an Azure subscription, create a [free account](https://aka.ms/AMLfree) before you begin. \n", + "If you do not have an Azure subscription, create a [free account](https://aka.ms/AMLfree) before you begin. \n", "\n", "> Code in this article was tested with Azure Machine Learning SDK version 1.0.0\n", "\n", @@ -485,7 +485,7 @@ ">The resources you created can be used as prerequisites to other Azure Machine Learning service tutorials and how-to articles. \n", "\n", "\n", - "If you don't plan to use the resources you created, delete them, so you don't incur any charges:\n", + "If you do not plan to use the resources you created, delete them, so you do not incur any charges:\n", "\n", "1. In the Azure portal, select **Resource groups** on the far left.\n", "\n", @@ -510,6 +510,13 @@ "\n", "[Deploy your model](https://docs.microsoft.com/azure/machine-learning/service/tutorial-deploy-models-with-aml) with Azure Machine Learning." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/tutorials/regression-part2-automated-ml.png)" + ] } ], "metadata": { From d4751bf6ecbb7a6cae7e0188b91a2a46e1179749 Mon Sep 17 00:00:00 2001 From: Roope Astala Date: Wed, 29 May 2019 11:04:19 -0400 Subject: [PATCH 103/108] dockerfile --- Dockerfiles/1.0.41/Dockerfile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Dockerfiles/1.0.41/Dockerfile diff --git a/Dockerfiles/1.0.41/Dockerfile b/Dockerfiles/1.0.41/Dockerfile new file mode 100644 index 00000000..eb4273a7 --- /dev/null +++ b/Dockerfiles/1.0.41/Dockerfile @@ -0,0 +1,29 @@ +FROM continuumio/miniconda:4.5.11 + +# install git +RUN apt-get update && apt-get upgrade -y && apt-get install -y git + +# create a new conda environment named azureml +RUN conda create -n azureml -y -q Python=3.6 + +# install additional packages used by sample notebooks. this is optional +RUN ["/bin/bash", "-c", "source activate azureml && conda install -y tqdm cython matplotlib scikit-learn"] + +# install azurmel-sdk components +RUN ["/bin/bash", "-c", "source activate azureml && pip install azureml-sdk[notebooks]==1.0.41"] + +# clone Azure ML GitHub sample notebooks +RUN cd /home && git clone -b "azureml-sdk-1.0.41" --single-branch https://github.com/Azure/MachineLearningNotebooks.git + +# generate jupyter configuration file +RUN ["/bin/bash", "-c", "source activate azureml && mkdir ~/.jupyter && cd ~/.jupyter && jupyter notebook --generate-config"] + +# set an emtpy token for Jupyter to remove authentication. +# this is NOT recommended for production environment +RUN echo "c.NotebookApp.token = ''" >> ~/.jupyter/jupyter_notebook_config.py + +# open up port 8887 on the container +EXPOSE 8887 + +# start Jupyter notebook server on port 8887 when the container starts +CMD /bin/bash -c "cd /home/MachineLearningNotebooks && source activate azureml && jupyter notebook --port 8887 --no-browser --ip 0.0.0.0 --allow-root" \ No newline at end of file From 41841fc8c01dfd6e91a040ca8202826b777151bd Mon Sep 17 00:00:00 2001 From: Roope Astala Date: Fri, 31 May 2019 13:00:41 -0400 Subject: [PATCH 104/108] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4a828187..16df3eda 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ The [How to use Azure ML](./how-to-use-azureml) folder contains specific example Visit following repos to see projects contributed by Azure ML users: + - [AMLSamples](https://github.com/Azure/AMLSamples) Number of end-to-end examples, including face recognition, predictive maintenance, customer churn and sentiment analysis. - [Fine tune natural language processing models using Azure Machine Learning service](https://github.com/Microsoft/AzureML-BERT) - [Fashion MNIST with Azure ML SDK](https://github.com/amynic/azureml-sdk-fashion) From 5e8268027230bc9c5da96dc665f3f8feedaef5b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shan=C3=A9=20Winner?= <43390034+swinner95@users.noreply.github.com> Date: Fri, 31 May 2019 10:58:39 -0700 Subject: [PATCH 105/108] Update README.md --- README.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/README.md b/README.md index 16df3eda..1b488d75 100644 --- a/README.md +++ b/README.md @@ -61,16 +61,6 @@ This repository collects usage data and sends it to Mircosoft to help improve ou To opt out of tracking, please go to the raw markdown or .ipynb files and remove the following line of code: -```sh - "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/README.png)" -``` -This URL will be slightly different depending on the file. - -## Data/Telemetry -This repository collects usage data and sends it to Mircosoft to help improve our products and services. Read Microsoft's [privacy statement to learn more](https://privacy.microsoft.com/en-US/privacystatement) - -To opt out of tracking, please go to the raw markdown or .ipynb files and remove the following line of code: - ```sh "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/README.png)" ``` From 5c9ca452fb4dc1afa30b5c93fe215fe369545f36 Mon Sep 17 00:00:00 2001 From: Roope Astala Date: Wed, 5 Jun 2019 12:15:19 -0400 Subject: [PATCH 106/108] Create README.md --- how-to-use-azureml/using-mlflow/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 how-to-use-azureml/using-mlflow/README.md diff --git a/how-to-use-azureml/using-mlflow/README.md b/how-to-use-azureml/using-mlflow/README.md new file mode 100644 index 00000000..3ac523db --- /dev/null +++ b/how-to-use-azureml/using-mlflow/README.md @@ -0,0 +1 @@ +Under contruction...please revisit soon! From 968cc798d004909d771e0d6829912b5e638a53f5 Mon Sep 17 00:00:00 2001 From: Roope Astala Date: Wed, 5 Jun 2019 12:15:33 -0400 Subject: [PATCH 107/108] Update README.md --- how-to-use-azureml/using-mlflow/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/how-to-use-azureml/using-mlflow/README.md b/how-to-use-azureml/using-mlflow/README.md index 3ac523db..65aaac93 100644 --- a/how-to-use-azureml/using-mlflow/README.md +++ b/how-to-use-azureml/using-mlflow/README.md @@ -1 +1 @@ -Under contruction...please revisit soon! +Under contruction...please visit again soon! From 8eed4e39d06cf67e73a6db65cbf1dfbc06725c20 Mon Sep 17 00:00:00 2001 From: rastala Date: Mon, 10 Jun 2019 15:10:57 -0400 Subject: [PATCH 108/108] mlflow integration preview --- how-to-use-azureml/using-mlflow/README.md | 12 +- .../deploy-model/deploy-model.ipynb | 322 ++++++++++++++++++ .../train-local/train-local.ipynb | 248 ++++++++++++++ .../train-remote/train-remote.ipynb | 318 +++++++++++++++++ .../train-remote/train_diabetes.py | 46 +++ 5 files changed, 945 insertions(+), 1 deletion(-) create mode 100644 how-to-use-azureml/using-mlflow/deploy-model/deploy-model.ipynb create mode 100644 how-to-use-azureml/using-mlflow/train-local/train-local.ipynb create mode 100644 how-to-use-azureml/using-mlflow/train-remote/train-remote.ipynb create mode 100644 how-to-use-azureml/using-mlflow/train-remote/train_diabetes.py diff --git a/how-to-use-azureml/using-mlflow/README.md b/how-to-use-azureml/using-mlflow/README.md index 65aaac93..df6c222e 100644 --- a/how-to-use-azureml/using-mlflow/README.md +++ b/how-to-use-azureml/using-mlflow/README.md @@ -1 +1,11 @@ -Under contruction...please visit again soon! +## Use MLflow with Azure Machine Learning service (Preview) + +[MLflow](https://mlflow.org/) is an open-source platform for tracking machine learning experiments and managing models. You can use MLflow logging APIs with Azure Machine Learning service: the metrics and artifacts are logged to your Azure ML Workspace. + +Try out the sample notebooks: + +* [Use MLflow with Azure Machine Learning for local training run](./train-local/train-local.ipynb) +* [Use MLflow with Azure Machine Learning for remote training run](./train-remote/train-remote.ipynb) +* [Deploy Model as Azure Machine Learning web service using MLflow](./deploy-model/deploy-model.ipynb) + +![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/using-mlflow/README..png) \ No newline at end of file diff --git a/how-to-use-azureml/using-mlflow/deploy-model/deploy-model.ipynb b/how-to-use-azureml/using-mlflow/deploy-model/deploy-model.ipynb new file mode 100644 index 00000000..e1fdd419 --- /dev/null +++ b/how-to-use-azureml/using-mlflow/deploy-model/deploy-model.ipynb @@ -0,0 +1,322 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) Microsoft Corporation. All rights reserved.\n", + "\n", + "Licensed under the MIT License." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/using-mlflow/deploy-model/deploy-model.png)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Deploy Model as Azure Machine Learning Web Service using MLflow\n", + "\n", + "This example shows you how to use mlflow together with Azure Machine Learning services for deploying a model as a web service. You'll learn how to:\n", + "\n", + " 1. Retrieve a previously trained scikit-learn model\n", + " 2. Create a Docker image from the model\n", + " 3. Deploy the model as a web service on Azure Container Instance\n", + " 4. Make a scoring request against the web service.\n", + "\n", + "## Prerequisites and Set-up\n", + "\n", + "This notebook requires you to first complete the [Use MLflow with Azure Machine Learning for Local Training Run](../train-local/train-local.ipnyb) or [Use MLflow with Azure Machine Learning for Remote Training Run](../train-remote/train-remote.ipnyb) notebook, so as to have an experiment run with uploaded model in your Azure Machine Learning Workspace.\n", + "\n", + "Also install following packages if you haven't already\n", + "\n", + "```\n", + "pip install azureml-mlflow pandas\n", + "```\n", + "\n", + "Then, import necessary packages:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import mlflow\n", + "import azureml.mlflow\n", + "import azureml.core\n", + "from azureml.core import Workspace\n", + "\n", + "# Check core SDK version number\n", + "print(\"SDK version:\", azureml.core.VERSION)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Connect to workspace and set MLflow tracking URI\n", + "\n", + "Setting the tracking URI is required for retrieving the model and creating an image using the MLflow APIs." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ws = Workspace.from_config()\n", + "\n", + "mlflow.set_tracking_uri(ws.get_mlflow_tracking_uri())" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Retrieve model from previous run\n", + "\n", + "Let's retrieve the experiment from training notebook, and list the runs within that experiment." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "experiment_name = \"experiment-with-mlflow\"\n", + "exp = ws.experiments[experiment_name]\n", + "\n", + "runs = list(exp.get_runs())\n", + "runs" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Then, let's select the most recent training run and find its ID. You also need to specify the path in run history where the model was saved. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "runid = runs[0].id\n", + "model_save_path = \"model\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Create Docker image\n", + "\n", + "To create a Docker image with Azure Machine Learning for Model Management, use ```mlflow.azureml.build_image``` method. Specify the model path, your workspace, run ID and other parameters.\n", + "\n", + "MLflow automatically recognizes the model framework as scikit-learn, and creates the scoring logic and includes library dependencies for you.\n", + "\n", + "Note that the image creation can take several minutes." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import mlflow.azureml\n", + "\n", + "azure_image, azure_model = mlflow.azureml.build_image(model_uri=\"runs:/{}/{}\".format(runid, model_save_path),\n", + " workspace=ws,\n", + " model_name='diabetes-sklearn-model',\n", + " image_name='diabetes-sklearn-image',\n", + " synchronous=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Deploy web service\n", + "\n", + "Let's use Azure Machine Learning SDK to deploy the image as a web service. \n", + "\n", + "First, specify the deployment configuration. Azure Container Instance is a suitable choice for a quick dev-test deployment, while Azure Kubernetes Service is suitable for scalable production deployments.\n", + "\n", + "Then, deploy the image using Azure Machine Learning SDK's ```deploy_from_image``` method.\n", + "\n", + "Note that the deployment can take several minutes." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core.webservice import AciWebservice, Webservice\n", + "\n", + "\n", + "aci_config = AciWebservice.deploy_configuration(cpu_cores=1, \n", + " memory_gb=1, \n", + " tags={\"method\" : \"sklearn\"}, \n", + " description='Diabetes model',\n", + " location='eastus2')\n", + "\n", + "\n", + "# Deploy the image to Azure Container Instances (ACI) for real-time serving\n", + "webservice = Webservice.deploy_from_image(\n", + " image=azure_image, workspace=ws, name=\"diabetes-model-1\", deployment_config=aci_config)\n", + "\n", + "\n", + "webservice.wait_for_deployment(show_output=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Make a scoring request\n", + "\n", + "Let's take the first few rows of test data and score them using the web service" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "test_rows = [\n", + " [0.01991321, 0.05068012, 0.10480869, 0.07007254, -0.03596778,\n", + " -0.0266789 , -0.02499266, -0.00259226, 0.00371174, 0.04034337],\n", + " [-0.01277963, -0.04464164, 0.06061839, 0.05285819, 0.04796534,\n", + " 0.02937467, -0.01762938, 0.03430886, 0.0702113 , 0.00720652],\n", + " [ 0.03807591, 0.05068012, 0.00888341, 0.04252958, -0.04284755,\n", + " -0.02104223, -0.03971921, -0.00259226, -0.01811827, 0.00720652]]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "MLflow-based web service for scikit-learn model requires the data to be converted to Pandas DataFrame, and then serialized as JSON. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import json\n", + "import pandas as pd\n", + "\n", + "test_rows_as_json = pd.DataFrame(test_rows).to_json(orient=\"split\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let's pass the conveted and serialized data to web service to get the predictions." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "predictions = webservice.run(test_rows_as_json)\n", + "\n", + "print(predictions)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can use the web service's scoring URI to make a raw HTTP request" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "webservice.scoring_uri" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can diagnose the web service using ```get_logs``` method." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "webservice.get_logs()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Next Steps\n", + "\n", + "Learn about [model management and inferencing in Azure Machine Learning service](https://docs.microsoft.com/en-us/azure/machine-learning/service/concept-model-management-and-deployment)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "authors": [ + { + "name": "rastala" + } + ], + "kernelspec": { + "display_name": "Python 3.6", + "language": "python", + "name": "python36" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.4" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/how-to-use-azureml/using-mlflow/train-local/train-local.ipynb b/how-to-use-azureml/using-mlflow/train-local/train-local.ipynb new file mode 100644 index 00000000..445923be --- /dev/null +++ b/how-to-use-azureml/using-mlflow/train-local/train-local.ipynb @@ -0,0 +1,248 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) Microsoft Corporation. All rights reserved.\n", + "\n", + "Licensed under the MIT License." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/using-mlflow/train-local/train-local.png)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Use MLflow with Azure Machine Learning for Local Training Run\n", + "\n", + "This example shows you how to use mlflow tracking APIs together with Azure Machine Learning services for storing your metrics and artifacts, from local Notebook run. You'll learn how to:\n", + "\n", + " 1. Set up MLflow tracking URI so as to use Azure ML\n", + " 2. Create experiment\n", + " 3. Train a model on your local computer while logging metrics and artifacts\n", + " 4. View your experiment within your Azure ML Workspace in Azure Portal.\n", + "\n", + "## Prerequisites and Set-up\n", + "\n", + "Make sure you have completed the [Configuration](../../../configuration.ipnyb) notebook to set up your Azure Machine Learning workspace and ensure other common prerequisites are met.\n", + "\n", + "Install azureml-mlflow package before running this notebook. Note that mlflow itself gets installed as dependency if you haven't installed it yet.\n", + "\n", + "```\n", + "pip install azureml-mlflow\n", + "```\n", + "\n", + "This example also uses scikit-learn and matplotlib packages. Install them:\n", + "```\n", + "pip install scikit-learn matplotlib\n", + "```\n", + "\n", + "Then, import necessary packages" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import mlflow\n", + "import mlflow.sklearn\n", + "import azureml.core\n", + "from azureml.core import Workspace\n", + "import matplotlib.pyplot as plt\n", + "\n", + "# Check core SDK version number\n", + "print(\"SDK version:\", azureml.core.VERSION)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Set tracking URI\n", + "\n", + "Set the MLflow tracking URI to point to your Azure ML Workspace. The subsequent logging calls from MLflow APIs will go to Azure ML services and will be tracked under your Workspace." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ws = Workspace.from_config()\n", + "\n", + "mlflow.set_tracking_uri(ws.get_mlflow_tracking_uri())" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Create Experiment\n", + "\n", + "In both MLflow and Azure ML, training runs are grouped into experiments. Let's create one for our experimentation." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "experiment_name = \"experiment-with-mlflow\"\n", + "mlflow.set_experiment(experiment_name)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Create training and test data set\n", + "\n", + "This example uses diabetes dataset to build a simple regression model. Let's load the dataset and split it into training and test sets." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "from sklearn.datasets import load_diabetes\n", + "from sklearn.linear_model import Ridge\n", + "from sklearn.metrics import mean_squared_error\n", + "from sklearn.model_selection import train_test_split\n", + "\n", + "X, y = load_diabetes(return_X_y = True)\n", + "columns = ['age', 'gender', 'bmi', 'bp', 's1', 's2', 's3', 's4', 's5', 's6']\n", + "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)\n", + "data = {\n", + " \"train\":{\"X\": X_train, \"y\": y_train}, \n", + " \"test\":{\"X\": X_test, \"y\": y_test}\n", + "}\n", + "\n", + "print (\"Data contains\", len(data['train']['X']), \"training samples and\",len(data['test']['X']), \"test samples\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Train while logging metrics and artifacts\n", + "\n", + "Next, start a mlflow run to train a scikit-learn regression model. Note that the training script has been instrumented using MLflow to:\n", + " * Log model hyperparameter alpha value\n", + " * Log mean squared error against test set\n", + " * Save the scikit-learn based regression model produced by training\n", + " * Save an image that shows actuals vs predictions against test set.\n", + " \n", + "These metrics and artifacts have been recorded to your Azure ML Workspace; in the next step you'll learn how to view them." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Create a run object in the experiment\n", + "model_save_path = \"model\"\n", + "\n", + "with mlflow.start_run() as run:\n", + " # Log the algorithm parameter alpha to the run\n", + " mlflow.log_metric('alpha', 0.03)\n", + " # Create, fit, and test the scikit-learn Ridge regression model\n", + " regression_model = Ridge(alpha=0.03)\n", + " regression_model.fit(data['train']['X'], data['train']['y'])\n", + " preds = regression_model.predict(data['test']['X'])\n", + "\n", + " # Log mean squared error\n", + " print('Mean Squared Error is', mean_squared_error(data['test']['y'], preds))\n", + " mlflow.log_metric('mse', mean_squared_error(data['test']['y'], preds))\n", + " \n", + " # Save the model to the outputs directory for capture\n", + " mlflow.sklearn.log_model(regression_model,model_save_path)\n", + " \n", + " # Plot actuals vs predictions and save the plot within the run\n", + " fig = plt.figure(1)\n", + " idx = np.argsort(data['test']['y'])\n", + " plt.plot(data['test']['y'][idx],preds[idx])\n", + " fig.savefig(\"actuals_vs_predictions.png\")\n", + " mlflow.log_artifact(\"actuals_vs_predictions.png\") " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can open the report page for your experiment and runs within it from Azure Portal.\n", + "\n", + "Select one of the runs to view the metrics, and the plot you saved. The saved scikit-learn model appears under **outputs** tab." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ws.experiments[experiment_name]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Next steps\n", + "\n", + "Try out these notebooks to learn more about MLflow-Azure Machine Learning integration:\n", + "\n", + " * [Train a model using remote compute on Azure Cloud](../train-on-remote/train-on-remote.ipynb)\n", + " * [Deploy the model as a web service](../deploy-model/deploy-model.ipynb)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "authors": [ + { + "name": "rastala" + } + ], + "kernelspec": { + "display_name": "Python 3.6", + "language": "python", + "name": "python36" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.4" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/how-to-use-azureml/using-mlflow/train-remote/train-remote.ipynb b/how-to-use-azureml/using-mlflow/train-remote/train-remote.ipynb new file mode 100644 index 00000000..6bd1592d --- /dev/null +++ b/how-to-use-azureml/using-mlflow/train-remote/train-remote.ipynb @@ -0,0 +1,318 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) Microsoft Corporation. All rights reserved.\n", + "\n", + "Licensed under the MIT License." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/using-mlflow/train-remote/train-remote.png)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Use MLflow with Azure Machine Learning for Remote Training Run\n", + "\n", + "This example shows you how to use MLflow tracking APIs together with Azure Machine Learning services for storing your metrics and artifacts, from local Notebook run. You'll learn how to:\n", + "\n", + " 1. Set up MLflow tracking URI so as to use Azure ML\n", + " 2. Create experiment\n", + " 3. Train a model on Machine Learning Compute while logging metrics and artifacts\n", + " 4. View your experiment within your Azure ML Workspace in Azure Portal." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Prerequisites\n", + "\n", + "Make sure you have completed the [Configuration](../../../configuration.ipnyb) notebook to set up your Azure Machine Learning workspace and ensure other common prerequisites are met." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Set-up\n", + "\n", + "Check Azure ML SDK version installed on your computer, and then connect to your Workspace." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Check core SDK version number\n", + "import azureml.core\n", + "from azureml.core import Workspace, Experiment\n", + "\n", + "print(\"SDK version:\", azureml.core.VERSION)\n", + "\n", + "ws = Workspace.from_config()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let's also create a Machine Learning Compute cluster for submitting the remote run. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core.compute import ComputeTarget, AmlCompute\n", + "from azureml.core.compute_target import ComputeTargetException\n", + "\n", + "# Choose a name for your CPU cluster\n", + "cpu_cluster_name = \"cpu-cluster\"\n", + "\n", + "# Verify that cluster does not exist already\n", + "try:\n", + " cpu_cluster = ComputeTarget(workspace=ws, name=cpu_cluster_name)\n", + " print(\"Found existing cpu-cluster\")\n", + "except ComputeTargetException:\n", + " print(\"Creating new cpu-cluster\")\n", + " \n", + " # Specify the configuration for the new cluster\n", + " compute_config = AmlCompute.provisioning_configuration(vm_size=\"STANDARD_D2_V2\",\n", + " min_nodes=0,\n", + " max_nodes=1)\n", + "\n", + " # Create the cluster with the specified name and configuration\n", + " cpu_cluster = ComputeTarget.create(ws, cpu_cluster_name, compute_config)\n", + " \n", + " # Wait for the cluster to complete, show the output log\n", + " cpu_cluster.wait_for_completion(show_output=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Create Azure ML Experiment" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The following steps show how to submit a training Python script to a cluster as an Azure ML run, while logging happens through MLflow APIs to your Azure ML Workspace. Let's first create an experiment to hold the training runs." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core import Experiment\n", + "\n", + "experiment_name = \"experiment-with-mlflow\"\n", + "exp = Experiment(workspace=ws, name=experiment_name)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Instrument remote training script using MLflow" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let's use [*train_diabetes.py*](train_diabetes.py) to train a regression model against diabetes dataset as the example. Note that the training script uses mlflow.start_run() to start logging, and then logs metrics, saves the trained scikit-learn model, and saves a plot as an artifact.\n", + "\n", + "Run following command to view the script file. Notice the mlflow logging statements, and also notice that the script doesn't have explicit dependencies on azureml library." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "training_script = 'train_diabetes.py'\n", + "with open(training_script, 'r') as f:\n", + " print(f.read())" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Submit Run to Cluster \n", + "\n", + "Let's submit the run to cluster. When running on the remote cluster as submitted run, Azure ML sets the MLflow tracking URI to point to your Azure ML Workspace, so that the metrics and artifacts are automatically logged there.\n", + "\n", + "Note that you have to specify the packages your script depends on, including *azureml-mlflow* that implicitly enables the MLflow logging to Azure ML. \n", + "\n", + "First, create a environment with Docker enable and required package dependencies specified." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "tags": [ + "mlflow" + ] + }, + "outputs": [], + "source": [ + "from azureml.core import Environment\n", + "from azureml.core.conda_dependencies import CondaDependencies\n", + "\n", + "env = Environment(name=\"mlflow-env\")\n", + "\n", + "env.docker.enabled = True\n", + "\n", + "# Specify conda dependencies with scikit-learn and temporary pointers to mlflow extensions\n", + "cd = CondaDependencies.create(\n", + " conda_packages=[\"scikit-learn\", \"matplotlib\"],\n", + " pip_packages=[\"azureml-mlflow\", \"numpy\"]\n", + " )\n", + "\n", + "env.python.conda_dependencies = cd" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Next, specify a script run configuration that includes the training script, environment and CPU cluster created earlier." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from azureml.core import ScriptRunConfig\n", + "\n", + "src = ScriptRunConfig(source_directory=\".\", script=training_script)\n", + "src.run_config.environment = env\n", + "src.run_config.target = cpu_cluster.name" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Finally, submit the run. Note that the first instance of the run typically takes longer as the Docker-based environment is created, several minutes. Subsequent runs reuse the image and are faster." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "run = exp.submit(src)\n", + "run.wait_for_completion(show_output=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can navigate to your Azure ML Workspace at Azure Portal to view the run metrics and artifacts. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "run.id" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can also get the metrics and bring them to your local notebook, and view the details of the run." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "run.get_metrics()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ws.get_details()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Next steps\n", + "\n", + " * [Deploy the model as a web service](../deploy-model/deploy-model.ipynb)\n", + " * [Learn more about Azure Machine Learning compute options](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-set-up-training-targets)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "authors": [ + { + "name": "rastala" + } + ], + "kernelspec": { + "display_name": "Python 3.6", + "language": "python", + "name": "python36" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.4" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/how-to-use-azureml/using-mlflow/train-remote/train_diabetes.py b/how-to-use-azureml/using-mlflow/train-remote/train_diabetes.py new file mode 100644 index 00000000..a89ab776 --- /dev/null +++ b/how-to-use-azureml/using-mlflow/train-remote/train_diabetes.py @@ -0,0 +1,46 @@ +# Copyright (c) Microsoft. All rights reserved. +# Licensed under the MIT license. + +import numpy as np +from sklearn.datasets import load_diabetes +from sklearn.linear_model import Ridge +from sklearn.metrics import mean_squared_error +from sklearn.model_selection import train_test_split +import mlflow +import mlflow.sklearn + +import matplotlib +matplotlib.use('Agg') +import matplotlib.pyplot as plt + +with mlflow.start_run(): + X, y = load_diabetes(return_X_y=True) + columns = ['age', 'gender', 'bmi', 'bp', 's1', 's2', 's3', 's4', 's5', 's6'] + X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0) + data = { + "train": {"X": X_train, "y": y_train}, + "test": {"X": X_test, "y": y_test}} + + mlflow.log_metric("Training samples", len(data['train']['X'])) + mlflow.log_metric("Test samples", len(data['test']['X'])) + + # Log the algorithm parameter alpha to the run + mlflow.log_metric('alpha', 0.03) + # Create, fit, and test the scikit-learn Ridge regression model + regression_model = Ridge(alpha=0.03) + regression_model.fit(data['train']['X'], data['train']['y']) + preds = regression_model.predict(data['test']['X']) + + # Log mean squared error + print('Mean Squared Error is', mean_squared_error(data['test']['y'], preds)) + mlflow.log_metric('mse', mean_squared_error(data['test']['y'], preds)) + + # Save the model to the outputs directory for capture + mlflow.sklearn.log_model(regression_model, "model") + + # Plot actuals vs predictions and save the plot within the run + fig = plt.figure(1) + idx = np.argsort(data['test']['y']) + plt.plot(data['test']['y'][idx], preds[idx]) + fig.savefig("actuals_vs_predictions.png") + mlflow.log_artifact("actuals_vs_predictions.png")