Introduction To Azure Machine Learning

2y ago
41 Views
4 Downloads
1.29 MB
27 Pages
Last View : 20d ago
Last Download : 2m ago
Upload by : Ophelia Arruda
Transcription

Introduction toAzure MachineLearning

ContentsOverview . 3Create a Workspace and Experiment . 5Explore and Visualize Data . 10Create a Simple Predictive Model . 14Exercises . 25Terms of Use . 26Introduction to Azure Machine Learning

OverviewSummaryThis lab is intended to serve as an introduction to creating apredictive model with Azure Machine Learning.The lab will walk through accessing the ML Studio environment,exploring and visualizing data in Azure Machine Learning, andcreating a simple predictive model.Business CaseConsumers often evaluate similar products by specific metrics ofinterest to them. In the auto industry, Miles per Gallon (MPG) alwayscomes up as an important metric for consumers. How domanufacturers know what an acceptable MPG will be for the vehiclethey are producing? Using advanced analytics, auto manufacturerscan use vehicle attributes and MPG for similar automobiles in themarket to predict what an acceptable MPG will be for their carcoming off the assembly line.For this lab, you will be working with a dataset that includes variousinformation about automobiles from the 1970s and early 1980s. Thedataset includes attributes like miles per gallon (MPG), horsepower,acceleration, weight, etc.The lab will use a linear regression algorithm to predict an acceptableMPG for an automobile. Linear regression is used to predict a single,numeric value based on one or many independent variables. It doesthis by fitting a representative line, or function, to a collection of inputvariables. This line/function can then be used to predict future valuesbased on new input data.Learning ObjectivesUpon completing this lab, you will have hands-on experience with thefollowing functions and concepts related to Azure Machine Learning: Creating and logging in to a free Azure Machine LearningWorkspace Creating, modifying, and saving an experiment with MLStudio.Introduction to Azure Machine Learning3

oRunning an experimentoUsing sample datasets an experimentoBrowsing modules to use in an experimentoUsing the search function to find modules to use in anexperimentoConnecting modules in an experimentoModifying and configuring properties of modules in anexperimentVisualizing and exploring data in ML StudiooExploring summary statistics about datasets andfeaturesoVisualizing features with scatterplots, boxplots, andhistogramsoVisualizing relationships between features withscatterplots and boxplotsoVisualizing predictive model resultsCreating a basic predictive model in ML StudiooSplitting data into a training dataset and a test datasetoTraining a Linear Regression modeloTesting a trained modeloEvaluating model performanceLab Requirements/Prerequisites A Microsoft account is required to access an Azure MachineLearning workspace. If you don’t already have a Microsoftaccount, you can obtain one for free by following the default.aspxIntroduction to Azure Machine Learning4

Create aWorkspaceandExperimentCreate/Access an Azure Machine Learning WorkspaceTo get started, you will need to create and log in to a free AzureMachine Learning workspace. A workspace is like an all-inclusivedevelopment environment with the tools to create, manage, andpublish machine learning models.1. Open Internet Explorer using the shortcut on the desktoptaskbar.2. Go to the ML Studio website by typinghttp://studio.azureml.net in the address bar.3. Click Sign In on the top right corner of the web page.4. Enter the email address and password associated withyour Microsoft ID, and click the Sign In button.5. If upon logging in, a Welcome video is displayed (usuallydisplays on the first login), click the X at the top right of thevideo to close it.Introduction to Azure Machine Learning5

6. If the Microsoft Samples dialogue box is displayed (usuallydisplays on the first login), go ahead and close it by choosingthe X in the top right corner of the pane.You are now logged into the free workspace associated withyour Microsoft ID.Introduction to Azure Machine Learning6

Create a Blank ExperimentNext, we will create our first experiment. An experiment is acollection of data, tasks, and machine learning algorithms that makeup a model.1. Click the NEW button in the bottom left corner of the page.2. Make sure EXPERIMENT is highlighted in the NEWdialogue window, and click the Blank Experiment pane.3. You are now in the ML Studio. Notice:a. The Canvas in the center of the screen. This is whereyou will drag and drop modules and string themtogether to create a data flow for your experiment.b. The navigation icons on the far left of the site allowingyou to browse back to your WorkspaceIntroduction to Azure Machine Learning7

