├── README.md ├── authentication.jpg ├── compute-identity ├── multi-step-pipelines │ ├── conda_dependencies.yml │ ├── data │ │ ├── t10k-images-idx3-ubyte │ │ ├── t10k-labels-idx1-ubyte │ │ ├── train-images-idx3-ubyte │ │ └── train-labels-idx1-ubyte │ ├── download │ │ └── updates_ca.csv │ ├── grantidentity.jpg │ ├── keras-mnist-fashion │ │ ├── prepare.py │ │ └── train.py │ └── pipeline-for-image-classification.ipynb └── train-with-estimator │ ├── conda_dependencies.yml │ ├── grantaccess.jpg │ ├── identity-based-data-access-with-compute-identity.ipynb │ └── iris-train │ ├── iris.csv │ └── train_iris.py ├── config.json └── user-identity-passthrough └── train-with-dataset ├── conda_dependencies.yml ├── roleaccess.PNG ├── storageurl.jpg ├── train-dataset ├── iris.csv ├── train_diabetes.py └── train_iris.py └── train-with-datasets.ipynb /README.md: -------------------------------------------------------------------------------- 1 | # [Private Preview] identity-based-data-access 2 | 3 | This private preview feature aims to: 4 | 1. Address the security concern for [AzureML datastore](https://docs.microsoft.com/en-us/azure/machine-learning/how-to-access-data) storing secrets. Today, users have to register datastore with credentials, which is then accessible to anyone with datastore reader role in the workspace. Blob, ADLS Gen1, ADLS Gen2 are supported. 5 | 2. Enable eyes-off training. For companies with sensitive data, we make it possible for data scientists to do training without access to the actual data content. You can grant data access to AML compute. So that data scientists won't be able to access or read the data using their own identity but they can still submit experiments to train with the data using compute identity.
6 | [Sample notebook using estimator](./compute-identity/train-with-estimator/)
7 | [Sample notebook using pipeline](./compute-identity/multi-step-pipelines/) 8 | 3. Enable credential passthrough for granular data access control. For workspace shared by users with different level of data access permission, it is now possible to always authenticate data access with users' AAD token. Admin only needs to manage access control at storage (e.g. adlsgen2). AzureML will passthrough users' AAD token for both interactive experiment and training on remote compute.
9 | **NOTE**: For private preview, we only support ScriptRun on AML compute* for ADLS Gen2 storage. We will expand support for automl, pipelines in public preview. Whitelisting is reqruied to enable credential passthrough. Please reach out to May Hu (sihhu@microsoft.com) to participate.
10 | *AML compute (Compute clusters) backed with all VM skus **EXCEPT** the following skus: 11 | - "standard_nc24r" 12 | - "standard_a8" 13 | - "standard_a9" 14 | - "standard_h16r" 15 | - "standard_h16mr" 16 | - "standard_nc24rs_v2" 17 | - "standard_nc24rs_v3" 18 | - "standard_nd24rs" 19 | 20 | [Sample notebook using Script Run](./user-identity-passthrough/train-with-datasets) 21 | 22 | How data access authenticaiton works: 23 | ![flow](authentication.jpg) 24 | 25 | 26 | ## Terms of Use 27 | This is a private preview feature of Azure Machine Learning and is subject to the [Azure Legal Terms](https://azure.microsoft.com/en-us/support/legal/?ranMID=24542&ranEAID=msYS1Nvjv4c&ranSiteID=msYS1Nvjv4c-pQVqGgzMLX3ysSdCWd8org&epi=msYS1Nvjv4c-pQVqGgzMLX3ysSdCWd8org&irgwc=1&OCID=AID2000142_aff_7593_1243925&tduid=%28ir__6kriqwk10wkftwnk0higqpq2m22xi0gd9xxevzpz00%29%287593%29%281243925%29%28msYS1Nvjv4c-pQVqGgzMLX3ysSdCWd8org%29%28%29&irclickid=_6kriqwk10wkftwnk0higqpq2m22xi0gd9xxevzpz00) and the [Supplemental Terms for Azure Previews](https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/)
28 | -------------------------------------------------------------------------------- /authentication.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MayMSFT/identity-based-data-access/9f2482a917517dddbeff9b8e34ead020c75713eb/authentication.jpg -------------------------------------------------------------------------------- /compute-identity/multi-step-pipelines/conda_dependencies.yml: -------------------------------------------------------------------------------- 1 | 2 | dependencies: 3 | - python=3.6.2 4 | - pip: 5 | - azureml-defaults 6 | - keras 7 | - tensorflow 8 | - numpy 9 | - scikit-learn 10 | - pandas 11 | - matplotlib 12 | -------------------------------------------------------------------------------- /compute-identity/multi-step-pipelines/data/t10k-images-idx3-ubyte: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MayMSFT/identity-based-data-access/9f2482a917517dddbeff9b8e34ead020c75713eb/compute-identity/multi-step-pipelines/data/t10k-images-idx3-ubyte -------------------------------------------------------------------------------- /compute-identity/multi-step-pipelines/data/t10k-labels-idx1-ubyte: -------------------------------------------------------------------------------- 1 | '                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           -------------------------------------------------------------------------------- /compute-identity/multi-step-pipelines/data/train-images-idx3-ubyte: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MayMSFT/identity-based-data-access/9f2482a917517dddbeff9b8e34ead020c75713eb/compute-identity/multi-step-pipelines/data/train-images-idx3-ubyte -------------------------------------------------------------------------------- /compute-identity/multi-step-pipelines/data/train-labels-idx1-ubyte: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MayMSFT/identity-based-data-access/9f2482a917517dddbeff9b8e34ead020c75713eb/compute-identity/multi-step-pipelines/data/train-labels-idx1-ubyte -------------------------------------------------------------------------------- /compute-identity/multi-step-pipelines/download/updates_ca.csv: -------------------------------------------------------------------------------- 1 | instant,dteday,season,yr,mnth,holiday,weekday,workingday,weathersit,temp,atemp,hum,windspeed,casual,registered,cnt 2 | 1,1/1/2011,1,0,1,0,6,0,2,0.344167,0.363625,0.805833,0.160446,331,654,985 3 | 2,1/2/2011,1,0,1,0,0,0,2,0.363478,0.353739,0.696087,0.248539,131,670,801 4 | 3,1/3/2011,1,0,1,0,1,1,1,0.196364,0.189405,0.437273,0.248309,120,1229,1349 5 | 4,1/4/2011,1,0,1,0,2,1,1,0.2,0.212122,0.590435,0.160296,108,1454,1562 6 | 5,1/5/2011,1,0,1,0,3,1,1,NA,0.22927,0.436957,0.1869,82,1518,1600 7 | 6,1/6/2011,1,0,1,0,4,1,1,0.204348,0.233209,0.518261,0.0895652,88,1518,1606 8 | 7,1/7/2011,1,0,1,0,5,1,2,0.196522,0.208839,NA,0.168726,148,1362,1510 9 | 8,1/8/2011,1,0,1,0,6,0,2,0.165,0.162254,,0.266804,68,891,959 10 | 9,1/9/2011,1,0,1,0,0,0,1,0.138333,0.116175,0.434167,0.36195,54,768,822 11 | 10,1/10/2011,1,0,1,0,1,1,1,0.150833,0.150888,0.482917,0.223267,41,1280,1321 12 | 11,1/11/2011,1,0,1,0,2,1,2,0.169091,0.191464,0.686364,0.122132,43,1220,1263 13 | 12,1/12/2011,1,0,,0,3,1,1,0.172727,0.160473,0.599545,0.304627,25,1137,1162 14 | 13,1/13/2011,1,0,1,0,4,1,1,0.165,0.150883,0.470417,0.301,38,1368,1406 15 | 14,1/14/2011,1,0,1,0,5,1,1,0.16087,0.188413,0.537826,0.126548,54,1367,1421 16 | 15,1/15/2011,1,0,1,0,6,0,2,0.233333,0.248112,0.49875,0.157963,222,1026,1248 17 | 16,1/16/2011,1,0,1,0,0,0,1,0.231667,0.234217,0.48375,0.188433,251,953,1204 18 | 17,1/17/2011,1,0,1,1,1,0,2,0.175833,0.176771,0.5375,0.194017,117,883,1000 19 | 18,1/18/2011,1,0,1,0,2,1,2,0.216667,0.232333,0.861667,0.146775,9,674,683 20 | 19,1/19/2011,1,0,1,0,3,1,2,0.292174,0.298422,0.741739,0.208317,78,1572,1650 21 | 20,1/20/2011,1,0,1,0,4,1,2,0.261667,0.25505,0.538333,0.195904,83,1844,1927 22 | 21,1/21/2011,1,0,1,0,5,1,1,0.1775,0.157833,0.457083,0.353242,75,1468,1543 23 | 22,1/22/2011,1,0,1,0,6,0,1,0.0591304,0.0790696,0.4,0.17197,93,888,981 24 | 23,1/23/2011,1,0,1,0,0,0,1,0.0965217,0.0988391,0.436522,0.2466,150,836,986 25 | 24,1/24/2011,1,0,1,0,1,1,1,0.0973913,0.11793,0.491739,0.15833,86,1330,1416 26 | 25,1/25/2011,1,0,1,0,2,1,2,0.223478,0.234526,0.616957,0.129796,186,1799,1985 27 | 26,1/26/2011,1,0,1,0,3,1,3,0.2175,0.2036,0.8625,0.29385,34,472,506 28 | 27,1/27/2011,1,0,1,0,4,1,1,0.195,0.2197,0.6875,0.113837,15,416,431 29 | 28,1/28/2011,1,0,1,0,5,1,2,0.203478,0.223317,0.793043,0.1233,38,1129,1167 30 | 29,1/29/2011,1,0,1,0,6,0,1,0.196522,0.212126,0.651739,0.145365,123,975,1098 31 | 30,1/30/2011,1,0,1,0,0,0,1,0.216522,0.250322,0.722174,0.0739826,140,956,1096 32 | 31,1/31/2011,1,0,1,0,1,1,2,0.180833,0.18625,0.60375,0.187192,42,1459,1501 33 | 32,2/1/2011,1,0,2,0,2,1,2,0.192174,0.23453,0.829565,0.053213,47,1313,1360 34 | 33,2/2/2011,1,0,2,0,3,1,2,0.26,0.254417,0.775417,0.264308,72,1454,1526 35 | 34,2/3/2011,1,0,2,0,4,1,1,0.186957,0.177878,0.437826,0.277752,61,1489,1550 36 | 35,2/4/2011,1,0,2,0,5,1,2,0.211304,0.228587,0.585217,0.127839,88,1620,1708 37 | 36,2/5/2011,1,0,2,0,6,0,2,0.233333,0.243058,0.929167,0.161079,100,905,1005 38 | 37,2/6/2011,1,0,2,0,0,0,1,0.285833,0.291671,0.568333,0.1418,354,1269,1623 39 | 38,2/7/2011,1,0,2,0,1,1,1,0.271667,0.303658,0.738333,0.0454083,120,1592,1712 40 | 39,2/8/2011,1,0,2,0,2,1,1,0.220833,0.198246,0.537917,0.36195,64,1466,1530 41 | 40,2/9/2011,1,0,2,0,3,1,2,0.134783,0.144283,0.494783,0.188839,53,1552,1605 42 | 41,2/10/2011,1,0,2,0,4,1,1,0.144348,0.149548,0.437391,0.221935,47,1491,1538 43 | 42,2/11/2011,1,0,2,0,5,1,1,0.189091,0.213509,0.506364,0.10855,149,1597,1746 44 | 43,2/12/2011,1,0,2,0,6,0,1,0.2225,0.232954,0.544167,0.203367,288,1184,1472 45 | 44,2/13/2011,1,0,2,0,0,0,1,0.316522,0.324113,0.457391,0.260883,397,1192,1589 46 | 45,2/14/2011,1,0,2,0,1,1,1,0.415,0.39835,0.375833,0.417908,208,1705,1913 47 | 46,2/15/2011,1,0,2,0,2,1,1,0.266087,0.254274,0.314348,0.291374,140,1675,1815 48 | 47,2/16/2011,1,0,2,0,3,1,1,0.318261,0.3162,0.423478,0.251791,218,1897,2115 49 | 48,2/17/2011,1,0,2,0,4,1,1,0.435833,0.428658,0.505,0.230104,259,2216,2475 50 | 49,2/18/2011,1,0,2,0,5,1,1,0.521667,0.511983,0.516667,0.264925,579,2348,2927 51 | 50,2/19/2011,1,0,2,0,6,0,1,0.399167,0.391404,0.187917,0.507463,532,1103,1635 52 | 51,2/20/2011,1,0,2,0,0,0,1,0.285217,0.27733,0.407826,0.223235,639,1173,1812 53 | 52,2/21/2011,1,0,2,1,1,0,2,0.303333,0.284075,0.605,0.307846,195,912,1107 54 | 53,2/22/2011,1,0,2,0,2,1,1,0.182222,0.186033,0.577778,0.195683,74,1376,1450 55 | 54,2/23/2011,1,0,2,0,3,1,1,0.221739,0.245717,0.423043,0.094113,139,1778,1917 56 | 55,2/24/2011,1,0,2,0,4,1,2,0.295652,0.289191,0.697391,0.250496,100,1707,1807 57 | 56,2/25/2011,1,0,2,0,5,1,2,0.364348,0.350461,0.712174,0.346539,120,1341,1461 58 | 57,2/26/2011,1,0,2,0,6,0,1,0.2825,0.282192,0.537917,0.186571,424,1545,1969 59 | 58,2/27/2011,1,0,2,0,0,0,1,0.343478,0.351109,0.68,0.125248,694,1708,2402 60 | 59,2/28/2011,1,0,2,0,1,1,2,0.407273,0.400118,0.876364,0.289686,81,1365,1446 61 | 60,3/1/2011,1,0,3,0,2,1,1,0.266667,0.263879,0.535,0.216425,137,1714,1851 62 | 61,3/2/2011,1,0,3,0,3,1,1,0.335,0.320071,0.449583,0.307833,231,1903,2134 63 | 62,3/3/2011,1,0,3,0,4,1,1,0.198333,0.200133,0.318333,0.225754,123,1562,1685 64 | 63,3/4/2011,1,0,3,0,5,1,2,0.261667,0.255679,0.610417,0.203346,214,1730,1944 65 | 64,3/5/2011,1,0,3,0,6,0,2,0.384167,0.378779,0.789167,0.251871,640,1437,2077 66 | 65,3/6/2011,1,0,3,0,0,0,2,0.376522,0.366252,0.948261,0.343287,114,491,605 67 | 66,3/7/2011,1,0,3,0,1,1,1,0.261739,0.238461,0.551304,0.341352,244,1628,1872 68 | 67,3/8/2011,1,0,3,0,2,1,1,0.2925,0.3024,0.420833,0.12065,316,1817,2133 69 | 68,3/9/2011,1,0,3,0,3,1,2,0.295833,0.286608,0.775417,0.22015,191,1700,1891 70 | 69,3/10/2011,1,0,3,0,4,1,3,0.389091,0.385668,0,0.261877,46,577,623 71 | 70,3/11/2011,1,0,3,0,5,1,2,0.316522,0.305,0.649565,0.23297,247,1730,1977 72 | 71,3/12/2011,1,0,3,0,6,0,1,0.329167,0.32575,0.594583,0.220775,724,1408,2132 73 | 72,3/13/2011,1,0,3,0,0,0,1,0.384348,0.380091,0.527391,0.270604,982,1435,2417 74 | 73,3/14/2011,1,0,3,0,1,1,1,0.325217,0.332,0.496957,0.136926,359,1687,2046 75 | 74,3/15/2011,1,0,3,0,2,1,2,0.317391,0.318178,0.655652,0.184309,289,1767,2056 76 | 75,3/16/2011,1,0,3,0,3,1,2,0.365217,0.36693,0.776522,0.203117,321,1871,2192 77 | 76,3/17/2011,1,0,3,0,4,1,1,0.415,0.410333,0.602917,0.209579,424,2320,2744 78 | 77,3/18/2011,1,0,3,0,5,1,1,0.54,0.527009,0.525217,0.231017,884,2355,3239 79 | 78,3/19/2011,1,0,3,0,6,0,1,0.4725,0.466525,0.379167,0.368167,1424,1693,3117 80 | 79,3/20/2011,1,0,3,0,0,0,1,0.3325,0.32575,0.47375,0.207721,1047,1424,2471 81 | 80,3/21/2011,2,0,3,0,1,1,2,0.430435,0.409735,0.737391,0.288783,401,1676,2077 82 | 81,3/22/2011,2,0,3,0,2,1,1,0.441667,0.440642,0.624583,0.22575,460,2243,2703 83 | 82,3/23/2011,2,0,3,0,3,1,2,0.346957,0.337939,0.839565,0.234261,203,1918,2121 84 | 83,3/24/2011,2,0,3,0,4,1,2,0.285,0.270833,0.805833,0.243787,166,1699,1865 85 | 84,3/25/2011,2,0,3,0,5,1,1,0.264167,0.256312,0.495,0.230725,300,1910,2210 86 | 85,3/26/2011,2,0,3,0,6,0,1,0.265833,0.257571,0.394167,0.209571,981,1515,2496 87 | 86,3/27/2011,2,0,3,0,0,0,2,0.253043,0.250339,0.493913,0.1843,472,1221,1693 88 | 87,3/28/2011,2,0,3,0,1,1,1,0.264348,0.257574,0.302174,0.212204,222,1806,2028 89 | 88,3/29/2011,2,0,3,0,2,1,1,0.3025,0.292908,0.314167,0.226996,317,2108,2425 90 | 89,3/30/2011,2,0,3,0,3,1,2,0.3,0.29735,0.646667,0.172888,168,1368,1536 91 | 90,3/31/2011,2,0,3,0,4,1,3,0.268333,0.257575,0.918333,0.217646,179,1506,1685 92 | 91,4/1/2011,2,0,4,0,5,1,2,0.3,0.283454,0.68625,0.258708,307,1920,2227 93 | 92,4/2/2011,2,0,4,0,6,0,2,0.315,0.315637,0.65375,0.197146,898,1354,2252 94 | 93,4/3/2011,2,0,4,0,0,0,1,0.378333,0.378767,0.48,0.182213,1651,1598,3249 95 | 94,4/4/2011,2,0,4,0,1,1,1,0.573333,0.542929,0.42625,0.385571,734,2381,3115 96 | 95,4/5/2011,2,0,4,0,2,1,2,0.414167,0.39835,0.642083,0.388067,167,1628,1795 97 | 96,4/6/2011,2,0,4,0,3,1,1,0.390833,0.387608,0.470833,0.263063,413,2395,2808 98 | 97,4/7/2011,2,0,,0,4,1,1,0.4375,0.433696,0.602917,0.162312,571,2570,3141 99 | 98,4/8/2011,2,0,4,0,5,1,2,0.335833,0.324479,0.83625,0.226992,172,1299,1471 100 | 99,4/9/2011,2,0,4,0,6,0,2,0.3425,0.341529,0.8775,0.133083,879,1576,2455 101 | 100,4/10/2011,2,0,4,0,0,0,2,0.426667,0.426737,0.8575,0.146767,1188,1707,2895 102 | 101,4/11/2011,2,0,4,0,1,1,2,0.595652,0.565217,0.716956,0.324474,855,2493,3348 103 | 102,4/12/2011,2,0,4,0,2,1,2,0.5025,0.493054,0.739167,0.274879,257,1777,2034 104 | 103,4/13/2011,2,0,4,0,3,1,2,0.4125,0.417283,0.819167,0.250617,209,1953,2162 105 | 104,4/14/2011,2,0,4,0,4,1,1,0.4675,0.462742,0.540417,0.1107,529,2738,3267 106 | 105,4/15/2011,2,0,4,1,5,0,1,0.446667,0.441913,0.67125,0.226375,642,2484,3126 107 | 106,4/16/2011,2,0,4,0,6,0,3,0.430833,0.425492,0.888333,0.340808,121,674,795 108 | 107,4/17/2011,2,0,4,0,0,0,1,0.456667,0.445696,0.479583,0.303496,1558,2186,3744 109 | 108,4/18/2011,2,0,4,0,1,1,1,0.5125,0.503146,0.5425,0.163567,669,2760,3429 110 | 109,4/19/2011,2,0,4,0,2,1,2,0.505833,0.489258,0.665833,0.157971,409,2795,3204 111 | 110,4/20/2011,2,0,4,0,3,1,1,0.595,0.564392,0.614167,0.241925,613,3331,3944 112 | 111,4/21/2011,2,0,4,0,4,1,1,0.459167,0.453892,0.407083,0.325258,745,3444,4189 113 | 112,4/22/2011,2,0,4,0,5,1,2,0.336667,0.321954,0.729583,0.219521,177,1506,1683 114 | 113,4/23/2011,2,0,4,0,6,0,2,0.46,0.450121,0.887917,0.230725,1462,2574,4036 115 | 114,4/24/2011,2,0,4,0,0,0,2,0.581667,0.551763,0.810833,0.192175,1710,2481,4191 116 | 115,4/25/2011,2,0,4,0,1,1,1,0.606667,0.5745,0.776667,0.185333,773,3300,4073 117 | 116,4/26/2011,2,0,4,0,2,1,1,0.631667,0.594083,0.729167,0.3265,678,3722,4400 118 | 117,4/27/2011,2,0,4,0,3,1,2,0.62,0.575142,0.835417,0.3122,547,3325,3872 119 | 118,4/28/2011,2,0,4,0,4,1,2,0.6175,0.578929,0.700833,0.320908,569,3489,4058 120 | 119,4/29/2011,2,0,4,0,5,1,1,0.51,0.497463,0.457083,0.240063,878,3717,4595 121 | 120,4/30/2011,2,0,4,0,6,0,1,0.4725,0.464021,0.503333,0.235075,1965,3347,5312 122 | 121,5/1/2011,2,0,5,0,0,0,2,0.451667,0.448204,0.762083,0.106354,1138,2213,3351 123 | 122,5/2/2011,2,0,5,0,1,1,2,0.549167,0.532833,0.73,0.183454,847,3554,4401 124 | 123,5/3/2011,2,0,5,0,2,1,2,0.616667,0.582079,0.697083,0.342667,603,3848,4451 125 | 124,5/4/2011,2,0,5,0,3,1,2,0.414167,0.40465,0.737083,0.328996,255,2378,2633 126 | 125,5/5/2011,2,0,5,0,4,1,1,0.459167,0.441917,0.444167,0.295392,614,3819,4433 127 | 126,5/6/2011,2,0,5,0,5,1,1,0.479167,0.474117,0.59,0.228246,894,3714,4608 128 | 127,5/7/2011,2,0,5,0,6,0,1,0.52,0.512621,0.54125,0.16045,1612,3102,4714 129 | 128,5/8/2011,2,0,5,0,0,0,1,0.528333,0.518933,0.631667,0.0746375,1401,2932,4333 130 | 129,5/9/2011,2,0,5,0,1,1,1,0.5325,0.525246,0.58875,0.176,664,3698,4362 131 | 130,5/10/2011,2,0,5,0,2,1,1,0.5325,0.522721,0.489167,0.115671,694,4109,4803 132 | 131,5/11/2011,2,0,5,0,3,1,1,0.5425,0.5284,0.632917,0.120642,550,3632,4182 133 | 132,5/12/2011,2,0,5,0,4,1,1,0.535,0.523363,0.7475,0.189667,695,4169,4864 134 | 133,5/13/2011,2,0,5,0,5,1,2,0.5125,0.4943,0.863333,0.179725,692,3413,4105 135 | 134,5/14/2011,2,0,5,0,6,0,2,0.520833,0.500629,0.9225,0.13495,902,2507,3409 136 | 135,5/15/2011,2,0,5,0,0,0,2,0.5625,0.536,0.867083,0.152979,1582,2971,4553 137 | 136,5/16/2011,2,0,5,0,1,1,1,0.5775,0.550512,0.787917,0.126871,773,3185,3958 138 | 137,5/17/2011,2,0,5,0,2,1,2,0.561667,0.538529,0.837917,0.277354,678,3445,4123 139 | 138,5/18/2011,2,0,5,0,3,1,2,0.55,0.527158,0.87,0.201492,536,3319,3855 140 | 139,5/19/2011,2,0,5,0,4,1,2,0.530833,0.510742,0.829583,0.108213,735,3840,4575 141 | 140,5/20/2011,2,0,5,0,5,1,1,0.536667,0.529042,0.719583,0.125013,909,4008,4917 142 | 141,5/21/2011,2,0,5,0,6,0,1,0.6025,0.571975,0.626667,0.12065,2258,3547,5805 143 | 142,5/22/2011,2,0,5,0,0,0,1,0.604167,0.5745,0.749583,0.148008,1576,3084,4660 144 | 143,5/23/2011,2,0,5,0,1,1,2,0.631667,0.590296,0.81,0.233842,836,3438,4274 145 | 144,5/24/2011,2,0,5,0,2,1,2,0.66,0.604813,0.740833,0.207092,659,3833,4492 146 | 145,5/25/2011,2,0,5,0,3,1,1,0.660833,0.615542,0.69625,0.154233,740,4238,4978 147 | 146,5/26/2011,2,0,5,0,4,1,1,0.708333,0.654688,0.6775,0.199642,758,3919,4677 148 | 147,5/27/2011,2,0,5,0,5,1,1,0.681667,0.637008,0.65375,0.240679,871,3808,4679 149 | 148,5/28/2011,2,0,5,0,6,0,1,0.655833,0.612379,0.729583,0.230092,2001,2757,4758 150 | 149,5/29/2011,2,0,5,0,0,0,1,0.6675,0.61555,0.81875,0.213938,2355,2433,4788 151 | 150,5/30/2011,2,0,5,1,1,0,1,0.733333,0.671092,0.685,0.131225,1549,2549,4098 152 | 151,5/31/2011,2,0,5,0,2,1,1,0.775,0.725383,0.636667,0.111329,673,3309,3982 153 | 152,6/1/2011,2,0,6,0,3,1,2,0.764167,0.720967,0.677083,0.207092,513,3461,3974 154 | 153,6/2/2011,2,0,6,0,4,1,1,0.715,0.643942,0.305,0.292287,736,4232,4968 155 | 154,6/3/2011,2,0,6,0,5,1,1,0.62,0.587133,0.354167,0.253121,898,4414,5312 156 | 155,6/4/2011,2,0,6,0,6,0,1,0.635,0.594696,0.45625,0.123142,1869,3473,5342 157 | 156,6/5/2011,2,0,6,0,0,0,2,0.648333,0.616804,0.6525,0.138692,1685,3221,4906 158 | 157,6/6/2011,2,0,6,0,1,1,1,0.678333,0.621858,0.6,0.121896,673,3875,4548 159 | 158,6/7/2011,2,0,6,0,2,1,1,0.7075,0.65595,0.597917,0.187808,763,4070,4833 160 | 159,6/8/2011,2,0,6,0,3,1,1,0.775833,0.727279,0.622083,0.136817,676,3725,4401 161 | 160,6/9/2011,2,0,6,0,4,1,2,0.808333,0.757579,0.568333,0.149883,563,3352,3915 162 | 161,6/10/2011,2,0,6,0,5,1,1,0.755,0.703292,0.605,0.140554,815,3771,4586 163 | 162,6/11/2011,2,0,6,0,6,0,1,0.725,0.678038,0.654583,0.15485,1729,3237,4966 164 | 163,6/12/2011,2,0,6,0,0,0,1,0.6925,0.643325,0.747917,0.163567,1467,2993,4460 165 | 164,6/13/2011,2,0,6,0,1,1,1,0.635,0.601654,0.494583,0.30535,863,4157,5020 166 | 165,6/14/2011,2,0,6,0,2,1,1,0.604167,0.591546,0.507083,0.269283,727,4164,4891 167 | 166,6/15/2011,2,0,6,0,3,1,1,0.626667,0.587754,0.471667,0.167912,769,4411,5180 168 | 167,6/16/2011,2,0,6,0,4,1,2,0.628333,0.595346,0.688333,0.206471,545,3222,3767 169 | 168,6/17/2011,2,0,6,0,5,1,1,0.649167,0.600383,0.735833,0.143029,863,3981,4844 170 | 169,6/18/2011,2,0,6,0,6,0,1,0.696667,0.643954,0.670417,0.119408,1807,3312,5119 171 | 170,6/19/2011,2,0,6,0,0,0,2,0.699167,0.645846,0.666667,0.102,1639,3105,4744 172 | 171,6/20/2011,2,0,6,0,1,1,2,0.635,0.595346,0.74625,0.155475,699,3311,4010 173 | 172,6/21/2011,3,0,6,0,2,1,2,0.680833,0.637646,0.770417,0.171025,774,4061,4835 174 | 173,6/22/2011,3,0,6,0,3,1,1,0.733333,0.693829,0.7075,0.172262,661,3846,4507 175 | 174,6/23/2011,3,0,6,0,4,1,2,0.728333,0.693833,0.703333,0.238804,746,4044,4790 176 | 175,6/24/2011,3,0,6,0,5,1,1,0.724167,0.656583,0.573333,0.222025,969,4022,4991 177 | 176,6/25/2011,3,0,6,0,6,0,1,0.695,0.643313,0.483333,0.209571,1782,3420,5202 178 | 177,6/26/2011,3,0,6,0,0,0,1,0.68,0.637629,0.513333,0.0945333,1920,3385,5305 179 | 178,6/27/2011,3,0,6,0,1,1,2,0.6825,0.637004,0.658333,0.107588,854,3854,4708 180 | 179,6/28/2011,3,0,6,0,2,1,1,0.744167,0.692558,0.634167,0.144283,732,3916,4648 181 | 180,6/29/2011,3,0,6,0,3,1,1,0.728333,0.654688,0.497917,0.261821,848,4377,5225 182 | 181,6/30/2011,3,0,6,0,4,1,1,0.696667,0.637008,0.434167,0.185312,1027,4488,5515 183 | 182,7/1/2011,3,0,7,0,5,1,1,0.7225,0.652162,0.39625,0.102608,1246,4116,5362 184 | 183,7/2/2011,3,0,7,0,6,0,1,0.738333,0.667308,0.444583,0.115062,2204,2915,5119 185 | 184,7/3/2011,3,0,7,0,0,0,2,0.716667,0.668575,0.6825,0.228858,2282,2367,4649 186 | 185,7/4/2011,3,0,7,1,1,0,2,0.726667,0.665417,0.637917,0.0814792,3065,2978,6043 187 | 186,7/5/2011,3,0,7,0,2,1,1,0.746667,0.696338,0.590417,0.126258,1031,3634,4665 188 | 187,7/6/2011,3,0,7,0,3,1,1,0.72,0.685633,0.743333,0.149883,784,3845,4629 189 | 188,7/7/2011,3,0,7,0,4,1,1,0.75,0.686871,0.65125,0.1592,754,3838,4592 190 | 189,7/8/2011,3,0,7,0,5,1,2,0.709167,0.670483,0.757917,0.225129,692,3348,4040 191 | 190,7/9/2011,3,0,7,0,6,0,1,0.733333,0.664158,0.609167,0.167912,1988,3348,5336 192 | 191,7/10/2011,3,0,7,0,0,0,1,0.7475,0.690025,0.578333,0.183471,1743,3138,4881 193 | 192,7/11/2011,3,0,7,0,1,1,1,0.7625,0.729804,0.635833,0.282337,723,3363,4086 194 | 193,7/12/2011,3,0,7,0,2,1,1,0.794167,0.739275,0.559167,0.200254,662,3596,4258 195 | 194,7/13/2011,3,0,7,0,3,1,1,0.746667,0.689404,0.631667,0.146133,748,3594,4342 196 | 195,7/14/2011,3,0,7,0,4,1,1,0.680833,0.635104,0.47625,0.240667,888,4196,5084 197 | 196,7/15/2011,3,0,7,0,5,1,1,0.663333,0.624371,0.59125,0.182833,1318,4220,5538 198 | 197,7/16/2011,3,0,7,0,6,0,1,0.686667,0.638263,0.585,0.208342,2418,3505,5923 199 | 198,7/17/2011,3,0,7,0,0,0,1,0.719167,0.669833,0.604167,0.245033,2006,3296,5302 200 | 199,7/18/2011,3,0,7,0,1,1,1,0.746667,0.703925,0.65125,0.215804,841,3617,4458 201 | 200,7/19/2011,3,0,7,0,2,1,1,0.776667,0.747479,0.650417,0.1306,752,3789,4541 202 | 201,7/20/2011,3,0,7,0,3,1,1,0.768333,0.74685,0.707083,0.113817,644,3688,4332 203 | 202,7/21/2011,3,0,7,0,4,1,2,0.815,0.826371,0.69125,0.222021,632,3152,3784 204 | 203,7/22/2011,3,0,7,0,5,1,1,0.848333,0.840896,0.580417,0.1331,562,2825,3387 205 | 204,7/23/2011,3,0,7,0,6,0,1,0.849167,0.804287,0.5,0.131221,987,2298,3285 206 | 205,7/24/2011,3,0,7,0,0,0,1,0.83,0.794829,0.550833,0.169171,1050,2556,3606 207 | 206,7/25/2011,3,0,7,0,1,1,1,0.743333,0.720958,0.757083,0.0908083,568,3272,3840 208 | 207,7/26/2011,3,0,7,0,2,1,1,0.771667,0.696979,0.540833,0.200258,750,3840,4590 209 | 208,7/27/2011,3,0,7,0,3,1,1,0.775,0.690667,0.402917,0.183463,755,3901,4656 210 | 209,7/28/2011,3,0,7,0,4,1,1,0.779167,0.7399,0.583333,0.178479,606,3784,4390 211 | 210,7/29/2011,3,0,7,0,5,1,1,0.838333,0.785967,0.5425,0.174138,670,3176,3846 212 | 211,7/30/2011,3,0,7,0,6,0,1,0.804167,0.728537,0.465833,0.168537,1559,2916,4475 213 | 212,7/31/2011,3,0,7,0,0,0,1,0.805833,0.729796,0.480833,0.164813,1524,2778,4302 214 | 213,8/1/2011,3,0,8,0,1,1,1,0.771667,0.703292,0.550833,0.156717,729,3537,4266 215 | 214,8/2/2011,3,0,8,0,2,1,1,0.783333,0.707071,0.49125,0.20585,801,4044,4845 216 | 215,8/3/2011,3,0,8,0,3,1,2,0.731667,0.679937,0.6575,0.135583,467,3107,3574 217 | 216,8/4/2011,3,0,8,0,4,1,2,0.71,0.664788,0.7575,0.19715,799,3777,4576 218 | 217,8/5/2011,3,0,8,0,5,1,1,0.710833,0.656567,0.630833,0.184696,1023,3843,4866 219 | 218,8/6/2011,3,0,8,0,6,0,2,0.716667,0.676154,0.755,0.22825,1521,2773,4294 220 | 219,8/7/2011,3,0,8,0,0,0,1,0.7425,0.715292,0.752917,0.201487,1298,2487,3785 221 | 220,8/8/2011,3,0,8,0,1,1,1,0.765,0.703283,0.592083,0.192175,846,3480,4326 222 | 221,8/9/2011,3,0,8,0,2,1,1,0.775,0.724121,0.570417,0.151121,907,3695,4602 223 | 222,8/10/2011,3,0,8,0,3,1,1,0.766667,0.684983,0.424167,0.200258,884,3896,4780 224 | 223,8/11/2011,3,0,8,0,4,1,1,0.7175,0.651521,0.42375,0.164796,812,3980,4792 225 | 224,8/12/2011,3,0,8,0,5,1,1,0.708333,0.654042,0.415,0.125621,1051,3854,4905 226 | 225,8/13/2011,3,0,8,0,6,0,2,0.685833,0.645858,0.729583,0.211454,1504,2646,4150 227 | 226,8/14/2011,3,0,8,0,0,0,2,0.676667,0.624388,0.8175,0.222633,1338,2482,3820 228 | 227,8/15/2011,3,0,8,0,1,1,1,0.665833,0.616167,0.712083,0.208954,775,3563,4338 229 | 228,8/16/2011,3,0,8,0,2,1,1,0.700833,0.645837,0.578333,0.236329,721,4004,4725 230 | 229,8/17/2011,3,0,8,0,3,1,1,0.723333,0.666671,0.575417,0.143667,668,4026,4694 231 | 230,8/18/2011,3,0,8,0,4,1,1,0.711667,0.662258,0.654583,0.233208,639,3166,3805 232 | 231,8/19/2011,3,0,8,0,5,1,2,0.685,0.633221,0.722917,0.139308,797,3356,4153 233 | 232,8/20/2011,3,0,8,0,6,0,1,0.6975,0.648996,0.674167,0.104467,1914,3277,5191 234 | 233,8/21/2011,3,0,8,0,0,0,1,0.710833,0.675525,0.77,0.248754,1249,2624,3873 235 | 234,8/22/2011,3,0,8,0,1,1,1,0.691667,0.638254,0.47,0.27675,833,3925,4758 236 | 235,8/23/2011,3,0,8,0,2,1,1,0.640833,0.606067,0.455417,0.146763,1281,4614,5895 237 | 236,8/24/2011,3,0,8,0,3,1,1,0.673333,0.630692,0.605,0.253108,949,4181,5130 238 | 237,8/25/2011,3,0,8,0,4,1,2,0.684167,0.645854,0.771667,0.210833,435,3107,3542 239 | 238,8/26/2011,3,0,8,0,5,1,1,0.7,0.659733,0.76125,0.0839625,768,3893,4661 240 | 239,8/27/2011,3,0,8,0,6,0,2,0.68,0.635556,0.85,0.375617,226,889,1115 241 | 240,8/28/2011,3,0,8,0,0,0,1,0.707059,0.647959,0.561765,0.304659,1415,2919,4334 242 | 241,8/29/2011,3,0,8,0,1,1,1,0.636667,0.607958,0.554583,0.159825,729,3905,4634 243 | 242,8/30/2011,3,0,8,0,2,1,1,0.639167,0.594704,0.548333,0.125008,775,4429,5204 244 | 243,8/31/2011,3,0,8,0,3,1,1,0.656667,0.611121,0.597917,0.0833333,688,4370,5058 245 | 244,9/1/2011,3,0,9,0,4,1,1,0.655,0.614921,0.639167,0.141796,783,4332,5115 246 | 245,9/2/2011,3,0,9,0,5,1,2,0.643333,0.604808,0.727083,0.139929,875,3852,4727 247 | 246,9/3/2011,3,0,9,0,6,0,1,0.669167,0.633213,0.716667,0.185325,1935,2549,4484 248 | 247,9/4/2011,3,0,9,0,0,0,1,0.709167,0.665429,0.742083,0.206467,2521,2419,4940 249 | 248,9/5/2011,3,0,,1,1,0,2,0.673333,0.625646,0.790417,0.212696,1236,2115,3351 250 | 249,9/6/2011,3,0,,0,2,1,3,0.54,0.5152,0.886957,0.343943,204,2506,2710 251 | 250,9/7/2011,3,0,,0,3,1,3,0.599167,0.544229,0.917083,0.0970208,118,1878,1996 252 | 251,9/8/2011,3,0,9,0,4,1,3,0.633913,0.555361,0.939565,0.192748,153,1689,1842 253 | 252,9/9/2011,3,0,9,0,5,1,2,0.65,0.578946,0.897917,0.124379,417,3127,3544 254 | 253,9/10/2011,3,0,9,0,6,0,1,0.66,0.607962,0.75375,0.153608,1750,3595,5345 255 | 254,9/11/2011,3,0,9,0,0,0,1,0.653333,0.609229,0.71375,0.115054,1633,3413,5046 256 | 255,9/12/2011,3,0,9,0,1,1,1,0.644348,0.60213,0.692174,0.088913,690,4023,4713 257 | 256,9/13/2011,3,0,9,0,2,1,1,0.650833,0.603554,0.7125,0.141804,701,4062,4763 258 | 257,9/14/2011,3,0,9,0,3,1,1,0.673333,0.6269,0.697083,0.1673,647,4138,4785 259 | 258,9/15/2011,3,0,9,0,4,1,2,0.5775,0.553671,0.709167,0.271146,428,3231,3659 260 | 259,9/16/2011,3,0,9,0,5,1,2,0.469167,0.461475,0.590417,0.164183,742,4018,4760 261 | 260,9/17/2011,3,0,9,0,6,0,2,0.491667,0.478512,0.718333,0.189675,1434,3077,4511 262 | 261,9/18/2011,3,0,9,0,0,0,1,0.5075,0.490537,0.695,0.178483,1353,2921,4274 263 | 262,9/19/2011,3,0,9,0,1,1,2,0.549167,0.529675,0.69,0.151742,691,3848,4539 264 | 263,9/20/2011,3,0,9,0,2,1,2,0.561667,0.532217,0.88125,0.134954,438,3203,3641 265 | 264,9/21/2011,3,0,9,0,3,1,2,0.595,0.550533,0.9,0.0964042,539,3813,4352 266 | 265,9/22/2011,3,0,9,0,4,1,2,0.628333,0.554963,0.902083,0.128125,555,4240,4795 267 | 266,9/23/2011,4,0,9,0,5,1,2,0.609167,0.522125,0.9725,0.0783667,258,2137,2395 268 | 267,9/24/2011,4,0,9,0,6,0,2,0.606667,0.564412,0.8625,0.0783833,1776,3647,5423 269 | 268,9/25/2011,4,0,9,0,0,0,2,0.634167,0.572637,0.845,0.0503792,1544,3466,5010 270 | 269,9/26/2011,4,0,9,0,1,1,2,0.649167,0.589042,0.848333,0.1107,684,3946,4630 271 | 270,9/27/2011,4,0,9,0,2,1,2,0.636667,0.574525,0.885417,0.118171,477,3643,4120 272 | 271,9/28/2011,4,0,9,0,3,1,2,0.635,0.575158,0.84875,0.148629,480,3427,3907 273 | 272,9/29/2011,4,0,9,0,4,1,1,0.616667,0.574512,0.699167,0.172883,653,4186,4839 274 | 273,9/30/2011,4,0,9,0,5,1,1,0.564167,0.544829,0.6475,0.206475,830,4372,5202 275 | 274,10/1/2011,4,0,10,0,6,0,2,0.41,0.412863,0.75375,0.292296,480,1949,2429 276 | 275,10/2/2011,4,0,10,0,0,0,2,0.356667,0.345317,0.791667,0.222013,616,2302,2918 277 | 276,10/3/2011,4,0,10,0,1,1,2,0.384167,0.392046,0.760833,0.0833458,330,3240,3570 278 | 277,10/4/2011,4,0,10,0,2,1,1,0.484167,0.472858,0.71,0.205854,486,3970,4456 279 | 278,10/5/2011,4,0,10,0,3,1,1,0.538333,0.527138,0.647917,0.17725,559,4267,4826 280 | 279,10/6/2011,4,0,10,0,4,1,1,0.494167,0.480425,0.620833,0.134954,639,4126,4765 281 | 280,10/7/2011,4,0,10,0,5,1,1,0.510833,0.504404,0.684167,0.0223917,949,4036,4985 282 | 281,10/8/2011,4,0,10,0,6,0,1,0.521667,0.513242,0.70125,0.0454042,2235,3174,5409 283 | 282,10/9/2011,4,0,10,0,0,0,1,0.540833,0.523983,0.7275,0.06345,2397,3114,5511 284 | 283,10/10/2011,4,0,10,1,1,0,1,0.570833,0.542925,0.73375,0.0423042,1514,3603,5117 285 | 284,10/11/2011,4,0,10,0,2,1,2,0.566667,0.546096,0.80875,0.143042,667,3896,4563 286 | 285,10/12/2011,4,0,10,0,3,1,3,0.543333,0.517717,0.90625,0.24815,217,2199,2416 287 | 286,10/13/2011,4,0,10,0,4,1,2,0.589167,0.551804,0.896667,0.141787,290,2623,2913 288 | 287,10/14/2011,4,0,10,0,5,1,2,0.550833,0.529675,0.71625,0.223883,529,3115,3644 289 | 288,10/15/2011,4,0,10,0,6,0,1,0.506667,0.498725,0.483333,0.258083,1899,3318,5217 290 | 289,10/16/2011,4,0,10,0,0,0,1,0.511667,0.503154,0.486667,0.281717,1748,3293,5041 291 | 290,10/17/2011,4,0,10,0,1,1,1,0.534167,0.510725,0.579583,0.175379,713,3857,4570 292 | 291,10/18/2011,4,0,10,0,2,1,2,0.5325,0.522721,0.701667,0.110087,637,4111,4748 293 | 292,10/19/2011,4,0,10,0,3,1,3,0.541739,0.513848,0.895217,0.243339,254,2170,2424 294 | 293,10/20/2011,4,0,10,0,4,1,1,0.475833,0.466525,0.63625,0.422275,471,3724,4195 295 | 294,10/21/2011,4,0,10,0,5,1,1,0.4275,0.423596,0.574167,0.221396,676,3628,4304 296 | 295,10/22/2011,4,0,10,0,6,0,1,0.4225,0.425492,0.629167,0.0926667,1499,2809,4308 297 | 296,10/23/2011,4,0,10,0,0,0,1,0.421667,0.422333,0.74125,0.0995125,1619,2762,4381 298 | 297,10/24/2011,4,0,10,0,1,1,1,0.463333,0.457067,0.772083,0.118792,699,3488,4187 299 | 298,10/25/2011,4,0,10,0,2,1,1,0.471667,0.463375,0.622917,0.166658,695,3992,4687 300 | 299,10/26/2011,4,0,10,0,3,1,2,0.484167,0.472846,0.720417,0.148642,404,3490,3894 301 | 300,10/27/2011,4,0,10,0,4,1,2,0.47,0.457046,0.812917,0.197763,240,2419,2659 302 | 301,10/28/2011,4,0,10,0,5,1,2,0.330833,0.318812,0.585833,0.229479,456,3291,3747 303 | 302,10/29/2011,4,0,10,0,6,0,3,0.254167,0.227913,0.8825,0.351371,57,570,627 304 | 303,10/30/2011,4,0,10,0,0,0,1,0.319167,0.321329,0.62375,0.176617,885,2446,3331 305 | 304,10/31/2011,4,0,10,0,1,1,1,0.34,0.356063,0.703333,0.10635,362,3307,3669 306 | 305,11/1/2011,4,0,11,0,2,1,1,0.400833,0.397088,0.68375,0.135571,410,3658,4068 307 | 306,11/2/2011,4,0,11,0,3,1,1,0.3775,0.390133,0.71875,0.0820917,370,3816,4186 308 | 307,11/3/2011,4,0,11,0,4,1,1,0.408333,0.405921,0.702083,0.136817,318,3656,3974 309 | 308,11/4/2011,4,0,11,0,5,1,2,0.403333,0.403392,0.6225,0.271779,470,3576,4046 310 | 309,11/5/2011,4,0,11,0,6,0,1,0.326667,0.323854,0.519167,0.189062,1156,2770,3926 311 | 310,11/6/2011,4,0,11,0,0,0,1,0.348333,0.362358,0.734583,0.0920542,952,2697,3649 312 | 311,11/7/2011,4,0,11,0,1,1,1,0.395,0.400871,0.75875,0.057225,373,3662,4035 313 | 312,11/8/2011,4,0,11,0,2,1,1,0.408333,0.412246,0.721667,0.0690375,376,3829,4205 314 | 313,11/9/2011,4,0,11,0,3,1,1,0.4,0.409079,0.758333,0.0621958,305,3804,4109 315 | 314,11/10/2011,4,0,11,0,4,1,2,0.38,0.373721,0.813333,0.189067,190,2743,2933 316 | 315,11/11/2011,4,0,11,1,5,0,1,0.324167,0.306817,0.44625,0.314675,440,2928,3368 317 | 316,11/12/2011,4,0,11,0,6,0,1,0.356667,0.357942,0.552917,0.212062,1275,2792,4067 318 | 317,11/13/2011,4,0,11,0,0,0,1,0.440833,0.43055,0.458333,0.281721,1004,2713,3717 319 | 318,11/14/2011,4,0,11,0,1,1,1,0.53,0.524612,0.587083,0.306596,595,3891,4486 320 | 319,11/15/2011,4,0,11,0,2,1,2,0.53,0.507579,0.68875,0.199633,449,3746,4195 321 | 320,11/16/2011,4,0,11,0,3,1,3,0.456667,0.451988,0.93,0.136829,145,1672,1817 322 | 321,11/17/2011,4,0,11,0,4,1,2,0.341667,0.323221,0.575833,0.305362,139,2914,3053 323 | 322,11/18/2011,4,0,11,0,5,1,1,0.274167,0.272721,0.41,0.168533,245,3147,3392 324 | 323,11/19/2011,4,0,11,0,6,0,1,0.329167,0.324483,0.502083,0.224496,943,2720,3663 325 | 324,11/20/2011,4,0,11,0,0,0,2,0.463333,0.457058,0.684583,0.18595,787,2733,3520 326 | 325,11/21/2011,4,0,11,0,1,1,3,0.4475,0.445062,0.91,0.138054,220,2545,2765 327 | 326,11/22/2011,4,0,11,0,2,1,3,0.416667,0.421696,0.9625,0.118792,69,1538,1607 328 | 327,11/23/2011,4,0,11,0,3,1,2,0.440833,0.430537,0.757917,0.335825,112,2454,2566 329 | 328,11/24/2011,4,0,11,1,4,0,1,0.373333,0.372471,0.549167,0.167304,560,935,1495 330 | 329,11/25/2011,4,0,11,0,5,1,1,0.375,0.380671,0.64375,0.0988958,1095,1697,2792 331 | 330,11/26/2011,4,0,11,0,6,0,1,0.375833,0.385087,0.681667,0.0684208,1249,1819,3068 332 | 331,11/27/2011,4,0,11,0,0,0,1,0.459167,0.4558,0.698333,0.208954,810,2261,3071 333 | 332,11/28/2011,4,0,11,0,1,1,1,0.503478,0.490122,0.743043,0.142122,253,3614,3867 334 | 333,11/29/2011,4,0,11,0,2,1,2,0.458333,0.451375,0.830833,0.258092,96,2818,2914 335 | 334,11/30/2011,4,0,11,0,3,1,1,0.325,0.311221,0.613333,0.271158,188,3425,3613 336 | 335,12/1/2011,4,0,12,0,4,1,1,0.3125,0.305554,0.524583,0.220158,182,3545,3727 337 | 336,12/2/2011,4,0,12,0,5,1,1,0.314167,0.331433,0.625833,0.100754,268,3672,3940 338 | 337,12/3/2011,4,0,12,0,6,0,1,0.299167,0.310604,0.612917,0.0957833,706,2908,3614 339 | 338,12/4/2011,4,0,12,0,0,0,1,0.330833,0.3491,0.775833,0.0839583,634,2851,3485 340 | 339,12/5/2011,4,0,12,0,1,1,2,0.385833,0.393925,0.827083,0.0622083,233,3578,3811 341 | 340,12/6/2011,4,0,12,0,2,1,3,0.4625,0.4564,0.949583,0.232583,126,2468,2594 342 | 341,12/7/2011,4,0,12,0,3,1,3,0.41,0.400246,0.970417,0.266175,50,655,705 343 | 342,12/8/2011,4,0,12,0,4,1,1,0.265833,0.256938,0.58,0.240058,150,3172,3322 344 | 343,12/9/2011,4,0,12,0,5,1,1,0.290833,0.317542,0.695833,0.0827167,261,3359,3620 345 | 344,12/10/2011,4,0,12,0,6,0,1,0.275,0.266412,0.5075,0.233221,502,2688,3190 346 | 345,12/11/2011,4,0,12,0,0,0,1,0.220833,0.253154,0.49,0.0665417,377,2366,2743 347 | 346,12/12/2011,4,0,12,0,1,1,1,0.238333,0.270196,0.670833,0.06345,143,3167,3310 348 | 347,12/13/2011,4,0,12,0,2,1,1,0.2825,0.301138,,0.14055,155,3368,3523 349 | 348,12/14/2011,4,0,12,0,3,1,2,0.3175,0.338362,,0.0609583,178,3562,3740 350 | 349,12/15/2011,4,0,12,0,4,1,2,0.4225,0.412237,,0.268042,181,3528,3709 351 | 350,12/16/2011,4,0,12,0,5,1,2,0.375,0.359825,0.500417,0.260575,178,3399,3577 352 | 351,12/17/2011,4,0,12,0,6,0,2,0.258333,0.249371,0.560833,0.243167,275,2464,2739 353 | 352,12/18/2011,4,0,12,0,0,0,1,0.238333,0.245579,0.58625,0.169779,220,2211,2431 354 | 353,12/19/2011,4,0,12,0,1,1,1,0.276667,0.280933,0.6375,0.172896,260,3143,3403 355 | 354,12/20/2011,4,0,12,0,2,1,2,0.385833,0.396454,0.595417,0.0615708,216,3534,3750 356 | 355,12/21/2011,1,0,12,0,3,1,2,0.428333,0.428017,0.858333,0.2214,107,2553,2660 357 | 356,12/22/2011,1,0,12,0,4,1,2,0.423333,0.426121,0.7575,0.047275,227,2841,3068 358 | 357,12/23/2011,1,0,12,0,5,1,1,0.373333,0.377513,0.68625,0.274246,163,2046,2209 359 | 358,12/24/2011,1,0,12,0,6,0,1,0.3025,0.299242,0.5425,0.190304,155,856,1011 360 | 359,12/25/2011,1,0,12,0,0,0,1,0.274783,0.279961,0.681304,0.155091,303,451,754 361 | 360,12/26/2011,1,0,12,1,1,0,1,0.321739,0.315535,0.506957,0.239465,430,887,1317 362 | 361,12/27/2011,1,0,12,0,2,1,2,0.325,0.327633,0.7625,0.18845,103,1059,1162 363 | 362,12/28/2011,1,0,12,0,3,1,1,0.29913,0.279974,0.503913,0.293961,255,2047,2302 364 | 363,12/29/2011,1,0,12,0,4,1,1,0.248333,0.263892,0.574167,0.119412,254,2169,2423 365 | 364,12/30/2011,1,0,12,0,5,1,1,0.311667,0.318812,0.636667,0.134337,491,2508,2999 366 | 365,12/31/2011,1,0,12,0,6,0,1,0.41,0.414121,0.615833,0.220154,665,1820,2485 367 | 366,1/1/2012,1,1,1,0,0,0,1,0.37,0.375621,0.6925,0.192167,686,1608,2294 368 | 367,1/2/2012,1,1,1,1,1,0,1,0.273043,0.252304,0.381304,0.329665,244,1707,1951 369 | 368,1/3/2012,1,1,1,0,2,1,1,0.15,0.126275,0.44125,0.365671,89,2147,2236 370 | 369,1/4/2012,1,1,1,0,3,1,2,0.1075,0.119337,0.414583,0.1847,95,2273,2368 371 | 370,1/5/2012,1,1,1,0,4,1,1,0.265833,0.278412,0.524167,0.129987,140,3132,3272 372 | 371,1/6/2012,1,1,1,0,5,1,1,0.334167,0.340267,0.542083,0.167908,307,3791,4098 373 | 372,1/7/2012,1,1,1,0,6,0,1,0.393333,0.390779,0.531667,0.174758,1070,3451,4521 374 | 373,1/8/2012,1,1,1,0,0,0,1,0.3375,0.340258,0.465,0.191542,599,2826,3425 375 | 374,1/9/2012,1,1,1,0,1,1,2,0.224167,0.247479,0.701667,0.0989,106,2270,2376 376 | 375,1/10/2012,1,1,1,0,2,1,1,0.308696,0.318826,0.646522,0.187552,173,3425,3598 377 | 376,1/11/2012,1,1,1,0,3,1,2,0.274167,0.282821,0.8475,0.131221,92,2085,2177 378 | 377,1/12/2012,1,1,1,0,4,1,2,0.3825,0.381938,0.802917,0.180967,269,3828,4097 379 | 378,1/13/2012,1,1,1,0,5,1,1,0.274167,0.249362,0.5075,0.378108,174,3040,3214 380 | 379,1/14/2012,1,1,1,0,6,0,1,0.18,0.183087,0.4575,0.187183,333,2160,2493 381 | 380,1/15/2012,1,1,1,0,0,0,1,0.166667,0.161625,0.419167,0.251258,284,2027,2311 382 | 381,1/16/2012,1,1,1,1,1,0,1,0.19,0.190663,0.5225,0.231358,217,2081,2298 383 | 382,1/17/2012,1,1,1,0,2,1,2,0.373043,0.364278,0.716087,0.34913,127,2808,2935 384 | 383,1/18/2012,1,1,1,0,3,1,1,0.303333,0.275254,0.443333,0.415429,109,3267,3376 385 | 384,1/19/2012,1,1,1,0,4,1,1,0.19,0.190038,0.4975,0.220158,130,3162,3292 386 | 385,1/20/2012,1,1,1,0,5,1,2,0.2175,0.220958,0.45,0.20275,115,3048,3163 387 | 386,1/21/2012,1,1,1,0,6,0,2,0.173333,0.174875,0.83125,0.222642,67,1234,1301 388 | 387,1/22/2012,1,1,1,0,0,0,2,0.1625,0.16225,0.79625,0.199638,196,1781,1977 389 | 388,1/23/2012,1,1,1,0,1,1,2,0.218333,0.243058,0.91125,0.110708,145,2287,2432 390 | 389,1/24/2012,1,1,1,0,2,1,1,0.3425,0.349108,0.835833,0.123767,439,3900,4339 391 | 390,1/25/2012,1,1,1,0,3,1,1,0.294167,0.294821,0.64375,0.161071,467,3803,4270 392 | 391,1/26/2012,1,1,1,0,4,1,2,0.341667,0.35605,0.769583,0.0733958,244,3831,4075 393 | 392,1/27/2012,1,1,1,0,5,1,2,0.425,0.415383,0.74125,0.342667,269,3187,3456 394 | 393,1/28/2012,1,1,1,0,6,0,1,0.315833,0.326379,0.543333,0.210829,775,3248,4023 395 | 394,1/29/2012,1,1,1,0,0,0,1,0.2825,0.272721,0.31125,0.24005,558,2685,3243 396 | 395,1/30/2012,1,1,1,0,1,1,1,0.269167,0.262625,0.400833,0.215792,126,3498,3624 397 | 396,1/31/2012,1,1,1,0,2,1,1,0.39,0.381317,0.416667,0.261817,324,4185,4509 398 | 397,2/1/2012,1,1,2,0,3,1,1,0.469167,0.466538,0.507917,0.189067,304,4275,4579 399 | 398,2/2/2012,1,1,2,0,4,1,2,0.399167,0.398971,0.672917,0.187187,190,3571,3761 400 | 399,2/3/2012,1,1,2,0,5,1,1,0.313333,0.309346,0.526667,0.178496,310,3841,4151 401 | 400,2/4/2012,1,1,2,0,6,0,2,0.264167,0.272725,0.779583,0.121896,384,2448,2832 402 | 401,2/5/2012,1,1,2,0,0,0,2,0.265833,0.264521,0.687917,0.175996,318,2629,2947 403 | 402,2/6/2012,1,1,2,0,1,1,1,0.282609,0.296426,0.622174,0.1538,206,3578,3784 404 | 403,2/7/2012,1,1,2,0,2,1,1,0.354167,0.361104,0.49625,0.147379,199,4176,4375 405 | 404,2/8/2012,1,1,2,0,3,1,2,0.256667,0.266421,0.722917,0.133721,109,2693,2802 406 | 405,2/9/2012,1,1,2,0,4,1,1,0.265,0.261988,0.562083,0.194037,163,3667,3830 407 | 406,2/10/2012,1,1,2,0,5,1,2,0.280833,0.293558,0.54,0.116929,227,3604,3831 408 | 407,2/11/2012,1,1,2,0,6,0,3,0.224167,0.210867,0.73125,0.289796,192,1977,2169 409 | 408,2/12/2012,1,1,2,0,0,0,1,0.1275,0.101658,0.464583,0.409212,73,1456,1529 410 | 409,2/13/2012,1,1,2,0,1,1,1,0.2225,0.227913,0.41125,0.167283,94,3328,3422 411 | 410,2/14/2012,1,1,2,0,2,1,2,0.319167,0.333946,0.50875,0.141179,135,3787,3922 412 | 411,2/15/2012,1,1,2,0,3,1,1,0.348333,0.351629,0.53125,0.1816,141,4028,4169 413 | 412,2/16/2012,1,1,2,0,4,1,2,0.316667,0.330162,0.752917,0.091425,74,2931,3005 414 | 413,2/17/2012,1,1,2,0,5,1,1,0.343333,0.351629,0.634583,0.205846,349,3805,4154 415 | 414,2/18/2012,1,1,2,0,6,0,1,0.346667,0.355425,0.534583,0.190929,1435,2883,4318 416 | 415,2/19/2012,1,1,2,0,0,0,2,0.28,0.265788,0.515833,0.253112,618,2071,2689 417 | 416,2/20/2012,1,1,2,1,1,0,1,0.28,0.273391,0.507826,0.229083,502,2627,3129 418 | 417,2/21/2012,1,1,2,0,2,1,1,0.287826,0.295113,0.594348,0.205717,163,3614,3777 419 | 418,2/22/2012,1,1,2,0,3,1,1,0.395833,0.392667,0.567917,0.234471,394,4379,4773 420 | 419,2/23/2012,1,1,2,0,4,1,1,0.454167,0.444446,0.554583,0.190913,516,4546,5062 421 | 420,2/24/2012,1,1,2,0,5,1,2,0.4075,0.410971,0.7375,0.237567,246,3241,3487 422 | 421,2/25/2012,1,1,2,0,6,0,1,0.290833,0.255675,0.395833,0.421642,317,2415,2732 423 | 422,2/26/2012,1,1,2,0,0,0,1,0.279167,0.268308,0.41,0.205229,515,2874,3389 424 | 423,2/27/2012,1,1,2,0,1,1,1,0.366667,0.357954,0.490833,0.268033,253,4069,4322 425 | 424,2/28/2012,1,1,2,0,2,1,1,0.359167,0.353525,0.395833,0.193417,229,4134,4363 426 | 425,2/29/2012,1,1,2,0,3,1,2,0.344348,0.34847,0.804783,0.179117,65,1769,1834 427 | 426,3/1/2012,1,1,3,0,4,1,1,0.485833,0.475371,0.615417,0.226987,325,4665,4990 428 | 427,3/2/2012,1,1,3,0,5,1,2,0.353333,0.359842,0.657083,0.144904,246,2948,3194 429 | 428,3/3/2012,1,1,3,0,6,0,2,0.414167,0.413492,0.62125,0.161079,956,3110,4066 430 | 429,3/4/2012,1,1,3,0,0,0,1,0.325833,0.303021,0.403333,0.334571,710,2713,3423 431 | 430,3/5/2012,1,1,3,0,1,1,1,0.243333,0.241171,0.50625,0.228858,203,3130,3333 432 | 431,3/6/2012,1,1,3,0,2,1,1,0.258333,0.255042,0.456667,0.200875,221,3735,3956 433 | 432,3/7/2012,1,1,3,0,3,1,1,0.404167,0.3851,0.513333,0.345779,432,4484,4916 434 | 433,3/8/2012,1,1,3,0,4,1,1,0.5275,0.524604,0.5675,0.441563,486,4896,5382 435 | 434,3/9/2012,1,1,3,0,5,1,2,0.410833,0.397083,0.407083,0.4148,447,4122,4569 436 | 435,3/10/2012,1,1,3,0,6,0,1,0.2875,0.277767,0.350417,0.22575,968,3150,4118 437 | 436,3/11/2012,1,1,3,0,0,0,1,0.361739,0.35967,0.476957,0.222587,1658,3253,4911 438 | 437,3/12/2012,1,1,3,0,1,1,1,0.466667,0.459592,0.489167,0.207713,838,4460,5298 439 | 438,3/13/2012,1,1,3,0,2,1,1,0.565,0.542929,0.6175,0.23695,762,5085,5847 440 | 439,3/14/2012,1,1,3,0,3,1,1,0.5725,0.548617,0.507083,0.115062,997,5315,6312 441 | 440,3/15/2012,1,1,3,0,4,1,1,0.5575,0.532825,0.579583,0.149883,1005,5187,6192 442 | 441,3/16/2012,1,1,3,0,5,1,2,0.435833,0.436229,0.842083,0.113192,548,3830,4378 443 | 442,3/17/2012,1,1,3,0,6,0,2,0.514167,0.505046,0.755833,0.110704,3155,4681,7836 444 | 443,3/18/2012,1,1,3,0,0,0,2,0.4725,0.464,0.81,0.126883,2207,3685,5892 445 | 444,3/19/2012,1,1,3,0,1,1,1,0.545,0.532821,0.72875,0.162317,982,5171,6153 446 | 445,3/20/2012,1,1,3,0,2,1,1,0.560833,0.538533,0.807917,0.121271,1051,5042,6093 447 | 446,3/21/2012,2,1,3,0,3,1,2,0.531667,0.513258,0.82125,0.0895583,1122,5108,6230 448 | 447,3/22/2012,2,1,3,0,4,1,1,0.554167,0.531567,0.83125,0.117562,1334,5537,6871 449 | 448,3/23/2012,2,1,3,0,5,1,2,0.601667,0.570067,0.694167,0.1163,2469,5893,8362 450 | 449,3/24/2012,2,1,3,0,6,0,2,0.5025,0.486733,0.885417,0.192783,1033,2339,3372 451 | 450,3/25/2012,2,1,3,0,0,0,2,0.4375,0.437488,0.880833,0.220775,1532,3464,4996 452 | 451,3/26/2012,2,1,3,0,1,1,1,0.445833,0.43875,0.477917,0.386821,795,4763,5558 453 | 452,3/27/2012,2,1,3,0,2,1,1,0.323333,0.315654,0.29,0.187192,531,4571,5102 454 | 453,3/28/2012,2,1,3,0,3,1,1,0.484167,0.47095,0.48125,0.291671,674,5024,5698 455 | 454,3/29/2012,2,1,3,0,4,1,1,0.494167,0.482304,0.439167,0.31965,834,5299,6133 456 | 455,3/30/2012,2,1,3,0,5,1,2,0.37,0.375621,0.580833,0.138067,796,4663,5459 457 | 456,3/31/2012,2,1,3,0,6,0,2,0.424167,0.421708,0.738333,0.250617,2301,3934,6235 458 | 457,4/1/2012,2,1,4,0,0,0,2,0.425833,0.417287,0.67625,0.172267,2347,3694,6041 459 | 458,4/2/2012,2,1,4,0,1,1,1,0.433913,0.427513,0.504348,0.312139,1208,4728,5936 460 | 459,4/3/2012,2,1,4,0,2,1,1,0.466667,0.461483,0.396667,0.100133,1348,5424,6772 461 | 460,4/4/2012,2,1,4,0,3,1,1,0.541667,0.53345,0.469583,0.180975,1058,5378,6436 462 | 461,4/5/2012,2,1,4,0,4,1,1,0.435,0.431163,0.374167,0.219529,1192,5265,6457 463 | 462,4/6/2012,2,1,4,0,5,1,1,0.403333,0.390767,0.377083,0.300388,1807,4653,6460 464 | 463,4/7/2012,2,1,4,0,6,0,1,0.4375,0.426129,0.254167,0.274871,3252,3605,6857 465 | 464,4/8/2012,2,1,4,0,0,0,1,0.5,0.492425,0.275833,0.232596,2230,2939,5169 466 | 465,4/9/2012,2,1,4,0,1,1,1,0.489167,0.476638,0.3175,0.358196,905,4680,5585 467 | 466,4/10/2012,2,1,4,0,2,1,1,0.446667,0.436233,0.435,0.249375,819,5099,5918 468 | 467,4/11/2012,2,1,4,0,3,1,1,0.348696,0.337274,0.469565,0.295274,482,4380,4862 469 | 468,4/12/2012,2,1,4,0,4,1,1,0.3975,0.387604,0.46625,0.290429,663,4746,5409 470 | 469,4/13/2012,2,1,4,0,5,1,1,0.4425,0.431808,0.408333,0.155471,1252,5146,6398 471 | 470,4/14/2012,2,1,4,0,6,0,1,0.495,0.487996,0.502917,0.190917,2795,4665,7460 472 | 471,4/15/2012,2,1,4,0,0,0,1,0.606667,0.573875,0.507917,0.225129,2846,4286,7132 473 | 472,4/16/2012,2,1,4,1,1,0,1,0.664167,0.614925,0.561667,0.284829,1198,5172,6370 474 | 473,4/17/2012,2,1,4,0,2,1,1,0.608333,0.598487,0.390417,0.273629,989,5702,6691 475 | 474,4/18/2012,2,1,4,0,3,1,2,0.463333,0.457038,0.569167,0.167912,347,4020,4367 476 | 475,4/19/2012,2,1,4,0,4,1,1,0.498333,0.493046,0.6125,0.0659292,846,5719,6565 477 | 476,4/20/2012,2,1,4,0,5,1,1,0.526667,0.515775,0.694583,0.149871,1340,5950,7290 478 | 477,4/21/2012,2,1,4,0,6,0,1,0.57,0.542921,0.682917,0.283587,2541,4083,6624 479 | 478,4/22/2012,2,1,4,0,0,0,3,0.396667,0.389504,0.835417,0.344546,120,907,1027 480 | 479,4/23/2012,2,1,4,0,1,1,2,0.321667,0.301125,0.766667,0.303496,195,3019,3214 481 | 480,4/24/2012,2,1,4,0,2,1,1,0.413333,0.405283,0.454167,0.249383,518,5115,5633 482 | 481,4/25/2012,2,1,4,0,3,1,1,0.476667,0.470317,0.427917,0.118792,655,5541,6196 483 | 482,4/26/2012,2,1,4,0,4,1,2,0.498333,0.483583,0.756667,0.176625,475,4551,5026 484 | 483,4/27/2012,2,1,4,0,5,1,1,0.4575,0.452637,0.400833,0.347633,1014,5219,6233 485 | 484,4/28/2012,2,1,4,0,6,0,2,0.376667,0.377504,0.489583,0.129975,1120,3100,4220 486 | 485,4/29/2012,2,1,4,0,0,0,1,0.458333,0.450121,0.587083,0.116908,2229,4075,6304 487 | 486,4/30/2012,2,1,4,0,1,1,2,0.464167,0.457696,0.57,0.171638,665,4907,5572 488 | 487,5/1/2012,2,1,5,0,2,1,2,0.613333,0.577021,0.659583,0.156096,653,5087,5740 489 | 488,5/2/2012,2,1,5,0,3,1,1,0.564167,0.537896,0.797083,0.138058,667,5502,6169 490 | 489,5/3/2012,2,1,5,0,4,1,2,0.56,0.537242,0.768333,0.133696,764,5657,6421 491 | 490,5/4/2012,2,1,5,0,5,1,1,0.6275,0.590917,0.735417,0.162938,1069,5227,6296 492 | 491,5/5/2012,2,1,5,0,6,0,2,0.621667,0.584608,0.756667,0.152992,2496,4387,6883 493 | 492,5/6/2012,2,1,5,0,0,0,2,0.5625,0.546737,0.74,0.149879,2135,4224,6359 494 | 493,5/7/2012,2,1,5,0,1,1,2,0.5375,0.527142,0.664167,0.230721,1008,5265,6273 495 | 494,5/8/2012,2,1,5,0,2,1,2,0.581667,0.557471,0.685833,0.296029,738,4990,5728 496 | 495,5/9/2012,2,1,5,0,3,1,2,0.575,0.553025,0.744167,0.216412,620,4097,4717 497 | 496,5/10/2012,2,1,5,0,4,1,1,0.505833,0.491783,0.552083,0.314063,1026,5546,6572 498 | 497,5/11/2012,2,1,5,0,5,1,1,0.533333,0.520833,0.360417,0.236937,1319,5711,7030 499 | 498,5/12/2012,2,1,5,0,6,0,1,0.564167,0.544817,0.480417,0.123133,2622,4807,7429 500 | 499,5/13/2012,2,1,5,0,0,0,1,0.6125,0.585238,0.57625,0.225117,2172,3946,6118 501 | 500,5/14/2012,2,1,5,0,1,1,2,0.573333,0.5499,0.789583,0.212692,342,2501,2843 502 | 501,5/15/2012,2,1,5,0,2,1,2,0.611667,0.576404,0.794583,0.147392,625,4490,5115 503 | 502,5/16/2012,2,1,5,0,3,1,1,0.636667,0.595975,0.697917,0.122512,991,6433,7424 504 | 503,5/17/2012,2,1,5,0,4,1,1,0.593333,0.572613,0.52,0.229475,1242,6142,7384 505 | 504,5/18/2012,2,1,5,0,5,1,1,0.564167,0.551121,0.523333,0.136817,1521,6118,7639 506 | 505,5/19/2012,2,1,5,0,6,0,1,0.6,0.566908,0.45625,0.083975,3410,4884,8294 507 | 506,5/20/2012,2,1,5,0,0,0,1,0.620833,0.583967,0.530417,0.254367,2704,4425,7129 508 | 507,5/21/2012,2,1,5,0,1,1,2,0.598333,0.565667,0.81125,0.233204,630,3729,4359 509 | 508,5/22/2012,2,1,5,0,2,1,2,0.615,0.580825,0.765833,0.118167,819,5254,6073 510 | 509,5/23/2012,2,1,5,0,3,1,2,0.621667,0.584612,0.774583,0.102,766,4494,5260 511 | 510,5/24/2012,2,1,5,0,4,1,1,0.655,0.6067,0.716667,0.172896,1059,5711,6770 512 | 511,5/25/2012,2,1,5,0,5,1,1,0.68,0.627529,0.747083,0.14055,1417,5317,6734 513 | 512,5/26/2012,2,1,5,0,6,0,1,0.6925,0.642696,0.7325,0.198992,2855,3681,6536 514 | 513,5/27/2012,2,1,5,0,0,0,1,0.69,0.641425,0.697083,0.215171,3283,3308,6591 515 | 514,5/28/2012,2,1,5,1,1,0,1,0.7125,0.6793,0.67625,0.196521,2557,3486,6043 516 | 515,5/29/2012,2,1,5,0,2,1,1,0.7225,0.672992,0.684583,0.2954,880,4863,5743 517 | 516,5/30/2012,2,1,5,0,3,1,2,0.656667,0.611129,0.67,0.134329,745,6110,6855 518 | 517,5/31/2012,2,1,5,0,4,1,1,0.68,0.631329,0.492917,0.195279,1100,6238,7338 519 | 518,6/1/2012,2,1,6,0,5,1,2,0.654167,0.607962,0.755417,0.237563,533,3594,4127 520 | 519,6/2/2012,2,1,6,0,6,0,1,0.583333,0.566288,0.549167,0.186562,2795,5325,8120 521 | 520,6/3/2012,2,1,6,0,0,0,1,0.6025,0.575133,0.493333,0.184087,2494,5147,7641 522 | 521,6/4/2012,2,1,6,0,1,1,1,0.5975,0.578283,0.487083,0.284833,1071,5927,6998 523 | 522,6/5/2012,2,1,6,0,2,1,2,0.540833,0.525892,0.613333,0.209575,968,6033,7001 524 | 523,6/6/2012,2,1,6,0,3,1,1,0.554167,0.542292,0.61125,0.077125,1027,6028,7055 525 | 524,6/7/2012,2,1,6,0,4,1,1,0.6025,0.569442,0.567083,0.15735,1038,6456,7494 526 | 525,6/8/2012,2,1,6,0,5,1,1,0.649167,0.597862,0.467917,0.175383,1488,6248,7736 527 | 526,6/9/2012,2,1,6,0,6,0,1,0.710833,0.648367,0.437083,0.144287,2708,4790,7498 528 | 527,6/10/2012,2,1,6,0,0,0,1,0.726667,0.663517,0.538333,0.133721,2224,4374,6598 529 | 528,6/11/2012,2,1,6,0,1,1,2,0.720833,0.659721,0.587917,0.207713,1017,5647,6664 530 | 529,6/12/2012,2,1,6,0,2,1,2,0.653333,0.597875,0.833333,0.214546,477,4495,4972 531 | 530,6/13/2012,2,1,6,0,3,1,1,0.655833,0.611117,0.582083,0.343279,1173,6248,7421 532 | 531,6/14/2012,2,1,6,0,4,1,1,0.648333,0.624383,0.569583,0.253733,1180,6183,7363 533 | 532,6/15/2012,2,1,6,0,5,1,1,0.639167,0.599754,0.589583,0.176617,1563,6102,7665 534 | 533,6/16/2012,2,1,6,0,6,0,1,0.631667,0.594708,0.504167,0.166667,2963,4739,7702 535 | 534,6/17/2012,2,1,6,0,0,0,1,0.5925,0.571975,0.59875,0.144904,2634,4344,6978 536 | 535,6/18/2012,2,1,6,0,1,1,2,0.568333,0.544842,0.777917,0.174746,653,4446,5099 537 | 536,6/19/2012,2,1,6,0,2,1,1,0.688333,0.654692,0.69,0.148017,968,5857,6825 538 | 537,6/20/2012,2,1,6,0,3,1,1,0.7825,0.720975,0.592083,0.113812,872,5339,6211 539 | 538,6/21/2012,3,1,6,0,4,1,1,0.805833,0.752542,0.567917,0.118787,778,5127,5905 540 | 539,6/22/2012,3,1,6,0,5,1,1,0.7775,0.724121,0.57375,0.182842,964,4859,5823 541 | 540,6/23/2012,3,1,6,0,6,0,1,0.731667,0.652792,0.534583,0.179721,2657,4801,7458 542 | 541,6/24/2012,3,1,6,0,0,0,1,0.743333,0.674254,0.479167,0.145525,2551,4340,6891 543 | 542,6/25/2012,3,1,6,0,1,1,1,0.715833,0.654042,0.504167,0.300383,1139,5640,6779 544 | 543,6/26/2012,3,1,6,0,2,1,1,0.630833,0.594704,0.373333,0.347642,1077,6365,7442 545 | 544,6/27/2012,3,1,6,0,3,1,1,0.6975,0.640792,0.36,0.271775,1077,6258,7335 546 | 545,6/28/2012,3,1,6,0,4,1,1,0.749167,0.675512,0.4225,0.17165,921,5958,6879 547 | 546,6/29/2012,3,1,6,0,5,1,1,0.834167,0.786613,0.48875,0.165417,829,4634,5463 548 | 547,6/30/2012,3,1,6,0,6,0,1,0.765,0.687508,0.60125,0.161071,1455,4232,5687 549 | 548,7/1/2012,3,1,7,0,0,0,1,0.815833,0.750629,0.51875,0.168529,1421,4110,5531 550 | 549,7/2/2012,3,1,7,0,1,1,1,0.781667,0.702038,0.447083,0.195267,904,5323,6227 551 | 550,7/3/2012,3,1,7,0,2,1,1,0.780833,0.70265,0.492083,0.126237,1052,5608,6660 552 | 551,7/4/2012,3,1,7,1,3,0,1,0.789167,0.732337,0.53875,0.13495,2562,4841,7403 553 | 552,7/5/2012,3,1,7,0,4,1,1,0.8275,0.761367,0.457917,0.194029,1405,4836,6241 554 | 553,7/6/2012,3,1,7,0,5,1,1,0.828333,0.752533,0.450833,0.146142,1366,4841,6207 555 | 554,7/7/2012,3,1,7,0,6,0,1,0.861667,0.804913,0.492083,0.163554,1448,3392,4840 556 | 555,7/8/2012,3,1,7,0,0,0,1,0.8225,0.790396,0.57375,0.125629,1203,3469,4672 557 | 556,7/9/2012,3,1,7,0,1,1,2,0.710833,0.654054,0.683333,0.180975,998,5571,6569 558 | 557,7/10/2012,3,1,7,0,2,1,2,0.720833,0.664796,0.6675,0.151737,954,5336,6290 559 | 558,7/11/2012,3,1,7,0,3,1,1,0.716667,0.650271,0.633333,0.151733,975,6289,7264 560 | 559,7/12/2012,3,1,7,0,4,1,1,0.715833,0.654683,0.529583,0.146775,1032,6414,7446 561 | 560,7/13/2012,3,1,7,0,5,1,2,0.731667,0.667933,0.485833,0.08085,1511,5988,7499 562 | 561,7/14/2012,3,1,7,0,6,0,2,0.703333,0.666042,0.699167,0.143679,2355,4614,6969 563 | 562,7/15/2012,3,1,7,0,0,0,1,0.745833,0.705196,0.717917,0.166667,1920,4111,6031 564 | 563,7/16/2012,3,1,7,0,1,1,1,0.763333,0.724125,0.645,0.164187,1088,5742,6830 565 | 564,7/17/2012,3,1,7,0,2,1,1,0.818333,0.755683,0.505833,0.114429,921,5865,6786 566 | 565,7/18/2012,3,1,7,0,3,1,1,0.793333,0.745583,0.577083,0.137442,799,4914,5713 567 | 566,7/19/2012,3,1,7,0,4,1,1,0.77,0.714642,0.600417,0.165429,888,5703,6591 568 | 567,7/20/2012,3,1,7,0,5,1,2,0.665833,0.613025,0.844167,0.208967,747,5123,5870 569 | 568,7/21/2012,3,1,7,0,6,0,3,0.595833,0.549912,0.865417,0.2133,1264,3195,4459 570 | 569,7/22/2012,3,1,7,0,0,0,2,0.6675,0.623125,0.7625,0.0939208,2544,4866,7410 571 | 570,7/23/2012,3,1,7,0,1,1,1,0.741667,0.690017,0.694167,0.138683,1135,5831,6966 572 | 571,7/24/2012,3,1,7,0,2,1,1,0.750833,0.70645,0.655,0.211454,1140,6452,7592 573 | 572,7/25/2012,3,1,7,0,3,1,1,0.724167,0.654054,0.45,0.1648,1383,6790,8173 574 | 573,7/26/2012,3,1,7,0,4,1,1,0.776667,0.739263,0.596667,0.284813,1036,5825,6861 575 | 574,7/27/2012,3,1,7,0,5,1,1,0.781667,0.734217,0.594583,0.152992,1259,5645,6904 576 | 575,7/28/2012,3,1,7,0,6,0,1,0.755833,0.697604,0.613333,0.15735,2234,4451,6685 577 | 576,7/29/2012,3,1,7,0,0,0,1,0.721667,0.667933,0.62375,0.170396,2153,4444,6597 578 | 577,7/30/2012,3,1,7,0,1,1,1,0.730833,0.684987,0.66875,0.153617,1040,6065,7105 579 | 578,7/31/2012,3,1,7,0,2,1,1,0.713333,0.662896,0.704167,0.165425,968,6248,7216 580 | 579,8/1/2012,3,1,8,0,3,1,1,0.7175,0.667308,0.6775,0.141179,1074,6506,7580 581 | 580,8/2/2012,3,1,8,0,4,1,1,0.7525,0.707088,0.659583,0.129354,983,6278,7261 582 | 581,8/3/2012,3,1,8,0,5,1,2,0.765833,0.722867,0.6425,0.215792,1328,5847,7175 583 | 582,8/4/2012,3,1,8,0,6,0,1,0.793333,0.751267,0.613333,0.257458,2345,4479,6824 584 | 583,8/5/2012,3,1,8,0,0,0,1,0.769167,0.731079,0.6525,0.290421,1707,3757,5464 585 | 584,8/6/2012,3,1,8,0,1,1,2,0.7525,0.710246,0.654167,0.129354,1233,5780,7013 586 | 585,8/7/2012,3,1,8,0,2,1,2,0.735833,0.697621,0.70375,0.116908,1278,5995,7273 587 | 586,8/8/2012,3,1,8,0,3,1,2,0.75,0.707717,0.672917,0.1107,1263,6271,7534 588 | 587,8/9/2012,3,1,8,0,4,1,1,0.755833,0.699508,0.620417,0.1561,1196,6090,7286 589 | 588,8/10/2012,3,1,8,0,5,1,2,0.715833,0.667942,0.715833,0.238813,1065,4721,5786 590 | 589,8/11/2012,3,1,8,0,6,0,2,0.6925,0.638267,0.732917,0.206479,2247,4052,6299 591 | 590,8/12/2012,3,1,8,0,0,0,1,0.700833,0.644579,0.530417,0.122512,2182,4362,6544 592 | 591,8/13/2012,3,1,8,0,1,1,1,0.720833,0.662254,0.545417,0.136212,1207,5676,6883 593 | 592,8/14/2012,3,1,8,0,2,1,1,0.726667,0.676779,0.686667,0.169158,1128,5656,6784 594 | 593,8/15/2012,3,1,8,0,3,1,1,0.706667,0.654037,0.619583,0.169771,1198,6149,7347 595 | 594,8/16/2012,3,1,8,0,4,1,1,0.719167,0.654688,0.519167,0.141796,1338,6267,7605 596 | 595,8/17/2012,3,1,8,0,5,1,1,0.723333,0.2424,0.570833,0.231354,1483,5665,7148 597 | 596,8/18/2012,3,1,8,0,6,0,1,0.678333,0.618071,0.603333,0.177867,2827,5038,7865 598 | 597,8/19/2012,3,1,8,0,0,0,2,0.635833,0.603554,0.711667,0.08645,1208,3341,4549 599 | 598,8/20/2012,3,1,8,0,1,1,2,0.635833,0.595967,0.734167,0.129979,1026,5504,6530 600 | 599,8/21/2012,3,1,8,0,2,1,1,0.649167,0.601025,0.67375,0.0727708,1081,5925,7006 601 | 600,8/22/2012,3,1,8,0,3,1,1,0.6675,0.621854,0.677083,0.0702833,1094,6281,7375 602 | 601,8/23/2012,3,1,8,0,4,1,1,0.695833,0.637008,0.635833,0.0845958,1363,6402,7765 603 | 602,8/24/2012,3,1,8,0,5,1,2,0.7025,0.6471,0.615,0.0721458,1325,6257,7582 604 | 603,8/25/2012,3,1,8,0,6,0,2,0.661667,0.618696,0.712917,0.244408,1829,4224,6053 605 | 604,8/26/2012,3,1,8,0,0,0,2,0.653333,0.595996,0.845833,0.228858,1483,3772,5255 606 | 605,8/27/2012,3,1,8,0,1,1,1,0.703333,0.654688,0.730417,0.128733,989,5928,6917 607 | 606,8/28/2012,3,1,8,0,2,1,1,0.728333,0.66605,0.62,0.190925,935,6105,7040 608 | 607,8/29/2012,3,1,8,0,3,1,1,0.685,0.635733,0.552083,0.112562,1177,6520,7697 609 | 608,8/30/2012,3,1,8,0,4,1,1,0.706667,0.652779,0.590417,0.0771167,1172,6541,7713 610 | 609,8/31/2012,3,1,8,0,5,1,1,0.764167,0.6894,0.5875,0.168533,1433,5917,7350 611 | 610,9/1/2012,3,1,9,0,6,0,2,0.753333,0.702654,0.638333,0.113187,2352,3788,6140 612 | 611,9/2/2012,3,1,9,0,0,0,2,0.696667,0.649,0.815,0.0640708,2613,3197,5810 613 | 612,9/3/2012,3,1,9,1,1,0,1,0.7075,0.661629,0.790833,0.151121,1965,4069,6034 614 | 613,9/4/2012,3,1,9,0,2,1,1,0.725833,0.686888,0.755,0.236321,867,5997,6864 615 | 614,9/5/2012,3,1,9,0,3,1,1,0.736667,0.708983,0.74125,0.187808,832,6280,7112 616 | 615,9/6/2012,3,1,9,0,4,1,2,0.696667,0.655329,0.810417,0.142421,611,5592,6203 617 | 616,9/7/2012,3,1,9,0,5,1,1,0.703333,0.657204,0.73625,0.171646,1045,6459,7504 618 | 617,9/8/2012,3,1,9,0,6,0,2,0.659167,0.611121,0.799167,0.281104,1557,4419,5976 619 | 618,9/9/2012,3,1,9,0,0,0,1,0.61,0.578925,0.5475,0.224496,2570,5657,8227 620 | 619,9/10/2012,3,1,9,0,1,1,1,0.583333,0.565654,0.50375,0.258713,1118,6407,7525 621 | 620,9/11/2012,3,1,9,0,2,1,1,0.5775,0.554292,0.52,0.0920542,1070,6697,7767 622 | 621,9/12/2012,3,1,9,0,3,1,1,0.599167,0.570075,0.577083,0.131846,1050,6820,7870 623 | 622,9/13/2012,3,1,9,0,4,1,1,0.6125,0.579558,0.637083,0.0827208,1054,6750,7804 624 | 623,9/14/2012,3,1,9,0,5,1,1,0.633333,0.594083,0.6725,0.103863,1379,6630,8009 625 | 624,9/15/2012,3,1,9,0,6,0,1,0.608333,0.585867,0.501667,0.247521,3160,5554,8714 626 | 625,9/16/2012,3,1,9,0,0,0,1,0.58,0.563125,0.57,0.0901833,2166,5167,7333 627 | 626,9/17/2012,3,1,9,0,1,1,2,0.580833,0.55305,0.734583,0.151742,1022,5847,6869 628 | 627,9/18/2012,3,1,9,0,2,1,2,0.623333,0.565067,0.8725,0.357587,371,3702,4073 629 | 628,9/19/2012,3,1,9,0,3,1,1,0.5525,0.540404,0.536667,0.215175,788,6803,7591 630 | 629,9/20/2012,3,1,9,0,4,1,1,0.546667,0.532192,0.618333,0.118167,939,6781,7720 631 | 630,9/21/2012,3,1,9,0,5,1,1,0.599167,0.571971,0.66875,0.154229,1250,6917,8167 632 | 631,9/22/2012,3,1,9,0,6,0,1,0.65,0.610488,0.646667,0.283583,2512,5883,8395 633 | 632,9/23/2012,4,1,9,0,0,0,1,0.529167,0.518933,0.467083,0.223258,2454,5453,7907 634 | 633,9/24/2012,4,1,9,0,1,1,1,0.514167,0.502513,0.492917,0.142404,1001,6435,7436 635 | 634,9/25/2012,4,1,9,0,2,1,1,0.55,0.544179,0.57,0.236321,845,6693,7538 636 | 635,9/26/2012,4,1,9,0,3,1,1,0.635,0.596613,0.630833,0.2444,787,6946,7733 637 | 636,9/27/2012,4,1,9,0,4,1,2,0.65,0.607975,0.690833,0.134342,751,6642,7393 638 | 637,9/28/2012,4,1,9,0,5,1,2,0.619167,0.585863,0.69,0.164179,1045,6370,7415 639 | 638,9/29/2012,4,1,9,0,6,0,1,0.5425,0.530296,0.542917,0.227604,2589,5966,8555 640 | 639,9/30/2012,4,1,9,0,0,0,1,0.526667,0.517663,0.583333,0.134958,2015,4874,6889 641 | 640,10/1/2012,4,1,10,0,1,1,2,0.520833,0.512,0.649167,0.0908042,763,6015,6778 642 | 641,10/2/2012,4,1,10,0,2,1,3,0.590833,0.542333,0.871667,0.104475,315,4324,4639 643 | 642,10/3/2012,4,1,10,0,3,1,2,0.6575,0.599133,0.79375,0.0665458,728,6844,7572 644 | 643,10/4/2012,4,1,10,0,4,1,2,0.6575,0.607975,0.722917,0.117546,891,6437,7328 645 | 644,10/5/2012,4,1,10,0,5,1,1,0.615,0.580187,0.6275,0.10635,1516,6640,8156 646 | 645,10/6/2012,4,1,10,0,6,0,1,0.554167,0.538521,0.664167,0.268025,3031,4934,7965 647 | 646,10/7/2012,4,1,10,0,0,0,2,0.415833,0.419813,0.708333,0.141162,781,2729,3510 648 | 647,10/8/2012,4,1,10,1,1,0,2,0.383333,0.387608,0.709583,0.189679,874,4604,5478 649 | 648,10/9/2012,4,1,10,0,2,1,2,0.446667,0.438112,0.761667,0.1903,601,5791,6392 650 | 649,10/10/2012,4,1,10,0,3,1,1,0.514167,0.503142,0.630833,0.187821,780,6911,7691 651 | 650,10/11/2012,4,1,10,0,4,1,1,0.435,0.431167,0.463333,0.181596,834,6736,7570 652 | 651,10/12/2012,4,1,10,0,5,1,1,0.4375,0.433071,0.539167,0.235092,1060,6222,7282 653 | 652,10/13/2012,4,1,10,0,6,0,1,0.393333,0.391396,0.494583,0.146142,2252,4857,7109 654 | 653,10/14/2012,4,1,10,0,0,0,1,0.521667,0.508204,0.640417,0.278612,2080,4559,6639 655 | 654,10/15/2012,4,1,10,0,1,1,2,0.561667,0.53915,0.7075,0.296037,760,5115,5875 656 | 655,10/16/2012,4,1,10,0,2,1,1,0.468333,0.460846,0.558333,0.182221,922,6612,7534 657 | 656,10/17/2012,4,1,10,0,3,1,1,0.455833,0.450108,0.692917,0.101371,979,6482,7461 658 | 657,10/18/2012,4,1,10,0,4,1,2,0.5225,0.512625,0.728333,0.236937,1008,6501,7509 659 | 658,10/19/2012,4,1,10,0,5,1,2,0.563333,0.537896,0.815,0.134954,753,4671,5424 660 | 659,10/20/2012,4,1,10,0,6,0,1,0.484167,0.472842,0.572917,0.117537,2806,5284,8090 661 | 660,10/21/2012,4,1,10,0,0,0,1,0.464167,0.456429,0.51,0.166054,2132,4692,6824 662 | 661,10/22/2012,4,1,10,0,1,1,1,0.4875,0.482942,0.568333,0.0814833,830,6228,7058 663 | 662,10/23/2012,4,1,10,0,2,1,1,0.544167,0.530304,0.641667,0.0945458,841,6625,7466 664 | 663,10/24/2012,4,1,10,0,3,1,1,0.5875,0.558721,0.63625,0.0727792,795,6898,7693 665 | 664,10/25/2012,4,1,10,0,4,1,2,0.55,0.529688,0.800417,0.124375,875,6484,7359 666 | 665,10/26/2012,4,1,10,0,5,1,2,0.545833,0.52275,0.807083,0.132467,1182,6262,7444 667 | 666,10/27/2012,4,1,10,0,6,0,2,0.53,0.515133,0.72,0.235692,2643,5209,7852 668 | 667,10/28/2012,4,1,10,0,0,0,2,0.4775,0.467771,0.694583,0.398008,998,3461,4459 669 | 668,10/29/2012,4,1,10,0,1,1,3,0.44,0.4394,0.88,0.3582,2,20,22 670 | 669,10/30/2012,4,1,10,0,2,1,2,0.318182,0.309909,0.825455,0.213009,87,1009,1096 671 | 670,10/31/2012,4,1,10,0,3,1,2,0.3575,0.3611,0.666667,0.166667,419,5147,5566 672 | 671,11/1/2012,4,1,11,0,4,1,2,0.365833,0.369942,0.581667,0.157346,466,5520,5986 673 | 672,11/2/2012,4,1,11,0,5,1,1,0.355,0.356042,0.522083,0.266175,618,5229,5847 674 | 673,11/3/2012,4,1,11,0,6,0,2,0.343333,0.323846,0.49125,0.270529,1029,4109,5138 675 | 674,11/4/2012,4,1,11,0,0,0,1,0.325833,0.329538,0.532917,0.179108,1201,3906,5107 676 | 675,11/5/2012,4,1,11,0,1,1,1,0.319167,0.308075,0.494167,0.236325,378,4881,5259 677 | 676,11/6/2012,4,1,11,0,2,1,1,0.280833,0.281567,0.567083,0.173513,466,5220,5686 678 | 677,11/7/2012,4,1,11,0,3,1,2,0.295833,0.274621,0.5475,0.304108,326,4709,5035 679 | 678,11/8/2012,4,1,11,0,4,1,1,0.352174,0.341891,0.333478,0.347835,340,4975,5315 680 | 679,11/9/2012,4,1,11,0,5,1,1,0.361667,0.355413,0.540833,0.214558,709,5283,5992 681 | 680,11/10/2012,4,1,11,0,6,0,1,0.389167,0.393937,0.645417,0.0578458,2090,4446,6536 682 | 681,11/11/2012,4,1,11,0,0,0,1,0.420833,0.421713,0.659167,0.1275,2290,4562,6852 683 | 682,11/12/2012,4,1,11,1,1,0,1,0.485,0.475383,0.741667,0.173517,1097,5172,6269 684 | 683,11/13/2012,4,1,11,0,2,1,2,0.343333,0.323225,0.662917,0.342046,327,3767,4094 685 | 684,11/14/2012,4,1,11,0,3,1,1,0.289167,0.281563,0.552083,0.199625,373,5122,5495 686 | 685,11/15/2012,4,1,11,0,4,1,2,0.321667,0.324492,0.620417,0.152987,320,5125,5445 687 | 686,11/16/2012,4,1,11,0,5,1,1,0.345,0.347204,0.524583,0.171025,484,5214,5698 688 | 687,11/17/2012,4,1,11,0,6,0,1,0.325,0.326383,0.545417,0.179729,1313,4316,5629 689 | 688,11/18/2012,4,1,11,0,0,0,1,0.3425,0.337746,0.692917,0.227612,922,3747,4669 690 | 689,11/19/2012,4,1,11,0,1,1,2,0.380833,0.375621,0.623333,0.235067,449,5050,5499 691 | 690,11/20/2012,4,1,11,0,2,1,2,0.374167,0.380667,0.685,0.082725,534,5100,5634 692 | 691,11/21/2012,4,1,11,0,3,1,1,0.353333,0.364892,0.61375,0.103246,615,4531,5146 693 | 692,11/22/2012,4,1,11,1,4,0,1,0.34,0.350371,0.580417,0.0528708,955,1470,2425 694 | 693,11/23/2012,4,1,11,0,5,1,1,0.368333,0.378779,0.56875,0.148021,1603,2307,3910 695 | 694,11/24/2012,4,1,11,0,6,0,1,0.278333,0.248742,0.404583,0.376871,532,1745,2277 696 | 695,11/25/2012,4,1,11,0,0,0,1,0.245833,0.257583,0.468333,0.1505,309,2115,2424 697 | 696,11/26/2012,4,1,11,0,1,1,1,0.313333,0.339004,0.535417,0.04665,337,4750,5087 698 | 697,11/27/2012,4,1,11,0,2,1,2,0.291667,0.281558,0.786667,0.237562,123,3836,3959 699 | 698,11/28/2012,4,1,11,0,3,1,1,0.296667,0.289762,0.50625,0.210821,198,5062,5260 700 | 699,11/29/2012,4,1,11,0,4,1,1,0.28087,0.298422,0.555652,0.115522,243,5080,5323 701 | 700,11/30/2012,4,1,11,0,5,1,1,0.298333,0.323867,0.649583,0.0584708,362,5306,5668 702 | 701,12/1/2012,4,1,12,0,6,0,2,0.298333,0.316904,0.806667,0.0597042,951,4240,5191 703 | 702,12/2/2012,4,1,12,0,0,0,2,0.3475,0.359208,0.823333,0.124379,892,3757,4649 704 | 703,12/3/2012,4,1,12,0,1,1,1,0.4525,0.455796,0.7675,0.0827208,555,5679,6234 705 | 704,12/4/2012,4,1,12,0,2,1,1,0.475833,0.469054,0.73375,0.174129,551,6055,6606 706 | 705,12/5/2012,4,1,12,0,3,1,1,0.438333,0.428012,0.485,0.324021,331,5398,5729 707 | 706,12/6/2012,4,1,12,0,4,1,1,0.255833,0.258204,0.50875,0.174754,340,5035,5375 708 | 707,12/7/2012,4,1,12,0,5,1,2,0.320833,0.321958,0.764167,0.1306,349,4659,5008 709 | 708,12/8/2012,4,1,12,0,6,0,2,0.381667,0.389508,0.91125,0.101379,1153,4429,5582 710 | 709,12/9/2012,4,1,12,0,0,0,2,0.384167,0.390146,0.905417,0.157975,441,2787,3228 711 | 710,12/10/2012,4,1,12,0,1,1,2,0.435833,0.435575,0.925,0.190308,329,4841,5170 712 | 711,12/11/2012,4,1,12,0,2,1,2,0.353333,0.338363,0.596667,0.296037,282,5219,5501 713 | 712,12/12/2012,4,1,12,0,3,1,2,0.2975,0.297338,0.538333,0.162937,310,5009,5319 714 | 713,12/13/2012,4,1,12,0,4,1,1,0.295833,0.294188,0.485833,0.174129,425,5107,5532 715 | 714,12/14/2012,4,1,12,0,5,1,1,0.281667,0.294192,0.642917,0.131229,429,5182,5611 716 | 715,12/15/2012,4,1,12,0,6,0,1,0.324167,0.338383,0.650417,0.10635,767,4280,5047 717 | 716,12/16/2012,4,1,12,0,0,0,2,0.3625,0.369938,0.83875,0.100742,538,3248,3786 718 | 717,12/17/2012,4,1,12,0,1,1,2,0.393333,0.4015,0.907083,0.0982583,212,4373,4585 719 | 718,12/18/2012,4,1,12,0,2,1,1,0.410833,0.409708,0.66625,0.221404,433,5124,5557 720 | 719,12/19/2012,4,1,12,0,3,1,1,0.3325,0.342162,0.625417,0.184092,333,4934,5267 721 | 720,12/20/2012,4,1,12,0,4,1,2,0.33,0.335217,0.667917,0.132463,314,3814,4128 722 | 721,12/21/2012,1,1,12,0,5,1,2,0.326667,0.301767,0.556667,0.374383,221,3402,3623 723 | 722,12/22/2012,1,1,12,0,6,0,1,0.265833,0.236113,0.44125,0.407346,205,1544,1749 724 | 723,12/23/2012,1,1,12,0,0,0,1,0.245833,0.259471,0.515417,0.133083,408,1379,1787 725 | 724,12/24/2012,1,1,12,0,1,1,2,0.231304,0.2589,0.791304,0.0772304,174,746,920 726 | 725,12/25/2012,1,1,12,1,2,0,2,0.291304,0.294465,0.734783,0.168726,440,573,1013 727 | 726,12/26/2012,1,1,12,0,3,1,3,0.243333,0.220333,0.823333,0.316546,9,432,441 728 | 727,12/27/2012,1,1,12,0,4,1,2,0.254167,0.226642,0.652917,0.350133,247,1867,2114 729 | 728,12/28/2012,1,1,12,0,5,1,2,0.253333,0.255046,0.59,0.155471,644,2451,3095 730 | 729,12/29/2012,1,1,12,0,6,0,2,0.253333,0.2424,0.752917,0.124383,159,1182,1341 731 | 730,12/30/2012,1,1,12,0,0,0,1,0.255833,0.2317,0.483333,0.350754,364,1432,1796 732 | 731,12/31/2012,1,1,12,0,1,1,2,0.215833,0.223487,0.5775,0.154846,439,2290,2729 733 | -------------------------------------------------------------------------------- /compute-identity/multi-step-pipelines/grantidentity.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MayMSFT/identity-based-data-access/9f2482a917517dddbeff9b8e34ead020c75713eb/compute-identity/multi-step-pipelines/grantidentity.jpg -------------------------------------------------------------------------------- /compute-identity/multi-step-pipelines/keras-mnist-fashion/prepare.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | 5 | def convert(imgf, labelf, outf, n): 6 | f = open(imgf, "rb") 7 | l = open(labelf, "rb") 8 | o = open(outf, "w") 9 | 10 | f.read(16) 11 | l.read(8) 12 | images = [] 13 | 14 | for i in range(n): 15 | image = [ord(l.read(1))] 16 | for j in range(28 * 28): 17 | image.append(ord(f.read(1))) 18 | images.append(image) 19 | 20 | for image in images: 21 | o.write(",".join(str(pix) for pix in image) + "\n") 22 | f.close() 23 | o.close() 24 | l.close() 25 | 26 | 27 | mounted_input_path = sys.argv[1] 28 | mounted_output_path = sys.argv[2] 29 | os.makedirs(mounted_output_path, exist_ok=True) 30 | 31 | convert(os.path.join(mounted_input_path, 'train-images-idx3-ubyte'), 32 | os.path.join(mounted_input_path, 'train-labels-idx1-ubyte'), 33 | os.path.join(mounted_output_path, 'mnist_train.csv'), 60000) 34 | convert(os.path.join(mounted_input_path, 't10k-images-idx3-ubyte'), 35 | os.path.join(mounted_input_path, 't10k-labels-idx1-ubyte'), 36 | os.path.join(mounted_output_path, 'mnist_test.csv'), 10000) 37 | -------------------------------------------------------------------------------- /compute-identity/multi-step-pipelines/keras-mnist-fashion/train.py: -------------------------------------------------------------------------------- 1 | import keras 2 | from keras.models import Sequential 3 | from keras.layers import Dense, Dropout, Flatten 4 | from keras.layers import Conv2D, MaxPooling2D 5 | from keras.layers.normalization import BatchNormalization 6 | from keras.utils import to_categorical 7 | from keras.callbacks import Callback 8 | 9 | import numpy as np 10 | import pandas as pd 11 | import os 12 | import matplotlib.pyplot as plt 13 | from sklearn.model_selection import train_test_split 14 | from azureml.core import Run 15 | 16 | # + 17 | from azureml.core import __version__ as corever 18 | from azureml.dataprep import __version__ as dprepver 19 | from azureml._base_sdk_common import _ClientSessionId 20 | 21 | print('core version: {}'.format(corever)) 22 | print('dprep version: {}'.format(dprepver)) 23 | # - 24 | 25 | # dataset object from the run 26 | run = Run.get_context() 27 | dataset = run.input_datasets['prepared_fashion_ds'] 28 | 29 | # split dataset into train and test set 30 | (train_dataset, test_dataset) = dataset.random_split(percentage=0.8, seed=111) 31 | 32 | # load dataset into pandas dataframe 33 | data_train = train_dataset.to_pandas_dataframe() 34 | data_test = test_dataset.to_pandas_dataframe() 35 | 36 | img_rows, img_cols = 28, 28 37 | input_shape = (img_rows, img_cols, 1) 38 | 39 | X = np.array(data_train.iloc[:, 1:]) 40 | y = to_categorical(np.array(data_train.iloc[:, 0])) 41 | 42 | # here we split validation data to optimiza classifier during training 43 | X_train, X_val, y_train, y_val = train_test_split(X, y, test_size=0.2, random_state=13) 44 | 45 | # test data 46 | X_test = np.array(data_test.iloc[:, 1:]) 47 | y_test = to_categorical(np.array(data_test.iloc[:, 0])) 48 | 49 | 50 | X_train = X_train.reshape(X_train.shape[0], img_rows, img_cols, 1).astype('float32') / 255 51 | X_test = X_test.reshape(X_test.shape[0], img_rows, img_cols, 1).astype('float32') / 255 52 | X_val = X_val.reshape(X_val.shape[0], img_rows, img_cols, 1).astype('float32') / 255 53 | 54 | batch_size = 256 55 | num_classes = 10 56 | epochs = 10 57 | 58 | # construct neuron network 59 | model = Sequential() 60 | model.add(Conv2D(32, kernel_size=(3, 3), 61 | activation='relu', 62 | kernel_initializer='he_normal', 63 | input_shape=input_shape)) 64 | model.add(MaxPooling2D((2, 2))) 65 | model.add(Dropout(0.25)) 66 | model.add(Conv2D(64, (3, 3), activation='relu')) 67 | model.add(MaxPooling2D(pool_size=(2, 2))) 68 | model.add(Dropout(0.25)) 69 | model.add(Conv2D(128, (3, 3), activation='relu')) 70 | model.add(Dropout(0.4)) 71 | model.add(Flatten()) 72 | model.add(Dense(128, activation='relu')) 73 | model.add(Dropout(0.3)) 74 | model.add(Dense(num_classes, activation='softmax')) 75 | 76 | model.compile(loss=keras.losses.categorical_crossentropy, 77 | optimizer=keras.optimizers.Adam(), 78 | metrics=['accuracy']) 79 | 80 | # start an Azure ML run 81 | run = Run.get_context() 82 | 83 | 84 | class LogRunMetrics(Callback): 85 | # callback at the end of every epoch 86 | def on_epoch_end(self, epoch, log): 87 | # log a value repeated which creates a list 88 | run.log('Loss', log['loss']) 89 | run.log('Accuracy', log['accuracy']) 90 | 91 | 92 | history = model.fit(X_train, y_train, 93 | batch_size=batch_size, 94 | epochs=epochs, 95 | verbose=1, 96 | validation_data=(X_val, y_val), 97 | callbacks=[LogRunMetrics()]) 98 | 99 | score = model.evaluate(X_test, y_test, verbose=0) 100 | 101 | # log a single value 102 | run.log("Final test loss", score[0]) 103 | print('Test loss:', score[0]) 104 | 105 | run.log('Final test accuracy', score[1]) 106 | print('Test accuracy:', score[1]) 107 | 108 | plt.figure(figsize=(6, 3)) 109 | plt.title('Fashion MNIST with Keras ({} epochs)'.format(epochs), fontsize=14) 110 | plt.plot(history.history['accuracy'], 'b-', label='Accuracy', lw=4, alpha=0.5) 111 | plt.plot(history.history['loss'], 'r--', label='Loss', lw=4, alpha=0.5) 112 | plt.legend(fontsize=12) 113 | plt.grid(True) 114 | 115 | # log an image 116 | run.log_image('Loss v.s. Accuracy', plot=plt) 117 | 118 | # create a ./outputs/model folder in the compute target 119 | # files saved in the "./outputs" folder are automatically uploaded into run history 120 | os.makedirs('./outputs/model', exist_ok=True) 121 | 122 | # serialize NN architecture to JSON 123 | model_json = model.to_json() 124 | # save model JSON 125 | with open('./outputs/model/model.json', 'w') as f: 126 | f.write(model_json) 127 | # save model weights 128 | model.save_weights('./outputs/model/model.h5') 129 | print("model saved in ./outputs/model folder") 130 | -------------------------------------------------------------------------------- /compute-identity/multi-step-pipelines/pipeline-for-image-classification.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "Copyright (c) Microsoft Corporation. All rights reserved.\n", 8 | "\n", 9 | "Licensed under the MIT License [2017] Zalando SE, https://tech.zalando.com" 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "metadata": {}, 15 | "source": [ 16 | "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/work-with-data/datasets-tutorial/pipeline-with-datasets/pipeline-for-image-classification.png)" 17 | ] 18 | }, 19 | { 20 | "cell_type": "markdown", 21 | "metadata": {}, 22 | "source": [ 23 | "# Build a simple ML pipeline for image classification\n", 24 | "\n", 25 | "## Introduction\n", 26 | "This tutorial shows how to train a simple deep neural network using the [Fashion MNIST](https://github.com/zalandoresearch/fashion-mnist) dataset and Keras on Azure Machine Learning. Fashion-MNIST is a dataset of Zalando's article images—consisting of a training set of 60,000 examples and a test set of 10,000 examples. Each example is a 28x28 grayscale image, associated with a label from 10 classes.\n", 27 | "\n", 28 | "Learn how to:\n", 29 | "\n", 30 | "> * Set up your development environment\n", 31 | "> * Create the Fashion MNIST dataset\n", 32 | "> * Create a machine learning pipeline to train a simple deep learning neural network on a remote cluster\n", 33 | "> * Retrieve input datasets from the experiment and register the output model with datasets\n", 34 | "\n", 35 | "## Prerequisite:\n", 36 | "* Understand the [architecture and terms](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture) introduced by Azure Machine Learning\n", 37 | "* If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration notebook](../../../configuration.ipynb) to:\n", 38 | " * install the latest version of AzureML SDK\n", 39 | " * create a workspace and its configuration file (`config.json`)" 40 | ] 41 | }, 42 | { 43 | "cell_type": "code", 44 | "execution_count": null, 45 | "metadata": {}, 46 | "outputs": [], 47 | "source": [ 48 | "# install the latest version if azureml sdk\n", 49 | "!pip install -U azureml-sdk" 50 | ] 51 | }, 52 | { 53 | "cell_type": "markdown", 54 | "metadata": {}, 55 | "source": [ 56 | "## Set up your development environment\n", 57 | "\n", 58 | "All the setup for your development work can be accomplished in a Python notebook. Setup includes:\n", 59 | "\n", 60 | "* Importing Python packages\n", 61 | "* Connecting to a workspace to enable communication between your local computer and remote resources\n", 62 | "* Creating an experiment to track all your runs\n", 63 | "* Creating a remote compute target to use for training\n", 64 | "\n", 65 | "### Import packages\n", 66 | "\n", 67 | "Import Python packages you need in this session. Also display the Azure Machine Learning SDK version." 68 | ] 69 | }, 70 | { 71 | "cell_type": "code", 72 | "execution_count": null, 73 | "metadata": {}, 74 | "outputs": [], 75 | "source": [ 76 | "import os\n", 77 | "import azureml.core\n", 78 | "from azureml.core import Workspace, Dataset, Datastore, ComputeTarget, RunConfiguration, Experiment\n", 79 | "from azureml.core.runconfig import CondaDependencies\n", 80 | "from azureml.pipeline.steps import PythonScriptStep, EstimatorStep\n", 81 | "from azureml.pipeline.core import Pipeline, PipelineData\n", 82 | "from azureml.train.dnn import TensorFlow\n", 83 | "\n", 84 | "# check core SDK version number\n", 85 | "print(\"Azure ML SDK Version: \", azureml.core.VERSION)" 86 | ] 87 | }, 88 | { 89 | "cell_type": "markdown", 90 | "metadata": {}, 91 | "source": [ 92 | "### Connect to workspace\n", 93 | "\n", 94 | "Create a workspace object from the existing workspace. `Workspace.from_config()` reads the file **config.json** and loads the details into an object named `workspace`." 95 | ] 96 | }, 97 | { 98 | "cell_type": "code", 99 | "execution_count": null, 100 | "metadata": {}, 101 | "outputs": [], 102 | "source": [ 103 | "# load workspace\n", 104 | "workspace = Workspace.from_config()\n", 105 | "print('Workspace name: ' + workspace.name, \n", 106 | " 'Azure region: ' + workspace.location, \n", 107 | " 'Subscription id: ' + workspace.subscription_id, \n", 108 | " 'Resource group: ' + workspace.resource_group, sep='\\n')" 109 | ] 110 | }, 111 | { 112 | "cell_type": "markdown", 113 | "metadata": {}, 114 | "source": [ 115 | "### Create experiment and a directory\n", 116 | "\n", 117 | "Create an experiment to track the runs in your workspace and a directory to deliver the necessary code from your computer to the remote resource." 118 | ] 119 | }, 120 | { 121 | "cell_type": "code", 122 | "execution_count": null, 123 | "metadata": {}, 124 | "outputs": [], 125 | "source": [ 126 | "# create an ML experiment\n", 127 | "exp = Experiment(workspace=workspace, name='keras-mnist-fashion')\n", 128 | "\n", 129 | "# create a directory\n", 130 | "script_folder = './keras-mnist-fashion'\n", 131 | "os.makedirs(script_folder, exist_ok=True)" 132 | ] 133 | }, 134 | { 135 | "cell_type": "markdown", 136 | "metadata": {}, 137 | "source": [ 138 | "### Create AzureML compute resource with user assigned identity\n", 139 | "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", 140 | "\n", 141 | "To provision the compute with identity:\n", 142 | "* `identity_type`: Compute Identity type that you want to set on the cluster, which can either be SystemAssigned or UserAssigned\n", 143 | "* `identity_id`: List of resource ID of identity in case it is a UserAssigned identity, optional otherwise. To get identity_id of your managed identity, run the following command:\n", 144 | "`az identity show --resource-group yourRGName --name yourIdentityName`\n", 145 | "\n", 146 | "**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." 147 | ] 148 | }, 149 | { 150 | "cell_type": "code", 151 | "execution_count": null, 152 | "metadata": {}, 153 | "outputs": [], 154 | "source": [ 155 | "from azureml.core.compute import ComputeTarget, AmlCompute\n", 156 | "from azureml.core.compute_target import ComputeTargetException\n", 157 | "\n", 158 | "# choose a name for your cluster\n", 159 | "cluster_name = 'identitycomp3'\n", 160 | "\n", 161 | "try:\n", 162 | " compute_target = ComputeTarget(workspace=workspace, name=cluster_name)\n", 163 | " print('Found existing compute target')\n", 164 | "except ComputeTargetException:\n", 165 | " print('Creating a new compute target...')\n", 166 | " compute_config = AmlCompute.provisioning_configuration(vm_size='Standard_D3_v2', \n", 167 | " max_nodes=4,\n", 168 | " vnet_resourcegroup_name='maytest',\n", 169 | " vnet_name='mayvnetcentral',\n", 170 | " subnet_name='default',\n", 171 | " identity_type='UserAssigned',\n", 172 | " identity_id=['/subscriptions/35f16a99-532a-4a47-9e93-00305f6c40f2/resourcegroups/maytest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/mayidentity'])\n", 173 | "\n", 174 | " # create the cluster\n", 175 | " compute_target = ComputeTarget.create(workspace, cluster_name, compute_config)\n", 176 | "\n", 177 | " # can poll for a minimum number of nodes and for a specific timeout. \n", 178 | " # if no min node count is provided it uses the scale settings for the cluster\n", 179 | " compute_target.wait_for_completion(show_output=True, min_node_count=None, timeout_in_minutes=20)\n", 180 | "\n", 181 | "# use get_status() to get a detailed status for the current cluster. \n", 182 | "print(compute_target.get_status().serialize())" 183 | ] 184 | }, 185 | { 186 | "cell_type": "markdown", 187 | "metadata": {}, 188 | "source": [ 189 | "## Create datastore without credentials\n", 190 | "For datastores without credentials:\n", 191 | "1. If you are interacting with the datastore/dataset on your local laptop (e.g. using notebook), you will be prompt to login and your identity will be used for data access authentication.\n", 192 | "2. If you submit an azureML experiment with an AML Compute as compute target, the identity of the compute will be used for data access authentication.\n", 193 | "\n", 194 | "Therefore, make sure you grant your user identity and the compute identity access to your storage account. We support Azure Blob, ADLS Gen1, ADLS Gen2 for private preview. " 195 | ] 196 | }, 197 | { 198 | "cell_type": "code", 199 | "execution_count": null, 200 | "metadata": {}, 201 | "outputs": [], 202 | "source": [ 203 | "# create blob datatastore without credentials\n", 204 | "# the blob container in the sample is behind vnet\n", 205 | "blob_dstore = Datastore.register_azure_blob_container(workspace=workspace,\n", 206 | " datastore_name='credentialless_blob',\n", 207 | " container_name='data',\n", 208 | " account_name='mayvnet')" 209 | ] 210 | }, 211 | { 212 | "cell_type": "code", 213 | "execution_count": null, 214 | "metadata": {}, 215 | "outputs": [], 216 | "source": [ 217 | "# create adls gen1 without credentials\n", 218 | "adls_dstore = Datastore.register_azure_data_lake(workspace = workspace,\n", 219 | " datastore_name='credentialless_adls1',\n", 220 | " store_name='rozh')" 221 | ] 222 | }, 223 | { 224 | "cell_type": "code", 225 | "execution_count": null, 226 | "metadata": {}, 227 | "outputs": [], 228 | "source": [ 229 | "# createn adls2 datastore without credentials\n", 230 | "adls2_dstore = Datastore.register_azure_data_lake_gen2(workspace=workspace, \n", 231 | " datastore_name='credentialless_adls2', \n", 232 | " filesystem='tabular', \n", 233 | " account_name='mayadls2') " 234 | ] 235 | }, 236 | { 237 | "cell_type": "markdown", 238 | "metadata": {}, 239 | "source": [ 240 | "## Interact with data in notebook\n", 241 | "Dataset is the recommended approach to interact with data in AzureML. You can download, mount or load dataset into common dataframe. [Lear More](https://docs.microsoft.com/azure/machine-learning/how-to-create-register-datasets)" 242 | ] 243 | }, 244 | { 245 | "cell_type": "code", 246 | "execution_count": null, 247 | "metadata": {}, 248 | "outputs": [], 249 | "source": [ 250 | "# create tabulardataset from the credential-less blobdatastore behind vnet\n", 251 | "# if your datastore is behind vnet. Make sure the compute (e.g. compute instance) you are running the following code is behind the same vnet\n", 252 | "blob_ds = Dataset.Tabular.from_delimited_files((blob_dstore,'Titanic.csv'))" 253 | ] 254 | }, 255 | { 256 | "cell_type": "code", 257 | "execution_count": null, 258 | "metadata": {}, 259 | "outputs": [], 260 | "source": [ 261 | "blob_ds.take(5).to_pandas_dataframe()" 262 | ] 263 | }, 264 | { 265 | "cell_type": "code", 266 | "execution_count": null, 267 | "metadata": {}, 268 | "outputs": [], 269 | "source": [ 270 | "# create filedataset from the credential-less adlsgen2 datastore \n", 271 | "adls2_ds = Dataset.File.from_files((adls2_dstore,'updates_ca.csv'))\n", 272 | "adls2_ds.to_path()" 273 | ] 274 | }, 275 | { 276 | "cell_type": "markdown", 277 | "metadata": {}, 278 | "source": [ 279 | "## Create the Fashion MNIST dataset\n", 280 | "\n", 281 | "By creating a dataset, you create a reference to the data source location. If you applied any subsetting transformations to the dataset, they will be stored in the dataset as well. The data remains in its existing location, so no extra storage cost is incurred. \n", 282 | "\n", 283 | "We will now upload the Fashion MNIST files to the blob datastore without credentials." 284 | ] 285 | }, 286 | { 287 | "cell_type": "code", 288 | "execution_count": null, 289 | "metadata": {}, 290 | "outputs": [], 291 | "source": [ 292 | "#this is a new api to upload data to dataset and create a dataset from it\n", 293 | "fashion_ds = Dataset.File.upload_directory(src_dir='./data', target = (blob_dstore, \"mnist-fashion\"), overwrite=True)" 294 | ] 295 | }, 296 | { 297 | "cell_type": "markdown", 298 | "metadata": {}, 299 | "source": [ 300 | "Then we will create an unregistered FileDataset pointing to the path in the datastore. You can also create a dataset from multiple paths. [Learn More](https://aka.ms/azureml/howto/createdatasets) " 301 | ] 302 | }, 303 | { 304 | "cell_type": "code", 305 | "execution_count": null, 306 | "metadata": {}, 307 | "outputs": [], 308 | "source": [ 309 | "fashion_ds = Dataset.File.from_files((blob_dstore, \"mnist-fashion\"))" 310 | ] 311 | }, 312 | { 313 | "cell_type": "code", 314 | "execution_count": null, 315 | "metadata": {}, 316 | "outputs": [], 317 | "source": [ 318 | "# list files referenced by dataset\n", 319 | "fashion_ds.to_path()" 320 | ] 321 | }, 322 | { 323 | "cell_type": "markdown", 324 | "metadata": {}, 325 | "source": [ 326 | "## Build 2-step ML pipeline\n", 327 | "\n", 328 | "The [Azure Machine Learning Pipeline](https://docs.microsoft.com/en-us/azure/machine-learning/service/concept-ml-pipelines) enables data scientists to create and manage multiple simple and complex workflows concurrently. A typical pipeline would have multiple tasks to prepare data, train, deploy and evaluate models. Individual steps in the pipeline can make use of diverse compute options (for example: CPU for data preparation and GPU for training) and languages. [Learn More](https://github.com/Azure/MachineLearningNotebooks/tree/master/how-to-use-azureml/machine-learning-pipelines)\n", 329 | "\n", 330 | "\n", 331 | "### Step 1: data preparation\n", 332 | "\n", 333 | "In step one, we will load the image and labels from Fashion MNIST dataset into mnist_train.csv and mnist_test.csv\n", 334 | "\n", 335 | "Each image is 28 pixels in height and 28 pixels in width, for a total of 784 pixels in total. Each pixel has a single pixel-value associated with it, indicating the lightness or darkness of that pixel, with higher numbers meaning darker. This pixel-value is an integer between 0 and 255. Both mnist_train.csv and mnist_test.csv contain 785 columns. The first column consists of the class labels, which represent the article of clothing. The rest of the columns contain the pixel-values of the associated image." 336 | ] 337 | }, 338 | { 339 | "cell_type": "markdown", 340 | "metadata": {}, 341 | "source": [ 342 | "Intermediate data (or output of a step) is represented by a OutputFileDatasetConfig object. preprared_fashion_ds is produced as the output of step 1, and used as the input of step 2. OutputFileDatasetConfig introduces a data dependency between steps, and creates an implicit execution order in the pipeline. You can register a OutputFileDatasetConfig as a dataset and version the output data automatically." 343 | ] 344 | }, 345 | { 346 | "cell_type": "code", 347 | "execution_count": null, 348 | "metadata": {}, 349 | "outputs": [], 350 | "source": [ 351 | "from azureml.data import OutputFileDatasetConfig\n", 352 | "\n", 353 | "# learn more about the output config\n", 354 | "help(OutputFileDatasetConfig)" 355 | ] 356 | }, 357 | { 358 | "cell_type": "markdown", 359 | "metadata": {}, 360 | "source": [ 361 | "**Configure output as dataset**: This is a new feature in private preview. We support mount write back to blob, adlsgen1, adlsgen2, fileshare via dataset." 362 | ] 363 | }, 364 | { 365 | "cell_type": "code", 366 | "execution_count": null, 367 | "metadata": {}, 368 | "outputs": [], 369 | "source": [ 370 | "# write output to blob datastore under folder `outputdataset` and registger it as a dataset after the experiment completes\n", 371 | "prepared_fashion_ds = OutputFileDatasetConfig(destination=(blob_dstore, 'outputdataset/{run-id}')).register_on_complete(name='prepared_fashion_ds')" 372 | ] 373 | }, 374 | { 375 | "cell_type": "markdown", 376 | "metadata": {}, 377 | "source": [ 378 | "**Important**
\n", 379 | "In remote training, the identity of the compute will be used for data authentication. In this example, a managed identity was assigned to the compute target. Therefore, you need to make sure the managed identity has blob data contributor role in order to write data back to the datastore without credentials.\n", 380 | "![image](grantidentity.jpg)" 381 | ] 382 | }, 383 | { 384 | "cell_type": "markdown", 385 | "metadata": {}, 386 | "source": [ 387 | "A **PythonScriptStep** is a basic, built-in step to run a Python Script on a compute target. It takes a script name and optionally other parameters like arguments for the script, compute target, inputs and outputs. If no compute target is specified, default compute target for the workspace is used. You can also use a [**RunConfiguration**](https://docs.microsoft.com/en-us/python/api/azureml-core/azureml.core.runconfiguration?view=azure-ml-py) to specify requirements for the PythonScriptStep, such as conda dependencies and docker image." 388 | ] 389 | }, 390 | { 391 | "cell_type": "code", 392 | "execution_count": null, 393 | "metadata": {}, 394 | "outputs": [], 395 | "source": [ 396 | "prep_step = PythonScriptStep(name='prepare step',\n", 397 | " script_name=\"prepare.py\",\n", 398 | " # mount fashion_ds dataset to the compute_target\n", 399 | " arguments=[fashion_ds.as_named_input('fashion_ds').as_mount(), prepared_fashion_ds],\n", 400 | " source_directory=script_folder,\n", 401 | " compute_target=compute_target,\n", 402 | " allow_reuse=True)" 403 | ] 404 | }, 405 | { 406 | "cell_type": "markdown", 407 | "metadata": {}, 408 | "source": [ 409 | "### Step 2: train CNN with Keras\n", 410 | "\n", 411 | "Next, construct a ScriptRunConfig to configure the training run that trains a CNN model using Keras. It takes a dataset as the input." 412 | ] 413 | }, 414 | { 415 | "cell_type": "code", 416 | "execution_count": null, 417 | "metadata": {}, 418 | "outputs": [], 419 | "source": [ 420 | "%%writefile conda_dependencies.yml\n", 421 | "\n", 422 | "dependencies:\n", 423 | "- python=3.6.2\n", 424 | "- pip:\n", 425 | " - azureml-defaults\n", 426 | " - keras\n", 427 | " - tensorflow\n", 428 | " - numpy\n", 429 | " - scikit-learn\n", 430 | " - pandas\n", 431 | " - matplotlib" 432 | ] 433 | }, 434 | { 435 | "cell_type": "code", 436 | "execution_count": null, 437 | "metadata": {}, 438 | "outputs": [], 439 | "source": [ 440 | "from azureml.core import Environment, ScriptRunConfig\n", 441 | "\n", 442 | "keras_env = Environment.from_conda_specification(name = 'keras-env', file_path = './conda_dependencies.yml')" 443 | ] 444 | }, 445 | { 446 | "cell_type": "code", 447 | "execution_count": null, 448 | "metadata": {}, 449 | "outputs": [], 450 | "source": [ 451 | "train_src = ScriptRunConfig(source_directory=script_folder,\n", 452 | " script='train.py',\n", 453 | " compute_target=compute_target,\n", 454 | " environment=keras_env)" 455 | ] 456 | }, 457 | { 458 | "cell_type": "markdown", 459 | "metadata": {}, 460 | "source": [ 461 | "Pass the run configuration details into the PythonScriptStep." 462 | ] 463 | }, 464 | { 465 | "cell_type": "code", 466 | "execution_count": null, 467 | "metadata": {}, 468 | "outputs": [], 469 | "source": [ 470 | "train_step = PythonScriptStep(name='train step',\n", 471 | " arguments=[prepared_fashion_ds.read_delimited_files().as_input(name='prepared_fashion_ds')],\n", 472 | " source_directory=train_src.source_directory,\n", 473 | " script_name=train_src.script,\n", 474 | " runconfig=train_src.run_config)" 475 | ] 476 | }, 477 | { 478 | "cell_type": "markdown", 479 | "metadata": {}, 480 | "source": [ 481 | "### Build the pipeline\n", 482 | "Once we have the steps (or steps collection), we can build the [pipeline](https://docs.microsoft.com/python/api/azureml-pipeline-core/azureml.pipeline.core.pipeline.pipeline?view=azure-ml-py).\n", 483 | "\n", 484 | "A pipeline is created with a list of steps and a workspace. Submit a pipeline using [submit](https://docs.microsoft.com/python/api/azureml-core/azureml.core.experiment(class)?view=azure-ml-py#submit-config--tags-none----kwargs-). When submit is called, a [PipelineRun](https://docs.microsoft.com/python/api/azureml-pipeline-core/azureml.pipeline.core.pipelinerun?view=azure-ml-py) is created which in turn creates [StepRun](https://docs.microsoft.com/python/api/azureml-pipeline-core/azureml.pipeline.core.steprun?view=azure-ml-py) objects for each step in the workflow." 485 | ] 486 | }, 487 | { 488 | "cell_type": "code", 489 | "execution_count": null, 490 | "metadata": {}, 491 | "outputs": [], 492 | "source": [ 493 | "# build pipeline & run experiment\n", 494 | "pipeline = Pipeline(workspace, steps=[prep_step, train_step])\n", 495 | "run = exp.submit(pipeline)" 496 | ] 497 | }, 498 | { 499 | "cell_type": "markdown", 500 | "metadata": {}, 501 | "source": [ 502 | "### Monitor the PipelineRun" 503 | ] 504 | }, 505 | { 506 | "cell_type": "code", 507 | "execution_count": null, 508 | "metadata": { 509 | "inputHidden": false, 510 | "outputHidden": false 511 | }, 512 | "outputs": [], 513 | "source": [ 514 | "run.wait_for_completion(show_output=True)" 515 | ] 516 | }, 517 | { 518 | "cell_type": "code", 519 | "execution_count": null, 520 | "metadata": {}, 521 | "outputs": [], 522 | "source": [ 523 | "run.find_step_run('train step')[0].get_metrics()" 524 | ] 525 | }, 526 | { 527 | "cell_type": "markdown", 528 | "metadata": {}, 529 | "source": [ 530 | "## Register the input dataset and the output model" 531 | ] 532 | }, 533 | { 534 | "cell_type": "markdown", 535 | "metadata": {}, 536 | "source": [ 537 | "Azure Machine Learning dataset makes it easy to trace how your data is used in ML. [Learn More](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-version-track-datasets#track-datasets-in-experiments)
\n", 538 | "For each Machine Learning experiment, you can easily trace the datasets used as the input through `Run` object." 539 | ] 540 | }, 541 | { 542 | "cell_type": "code", 543 | "execution_count": null, 544 | "metadata": {}, 545 | "outputs": [], 546 | "source": [ 547 | "# get input tabular datasets to train step\n", 548 | "train_step = run.find_step_run('train step')[0]\n", 549 | "inputs = train_step.get_details()['inputDatasets']\n", 550 | "input_dataset = inputs[0]['dataset']\n", 551 | "\n", 552 | "input_dataset.take(3).to_pandas_dataframe()" 553 | ] 554 | }, 555 | { 556 | "cell_type": "markdown", 557 | "metadata": {}, 558 | "source": [ 559 | "Register the prepared Fashion MNIST TabularDataset with the workspace so that you can reuse it in other experiments or share it with your colleagues who have access to your workspace." 560 | ] 561 | }, 562 | { 563 | "cell_type": "code", 564 | "execution_count": null, 565 | "metadata": {}, 566 | "outputs": [], 567 | "source": [ 568 | "tabular_prepared_ds = input_dataset.register(workspace = workspace,\n", 569 | " name = 'tabular_prepared_ds',\n", 570 | " description = 'prepared ds in tabular format',\n", 571 | " create_new_version = True)\n", 572 | "tabular_prepared_ds" 573 | ] 574 | }, 575 | { 576 | "cell_type": "markdown", 577 | "metadata": {}, 578 | "source": [ 579 | "Register the output model with dataset" 580 | ] 581 | }, 582 | { 583 | "cell_type": "code", 584 | "execution_count": null, 585 | "metadata": {}, 586 | "outputs": [], 587 | "source": [ 588 | "run.find_step_run('train step')[0].register_model(model_name = 'keras-model', model_path = 'outputs/model/',\n", 589 | " datasets=[('training data', tabular_prepared_ds)])" 590 | ] 591 | } 592 | ], 593 | "metadata": { 594 | "authors": [ 595 | { 596 | "name": "sihhu" 597 | } 598 | ], 599 | "category": "tutorial", 600 | "compute": [ 601 | "Remote" 602 | ], 603 | "datasets": [ 604 | "Fashion MNIST" 605 | ], 606 | "deployment": [ 607 | "None" 608 | ], 609 | "exclude_from_index": false, 610 | "framework": [ 611 | "Azure ML" 612 | ], 613 | "friendly_name": "Datasets with ML Pipeline", 614 | "index_order": 1, 615 | "kernel_info": { 616 | "name": "python3-azureml" 617 | }, 618 | "kernelspec": { 619 | "display_name": "Python 3", 620 | "language": "python", 621 | "name": "python3" 622 | }, 623 | "language_info": { 624 | "codemirror_mode": { 625 | "name": "ipython", 626 | "version": 3 627 | }, 628 | "file_extension": ".py", 629 | "mimetype": "text/x-python", 630 | "name": "python", 631 | "nbconvert_exporter": "python", 632 | "pygments_lexer": "ipython3", 633 | "version": "3.7.9" 634 | }, 635 | "nteract": { 636 | "version": "nteract-front-end@1.0.0" 637 | }, 638 | "star_tag": [ 639 | "featured" 640 | ], 641 | "tags": [ 642 | "Dataset", 643 | "Pipeline", 644 | "Estimator", 645 | "ScriptRun" 646 | ], 647 | "task": "Train" 648 | }, 649 | "nbformat": 4, 650 | "nbformat_minor": 4 651 | } 652 | -------------------------------------------------------------------------------- /compute-identity/train-with-estimator/conda_dependencies.yml: -------------------------------------------------------------------------------- 1 | 2 | dependencies: 3 | - python=3.6.2 4 | - scikit-learn 5 | - pip: 6 | - pandas 7 | - azureml-defaults 8 | -------------------------------------------------------------------------------- /compute-identity/train-with-estimator/grantaccess.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MayMSFT/identity-based-data-access/9f2482a917517dddbeff9b8e34ead020c75713eb/compute-identity/train-with-estimator/grantaccess.jpg -------------------------------------------------------------------------------- /compute-identity/train-with-estimator/identity-based-data-access-with-compute-identity.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "Copyright (c) Microsoft Corporation. All rights reserved.\n", 8 | "\n", 9 | "Licensed under the MIT License [2017] Zalando SE, https://tech.zalando.com" 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "metadata": {}, 15 | "source": [ 16 | "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/work-with-data/datasets-tutorial/pipeline-with-datasets/pipeline-for-image-classification.png)" 17 | ] 18 | }, 19 | { 20 | "cell_type": "markdown", 21 | "metadata": {}, 22 | "source": [ 23 | "# Identity based data access with compute identity\n", 24 | "\n", 25 | "## Introduction\n", 26 | "This tutorial shows how to setup compute and datastore for identitiy based data access.\n", 27 | "\n", 28 | "Learn how to:\n", 29 | "\n", 30 | "> * Create compute with managed identity.\n", 31 | "> * Interact with dataset using users identity\n", 32 | "> * Submit remote training using compute identity for data access\n", 33 | "\n", 34 | "## Prerequisite:\n", 35 | "* Understand the [architecture and terms](https://docs.microsoft.com/azure/machine-learning/service/concept-azure-machine-learning-architecture) introduced by Azure Machine Learning\n", 36 | "* If you are using an Azure Machine Learning Notebook VM, you are all set. Otherwise, go through the [configuration notebook](../../../configuration.ipynb) to:\n", 37 | " * install the latest version of AzureML SDK. No private build is requried to use identity based data access with compute identity\n", 38 | " * create a workspace and its configuration file (`config.json`)" 39 | ] 40 | }, 41 | { 42 | "cell_type": "code", 43 | "execution_count": null, 44 | "metadata": {}, 45 | "outputs": [], 46 | "source": [ 47 | "# install latest version of AzureML SDK\n", 48 | "!pip install -U azureml-sdk" 49 | ] 50 | }, 51 | { 52 | "cell_type": "code", 53 | "execution_count": null, 54 | "metadata": {}, 55 | "outputs": [], 56 | "source": [ 57 | "!pip install pandas pyarrow" 58 | ] 59 | }, 60 | { 61 | "cell_type": "markdown", 62 | "metadata": {}, 63 | "source": [ 64 | "## Set up your development environment\n", 65 | "\n", 66 | "All the setup for your development work can be accomplished in a Python notebook. Setup includes:\n", 67 | "\n", 68 | "* Importing Python packages\n", 69 | "* Connecting to a workspace to enable communication between your local computer and remote resources\n", 70 | "* Creating an experiment to track all your runs\n", 71 | "* Creating a remote compute target to use for training\n", 72 | "\n", 73 | "### Import packages\n", 74 | "\n", 75 | "Import Python packages you need in this session. Also display the Azure Machine Learning SDK version." 76 | ] 77 | }, 78 | { 79 | "cell_type": "code", 80 | "execution_count": null, 81 | "metadata": {}, 82 | "outputs": [], 83 | "source": [ 84 | "import os\n", 85 | "import azureml.core\n", 86 | "from azureml.core import Workspace, Dataset, Datastore, ComputeTarget, RunConfiguration, Experiment\n", 87 | "from azureml.core.runconfig import CondaDependencies\n", 88 | "\n", 89 | "# check core SDK version number\n", 90 | "print(\"Azure ML SDK Version: \", azureml.core.VERSION)" 91 | ] 92 | }, 93 | { 94 | "cell_type": "markdown", 95 | "metadata": {}, 96 | "source": [ 97 | "### Connect to workspace\n", 98 | "\n", 99 | "Create a workspace object from the existing workspace. `Workspace.from_config()` reads the file **config.json** and loads the details into an object named `workspace`." 100 | ] 101 | }, 102 | { 103 | "cell_type": "code", 104 | "execution_count": null, 105 | "metadata": {}, 106 | "outputs": [], 107 | "source": [ 108 | "workspace = Workspace.from_config()\n", 109 | "print('Workspace name: ' + workspace.name, \n", 110 | " 'Azure region: ' + workspace.location, \n", 111 | " 'Subscription id: ' + workspace.subscription_id, \n", 112 | " 'Resource group: ' + workspace.resource_group, sep='\\n')" 113 | ] 114 | }, 115 | { 116 | "cell_type": "markdown", 117 | "metadata": {}, 118 | "source": [ 119 | "### Create experiment and a directory\n", 120 | "\n", 121 | "Create an experiment to track the runs in your workspace and a directory to deliver the necessary code from your computer to the remote resource." 122 | ] 123 | }, 124 | { 125 | "cell_type": "code", 126 | "execution_count": null, 127 | "metadata": {}, 128 | "outputs": [], 129 | "source": [ 130 | "# create an ML experiment\n", 131 | "exp = Experiment(workspace=workspace, name='iris')\n", 132 | "\n", 133 | "# create a directory\n", 134 | "script_folder = './iris-train'\n", 135 | "os.makedirs(script_folder, exist_ok=True)" 136 | ] 137 | }, 138 | { 139 | "cell_type": "markdown", 140 | "metadata": {}, 141 | "source": [ 142 | "### Create AzureML compute resource with system assigned identity\n", 143 | "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", 144 | "\n", 145 | "To provision the compute with identity:\n", 146 | "* `identity_type`: Compute Identity type that you want to set on the cluster, which can either be SystemAssigned or UserAssigned\n", 147 | "* `identity_id`: List of resource ID of identity in case it is a UserAssigned identity, optional otherwise. To get identity_id of your managed identity, run the following command:\n", 148 | "`az identity show --resource-group yourRGName --name yourIdentityName`\n", 149 | "\n", 150 | "**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." 151 | ] 152 | }, 153 | { 154 | "cell_type": "code", 155 | "execution_count": null, 156 | "metadata": {}, 157 | "outputs": [], 158 | "source": [ 159 | "from azureml.core.compute import ComputeTarget, AmlCompute\n", 160 | "from azureml.core.compute_target import ComputeTargetException\n", 161 | "\n", 162 | "# choose a name for your cluster\n", 163 | "cluster_name = \"identitycomp3\"\n", 164 | "\n", 165 | "try:\n", 166 | " compute_target = ComputeTarget(workspace=workspace, name=cluster_name)\n", 167 | " print('Found existing compute target')\n", 168 | "except ComputeTargetException:\n", 169 | " print('Creating a new compute target...')\n", 170 | " compute_config = AmlCompute.provisioning_configuration(vm_size='Standard_D3_v2', \n", 171 | " max_nodes=4,\n", 172 | " identity_type='SystemAssigned')\n", 173 | "\n", 174 | " # create the cluster\n", 175 | " compute_target = ComputeTarget.create(workspace, cluster_name, compute_config)\n", 176 | "\n", 177 | " # can poll for a minimum number of nodes and for a specific timeout. \n", 178 | " # if no min node count is provided it uses the scale settings for the cluster\n", 179 | " compute_target.wait_for_completion(show_output=True, min_node_count=None, timeout_in_minutes=20)\n", 180 | "\n", 181 | "# use get_status() to get a detailed status for the current cluster. \n", 182 | "print(compute_target.get_status().serialize())" 183 | ] 184 | }, 185 | { 186 | "cell_type": "markdown", 187 | "metadata": {}, 188 | "source": [ 189 | "## Create datastore without credentials\n", 190 | "For datastores without credentials:\n", 191 | "1. If you are interacting with the datastore/dataset on your local laptop (e.g. using notebook), you will be prompt to login and your identity will be used for data access authentication.\n", 192 | "2. If you submit an azureML experiment with an AML Compute as compute target, the identity of the compute will be used for data access authentication.\n", 193 | "\n", 194 | "Therefore, make sure you grant your user identity and the compute identity access to your storage account. We support Azure Blob, ADLS Gen1, ADLS Gen2 for private preview. " 195 | ] 196 | }, 197 | { 198 | "cell_type": "code", 199 | "execution_count": null, 200 | "metadata": {}, 201 | "outputs": [], 202 | "source": [ 203 | "# create blob datatastore without credentials\n", 204 | "blob_dstore = Datastore.register_azure_blob_container(workspace=workspace,\n", 205 | " datastore_name='credentialless_mayblob',\n", 206 | " container_name='openhack',\n", 207 | " account_name='mayworkspace8597807414')" 208 | ] 209 | }, 210 | { 211 | "cell_type": "code", 212 | "execution_count": null, 213 | "metadata": {}, 214 | "outputs": [], 215 | "source": [ 216 | "# create adls gen1 without credentials\n", 217 | "adls_dstore = Datastore.register_azure_data_lake(workspace = workspace,\n", 218 | " datastore_name='credentialless_adls1',\n", 219 | " store_name='rozh')" 220 | ] 221 | }, 222 | { 223 | "cell_type": "code", 224 | "execution_count": null, 225 | "metadata": {}, 226 | "outputs": [], 227 | "source": [ 228 | "# createn adls2 datastore without credentials\n", 229 | "adls2_dstore = Datastore.register_azure_data_lake_gen2(workspace=workspace, \n", 230 | " datastore_name='credentialless_adls2', \n", 231 | " filesystem='tabular', \n", 232 | " account_name='mayadls2') " 233 | ] 234 | }, 235 | { 236 | "cell_type": "markdown", 237 | "metadata": {}, 238 | "source": [ 239 | "## Interact with data in notebook\n", 240 | "Dataset is the recommended approach to interact with data in AzureML. You can download, mount or load dataset into common dataframe. [Lear More](https://docs.microsoft.com/azure/machine-learning/how-to-create-register-datasets)\n", 241 | "\n", 242 | "Your identity will be used for data access. For blob and ADLSGen 2, Make sure you have **blob data reader role** to read data from the resource or **blob data contributor role** if you plan to write data back to the storage account. " 243 | ] 244 | }, 245 | { 246 | "cell_type": "code", 247 | "execution_count": null, 248 | "metadata": {}, 249 | "outputs": [], 250 | "source": [ 251 | "# create tabulardataset from the credential-less blobdatastore\n", 252 | "# if your datastore is behind vnet. Make sure the compute (e.g. compute instance) you are running the following code is behind the same vnet\n", 253 | "blob_ds = Dataset.Tabular.from_delimited_files((blob_dstore,'test.csv'))" 254 | ] 255 | }, 256 | { 257 | "cell_type": "code", 258 | "execution_count": null, 259 | "metadata": {}, 260 | "outputs": [], 261 | "source": [ 262 | "blob_ds.take(5).to_pandas_dataframe()" 263 | ] 264 | }, 265 | { 266 | "cell_type": "code", 267 | "execution_count": null, 268 | "metadata": {}, 269 | "outputs": [], 270 | "source": [ 271 | "# create filedataset from the credential-less adlsgen2 datastore \n", 272 | "adls2_ds = Dataset.File.from_files((adls2_dstore,'updates_ca.csv'))\n", 273 | "adls2_ds.to_path()" 274 | ] 275 | }, 276 | { 277 | "cell_type": "markdown", 278 | "metadata": {}, 279 | "source": [ 280 | "## Create the iris dataset\n", 281 | "\n", 282 | "By creating a dataset, you create a reference to the data source location. If you applied any subsetting transformations to the dataset, they will be stored in the dataset as well. The data remains in its existing location, so no extra storage cost is incurred. \n", 283 | "\n", 284 | "We will now upload the [Iris data](./train-dataset/Iris.csv) to a credentialess blob datastore within your workspace." 285 | ] 286 | }, 287 | { 288 | "cell_type": "code", 289 | "execution_count": null, 290 | "metadata": {}, 291 | "outputs": [], 292 | "source": [ 293 | "import pandas as pd\n", 294 | "df = pd.read_csv(\"./iris-train/iris.csv\")\n", 295 | "df.head(3)" 296 | ] 297 | }, 298 | { 299 | "cell_type": "code", 300 | "execution_count": null, 301 | "metadata": {}, 302 | "outputs": [], 303 | "source": [ 304 | "from azureml.core import Dataset\n", 305 | "# this is a new API to directly create Tabulardataset from pandas dataframe\n", 306 | "dataset = Dataset.Tabular.register_pandas_dataframe(df, target=(blob_dstore, \"iris\"), name='iris_train', show_progress=True)" 307 | ] 308 | }, 309 | { 310 | "cell_type": "markdown", 311 | "metadata": {}, 312 | "source": [ 313 | "### Create a training script\n", 314 | "\n", 315 | "To submit the job to the cluster, first create a training script. Run the following code to create the training script called `train_iris.py` in the script_folder. " 316 | ] 317 | }, 318 | { 319 | "cell_type": "code", 320 | "execution_count": null, 321 | "metadata": {}, 322 | "outputs": [], 323 | "source": [ 324 | "%%writefile $script_folder/train_iris.py\n", 325 | "\n", 326 | "import os\n", 327 | "import joblib\n", 328 | "\n", 329 | "from azureml.core import Dataset, Run\n", 330 | "from sklearn.model_selection import train_test_split\n", 331 | "from sklearn.tree import DecisionTreeClassifier\n", 332 | "\n", 333 | "\n", 334 | "run = Run.get_context()\n", 335 | "# get input dataset by name\n", 336 | "dataset = run.input_datasets['iris']\n", 337 | "\n", 338 | "df = dataset.to_pandas_dataframe()\n", 339 | "\n", 340 | "x_col = ['sepal_length', 'sepal_width', 'petal_length', 'petal_width']\n", 341 | "y_col = ['species']\n", 342 | "x_df = df.loc[:, x_col]\n", 343 | "y_df = df.loc[:, y_col]\n", 344 | "\n", 345 | "#dividing X,y into train and test data\n", 346 | "x_train, x_test, y_train, y_test = train_test_split(x_df, y_df, test_size=0.2, random_state=223)\n", 347 | "\n", 348 | "data = {'train': {'X': x_train, 'y': y_train},\n", 349 | "\n", 350 | " 'test': {'X': x_test, 'y': y_test}}\n", 351 | "\n", 352 | "clf = DecisionTreeClassifier().fit(data['train']['X'], data['train']['y'])\n", 353 | "model_file_name = 'decision_tree.pkl'\n", 354 | "\n", 355 | "print('Accuracy of Decision Tree classifier on training set: {:.2f}'.format(clf.score(x_train, y_train)))\n", 356 | "print('Accuracy of Decision Tree classifier on test set: {:.2f}'.format(clf.score(x_test, y_test)))\n", 357 | "\n", 358 | "os.makedirs('./outputs', exist_ok=True)\n", 359 | "with open(model_file_name, 'wb') as file:\n", 360 | " joblib.dump(value=clf, filename='outputs/' + model_file_name)" 361 | ] 362 | }, 363 | { 364 | "cell_type": "markdown", 365 | "metadata": {}, 366 | "source": [ 367 | "### Grant data access to compute identity" 368 | ] 369 | }, 370 | { 371 | "cell_type": "markdown", 372 | "metadata": {}, 373 | "source": [ 374 | "In remote trainig, the identity of the compute will be used to access data. Make sure your compute identity has blob data reader or contributor role to your storage service. If you choose system assigned identity when creating the compute, your compute identity name will be the following:" 375 | ] 376 | }, 377 | { 378 | "cell_type": "code", 379 | "execution_count": null, 380 | "metadata": {}, 381 | "outputs": [], 382 | "source": [ 383 | "\"{}/computes/{}\".format(workspace.name, cluster_name)" 384 | ] 385 | }, 386 | { 387 | "cell_type": "markdown", 388 | "metadata": {}, 389 | "source": [ 390 | "You can go to portal to grant data access to this compute identity.\n", 391 | "![image](grantaccess.jpg)" 392 | ] 393 | }, 394 | { 395 | "cell_type": "markdown", 396 | "metadata": {}, 397 | "source": [ 398 | "### Create an environment\n", 399 | "\n", 400 | "Define a conda environment YAML file with your training script dependencies and create an Azure ML environment." 401 | ] 402 | }, 403 | { 404 | "cell_type": "code", 405 | "execution_count": null, 406 | "metadata": {}, 407 | "outputs": [], 408 | "source": [ 409 | "%%writefile conda_dependencies.yml\n", 410 | "\n", 411 | "dependencies:\n", 412 | "- python=3.6.2\n", 413 | "- scikit-learn\n", 414 | "- pip:\n", 415 | " - pandas\n", 416 | " - azureml-defaults" 417 | ] 418 | }, 419 | { 420 | "cell_type": "markdown", 421 | "metadata": {}, 422 | "source": [ 423 | "### Configure training run\n", 424 | "\n", 425 | "A ScriptRunConfig object specifies the configuration details of your training job, including your training script, environment to use, and the compute target to run on. Specify the following in your script run configuration:\n", 426 | "* The directory that contains your scripts. All the files in this directory are uploaded into the cluster nodes for execution. \n", 427 | "* The training script name, train_iris.py\n", 428 | "* The input dataset for training, passed as an argument to your training script. `as_named_input()` is required so that the input dataset can be referenced by the assigned name in your training script. \n", 429 | "* The compute target. In this case you will use the AmlCompute you created\n", 430 | "* The environment definition for the experiment" 431 | ] 432 | }, 433 | { 434 | "cell_type": "code", 435 | "execution_count": null, 436 | "metadata": {}, 437 | "outputs": [], 438 | "source": [ 439 | "from azureml.core import Environment\n", 440 | "\n", 441 | "sklearn_env = Environment.from_conda_specification(name = 'sklearn-env', file_path = './conda_dependencies.yml')" 442 | ] 443 | }, 444 | { 445 | "cell_type": "code", 446 | "execution_count": null, 447 | "metadata": {}, 448 | "outputs": [], 449 | "source": [ 450 | "from azureml.core import ScriptRunConfig\n", 451 | "\n", 452 | "src = ScriptRunConfig(source_directory=script_folder,\n", 453 | " script='train_iris.py',\n", 454 | " arguments=[dataset.as_named_input('iris')],\n", 455 | " compute_target=compute_target,\n", 456 | " environment=sklearn_env)" 457 | ] 458 | }, 459 | { 460 | "cell_type": "markdown", 461 | "metadata": {}, 462 | "source": [ 463 | "### Submit job to run\n", 464 | "Submit the estimator to the Azure ML experiment to kick off the execution." 465 | ] 466 | }, 467 | { 468 | "cell_type": "code", 469 | "execution_count": null, 470 | "metadata": {}, 471 | "outputs": [], 472 | "source": [ 473 | "run = exp.submit(src)" 474 | ] 475 | }, 476 | { 477 | "cell_type": "code", 478 | "execution_count": null, 479 | "metadata": {}, 480 | "outputs": [], 481 | "source": [ 482 | "run.wait_for_completion(show_output=True)" 483 | ] 484 | } 485 | ], 486 | "metadata": { 487 | "authors": [ 488 | { 489 | "name": "sihhu" 490 | } 491 | ], 492 | "category": "tutorial", 493 | "compute": [ 494 | "Remote" 495 | ], 496 | "datasets": [ 497 | "Fashion MNIST" 498 | ], 499 | "deployment": [ 500 | "None" 501 | ], 502 | "exclude_from_index": false, 503 | "framework": [ 504 | "Azure ML" 505 | ], 506 | "friendly_name": "Datasets with ML Pipeline", 507 | "index_order": 1, 508 | "kernelspec": { 509 | "display_name": "Python 3", 510 | "language": "python", 511 | "name": "python3" 512 | }, 513 | "language_info": { 514 | "codemirror_mode": { 515 | "name": "ipython", 516 | "version": 3 517 | }, 518 | "file_extension": ".py", 519 | "mimetype": "text/x-python", 520 | "name": "python", 521 | "nbconvert_exporter": "python", 522 | "pygments_lexer": "ipython3", 523 | "version": "3.7.9" 524 | }, 525 | "nteract": { 526 | "version": "nteract-front-end@1.0.0" 527 | }, 528 | "star_tag": [ 529 | "featured" 530 | ], 531 | "tags": [ 532 | "Dataset", 533 | "Pipeline", 534 | "Estimator", 535 | "ScriptRun" 536 | ], 537 | "task": "Train" 538 | }, 539 | "nbformat": 4, 540 | "nbformat_minor": 4 541 | } 542 | -------------------------------------------------------------------------------- /compute-identity/train-with-estimator/iris-train/iris.csv: -------------------------------------------------------------------------------- 1 | sepal_length,sepal_width,petal_length,petal_width,species 2 | 5.1,3.5,1.4,0.2,Iris-setosa 3 | 4.9,3,1.4,0.2,Iris-setosa 4 | 4.7,3.2,1.3,0.2,Iris-setosa 5 | 4.6,3.1,1.5,0.2,Iris-setosa 6 | 5,3.6,1.4,0.2,Iris-setosa 7 | 5.4,3.9,1.7,0.4,Iris-setosa 8 | 4.6,3.4,1.4,0.3,Iris-setosa 9 | 5,3.4,1.5,0.2,Iris-setosa 10 | 4.4,2.9,1.4,0.2,Iris-setosa 11 | 4.9,3.1,1.5,0.1,Iris-setosa 12 | 5.4,3.7,1.5,0.2,Iris-setosa 13 | 4.8,3.4,1.6,0.2,Iris-setosa 14 | 4.8,3,1.4,0.1,Iris-setosa 15 | 4.3,3,1.1,0.1,Iris-setosa 16 | 5.8,4,1.2,0.2,Iris-setosa 17 | 5.7,4.4,1.5,0.4,Iris-setosa 18 | 5.4,3.9,1.3,0.4,Iris-setosa 19 | 5.1,3.5,1.4,0.3,Iris-setosa 20 | 5.7,3.8,1.7,0.3,Iris-setosa 21 | 5.1,3.8,1.5,0.3,Iris-setosa 22 | 5.4,3.4,1.7,0.2,Iris-setosa 23 | 5.1,3.7,1.5,0.4,Iris-setosa 24 | 4.6,3.6,1,0.2,Iris-setosa 25 | 5.1,3.3,1.7,0.5,Iris-setosa 26 | 4.8,3.4,1.9,0.2,Iris-setosa 27 | 5,3,1.6,0.2,Iris-setosa 28 | 5,3.4,1.6,0.4,Iris-setosa 29 | 5.2,3.5,1.5,0.2,Iris-setosa 30 | 5.2,3.4,1.4,0.2,Iris-setosa 31 | 4.7,3.2,1.6,0.2,Iris-setosa 32 | 4.8,3.1,1.6,0.2,Iris-setosa 33 | 5.4,3.4,1.5,0.4,Iris-setosa 34 | 5.2,4.1,1.5,0.1,Iris-setosa 35 | 5.5,4.2,1.4,0.2,Iris-setosa 36 | 4.9,3.1,1.5,0.1,Iris-setosa 37 | 5,3.2,1.2,0.2,Iris-setosa 38 | 5.5,3.5,1.3,0.2,Iris-setosa 39 | 4.9,3.1,1.5,0.1,Iris-setosa 40 | 4.4,3,1.3,0.2,Iris-setosa 41 | 5.1,3.4,1.5,0.2,Iris-setosa 42 | 5,3.5,1.3,0.3,Iris-setosa 43 | 4.5,2.3,1.3,0.3,Iris-setosa 44 | 4.4,3.2,1.3,0.2,Iris-setosa 45 | 5,3.5,1.6,0.6,Iris-setosa 46 | 5.1,3.8,1.9,0.4,Iris-setosa 47 | 4.8,3,1.4,0.3,Iris-setosa 48 | 5.1,3.8,1.6,0.2,Iris-setosa 49 | 4.6,3.2,1.4,0.2,Iris-setosa 50 | 5.3,3.7,1.5,0.2,Iris-setosa 51 | 5,3.3,1.4,0.2,Iris-setosa 52 | 7,3.2,4.7,1.4,Iris-versicolor 53 | 6.4,3.2,4.5,1.5,Iris-versicolor 54 | 6.9,3.1,4.9,1.5,Iris-versicolor 55 | 5.5,2.3,4,1.3,Iris-versicolor 56 | 6.5,2.8,4.6,1.5,Iris-versicolor 57 | 5.7,2.8,4.5,1.3,Iris-versicolor 58 | 6.3,3.3,4.7,1.6,Iris-versicolor 59 | 4.9,2.4,3.3,1,Iris-versicolor 60 | 6.6,2.9,4.6,1.3,Iris-versicolor 61 | 5.2,2.7,3.9,1.4,Iris-versicolor 62 | 5,2,3.5,1,Iris-versicolor 63 | 5.9,3,4.2,1.5,Iris-versicolor 64 | 6,2.2,4,1,Iris-versicolor 65 | 6.1,2.9,4.7,1.4,Iris-versicolor 66 | 5.6,2.9,3.6,1.3,Iris-versicolor 67 | 6.7,3.1,4.4,1.4,Iris-versicolor 68 | 5.6,3,4.5,1.5,Iris-versicolor 69 | 5.8,2.7,4.1,1,Iris-versicolor 70 | 6.2,2.2,4.5,1.5,Iris-versicolor 71 | 5.6,2.5,3.9,1.1,Iris-versicolor 72 | 5.9,3.2,4.8,1.8,Iris-versicolor 73 | 6.1,2.8,4,1.3,Iris-versicolor 74 | 6.3,2.5,4.9,1.5,Iris-versicolor 75 | 6.1,2.8,4.7,1.2,Iris-versicolor 76 | 6.4,2.9,4.3,1.3,Iris-versicolor 77 | 6.6,3,4.4,1.4,Iris-versicolor 78 | 6.8,2.8,4.8,1.4,Iris-versicolor 79 | 6.7,3,5,1.7,Iris-versicolor 80 | 6,2.9,4.5,1.5,Iris-versicolor 81 | 5.7,2.6,3.5,1,Iris-versicolor 82 | 5.5,2.4,3.8,1.1,Iris-versicolor 83 | 5.5,2.4,3.7,1,Iris-versicolor 84 | 5.8,2.7,3.9,1.2,Iris-versicolor 85 | 6,2.7,5.1,1.6,Iris-versicolor 86 | 5.4,3,4.5,1.5,Iris-versicolor 87 | 6,3.4,4.5,1.6,Iris-versicolor 88 | 6.7,3.1,4.7,1.5,Iris-versicolor 89 | 6.3,2.3,4.4,1.3,Iris-versicolor 90 | 5.6,3,4.1,1.3,Iris-versicolor 91 | 5.5,2.5,4,1.3,Iris-versicolor 92 | 5.5,2.6,4.4,1.2,Iris-versicolor 93 | 6.1,3,4.6,1.4,Iris-versicolor 94 | 5.8,2.6,4,1.2,Iris-versicolor 95 | 5,2.3,3.3,1,Iris-versicolor 96 | 5.6,2.7,4.2,1.3,Iris-versicolor 97 | 5.7,3,4.2,1.2,Iris-versicolor 98 | 5.7,2.9,4.2,1.3,Iris-versicolor 99 | 6.2,2.9,4.3,1.3,Iris-versicolor 100 | 5.1,2.5,3,1.1,Iris-versicolor 101 | 5.7,2.8,4.1,1.3,Iris-versicolor 102 | 6.3,3.3,6,2.5,Iris-virginica 103 | 5.8,2.7,5.1,1.9,Iris-virginica 104 | 7.1,3,5.9,2.1,Iris-virginica 105 | 6.3,2.9,5.6,1.8,Iris-virginica 106 | 6.5,3,5.8,2.2,Iris-virginica 107 | 7.6,3,6.6,2.1,Iris-virginica 108 | 4.9,2.5,4.5,1.7,Iris-virginica 109 | 7.3,2.9,6.3,1.8,Iris-virginica 110 | 6.7,2.5,5.8,1.8,Iris-virginica 111 | 7.2,3.6,6.1,2.5,Iris-virginica 112 | 6.5,3.2,5.1,2,Iris-virginica 113 | 6.4,2.7,5.3,1.9,Iris-virginica 114 | 6.8,3,5.5,2.1,Iris-virginica 115 | 5.7,2.5,5,2,Iris-virginica 116 | 5.8,2.8,5.1,2.4,Iris-virginica 117 | 6.4,3.2,5.3,2.3,Iris-virginica 118 | 6.5,3,5.5,1.8,Iris-virginica 119 | 7.7,3.8,6.7,2.2,Iris-virginica 120 | 7.7,2.6,6.9,2.3,Iris-virginica 121 | 6,2.2,5,1.5,Iris-virginica 122 | 6.9,3.2,5.7,2.3,Iris-virginica 123 | 5.6,2.8,4.9,2,Iris-virginica 124 | 7.7,2.8,6.7,2,Iris-virginica 125 | 6.3,2.7,4.9,1.8,Iris-virginica 126 | 6.7,3.3,5.7,2.1,Iris-virginica 127 | 7.2,3.2,6,1.8,Iris-virginica 128 | 6.2,2.8,4.8,1.8,Iris-virginica 129 | 6.1,3,4.9,1.8,Iris-virginica 130 | 6.4,2.8,5.6,2.1,Iris-virginica 131 | 7.2,3,5.8,1.6,Iris-virginica 132 | 7.4,2.8,6.1,1.9,Iris-virginica 133 | 7.9,3.8,6.4,2,Iris-virginica 134 | 6.4,2.8,5.6,2.2,Iris-virginica 135 | 6.3,2.8,5.1,1.5,Iris-virginica 136 | 6.1,2.6,5.6,1.4,Iris-virginica 137 | 7.7,3,6.1,2.3,Iris-virginica 138 | 6.3,3.4,5.6,2.4,Iris-virginica 139 | 6.4,3.1,5.5,1.8,Iris-virginica 140 | 6,3,4.8,1.8,Iris-virginica 141 | 6.9,3.1,5.4,2.1,Iris-virginica 142 | 6.7,3.1,5.6,2.4,Iris-virginica 143 | 6.9,3.1,5.1,2.3,Iris-virginica 144 | 5.8,2.7,5.1,1.9,Iris-virginica 145 | 6.8,3.2,5.9,2.3,Iris-virginica 146 | 6.7,3.3,5.7,2.5,Iris-virginica 147 | 6.7,3,5.2,2.3,Iris-virginica 148 | 6.3,2.5,5,1.9,Iris-virginica 149 | 6.5,3,5.2,2,Iris-virginica 150 | 6.2,3.4,5.4,2.3,Iris-virginica 151 | 5.9,3,5.1,1.8,Iris-virginica 152 | -------------------------------------------------------------------------------- /compute-identity/train-with-estimator/iris-train/train_iris.py: -------------------------------------------------------------------------------- 1 | 2 | import os 3 | import joblib 4 | 5 | from azureml.core import Dataset, Run 6 | from sklearn.model_selection import train_test_split 7 | from sklearn.tree import DecisionTreeClassifier 8 | 9 | 10 | run = Run.get_context() 11 | # get input dataset by name 12 | dataset = run.input_datasets['iris'] 13 | 14 | df = dataset.to_pandas_dataframe() 15 | 16 | x_col = ['sepal_length', 'sepal_width', 'petal_length', 'petal_width'] 17 | y_col = ['species'] 18 | x_df = df.loc[:, x_col] 19 | y_df = df.loc[:, y_col] 20 | 21 | #dividing X,y into train and test data 22 | x_train, x_test, y_train, y_test = train_test_split(x_df, y_df, test_size=0.2, random_state=223) 23 | 24 | data = {'train': {'X': x_train, 'y': y_train}, 25 | 26 | 'test': {'X': x_test, 'y': y_test}} 27 | 28 | clf = DecisionTreeClassifier().fit(data['train']['X'], data['train']['y']) 29 | model_file_name = 'decision_tree.pkl' 30 | 31 | print('Accuracy of Decision Tree classifier on training set: {:.2f}'.format(clf.score(x_train, y_train))) 32 | print('Accuracy of Decision Tree classifier on test set: {:.2f}'.format(clf.score(x_test, y_test))) 33 | 34 | os.makedirs('./outputs', exist_ok=True) 35 | with open(model_file_name, 'wb') as file: 36 | joblib.dump(value=clf, filename='outputs/' + model_file_name) 37 | -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "subscription_id": "35f16a99-532a-4a47-9e93-00305f6c40f2", 3 | "resource_group": "maytest", 4 | "workspace_name": "testworkspace" 5 | } -------------------------------------------------------------------------------- /user-identity-passthrough/train-with-dataset/conda_dependencies.yml: -------------------------------------------------------------------------------- 1 | 2 | dependencies: 3 | - python=3.6.2 4 | - scikit-learn 5 | - pip: 6 | - packaging 7 | - nltk 8 | - azureml-core==0.1.0.26419284 9 | - --extra-index-url https://azuremlsdktestpypi.azureedge.net/DataDrift-SDK-Unit/26419284 10 | - azureml-telemetry==1.6.0 11 | - azureml-dataprep[pandas]==2.7.0.dev0+e4ddba8 12 | - --extra-index-url https://dataprepdownloads.azureedge.net/pypi/test-M3ME5B1GMEM3SW0W/26411269/ 13 | - --pre 14 | -------------------------------------------------------------------------------- /user-identity-passthrough/train-with-dataset/roleaccess.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MayMSFT/identity-based-data-access/9f2482a917517dddbeff9b8e34ead020c75713eb/user-identity-passthrough/train-with-dataset/roleaccess.PNG -------------------------------------------------------------------------------- /user-identity-passthrough/train-with-dataset/storageurl.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MayMSFT/identity-based-data-access/9f2482a917517dddbeff9b8e34ead020c75713eb/user-identity-passthrough/train-with-dataset/storageurl.jpg -------------------------------------------------------------------------------- /user-identity-passthrough/train-with-dataset/train-dataset/iris.csv: -------------------------------------------------------------------------------- 1 | sepal_length,sepal_width,petal_length,petal_width,species 2 | 5.1,3.5,1.4,0.2,Iris-setosa 3 | 4.9,3,1.4,0.2,Iris-setosa 4 | 4.7,3.2,1.3,0.2,Iris-setosa 5 | 4.6,3.1,1.5,0.2,Iris-setosa 6 | 5,3.6,1.4,0.2,Iris-setosa 7 | 5.4,3.9,1.7,0.4,Iris-setosa 8 | 4.6,3.4,1.4,0.3,Iris-setosa 9 | 5,3.4,1.5,0.2,Iris-setosa 10 | 4.4,2.9,1.4,0.2,Iris-setosa 11 | 4.9,3.1,1.5,0.1,Iris-setosa 12 | 5.4,3.7,1.5,0.2,Iris-setosa 13 | 4.8,3.4,1.6,0.2,Iris-setosa 14 | 4.8,3,1.4,0.1,Iris-setosa 15 | 4.3,3,1.1,0.1,Iris-setosa 16 | 5.8,4,1.2,0.2,Iris-setosa 17 | 5.7,4.4,1.5,0.4,Iris-setosa 18 | 5.4,3.9,1.3,0.4,Iris-setosa 19 | 5.1,3.5,1.4,0.3,Iris-setosa 20 | 5.7,3.8,1.7,0.3,Iris-setosa 21 | 5.1,3.8,1.5,0.3,Iris-setosa 22 | 5.4,3.4,1.7,0.2,Iris-setosa 23 | 5.1,3.7,1.5,0.4,Iris-setosa 24 | 4.6,3.6,1,0.2,Iris-setosa 25 | 5.1,3.3,1.7,0.5,Iris-setosa 26 | 4.8,3.4,1.9,0.2,Iris-setosa 27 | 5,3,1.6,0.2,Iris-setosa 28 | 5,3.4,1.6,0.4,Iris-setosa 29 | 5.2,3.5,1.5,0.2,Iris-setosa 30 | 5.2,3.4,1.4,0.2,Iris-setosa 31 | 4.7,3.2,1.6,0.2,Iris-setosa 32 | 4.8,3.1,1.6,0.2,Iris-setosa 33 | 5.4,3.4,1.5,0.4,Iris-setosa 34 | 5.2,4.1,1.5,0.1,Iris-setosa 35 | 5.5,4.2,1.4,0.2,Iris-setosa 36 | 4.9,3.1,1.5,0.1,Iris-setosa 37 | 5,3.2,1.2,0.2,Iris-setosa 38 | 5.5,3.5,1.3,0.2,Iris-setosa 39 | 4.9,3.1,1.5,0.1,Iris-setosa 40 | 4.4,3,1.3,0.2,Iris-setosa 41 | 5.1,3.4,1.5,0.2,Iris-setosa 42 | 5,3.5,1.3,0.3,Iris-setosa 43 | 4.5,2.3,1.3,0.3,Iris-setosa 44 | 4.4,3.2,1.3,0.2,Iris-setosa 45 | 5,3.5,1.6,0.6,Iris-setosa 46 | 5.1,3.8,1.9,0.4,Iris-setosa 47 | 4.8,3,1.4,0.3,Iris-setosa 48 | 5.1,3.8,1.6,0.2,Iris-setosa 49 | 4.6,3.2,1.4,0.2,Iris-setosa 50 | 5.3,3.7,1.5,0.2,Iris-setosa 51 | 5,3.3,1.4,0.2,Iris-setosa 52 | 7,3.2,4.7,1.4,Iris-versicolor 53 | 6.4,3.2,4.5,1.5,Iris-versicolor 54 | 6.9,3.1,4.9,1.5,Iris-versicolor 55 | 5.5,2.3,4,1.3,Iris-versicolor 56 | 6.5,2.8,4.6,1.5,Iris-versicolor 57 | 5.7,2.8,4.5,1.3,Iris-versicolor 58 | 6.3,3.3,4.7,1.6,Iris-versicolor 59 | 4.9,2.4,3.3,1,Iris-versicolor 60 | 6.6,2.9,4.6,1.3,Iris-versicolor 61 | 5.2,2.7,3.9,1.4,Iris-versicolor 62 | 5,2,3.5,1,Iris-versicolor 63 | 5.9,3,4.2,1.5,Iris-versicolor 64 | 6,2.2,4,1,Iris-versicolor 65 | 6.1,2.9,4.7,1.4,Iris-versicolor 66 | 5.6,2.9,3.6,1.3,Iris-versicolor 67 | 6.7,3.1,4.4,1.4,Iris-versicolor 68 | 5.6,3,4.5,1.5,Iris-versicolor 69 | 5.8,2.7,4.1,1,Iris-versicolor 70 | 6.2,2.2,4.5,1.5,Iris-versicolor 71 | 5.6,2.5,3.9,1.1,Iris-versicolor 72 | 5.9,3.2,4.8,1.8,Iris-versicolor 73 | 6.1,2.8,4,1.3,Iris-versicolor 74 | 6.3,2.5,4.9,1.5,Iris-versicolor 75 | 6.1,2.8,4.7,1.2,Iris-versicolor 76 | 6.4,2.9,4.3,1.3,Iris-versicolor 77 | 6.6,3,4.4,1.4,Iris-versicolor 78 | 6.8,2.8,4.8,1.4,Iris-versicolor 79 | 6.7,3,5,1.7,Iris-versicolor 80 | 6,2.9,4.5,1.5,Iris-versicolor 81 | 5.7,2.6,3.5,1,Iris-versicolor 82 | 5.5,2.4,3.8,1.1,Iris-versicolor 83 | 5.5,2.4,3.7,1,Iris-versicolor 84 | 5.8,2.7,3.9,1.2,Iris-versicolor 85 | 6,2.7,5.1,1.6,Iris-versicolor 86 | 5.4,3,4.5,1.5,Iris-versicolor 87 | 6,3.4,4.5,1.6,Iris-versicolor 88 | 6.7,3.1,4.7,1.5,Iris-versicolor 89 | 6.3,2.3,4.4,1.3,Iris-versicolor 90 | 5.6,3,4.1,1.3,Iris-versicolor 91 | 5.5,2.5,4,1.3,Iris-versicolor 92 | 5.5,2.6,4.4,1.2,Iris-versicolor 93 | 6.1,3,4.6,1.4,Iris-versicolor 94 | 5.8,2.6,4,1.2,Iris-versicolor 95 | 5,2.3,3.3,1,Iris-versicolor 96 | 5.6,2.7,4.2,1.3,Iris-versicolor 97 | 5.7,3,4.2,1.2,Iris-versicolor 98 | 5.7,2.9,4.2,1.3,Iris-versicolor 99 | 6.2,2.9,4.3,1.3,Iris-versicolor 100 | 5.1,2.5,3,1.1,Iris-versicolor 101 | 5.7,2.8,4.1,1.3,Iris-versicolor 102 | 6.3,3.3,6,2.5,Iris-virginica 103 | 5.8,2.7,5.1,1.9,Iris-virginica 104 | 7.1,3,5.9,2.1,Iris-virginica 105 | 6.3,2.9,5.6,1.8,Iris-virginica 106 | 6.5,3,5.8,2.2,Iris-virginica 107 | 7.6,3,6.6,2.1,Iris-virginica 108 | 4.9,2.5,4.5,1.7,Iris-virginica 109 | 7.3,2.9,6.3,1.8,Iris-virginica 110 | 6.7,2.5,5.8,1.8,Iris-virginica 111 | 7.2,3.6,6.1,2.5,Iris-virginica 112 | 6.5,3.2,5.1,2,Iris-virginica 113 | 6.4,2.7,5.3,1.9,Iris-virginica 114 | 6.8,3,5.5,2.1,Iris-virginica 115 | 5.7,2.5,5,2,Iris-virginica 116 | 5.8,2.8,5.1,2.4,Iris-virginica 117 | 6.4,3.2,5.3,2.3,Iris-virginica 118 | 6.5,3,5.5,1.8,Iris-virginica 119 | 7.7,3.8,6.7,2.2,Iris-virginica 120 | 7.7,2.6,6.9,2.3,Iris-virginica 121 | 6,2.2,5,1.5,Iris-virginica 122 | 6.9,3.2,5.7,2.3,Iris-virginica 123 | 5.6,2.8,4.9,2,Iris-virginica 124 | 7.7,2.8,6.7,2,Iris-virginica 125 | 6.3,2.7,4.9,1.8,Iris-virginica 126 | 6.7,3.3,5.7,2.1,Iris-virginica 127 | 7.2,3.2,6,1.8,Iris-virginica 128 | 6.2,2.8,4.8,1.8,Iris-virginica 129 | 6.1,3,4.9,1.8,Iris-virginica 130 | 6.4,2.8,5.6,2.1,Iris-virginica 131 | 7.2,3,5.8,1.6,Iris-virginica 132 | 7.4,2.8,6.1,1.9,Iris-virginica 133 | 7.9,3.8,6.4,2,Iris-virginica 134 | 6.4,2.8,5.6,2.2,Iris-virginica 135 | 6.3,2.8,5.1,1.5,Iris-virginica 136 | 6.1,2.6,5.6,1.4,Iris-virginica 137 | 7.7,3,6.1,2.3,Iris-virginica 138 | 6.3,3.4,5.6,2.4,Iris-virginica 139 | 6.4,3.1,5.5,1.8,Iris-virginica 140 | 6,3,4.8,1.8,Iris-virginica 141 | 6.9,3.1,5.4,2.1,Iris-virginica 142 | 6.7,3.1,5.6,2.4,Iris-virginica 143 | 6.9,3.1,5.1,2.3,Iris-virginica 144 | 5.8,2.7,5.1,1.9,Iris-virginica 145 | 6.8,3.2,5.9,2.3,Iris-virginica 146 | 6.7,3.3,5.7,2.5,Iris-virginica 147 | 6.7,3,5.2,2.3,Iris-virginica 148 | 6.3,2.5,5,1.9,Iris-virginica 149 | 6.5,3,5.2,2,Iris-virginica 150 | 6.2,3.4,5.4,2.3,Iris-virginica 151 | 5.9,3,5.1,1.8,Iris-virginica 152 | -------------------------------------------------------------------------------- /user-identity-passthrough/train-with-dataset/train-dataset/train_diabetes.py: -------------------------------------------------------------------------------- 1 | 2 | import os 3 | import glob 4 | import argparse 5 | 6 | from azureml.core.run import Run 7 | from sklearn.linear_model import Ridge 8 | from sklearn.metrics import mean_squared_error 9 | from sklearn.model_selection import train_test_split 10 | # sklearn.externals.joblib is removed in 0.23 11 | from sklearn import __version__ as sklearnver 12 | from packaging.version import Version 13 | if Version(sklearnver) < Version("0.23.0"): 14 | from sklearn.externals import joblib 15 | else: 16 | import joblib 17 | 18 | import numpy as np 19 | 20 | parser = argparse.ArgumentParser() 21 | parser.add_argument('--data-folder', type=str, help='training dataset') 22 | args = parser.parse_args() 23 | 24 | os.makedirs('./outputs', exist_ok=True) 25 | 26 | base_path = args.data_folder 27 | 28 | run = Run.get_context() 29 | 30 | X = np.load(glob.glob(os.path.join(base_path, '**/features.npy'), recursive=True)[0]) 31 | y = np.load(glob.glob(os.path.join(base_path, '**/labels.npy'), recursive=True)[0]) 32 | 33 | X_train, X_test, y_train, y_test = train_test_split( 34 | X, y, test_size=0.2, random_state=0) 35 | data = {'train': {'X': X_train, 'y': y_train}, 36 | 'test': {'X': X_test, 'y': y_test}} 37 | 38 | # list of numbers from 0.0 to 1.0 with a 0.05 interval 39 | alphas = np.arange(0.0, 1.0, 0.05) 40 | 41 | for alpha in alphas: 42 | # use Ridge algorithm to create a regression model 43 | reg = Ridge(alpha=alpha) 44 | reg.fit(data['train']['X'], data['train']['y']) 45 | 46 | preds = reg.predict(data['test']['X']) 47 | mse = mean_squared_error(preds, data['test']['y']) 48 | run.log('alpha', alpha) 49 | run.log('mse', mse) 50 | 51 | model_file_name = 'ridge_{0:.2f}.pkl'.format(alpha) 52 | with open(model_file_name, 'wb') as file: 53 | joblib.dump(value=reg, filename='outputs/' + model_file_name) 54 | 55 | print('alpha is {0:.2f}, and mse is {1:0.2f}'.format(alpha, mse)) 56 | -------------------------------------------------------------------------------- /user-identity-passthrough/train-with-dataset/train-dataset/train_iris.py: -------------------------------------------------------------------------------- 1 | 2 | import os 3 | 4 | from azureml.dataprep import __version__ as dprepver 5 | from azureml.core import Dataset, Run 6 | from sklearn.model_selection import train_test_split 7 | from sklearn.tree import DecisionTreeClassifier 8 | # sklearn.externals.joblib is removed in 0.23 9 | from sklearn import __version__ as sklearnver 10 | from packaging.version import Version 11 | if Version(sklearnver) < Version("0.23.0"): 12 | from sklearn.externals import joblib 13 | else: 14 | import joblib 15 | 16 | print('dprep version: {}'.format(dprepver)) 17 | 18 | run = Run.get_context() 19 | # get input dataset by name 20 | dataset = run.input_datasets['iris'] 21 | 22 | df = dataset.to_pandas_dataframe() 23 | 24 | x_col = ['sepal_length', 'sepal_width', 'petal_length', 'petal_width'] 25 | y_col = ['species'] 26 | x_df = df.loc[:, x_col] 27 | y_df = df.loc[:, y_col] 28 | 29 | #dividing X,y into train and test data 30 | x_train, x_test, y_train, y_test = train_test_split(x_df, y_df, test_size=0.2, random_state=223) 31 | 32 | data = {'train': {'X': x_train, 'y': y_train}, 33 | 34 | 'test': {'X': x_test, 'y': y_test}} 35 | 36 | clf = DecisionTreeClassifier().fit(data['train']['X'], data['train']['y']) 37 | model_file_name = 'decision_tree.pkl' 38 | 39 | print('Accuracy of Decision Tree classifier on training set: {:.2f}'.format(clf.score(x_train, y_train))) 40 | print('Accuracy of Decision Tree classifier on test set: {:.2f}'.format(clf.score(x_test, y_test))) 41 | 42 | os.makedirs('./outputs', exist_ok=True) 43 | with open(model_file_name, 'wb') as file: 44 | joblib.dump(value=clf, filename='outputs/' + model_file_name) 45 | -------------------------------------------------------------------------------- /user-identity-passthrough/train-with-dataset/train-with-datasets.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "Copyright (c) Microsoft Corporation. All rights reserved.\n", 8 | "\n", 9 | "Licensed under the MIT License." 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "metadata": {}, 15 | "source": [ 16 | "![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/work-with-data/datasets-tutorial/train-with-datasets/train-with-datasets.png)" 17 | ] 18 | }, 19 | { 20 | "cell_type": "markdown", 21 | "metadata": {}, 22 | "source": [ 23 | "# Train with Azure Machine Learning datasets\n", 24 | "Datasets are categorized into TabularDataset and FileDataset based on how users consume them in training. \n", 25 | "* A TabularDataset represents data in a tabular format by parsing the provided file or list of files. TabularDataset can be created from csv, tsv, parquet files, SQL query results etc. For the complete list, please visit our [documentation](https://aka.ms/tabulardataset-api-reference). It provides you with the ability to materialize the data into a pandas DataFrame.\n", 26 | "* A FileDataset references single or multiple files in your datastores or public urls. This provides you with the ability to download or mount the files to your compute. The files can be of any format, which enables a wider range of machine learning scenarios including deep learning.\n", 27 | "\n", 28 | "In this tutorial, you will learn how to train with Azure Machine Learning datasets:\n", 29 | "\n", 30 | "☑ Use datasets directly in your training script\n", 31 | "\n", 32 | "☑ Use datasets to mount files to a remote compute" 33 | ] 34 | }, 35 | { 36 | "cell_type": "markdown", 37 | "metadata": {}, 38 | "source": [ 39 | "## Prerequisites" 40 | ] 41 | }, 42 | { 43 | "cell_type": "markdown", 44 | "metadata": {}, 45 | "source": [ 46 | "Please install the private build using the following pip command on terminal:\n", 47 | "- pip install azureml-sdk==0.1.0.33087793 --index-url https://azuremlsdktestpypi.azureedge.net/DataDrift-SDK-Unit/33087793 --extra-index-url https://pypi.python.org/simple\n", 48 | "- pip install azureml-dataprep[pandas]\n", 49 | "- pip install sklearn" 50 | ] 51 | }, 52 | { 53 | "cell_type": "code", 54 | "execution_count": 1, 55 | "metadata": {}, 56 | "outputs": [ 57 | { 58 | "name": "stdout", 59 | "output_type": "stream", 60 | "text": [ 61 | "SDK version: 0.1.0.25355784\n" 62 | ] 63 | } 64 | ], 65 | "source": [ 66 | "# Check core SDK version number\n", 67 | "import azureml.core\n", 68 | "\n", 69 | "print('SDK version:', azureml.core.VERSION)" 70 | ] 71 | }, 72 | { 73 | "cell_type": "markdown", 74 | "metadata": {}, 75 | "source": [ 76 | "## Initialize Workspace\n", 77 | "\n", 78 | "Initialize a workspace object from persisted configuration." 79 | ] 80 | }, 81 | { 82 | "cell_type": "code", 83 | "execution_count": 2, 84 | "metadata": {}, 85 | "outputs": [ 86 | { 87 | "name": "stderr", 88 | "output_type": "stream", 89 | "text": [ 90 | "Warning: Falling back to use azure cli login credentials.\n", 91 | "If you run your code in unattended mode, i.e., where you can't give a user input, then we recommend to use ServicePrincipalAuthentication or MsiAuthentication.\n", 92 | "Please refer to aka.ms/aml-notebook-auth for different authentication mechanisms in azureml-sdk.\n" 93 | ] 94 | }, 95 | { 96 | "name": "stdout", 97 | "output_type": "stream", 98 | "text": [ 99 | "rafarmahcredpassthrucanary\n", 100 | "rafarmahtestrg\n", 101 | "eastus2euap\n", 102 | "b1fff005-d722-4d97-99ac-7c6e9ef020aa\n" 103 | ] 104 | } 105 | ], 106 | "source": [ 107 | "from azureml.core import Workspace\n", 108 | "\n", 109 | "# please update this with your workspace information. Make sure your workspace is whitelisted\n", 110 | "subscriptionid='b1fff005-d722-4d97-99ac-7c6e9ef020aa'\n", 111 | "resourcegroup='rafarmahtestrg'\n", 112 | "workspacename='rafarmahcredpassthrucanary'\n", 113 | "\n", 114 | "#subscriptionid={YourSubscriptionID}\n", 115 | "#resourcegroup={YourResourceGroup}\n", 116 | "#workspacename={WorkspaceName}\n", 117 | "\n", 118 | "ws = Workspace(subscriptionid, resourcegroup, workspacename)\n", 119 | "print(ws.name, ws.resource_group, ws.location, ws.subscription_id, sep = '\\n')" 120 | ] 121 | }, 122 | { 123 | "cell_type": "markdown", 124 | "metadata": {}, 125 | "source": [ 126 | "## Create Experiment\n", 127 | "\n", 128 | "**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." 129 | ] 130 | }, 131 | { 132 | "cell_type": "code", 133 | "execution_count": 3, 134 | "metadata": {}, 135 | "outputs": [], 136 | "source": [ 137 | "from azureml.core import Experiment\n", 138 | "experiment_name = 'credential-passthrough'\n", 139 | "experiment = Experiment(workspace = ws, name = experiment_name)" 140 | ] 141 | }, 142 | { 143 | "cell_type": "markdown", 144 | "metadata": {}, 145 | "source": [ 146 | "## Create or Attach existing compute resource\n", 147 | "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", 148 | "\n", 149 | "**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." 150 | ] 151 | }, 152 | { 153 | "cell_type": "code", 154 | "execution_count": 4, 155 | "metadata": {}, 156 | "outputs": [ 157 | { 158 | "name": "stdout", 159 | "output_type": "stream", 160 | "text": [ 161 | "Found existing cluster, use it.\n", 162 | "Succeeded\n", 163 | "AmlCompute wait for completion finished\n", 164 | "\n", 165 | "Minimum number of nodes requested have been provisioned\n" 166 | ] 167 | } 168 | ], 169 | "source": [ 170 | "from azureml.core.compute import ComputeTarget, AmlCompute\n", 171 | "from azureml.core.compute_target import ComputeTargetException\n", 172 | "\n", 173 | "# Choose a name for your CPU cluster. We've whitelisted the passthrucluster1,2,3. \n", 174 | "# If you want to whitelist a specific name for your cluster, please contact sihhu@microsoft.com\n", 175 | "cpu_cluster_name = 'passthrucluster1' # \"passthrucluster2\", \"passthrucluster3\"\n", 176 | "\n", 177 | "# Verify that cluster does not exist already\n", 178 | "try:\n", 179 | " cpu_cluster = ComputeTarget(workspace=ws, name=cpu_cluster_name)\n", 180 | " print('Found existing cluster, use it.')\n", 181 | "except ComputeTargetException:\n", 182 | " compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_D2_V2',\n", 183 | " max_nodes=4)\n", 184 | " cpu_cluster = ComputeTarget.create(ws, cpu_cluster_name, compute_config)\n", 185 | "\n", 186 | "cpu_cluster.wait_for_completion(show_output=True)" 187 | ] 188 | }, 189 | { 190 | "cell_type": "markdown", 191 | "metadata": {}, 192 | "source": [ 193 | "You now have the necessary packages and compute resources to train a model in the cloud.\n", 194 | "## Use datasets directly in training\n", 195 | "\n", 196 | "### Create a TabularDataset\n", 197 | "By creating a dataset, you create a reference to the data source location. If you applied any subsetting transformations to the dataset, they will be stored in the dataset as well. The data remains in its existing location, so no extra storage cost is incurred. \n", 198 | "\n", 199 | "First you need to upload [iris dataset](./train-dataset/iris.csv) to your ADLS Gen2 storage account. Make sure that you grant yourself 'Storage Blob Data Contributor' access to the storage account for read & write access. ADLS Gen 2 also supports POSIX-like access control lists (ACLs), learn how to set ACLs [here](https://docs.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-access-control)\n", 200 | "\n", 201 | "![roleaccess](roleaccess.PNG)" 202 | ] 203 | }, 204 | { 205 | "cell_type": "markdown", 206 | "metadata": {}, 207 | "source": [ 208 | "Then we will create an unregistered TabularDataset pointing from ADLS Gen2 storage url. You can also create a dataset from multiple paths. [learn more](https://aka.ms/azureml/howto/createdatasets)
\n", 209 | "You can find the storage url from storage explorer on Azure portal\n", 210 | "![image.png](storageurl.jpg)\n", 211 | "\n", 212 | "[TabularDataset](https://docs.microsoft.com/python/api/azureml-core/azureml.data.tabulardataset?view=azure-ml-py) represents data in a tabular format by parsing the provided file or list of files. This provides you with the ability to materialize the data into a Pandas or Spark DataFrame. You can create a TabularDataset object from .csv, .tsv, and parquet files, and from SQL query results. For a complete list, see [TabularDatasetFactory](https://docs.microsoft.com/python/api/azureml-core/azureml.data.dataset_factory.tabulardatasetfactory?view=azure-ml-py) class.\n", 213 | "\n", 214 | "**NOTE** You will get permission denied if you try to load data from the sample url below because you do not have permission to the adlsgen2 storage account. You need to upload [iris dataset](./train-dataset/iris.csv) to your adlsgen2 storage account and replace the url with your own storage url." 215 | ] 216 | }, 217 | { 218 | "cell_type": "code", 219 | "execution_count": 5, 220 | "metadata": { 221 | "tags": [ 222 | "dataset-remarks-tabular-sample" 223 | ] 224 | }, 225 | "outputs": [ 226 | { 227 | "name": "stdout", 228 | "output_type": "stream", 229 | "text": [ 230 | "Credentials are not provided to access data from the source. Please sign in using identity with required permission granted.\n" 231 | ] 232 | }, 233 | { 234 | "data": { 235 | "text/html": [ 236 | "
\n", 237 | "\n", 250 | "\n", 251 | " \n", 252 | " \n", 253 | " \n", 254 | " \n", 255 | " \n", 256 | " \n", 257 | " \n", 258 | " \n", 259 | " \n", 260 | " \n", 261 | " \n", 262 | " \n", 263 | " \n", 264 | " \n", 265 | " \n", 266 | " \n", 267 | " \n", 268 | " \n", 269 | " \n", 270 | " \n", 271 | " \n", 272 | " \n", 273 | " \n", 274 | " \n", 275 | " \n", 276 | " \n", 277 | " \n", 278 | " \n", 279 | " \n", 280 | " \n", 281 | " \n", 282 | " \n", 283 | " \n", 284 | " \n", 285 | " \n", 286 | " \n", 287 | "
sepal_lengthsepal_widthpetal_lengthpetal_widthspecies
05.13.51.40.2Iris-setosa
14.93.01.40.2Iris-setosa
24.73.21.30.2Iris-setosa
\n", 288 | "
" 289 | ], 290 | "text/plain": [ 291 | " sepal_length sepal_width petal_length petal_width species\n", 292 | "0 5.1 3.5 1.4 0.2 Iris-setosa\n", 293 | "1 4.9 3.0 1.4 0.2 Iris-setosa\n", 294 | "2 4.7 3.2 1.3 0.2 Iris-setosa" 295 | ] 296 | }, 297 | "execution_count": 5, 298 | "metadata": {}, 299 | "output_type": "execute_result" 300 | } 301 | ], 302 | "source": [ 303 | "from azureml.core import Dataset\n", 304 | "dataset = Dataset.Tabular.from_delimited_files('https://mayadls2.blob.core.windows.net/tabular/iris.csv')\n", 305 | "\n", 306 | "# preview the first 3 rows of the dataset\n", 307 | "dataset.take(3).to_pandas_dataframe()" 308 | ] 309 | }, 310 | { 311 | "cell_type": "markdown", 312 | "metadata": {}, 313 | "source": [ 314 | "Alternatively, you can create ADLS Gen2 without providing credentials and create dataset from datastore path" 315 | ] 316 | }, 317 | { 318 | "cell_type": "code", 319 | "execution_count": 6, 320 | "metadata": {}, 321 | "outputs": [ 322 | { 323 | "data": { 324 | "text/html": [ 325 | "
\n", 326 | "\n", 339 | "\n", 340 | " \n", 341 | " \n", 342 | " \n", 343 | " \n", 344 | " \n", 345 | " \n", 346 | " \n", 347 | " \n", 348 | " \n", 349 | " \n", 350 | " \n", 351 | " \n", 352 | " \n", 353 | " \n", 354 | " \n", 355 | " \n", 356 | " \n", 357 | " \n", 358 | " \n", 359 | " \n", 360 | " \n", 361 | " \n", 362 | " \n", 363 | " \n", 364 | " \n", 365 | " \n", 366 | " \n", 367 | " \n", 368 | " \n", 369 | " \n", 370 | " \n", 371 | " \n", 372 | " \n", 373 | " \n", 374 | " \n", 375 | " \n", 376 | "
sepal_lengthsepal_widthpetal_lengthpetal_widthspecies
05.13.51.40.2Iris-setosa
14.93.01.40.2Iris-setosa
24.73.21.30.2Iris-setosa
\n", 377 | "
" 378 | ], 379 | "text/plain": [ 380 | " sepal_length sepal_width petal_length petal_width species\n", 381 | "0 5.1 3.5 1.4 0.2 Iris-setosa\n", 382 | "1 4.9 3.0 1.4 0.2 Iris-setosa\n", 383 | "2 4.7 3.2 1.3 0.2 Iris-setosa" 384 | ] 385 | }, 386 | "execution_count": 6, 387 | "metadata": {}, 388 | "output_type": "execute_result" 389 | } 390 | ], 391 | "source": [ 392 | "from azureml.core import Datastore\n", 393 | "datastore = Datastore.register_azure_data_lake_gen2(workspace=ws, datastore_name='mayadlsgen2',\n", 394 | " filesystem='tabular', account_name='mayadls2')\n", 395 | "dataset = Dataset.Tabular.from_delimited_files((datastore, 'iris.csv'))\n", 396 | "dataset.take(3).to_pandas_dataframe()" 397 | ] 398 | }, 399 | { 400 | "cell_type": "markdown", 401 | "metadata": {}, 402 | "source": [ 403 | "### Create a training script\n", 404 | "\n", 405 | "To submit the job to the cluster, first create a training script. Run the following code to create the training script called `train_titanic.py` in the script_folder. " 406 | ] 407 | }, 408 | { 409 | "cell_type": "code", 410 | "execution_count": 7, 411 | "metadata": {}, 412 | "outputs": [], 413 | "source": [ 414 | "import os\n", 415 | "script_folder = os.path.join(os.getcwd(), 'train-dataset')" 416 | ] 417 | }, 418 | { 419 | "cell_type": "code", 420 | "execution_count": 8, 421 | "metadata": {}, 422 | "outputs": [ 423 | { 424 | "name": "stdout", 425 | "output_type": "stream", 426 | "text": [ 427 | "Overwriting C:\\Users\\SIHHU\\project\\identity-based-data-access\\user-identity-passthrough\\train-with-dataset\\train-dataset/train_iris.py\n" 428 | ] 429 | } 430 | ], 431 | "source": [ 432 | "%%writefile $script_folder/train_iris.py\n", 433 | "\n", 434 | "import os\n", 435 | "\n", 436 | "from azureml.dataprep import __version__ as dprepver\n", 437 | "from azureml.core import Dataset, Run\n", 438 | "from sklearn.model_selection import train_test_split\n", 439 | "from sklearn.tree import DecisionTreeClassifier\n", 440 | "# sklearn.externals.joblib is removed in 0.23\n", 441 | "from sklearn import __version__ as sklearnver\n", 442 | "from packaging.version import Version\n", 443 | "if Version(sklearnver) < Version(\"0.23.0\"):\n", 444 | " from sklearn.externals import joblib\n", 445 | "else:\n", 446 | " import joblib\n", 447 | "\n", 448 | "print('dprep version: {}'.format(dprepver))\n", 449 | "\n", 450 | "run = Run.get_context()\n", 451 | "# get input dataset by name\n", 452 | "dataset = run.input_datasets['iris']\n", 453 | "\n", 454 | "df = dataset.to_pandas_dataframe()\n", 455 | "\n", 456 | "x_col = ['sepal_length', 'sepal_width', 'petal_length', 'petal_width']\n", 457 | "y_col = ['species']\n", 458 | "x_df = df.loc[:, x_col]\n", 459 | "y_df = df.loc[:, y_col]\n", 460 | "\n", 461 | "#dividing X,y into train and test data\n", 462 | "x_train, x_test, y_train, y_test = train_test_split(x_df, y_df, test_size=0.2, random_state=223)\n", 463 | "\n", 464 | "data = {'train': {'X': x_train, 'y': y_train},\n", 465 | "\n", 466 | " 'test': {'X': x_test, 'y': y_test}}\n", 467 | "\n", 468 | "clf = DecisionTreeClassifier().fit(data['train']['X'], data['train']['y'])\n", 469 | "model_file_name = 'decision_tree.pkl'\n", 470 | "\n", 471 | "print('Accuracy of Decision Tree classifier on training set: {:.2f}'.format(clf.score(x_train, y_train)))\n", 472 | "print('Accuracy of Decision Tree classifier on test set: {:.2f}'.format(clf.score(x_test, y_test)))\n", 473 | "\n", 474 | "os.makedirs('./outputs', exist_ok=True)\n", 475 | "with open(model_file_name, 'wb') as file:\n", 476 | " joblib.dump(value=clf, filename='outputs/' + model_file_name)" 477 | ] 478 | }, 479 | { 480 | "cell_type": "markdown", 481 | "metadata": {}, 482 | "source": [ 483 | "### Create an environment\n", 484 | "\n", 485 | "Define a conda environment YAML file with your training script dependencies and create an Azure ML environment." 486 | ] 487 | }, 488 | { 489 | "cell_type": "code", 490 | "execution_count": 9, 491 | "metadata": {}, 492 | "outputs": [ 493 | { 494 | "name": "stdout", 495 | "output_type": "stream", 496 | "text": [ 497 | "Overwriting conda_dependencies.yml\n" 498 | ] 499 | } 500 | ], 501 | "source": [ 502 | "%%writefile conda_dependencies.yml\n", 503 | "\n", 504 | "dependencies:\n", 505 | "- python=3.6.2\n", 506 | "- scikit-learn\n", 507 | "- pip=20.2.4\n", 508 | "- pip:\n", 509 | " - packaging\n", 510 | " - nltk\n", 511 | " - azureml-defaults\n", 512 | " - azureml-telemetry\n", 513 | " - azureml-dataprep[pandas]" 514 | ] 515 | }, 516 | { 517 | "cell_type": "code", 518 | "execution_count": 10, 519 | "metadata": {}, 520 | "outputs": [], 521 | "source": [ 522 | "from azureml.core import Environment\n", 523 | "\n", 524 | "sklearn_env = Environment.from_conda_specification(name = 'sklearn-env', file_path = './conda_dependencies.yml')" 525 | ] 526 | }, 527 | { 528 | "cell_type": "markdown", 529 | "metadata": {}, 530 | "source": [ 531 | "### Configure training run" 532 | ] 533 | }, 534 | { 535 | "cell_type": "markdown", 536 | "metadata": {}, 537 | "source": [ 538 | "A ScriptRunConfig object specifies the configuration details of your training job, including your training script, environment to use, and the compute target to run on. Specify the following in your script run configuration:\n", 539 | "* The directory that contains your scripts. All the files in this directory are uploaded into the cluster nodes for execution. \n", 540 | "* The training script name, train_iris.py\n", 541 | "* The input dataset for training, passed as an argument to your training script. `as_named_input()` is required so that the input dataset can be referenced by the assigned name in your training script. \n", 542 | "* The compute target. In this case you will use the AmlCompute you created\n", 543 | "* The environment definition for the experiment" 544 | ] 545 | }, 546 | { 547 | "cell_type": "code", 548 | "execution_count": 11, 549 | "metadata": {}, 550 | "outputs": [], 551 | "source": [ 552 | "from azureml.core import ScriptRunConfig\n", 553 | "\n", 554 | "src = ScriptRunConfig(source_directory=script_folder,\n", 555 | " script='train_iris.py',\n", 556 | " arguments=[dataset.as_named_input('iris')],\n", 557 | " compute_target=cpu_cluster,\n", 558 | " environment=sklearn_env)" 559 | ] 560 | }, 561 | { 562 | "cell_type": "markdown", 563 | "metadata": {}, 564 | "source": [ 565 | "### Submit job to run\n", 566 | "Submit the ScriptRunConfig to the Azure ML experiment to kick off the execution. You will need to set `credential_passthrough=True` to opt-in to use your own identity for data access authentication in remote training. Otherwise, our service will try to use the identity of the compute for data access authentication." 567 | ] 568 | }, 569 | { 570 | "cell_type": "code", 571 | "execution_count": 12, 572 | "metadata": {}, 573 | "outputs": [ 574 | { 575 | "data": { 576 | "text/html": [ 577 | "
ExperimentIdTypeStatusDetails PageDocs Page
credential-passthroughcredential-passthrough_1612229920_361138c2azureml.scriptrunPreparingLink to Azure Machine Learning studioLink to Documentation
" 578 | ], 579 | "text/plain": [ 580 | "Run(Experiment: credential-passthrough,\n", 581 | "Id: credential-passthrough_1612229920_361138c2,\n", 582 | "Type: azureml.scriptrun,\n", 583 | "Status: Preparing)" 584 | ] 585 | }, 586 | "execution_count": 12, 587 | "metadata": {}, 588 | "output_type": "execute_result" 589 | } 590 | ], 591 | "source": [ 592 | "run = experiment.submit(src, credential_passthrough=True)\n", 593 | "run" 594 | ] 595 | }, 596 | { 597 | "cell_type": "markdown", 598 | "metadata": {}, 599 | "source": [ 600 | "## Use datasets to mount files to a remote compute\n", 601 | "\n", 602 | "You can use the `Dataset` object to mount or download files referred by it. When you mount a file system, you attach that file system to a directory (mount point) and make it available to the system. Because mounting load files at the time of processing, it is usually faster than download.
\n", 603 | "Note: mounting is only available for Linux-based compute (DSVM/VM, AMLCompute, HDInsights)." 604 | ] 605 | }, 606 | { 607 | "cell_type": "markdown", 608 | "metadata": {}, 609 | "source": [ 610 | "### Upload data files into your ADLS Gen2 storage account\n", 611 | "We will first load diabetes data from `scikit-learn` to the train-dataset folder." 612 | ] 613 | }, 614 | { 615 | "cell_type": "code", 616 | "execution_count": 15, 617 | "metadata": {}, 618 | "outputs": [], 619 | "source": [ 620 | "from sklearn.datasets import load_diabetes\n", 621 | "import numpy as np\n", 622 | "\n", 623 | "os.makedirs('./data', exist_ok=True)\n", 624 | "training_data = load_diabetes()\n", 625 | "np.save(file='./data/features.npy', arr=training_data['data'])\n", 626 | "np.save(file='./data/labels.npy', arr=training_data['target'])" 627 | ] 628 | }, 629 | { 630 | "cell_type": "markdown", 631 | "metadata": {}, 632 | "source": [ 633 | "Now upload the 2 files into the ADLS Gen2 storage account into a folder named `diabetes`and create a FileDataset referencing it. " 634 | ] 635 | }, 636 | { 637 | "cell_type": "code", 638 | "execution_count": 16, 639 | "metadata": {}, 640 | "outputs": [ 641 | { 642 | "name": "stderr", 643 | "output_type": "stream", 644 | "text": [ 645 | "Method upload_directory: This is an experimental method, and may change at any time.
For more information, see https://aka.ms/azuremlexperimental.\n" 646 | ] 647 | }, 648 | { 649 | "name": "stdout", 650 | "output_type": "stream", 651 | "text": [ 652 | "Validating arguments.\n", 653 | "Arguments validated.\n", 654 | "Uploading file to diabetes\n", 655 | "Uploading an estimated of 2 files\n", 656 | "Target already exists. Skipping upload for diabetes\\features.npy\n", 657 | "Target already exists. Skipping upload for diabetes\\labels.npy\n", 658 | "Uploaded 0 files\n", 659 | "Creating new dataset\n" 660 | ] 661 | } 662 | ], 663 | "source": [ 664 | "from azureml.core import Dataset\n", 665 | "\n", 666 | "dataset = Dataset.File.upload_directory(src_dir='./data',target=(datastore,'diabetes'))" 667 | ] 668 | }, 669 | { 670 | "cell_type": "markdown", 671 | "metadata": {}, 672 | "source": [ 673 | "### Create a training script\n", 674 | "\n", 675 | "To submit the job to the cluster, first create a training script. Run the following code to create the training script called `train_diabetes.py` in the script_folder. " 676 | ] 677 | }, 678 | { 679 | "cell_type": "code", 680 | "execution_count": 17, 681 | "metadata": {}, 682 | "outputs": [ 683 | { 684 | "name": "stdout", 685 | "output_type": "stream", 686 | "text": [ 687 | "Overwriting C:\\Users\\SIHHU\\project\\identity-based-data-access\\user-identity-passthrough\\train-with-dataset\\train-dataset/train_diabetes.py\n" 688 | ] 689 | } 690 | ], 691 | "source": [ 692 | "%%writefile $script_folder/train_diabetes.py\n", 693 | "\n", 694 | "import os\n", 695 | "import glob\n", 696 | "import argparse\n", 697 | "\n", 698 | "from azureml.core.run import Run\n", 699 | "from sklearn.linear_model import Ridge\n", 700 | "from sklearn.metrics import mean_squared_error\n", 701 | "from sklearn.model_selection import train_test_split\n", 702 | "# sklearn.externals.joblib is removed in 0.23\n", 703 | "from sklearn import __version__ as sklearnver\n", 704 | "from packaging.version import Version\n", 705 | "if Version(sklearnver) < Version(\"0.23.0\"):\n", 706 | " from sklearn.externals import joblib\n", 707 | "else:\n", 708 | " import joblib\n", 709 | "\n", 710 | "import numpy as np\n", 711 | "\n", 712 | "parser = argparse.ArgumentParser()\n", 713 | "parser.add_argument('--data-folder', type=str, help='training dataset')\n", 714 | "args = parser.parse_args()\n", 715 | "\n", 716 | "os.makedirs('./outputs', exist_ok=True)\n", 717 | "\n", 718 | "base_path = args.data_folder\n", 719 | "\n", 720 | "run = Run.get_context()\n", 721 | "\n", 722 | "X = np.load(glob.glob(os.path.join(base_path, '**/features.npy'), recursive=True)[0])\n", 723 | "y = np.load(glob.glob(os.path.join(base_path, '**/labels.npy'), recursive=True)[0])\n", 724 | "\n", 725 | "X_train, X_test, y_train, y_test = train_test_split(\n", 726 | " X, y, test_size=0.2, random_state=0)\n", 727 | "data = {'train': {'X': X_train, 'y': y_train},\n", 728 | " 'test': {'X': X_test, 'y': y_test}}\n", 729 | "\n", 730 | "# list of numbers from 0.0 to 1.0 with a 0.05 interval\n", 731 | "alphas = np.arange(0.0, 1.0, 0.05)\n", 732 | "\n", 733 | "for alpha in alphas:\n", 734 | " # use Ridge algorithm to create a regression model\n", 735 | " reg = Ridge(alpha=alpha)\n", 736 | " reg.fit(data['train']['X'], data['train']['y'])\n", 737 | "\n", 738 | " preds = reg.predict(data['test']['X'])\n", 739 | " mse = mean_squared_error(preds, data['test']['y'])\n", 740 | " run.log('alpha', alpha)\n", 741 | " run.log('mse', mse)\n", 742 | "\n", 743 | " model_file_name = 'ridge_{0:.2f}.pkl'.format(alpha)\n", 744 | " with open(model_file_name, 'wb') as file:\n", 745 | " joblib.dump(value=reg, filename='outputs/' + model_file_name)\n", 746 | "\n", 747 | " print('alpha is {0:.2f}, and mse is {1:0.2f}'.format(alpha, mse))" 748 | ] 749 | }, 750 | { 751 | "cell_type": "markdown", 752 | "metadata": {}, 753 | "source": [ 754 | "### Configure & Run" 755 | ] 756 | }, 757 | { 758 | "cell_type": "markdown", 759 | "metadata": {}, 760 | "source": [ 761 | "Now configure your run. We will reuse the same `sklearn_env` environment from the previous run. Once the environment is built, and if you don't change your dependencies, it will be reused in subsequent runs. \n", 762 | "\n", 763 | "We will pass in the DatasetConsumptionConfig of our FileDataset to the `'--data-folder'` argument of the script. Azure ML will resolve this to mount point of the data on the compute target, which we parse in the training script." 764 | ] 765 | }, 766 | { 767 | "cell_type": "code", 768 | "execution_count": 18, 769 | "metadata": {}, 770 | "outputs": [], 771 | "source": [ 772 | "from azureml.core import ScriptRunConfig\n", 773 | "\n", 774 | "src = ScriptRunConfig(source_directory=script_folder, \n", 775 | " script='train_diabetes.py', \n", 776 | " # to mount the dataset on the remote compute and pass the mounted path as an argument to the training script\n", 777 | " arguments =['--data-folder', dataset.as_mount()],\n", 778 | " compute_target=cpu_cluster,\n", 779 | " environment=sklearn_env)" 780 | ] 781 | }, 782 | { 783 | "cell_type": "markdown", 784 | "metadata": {}, 785 | "source": [ 786 | "You will need to set `credential_passthrough=True` to opt-in to use your own identity for data access authentication in remote training. Otherwise, our service will try to use the identity of the compute for data access authentication." 787 | ] 788 | }, 789 | { 790 | "cell_type": "code", 791 | "execution_count": 19, 792 | "metadata": {}, 793 | "outputs": [], 794 | "source": [ 795 | "run = experiment.submit(config=src, credential_passthrough=True)" 796 | ] 797 | }, 798 | { 799 | "cell_type": "markdown", 800 | "metadata": {}, 801 | "source": [ 802 | "### Display run results\n", 803 | "You now have a model trained on a remote cluster. Retrieve all the metrics logged during the run, including the accuracy of the model:" 804 | ] 805 | }, 806 | { 807 | "cell_type": "code", 808 | "execution_count": 20, 809 | "metadata": {}, 810 | "outputs": [ 811 | { 812 | "name": "stdout", 813 | "output_type": "stream", 814 | "text": [ 815 | "{'alpha': [0.0, 0.05, 0.1, 0.15000000000000002, 0.2, 0.25, 0.30000000000000004, 0.35000000000000003, 0.4, 0.45, 0.5, 0.55, 0.6000000000000001, 0.65, 0.7000000000000001, 0.75, 0.8, 0.8500000000000001, 0.9, 0.9500000000000001], 'mse': [3424.3166882137343, 3408.9153122589296, 3372.649627810032, 3345.14964347419, 3325.294679467878, 3311.5562509289744, 3302.6736334017264, 3297.658733944204, 3295.74106435581, 3296.316884705676, 3298.9096058070622, 3303.140055527517, 3308.7042707723226, 3315.3568399622573, 3322.898314903962, 3331.1656169285875, 3340.024662032161, 3349.364644348603, 3359.093569748443, 3369.1347399130477]}\n" 816 | ] 817 | } 818 | ], 819 | "source": [ 820 | "run.wait_for_completion()\n", 821 | "metrics = run.get_metrics()\n", 822 | "print(metrics)" 823 | ] 824 | } 825 | ], 826 | "metadata": { 827 | "authors": [ 828 | { 829 | "name": "sihhu" 830 | } 831 | ], 832 | "category": "tutorial", 833 | "compute": [ 834 | "Remote" 835 | ], 836 | "datasets": [ 837 | "Iris", 838 | "Diabetes" 839 | ], 840 | "deployment": [ 841 | "None" 842 | ], 843 | "exclude_from_index": false, 844 | "framework": [ 845 | "Azure ML" 846 | ], 847 | "friendly_name": "Train with Datasets (Tabular and File)", 848 | "index_order": 1, 849 | "kernelspec": { 850 | "display_name": "Python 3", 851 | "language": "python", 852 | "name": "python3" 853 | }, 854 | "language_info": { 855 | "codemirror_mode": { 856 | "name": "ipython", 857 | "version": 3 858 | }, 859 | "file_extension": ".py", 860 | "mimetype": "text/x-python", 861 | "name": "python", 862 | "nbconvert_exporter": "python", 863 | "pygments_lexer": "ipython3", 864 | "version": "3.7.9" 865 | }, 866 | "star_tag": [ 867 | "featured" 868 | ], 869 | "tags": [ 870 | "Dataset", 871 | "Estimator", 872 | "ScriptRun" 873 | ], 874 | "task": "Train" 875 | }, 876 | "nbformat": 4, 877 | "nbformat_minor": 2 878 | } --------------------------------------------------------------------------------