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

We are attaching the college professor salary dataset here.

Solution

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

Your output

Azure

Setup the web service in this model

Once the Deployment is completed, you will see the following screen.

Azure


Input the data and click on OK button.
Azure

Result will look like this.

Azure

Click on the New Web Service Experience and it will bring you the Web Service page.

Azure

Output

Azure

You can test the End Point, Configuration etc..

I have provided detailed steps here. If you still have any question and concerns, do comment below.