c. There is also a navigation map to traverse/zoom largeexperiments easily.d. The Modules pane down the left side of the Canvas.Modules are the individual components that make upyour Experiment.e. The Properties pane down the right side of theCanvas. This is where you will configure theproperties of the different Modules used in yourExperiment.Introduction to Azure Machine Learning8

4. At the top of the Canvas, highlight and delete the text thatreads Experiment created on , and replace it with Lab Intro to Azure Machine Learning.ToIntroduction to Azure Machine Learning9

Explore andVisualizeDataInput Sample DataAzure Machine Learning offers several ways to connect to and importdata. For this lab, we will work with one of the sample datasetsincluded with Azure Machine Learning.1. On the Modules panel, click Saved Datasets and thenSamples.This expands all of the sample datasets included in MLStudio.2. Scroll until you find MPG data for various automobiles.3. Click on the MPG dataset and notice the description alsoshows up at the bottom of the Properties pane.4. Click and drag the MPG dataset onto the Canvas. Noticethe Properties pane is now reflecting information about thedataset.Notice at the bottom of the MPG dataset module on theCanvas, there is a small circle called a port. Ports on the topof modules are called input ports, and ports on the bottom ofIntroduction to Azure Machine Learning10

modules are output ports. These ports are used to connectmodules to one another and to provide a menu of additionaloptions for the module.Explore the Input DataA common task in any advanced analytics workflow is to analyze andprofile the data you are working with. The following set of stepshighlights some of the ways we can explore and visualize the datawe just imported.1. Click the output port at the bottom of the MPG datasetmodule, and select Visualize from the menu that isdisplayed.The resulting dialogue box provides the number of rows andcolumns in the dataset as well as the first 100 rows and first100 columns in the dataset with a histogram for each column.2. Click anywhere in the first column, MPG, to highlight thecolumn.Introduction to Azure Machine Learning11

Notice on the right side of the dialogue box, there is nowinformation in the Statistics pane and Visualizations paneabout MPG (you might need to use the horizontal scroll bar inthe dialogue box to scroll all the way to the right if Statisticsand Visualizations are not visible).3. In the Visualizations pane, change the compare todropdown box from None to Horsepower.Introduction to Azure Machine Learning12

Notice the histogram changed to a ScatterPlot comparingMPG to Horsepower.4. Next, change the compare to dropdown option fromHorsepower to Model.Notice the resulting chart is now a MultiboxPlot with an MPGboxplot displayed for each of the values in the Model column.5. Click the X in the top right corner of the Visualize dialoguebox to return to the Canvas.Introduction to Azure Machine Learning13

Create aSimplePredictiveModelSplit Input Data into Train and Test Data SetsNow that we have explored our data, we are ready to create apredictive model. The first thing we will do is split the original datasetinto 2 datasets: one dataset will be used for training a model, andone will be used for testing our model (as it is typically better to testour models with different data than what we trained it with).1. In the search box at the top of the Modules pane, type theword split and hit Enter.Notice the list of modules has been filtered to show only thoserelevant to the search term.2. Click and drag the Split module onto the Canvas anywhereunder the MPG dataset.Notice the Split module has 1 input port and 2 output ports.The Properties pane displays properties that can be modifiedfor this module. There is also a description of the module atthe bottom of the Properties pane with a (more help ) link. Apage will open with more details about the module and itsconfigurable properties when this link is clicked.3. Click and drag the output port from the MPG datasetmodule to the input port of the Split module.Introduction to Azure Machine Learning14

4. In the Properties pane, type 0.75 in the Fraction of rowsin the first output dataset textbox.This configures the module to split 75% of the input rows tothe left output port, and 25% of the input rows to the rightoutput port.5. Click RUN at the bottom of the Canvas.The experiment will now execute each module in orderstarting from the first module in the workflow. When theexperiment is done executing, the words Finished running willdisplay in the top right corner of the Canvas. Notice the Splitmodule has a green check mark indicating it completedsuccessfully.6. Click the left output port on the Split module, and selectVisualize from the menu that is displayed.Introduction to Azure Machine Learning15

