You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/machine-learning/tutorial-1st-r-experiment.md
+29-28Lines changed: 29 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,30 +1,31 @@
1
1
---
2
-
title: "Tutorial: Your first ML model with R"
2
+
title: "Tutorial: Logistic regression model in R"
3
3
titleSuffix: Azure Machine Learning
4
-
description: In this tutorial, you learn the foundational design patterns in Azure Machine Learning, and train a logistic regression model model using R packages azuremlsdk and caret to predict likelihood of a fatality in an automobile accident.
4
+
description: In this tutorial, you create a logistic regression model using R packages azuremlsdk and caret to predict likelihood of a fatality in an automobile accident.
5
5
services: machine-learning
6
6
ms.service: machine-learning
7
7
ms.subservice: core
8
8
ms.topic: tutorial
9
9
ms.reviewer: sgilley
10
10
author: revodavid
11
11
ms.author: davidsmi
12
-
ms.date: 11/04/2019
12
+
ms.date: 02/07/2020
13
13
---
14
14
15
-
# Tutorial: Train and deploy your first model in R with Azure Machine Learning
15
+
# Tutorial: Create a logistic regression model in R with Azure Machine Learning
In this tutorial, you learn the foundational design patterns in Azure Machine Learning. You'll train and deploy a **caret** model to predict the likelihood of a fatality in an automobile accident. After completing this tutorial, you'll have the practical knowledge of the R SDK to scale up to developing more-complex experiments and workflows.
19
-
20
-
In this tutorial, you learn the following tasks:
18
+
In this tutorial you'll use R and Azure Machine Learning to create a logistic regression model that predicts the likelihood of a fatality in an automobile accident. After completing this tutorial, you'll have the practical knowledge of the Azure Machine Learning R SDK to scale up to developing more-complex experiments and workflows.
21
19
20
+
In this tutorial, you perform the following tasks:
22
21
> [!div class="checklist"]
23
-
> * Connect your workspace
22
+
> * Create an Azure Machine Learning workspace
23
+
> * Clone a notebook folder with the files necessary to run this tutorial into your workspace
24
+
> * Open RStudio from your workspace
24
25
> * Load data and prepare for training
25
-
> * Upload data to the datastore so it is available for remote training
26
-
> * Create a compute resource
27
-
> * Train a caret model to predict probability of fatality
26
+
> * Upload data to a datastore so it is available for remote training
27
+
> * Create a compute resource to train the model remotely
28
+
> * Train a `caret` model to predict probability of fatality
28
29
> * Deploy a prediction endpoint
29
30
> * Test the model from R
30
31
@@ -61,13 +62,11 @@ You complete the following experiment set-up and run steps in Azure Machine Lear
61
62
62
63
1. Open the folder with a version number on it. This number represents the current release for the R SDK.
63
64
64
-
1. Open the **vignettes** folder.
65
-
66
-
1. Select the **"..."** at the right of the **train-and-deploy-to-aci** folder and then select **Clone**.
65
+
1. Select the **"..."** at the right of the **vignettes** folder and then select **Clone**.
1. A list of folders displays showing each user who accesses the workspace. Select your folder to clone the **train-and-deploy-to-aci** folder there.
69
+
1. A list of folders displays showing each user who accesses the workspace. Select your folder to clone the **vignettes** folder there.
71
70
72
71
## <aname="open">Open RStudio
73
72
@@ -79,12 +78,13 @@ Use RStudio on a compute instance or Notebook VM to run this tutorial.
79
78
80
79
1. Once the compute is running, use the **RStudio** link to open RStudio.
81
80
82
-
1. In RStudio, your **train-and--deploy-to-aci** folder is a few levels down from **Users** in the **Files** section on the lower right. Select the **train-and-deploy-to-aci** folder to find the files needed in this tutorial.
81
+
1. In RStudio, your *vignettes* folder is a few levels down from *Users* in the **Files** section on the lower right. Under *vignettes*, select the *train-and-deploy-to-aci* folder to find the files needed in this tutorial.
83
82
84
83
> [!Important]
85
-
> The rest of this article contains the same content as you see in the **train-and-deploy-to-aci.Rmd** file.
84
+
> The rest of this article contains the same content as you see in the *train-and-deploy-to-aci.Rmd* file.
86
85
> If you are experienced with RMarkdown, feel free to use the code from that file. Or you can copy/paste the code snippets from there, or from this article into an R script or the command line.
87
86
87
+
88
88
## Set up your development environment
89
89
The setup for your development work in this tutorial includes the following actions:
90
90
@@ -100,12 +100,6 @@ This tutorial assumes you already have the Azure ML SDK installed. Go ahead and
100
100
library(azuremlsdk)
101
101
```
102
102
103
-
The tutorial uses data from the [**DAAG** package](https://cran.r-project.org/package=DAAG). Install the package if you don't have it.
104
-
105
-
```R
106
-
install.packages("DAAG")
107
-
```
108
-
109
103
The training and scoring scripts (`accidents.R` and `accident_predict.R`) have some additional dependencies. If you plan on running those scripts locally, make sure you have those required packages as well.
This tutorial uses data from the **DAAG** package. This dataset includes data from over 25,000 car crashes in the US, with variables you can use to predict the likelihood of a fatality. First, import the data into R and transform it into a new dataframe `accidents` for analysis, and export it to an `Rdata` file.
140
+
This tutorial uses data from the US [National Highway Traffic Safety Administration](https://cdan.nhtsa.gov/tsftables/tsfar.htm) (with thanks to [Mary C. Meyer and Tremika Finney](https://www.stat.colostate.edu/~meyer/airbags.htm)).
141
+
This dataset includes data from over 25,000 car crashes in the US, with variables you can use to predict the likelihood of a fatality. First, import the data into R and transform it into a new dataframe `accidents` for analysis, and export it to an `Rdata` file.
@@ -390,5 +390,6 @@ You can also keep the resource group but delete a single workspace. Display the
390
390
391
391
## Next steps
392
392
393
-
Now that you've completed your first Azure Machine Learning experiment in R, learn more about the [Azure Machine Learning SDK for R](https://azure.github.io/azureml-sdk-for-r/index.html).
393
+
*Now that you've completed your first Azure Machine Learning experiment in R, learn more about the [Azure Machine Learning SDK for R](https://azure.github.io/azureml-sdk-for-r/index.html).
394
394
395
+
* Learn more about Azure Machine Learning with R from the examples in the other *vignettes* folders.
0 commit comments