In this article, we are going to build a linear regression model. After building the model, we will train it and publish it as a web service so that we can use the service in any application.
What is Liner Regression
We model the relationship between two variables using Linear Regression. A dependent variable is denoted as Y and an independent variable is denoted as X.
Y= b1X+b0
Advertisement will be independent while Sales will be a dependent variable (Predictor).
Determine Y; X is variable; b1 is slope; b0 intercept
Example: Sales = Some Coefficient * Advertisement + Intercepts
Requirement
- Azure ML Account. Using the following link, you can create account https://studio.azureml.net/
Solution
- First, login to the Azure ML portal. You will see the following screen.

- Go to the Dataset and click “New” ( At the bottom of the page).

- Chose the data source or upload the file from local system.

- Chose the file and provide the appropriate data name and click the bottom right button.

Now, we have successfully uploaded the dataset.
In our dataset, we know that the Linear Regression is best to evaluate the result set. So, let’s build the model and publish as web service.
Building Experiment
- Select the Experiment tab from the left navigation and click the “New” to start the experiment.

- Chose a template which fits your requirement. I am choosing the blank template as highlighted in the screen print.

- You will get the page like below, click on the highlighted part to name your experiment.

- Select the Data source (which you uploaded in the first part in this article), drag the data source into the first box.

- Once you drop your data source your page will look like this .

- Select the data column from the data set. Go to Data, Transform Manipulation and Select Columns in the Data set; and drag and drop below to your data set.

- Connect the data set to the “Select Columns in Data set”. You can see the red dot in your “Select Columns in Data set” because you didn’t select it. Select the column. Click Right Side “Launch Column Selector” (Number 1) from your right side , the window will popup and select the column. Once you are done with the selection click the bottom on the bottom right side on popup windows

- Now split the data set into the Training and Test data set and choose the ratio. For that
go to Left Navigation, Data Transformation, Sample and Split, and Split Data (Drag and drop to below of “Select Columns In Dataset”). And in the right side you can choose the fraction of rows. We can chose 80% Training and 20% as Test data.


















Join the conversation! Your thoughts help the community grow.