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/iot-hub/iot-hub-weather-forecast-machine-learning.md
+66-13Lines changed: 66 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ ms.service: iot-hub
8
8
services: iot-hub
9
9
ms.topic: conceptual
10
10
ms.tgt_pltfrm: arduino
11
-
ms.date: 04/11/2018
11
+
ms.date: 02/10/2020
12
12
ms.author: robinsh
13
13
---
14
14
@@ -44,24 +44,77 @@ You learn how to use Azure Machine Learning to do weather forecast (chance of ra
44
44
45
45
## Deploy the weather prediction model as a web service
46
46
47
+
In this section you get the weather prediction model from the Azure AI Library. Then you add an R-script module to the model to clean the temperature and humidity data. Lastly, you deploy the model as a predictive web service.
48
+
49
+
### Get the weather prediction model
50
+
51
+
In this section you get the weather prediction model from the Azure AI Gallery and open it in Azure Machine Learning Studio (classic).
52
+
47
53
1. Go to the [weather prediction model page](https://gallery.cortanaintelligence.com/Experiment/Weather-prediction-model-1).
48
-
1. Click **Open in Studio** in Microsoft Azure Machine Learning Studio (classic).
49
-

50
-
1. Click **Run** to validate the steps in the model. This step might take 2 minutes to complete.
51
-

52
-
1. Click **SET UP WEB SERVICE** > **Predictive Web Service**.
53
-

54
-
1. In the diagram, drag the **Web service input** module somewhere near the **Score Model** module.
55
-
1. Connect the **Web service input** module to the **Score Model** module.
54
+
55
+

56
+
57
+
1. Click **Open in Studio (classic)** to open the model in Microsoft Azure Machine Learning Studio (classic).
58
+
59
+

60
+
61
+
### Add an R-script module to clean temperature and humidity data
62
+
63
+
For the model to behave correctly, the temperature and humidity data must be convertible to numeric data. In this section, you add an R-script module to the weather prediction model that removes any rows that have data values for temperature or humidity that cannot be converted to numeric values.
64
+
65
+
1. On the left-side of the Azure Machine Learning Studio window, click the arrow to expand the tools panel. Enter "Execute" into the search box. Select the **Execute R Script** module.
66
+
67
+

68
+
69
+
1. Drag the **Execute R Script** module near the **Clean Missing Data** module and the existing **Execute R Script** module on the diagram. Delete the connection between the **Clean Missing Data** and the **Execute R Script** modules and then connect the inputs and outputs of the new module as shown.
70
+
71
+

72
+
73
+
1. Select the new **Execute R Script** module to open its properties window. Copy and paste the following code into the **R Script** box.
When you're finished, the properties window should look similar to the following:
89
+
90
+

91
+
92
+
### Deploy predictive web service
93
+
94
+
In this section, you validate the model, set up a predictive web service based on the model, and then deploy the web service.
95
+
96
+
1. Click **Run** to validate the steps in the model. This step might take a few minutes to complete.
97
+
98
+

99
+
100
+
1. Click **SET UP WEB SERVICE** > **Predictive Web Service**. The predictive experiment diagram opens.
101
+
102
+

103
+
104
+
1. In the predictive experiment diagram, delete the connection between the **Web service input** module and the **Weather Dataset** at the top. Then drag the **Web service input** module somewhere near the **Score Model** module and connect it as shown:
105
+
56
106

107
+
57
108
1. Click **RUN** to validate the steps in the model.
109
+
58
110
1. Click **DEPLOY WEB SERVICE** to deploy the model as a web service.
111
+
59
112
1. On the dashboard of the model, download the **Excel 2010 or earlier workbook** for **REQUEST/RESPONSE**.
60
113
61
114
> [!Note]
62
-
> Ensure that you download the **Excel 2010 or earlier workbook** even if you are running a later version of Excel on your computer.
115
+
> Make sure that you download the **Excel 2010 or earlier workbook** even if you are running a later version of Excel on your computer.
63
116
64
-

117
+

65
118
66
119
1. Open the Excel workbook, make a note of the **WEB SERVICE URL** and **ACCESS KEY**.
67
120
@@ -175,9 +228,9 @@ Run the client application to start collecting and sending temperature and humid
175
228
1. Sign in to your Azure account.
176
229
1. Select your subscription.
177
230
1. Click your subscription > **Storage Accounts** > your storage account > **Blob Containers** > your container.
178
-
1.Open a .csv file to see the result. The last column records the chance of rain.
231
+
1.Download a .csv file to see the result. The last column records the chance of rain.
179
232
180
-

233
+

0 commit comments