7.Notice only 294 of the original 392 rows (75%) have beenrouted to the left output port. The remaining 98 rows (25%)have been routed to the right output port.8. Click the X in the top right corner to close the Visualizedialogue box.Train a Predictive ModelNext, you will use a common Linear Regression algorithm to train amodel that will predict an automobile’s MPG.1. Type train in the search box at the top of the Modulespane.2. Find the Train Model module, and click and drag it onto theCanvas below the Split module.3. Connect the left output port from the Split module to theright input port on the Train Model moduleIntroduction to Azure Machine Learning16

4. In the Properties pane, click the Launch columnselector button.This launches the Select Column dialogue box. Here, we willselect the column we want the model to predict.5. Click the text box with the red circle in it, and select MPGfrom the list of columns.6. Click thebutton to save the selection and close thedialogue box.7. Hover your mouse cursor over the red error icon in the TrainModel module. Noticehe error message now reads:We now need to select an appropriate machine learningalgorithm to forecast MPG.8. Clear the search box in the Modules pane and hit enter.Introduction to Azure Machine Learning17

9. In the Modules pane, find and click to expand MachineLearning, and then click Initialize Model, and then clickRegression.10. Click and drag the Linear Regression module onto theCanvas just above and to the left of the Train Modelmodule.11. Connect the output port of the Linear Regressionmodule to the left input port of the Train Model module.You might notice there are several parameters that can bemodified in the Properties pane for the Linear Regressionmodule. For this lab, we will use the defaults.12. Click RUN at the bottom of the Canvas to run theexperiment and train the model.Introduction to Azure Machine Learning18

The model will be trained to predict the MPG column usingthe other fields in the dataset with the Linear Regressionalgorithm.13. When the experiment finishes running, IF a CREATESCORING EXPERIMENT COMMAND box pops up, clickthe X at the top right corner of this box to close it.Test the Predictive ModelNext, we will use the test dataset we created to test our newly trainedmodel. This will be done using our new model to predict the MPG foreach row in the test dataset.1. In the search box at the top of the Modules pane, type theword score.2. Find the Score Model module, and click and drag it onto theCanvas under the Train Model module.Introduction to Azure Machine Learning19

3. Connect the output port on the Train Model module to theleft input port on the Score Model module.4. Connect the right output port on the Split module to theright input port on the Score Model module.5. Click RUN at the bottom of the Canvas to run theexperiment and score the test dataset with the trained LinearRegression model.6. After the experiment has finished running, click the outputport on the Score Model module and select Visualizefrom the displayed menu (see illustration below).Introduction to Azure Machine Learning20

7. In the list of columns, scroll to the right until Scored Labelsis visible, and click Scored Labels to select it.The Scored Labels column represents the predicted MPG foreach row in the test dataset. Notice the Statistics pane andhistogram in the Visualizations pane on the right side of theVisualize dialogue box.8. In the Visualizations pane, change the compare todropdown option to MPG.Introduction to Azure Machine Learning21

The resulting ScatterPlot compares the Scored Labels(predicted MPG) with the actual MPG for each row in the testdataset.9. Click the X in the top right corner to close the Visualizedialogue box.10. Click SAVE to save the experiment.Evaluate the Test ResultsFinally, we will evaluate how well the model performed against thetest dataset using a set of standard metrics for measuring regressionmodel performance.1. In the search box at the top of the Modules pane, type theword evaluate.2. Find the Evaluate Model module, and click and drag it ontothe Canvas below the Score Model module.Introduction to Azure Machine Learning22

3. Connect the output port on the Score Model module tothe left input port on the Evaluate Model module.4. Click RUN to run the experiment.5. When the experiment has finished running, click the outputport on the Evaluate Model module and select Visualizefrom the displayed menu.The columns and values in the Visualize dialogue boxrepresent common metrics for evaluating the performance ofa Linear Regression model. The metrics are calculated usingthe results of the Score Model module. Many of the metricsare based on the Error, which is the difference between theScored Labels (predicted value) and the actual values.At this point, you can assess whether or not your modelperforms at a satisfactory level. If not, you could go back andtweak parameters, add new features, try a different machinelearning algorithm, etc. to try and get the model performanceto be more acceptable.6. Click the X in the top right corner to close the Visualizedialogue box.Introduction to Azure Machine Learning23

7. Click SAVE to save your experimentIntroduction to Azure Machine Learning24

ExercisesTry the following exercises.1. Add data cleansing modules to your experiment:a. Clean Missing Data (select an appropriate method forreplacement).b. Remove Duplicate RowsIn each case consult the help files in the module properties2. Add in a feature selection method to your experiment. InAzure Machine Learning there are two types to explore:a. Filter based feature selectionb. Permutation feature importanceWhat are the differences between the two?3. Your experiment has one model type – Linear regression.Add to your experiment another regression module (e.g.Boosted Decision Tree Regression) and compare thepredictions on the out-of-sample test data with the linearregression model.ConclusionThis concludes the Intro to Azure Machine Learning lab. To recap,you have successfully created and logged into an Azure MachineLearning workspace, explored and visualized data in ML Studio, andproduced and saved a simple Linear Regression model that predictsautomobile MPG.You now have a model that can be used by an auto manufacturer topredict an acceptable MPG for any new automobile coming off theassembly line. As a next step, you could upload new data to bescored by your model, or you could even publish your model as aweb service. A web service gives you the ability to pass individualrows in and get predicted values (MPG) out.Introduction to Azure Machine Learning25

Terms ofUse 2016 Microsoft Corporation. All rights reserved.By using this Hands-on Lab, you agree to the following terms:The technology/functionality described in this Hands-on Lab isprovided by Microsoft Corporation in a “sandbox” testing environmentfor purposes of obtaining your feedback and to provide you with alearning experience. You may only use the Hands-on Lab to evaluatesuch technology features and functionality and provide feedback toMicrosoft. You may not use it for any other purpose. You may notmodify copy, distribute, transmit, display, perform, reproduce,publish, license, create derivative works from, transfer, or sell thisHands-on Lab or any portion thereof.COPYING OR REPRODUCTION OF THE HANDS-ON LAB (ORANY PORTION OF IT) TO ANY OTHER SERVER OR LOCATIONFOR FURTHER REPRODUCTION OR REDISTRIBUTION ISEXPRESSLY PROHIBITED.THIS HANDS-ON LAB PROVIDES CERTAIN SOFTWARETECHNOLOGY/PRODUCT FEATURES AND FUNCTIONALITY,INCLUDING POTENTIAL NEW FEATURES AND CONCEPTS, IN ASIMULATED ENVIRONMENT WITHOUT COMPLEX SET-UP ORINSTALLATION FOR THE PURPOSE DESCRIBED ABOVE. THETECHNOLOGY/CONCEPTS REPRESENTED IN THIS HANDS-ONLAB MAY NOT REPRESENT FULL FEATURE FUNCTIONALITYAND MAY NOT WORK THE WAY A FINAL VERSION MAYWORK. WE ALSO MAY NOT RELEASE A FINAL VERSION OFSUCH FEATURES OR CONCEPTS. YOUR EXPERIENCE WITHUSING SUCH FEATURES AND FUNCITONALITY IN A PHYSICALENVIRONMENT MAY ALSO BE DIFFERENT.FEEDBACK. If you give feedback about the technology features,functionality and/or concepts described in this Hands-on Lab toMicrosoft, you give to Microsoft, without charge, the right to use,share and commercialize your feedback in any way and for anypurpose. You also give to third parties, without charge, any patentrights needed for their products, technologies and services to use orinterface with any specific parts of a Microsoft software or servicethat includes the feedback. You will not give feedback that is subjectto a license that requires Microsoft to license its software ordocumentation to third parties because we include your feedback inthem. These rights survive this agreement.MICROSOFT CORPORATION HEREBY DISCLAIMS ALLWARRANTIES AND CONDITIONS WITH REGARD TO THEHANDS-ON LAB , INCLUDING ALL WARRANTIES ANDCONDITIONS OF MERCHANTABILITY, WHETHER EXPRESS,IMPLIED OR STATUTORY, FITNESS FOR A PARTICULARPURPOSE, TITLE AND NON-INFRINGEMENT. MICROSOFTIntroduction to Azure Machine Learning26

DOES NOT MAKE ANY ASSURANCES OR REPRESENTATIONSWITH REGARD TO THE ACCURACY OF THE RESULTS, OUTPUTTHAT DERIVES FROM USE OF THE VIRTUAL LAB, ORSUITABILITY OF THE INFORMATION CONTAINED IN THEVIRTUAL LAB FOR ANY PURPOSE.DISCLAIMERThis lab contains only a portion of the features and enhancements inMicrosoft Azure Machine Learning. Some of the features mightchange in future releases of the product.Introduction to Azure Machine Learning27

Introduction to Azure Machine Learning 3 Summary This lab is intended to serve as an introduction to creating a predictive model with Azure Machine Learning. The lab will walk through accessing the ML Studio environment, exploring and visualizing data in Azure Machine Learning

Related Documents:

Mar 27, 2017 · Azure ML Studio is a cloud machine learning platform. It is part of the Cortana analytics suite. Azure ML Studio make the process of creating predictive, descriptive and prescriptive analysis much easier. Azure ML Studio is in “Machine Learning and Analytics” part of Cortana. The main

Gain Insights into your Microsoft Azure Data using Splunk Jason Conger Splunk. Disclaimer 2 . Deploying Splunk on Azure Collecting Machine Data from Azure Splunk Add-ons Use cases for Azure Data in Splunk 3. Splunk available in Azure Marketplace 4. Splunk in Azure Marketplace

AZURE TAGGING BEST PRACTICES Adding tags to your Azure resources is very simple and can be done using Azure Portal, Azure PowerShell, CLI, or ARM JSON templates. You can tag any resources in Azure, and using this service is free. The tagging is done on the Azure platform level and does not impact the performance of the resource in any way.

DE LAS UNIDADES PROGRAMA CURRICULAR UNIDAD 2 - Introduccion a los servicios de azure - Los servicios de Azure - Cómo crear un App Service en Azure - Administrar App Service con Azure Cloud Shell Azure UNIDAD 3 - Introduccion al Modulo - Regiones y centros de datos en azure - Zonas Geograficas en

Resource Manager and the Azure portal through Azure Arc to facilitate resource management at a global level. This also means a single vendor for support and billing. Save time and resources with regular and consistent feature and security updates. Access Azure hybrid services such as Azure Security Center, Azure Backup, and Azure site recovery.

students solve a variety of challenges faced in education through Microsoft Azure and the cloud. Azure for research staff Azure for teaching staff Azure for students Azure for academic institutions Azure is a powerful tool for research and education, and Microsoft provides a number of programs to meet the needs of academic institutions.

I hope you enjoy this Microsoft Azure Essentials series from Microsoft Press. The first three ebooks cover fundamentals of Azure, Azure Automation, and Azure Machine Learning. And I hope you enjoy living and working with Microsoft Azure as much as we do. Scott Guthrie Executive Vice President Cloud and Enterprise group, Microsoft Corporation

Siklus Akuntansi Jasa BAGIAN PROYEK PENGEMBANGAN KURIKULUM DIREKTORAT PENDIDIKAN MENENGAH KEJURUAN DIREKTORAT JENDERAL PENDIDIKAN DASAR DAN MENENGAH DEPARTEMEN PENDIDIKAN NASIONAL 2003 Kode Modul: AK.26.D.2,3. BAGIAN PROYEK PENGEMBANGAN KURIKULUM DIREKTORAT PENDIDIKAN MENENGAH KEJURUAN DIREKTORAT JENDERAL PENDIDIKAN DASAR DAN MENENGAH DEPARTEMEN PENDIDIKAN NASIONAL 2003 Kode Modul: AK.26.D.2,3 .