## Introduction to Regression in Machine Learning

In this article, we will learn about Regression in Machine Learning. Regression means to predict the value using the input data. Regression models are used to predict a continuous value. It is mostly used to find the relationship between the variables and forecasting. Regression models differ based on the kind of relationship between dependent and independent variables.

### Types of Regression in Machine Learning

There are different types of regression:

**Simple Linear Regression:**Simple linear regression a target variable based on the independent variables. Linear regression is a machine learning algorithm based on supervised learning which performs the regression task.**Polynomial Regression:**Polynomial regression transforms the original features into polynomial features of a given degree or variable and then apply linear regression on it.**Support Vector Regression:**Support vector regression identifies a hyperplane with the maximum margin such that the maximum number of data points is within the margin.**Decision Tree Regression:**The decision tree is a tree that is built by partitioning the data into subsets containing instances with similar values. It can use for regression and classification also.**Random Forest Regression:**Random Forest is an ensemble approach where we take into account the predictions of several decision regression trees.

### Regression Model in Machine Learning

The regression model is employed to create a mathematical equation that defines y as operate of the x variables. This equation may be accustomed to predict the end result “y” on the ideas of the latest values of the predictor variables x. The statistical regression equation may be written as

**y = B0 + B1*x**

Where,

- B0 is the intercept.
- B1 is the regression weight or the constant related to the variable x.

These statistical regression coefficients are determined to attenuate the errors whereas predicting the end result worth. This methodology of computing the beta coefficients is termed the normal least square methodology.

In case, the end result and the variable are not linear then we would like to create a non-linear regression, like polynomial regression.

When we have multiple values within the regression model and wish to pick out the simplest combination of the variables then we would create the best predictor model that is termed the model choice. Model choice compares multiple models and selects the simplest model that minimize the prediction error.

In some cases, we have got variable information set that contains the correlate information. In this, the first information may be summarized into few variables that are a linear combination of the first variables. This new variables may be accustomed build a linear model which could be a lot of functioning for the information. This methodology is termed principal element-based strategies that is the combination of principal component regression. In this, it penalizes the model for having several variables. Penalty regression includes ridge regression and lasso regression.

4.7 (9,297 ratings)

View Course

The metrics used for examining the models are

**Root Mean Square Error**: It measures the model prediction error that corresponds to the typical distinction between the discovered famed worth of the end result and therefore the expected value by the model.**Adjusted R-square:**It represents the proportion of variation within the information explained by the model. This corresponds to the standard of the model. The upper is that the R2, the higher is that the model.

Let’s say with weight(y) from height(x). Then formulae for our statistical regression model illustration would be:

**y = B0 + B1 * x1**

Or

**Weight = B0 + B1* height**

As per the above equation,

- B0 is the bias constant
- B1 if the coefficient for the height columns

To predict the weight we can use different height values once we get the coefficient values.

**Example **

Let’s say b0 = 0.3 and b1 = 0.5.

Let’s take them in and calculate the load for someone with a peak of 192 centimeters.

- Weight = 0.3 + 0.5* 192
- Weight =
**96.3**

As per the above equation, it can be plotted as a line in two-dimension wherein B0 would be the starting point regardless of the height value given. We can predict different values of height to get the weight values for creating the line.

### Implementation of Linear Regression in Machine Learning

Linear regression is employed in varied ways in which a number of them are listed as:

- Sales prognostication
- Risk Analysis
- Housing applications
- Finance applications

The process used for implementing the statistical regression whereas exploitation it in many ways in which some are mentioned below:

- Loading the data
- Exploring the data
- Slicing the data
- Train and split data
- Generate the model
- Evacuate the accuracy

### Advantages and Disadvantages of Linear Regression

There are several advantages and disadvantages of linear regression.

#### Advantages of Linear Regression

- Linear regression performs well when the data set is linearly separable. We can use it to find the nature of the relationship between the variables.
- It is easier to implement, interpret and very efficient to train.
- It is prone to over-fitting but it can be easily avoided using some dimensionality reduction techniques, regularization techniques, and cross-validation.
- It has the extrapolation beyond the specific data set.

#### Disadvantages of Linear Regression

**Linear Assumption:**It assumes that the relationship between the input and the output is linear.**Remove Noise:**It assumes that the input and the output variables are not noisy.**Remove collinearity:**It will over-fit the data when we have highly correlated input variables.**Gaussian Distributions:**It will create a lot of reliable predictions if the input and output variables have a Gaussian distribution.**Resize Inputs:**It usually creates a lot of reliable predictions if we tend to use resize input variables exploitation standardization or social control.**Susceptible to Outliers:**It is very sensitive to outliers. So, the outliers need to be removed before applying the linear regression to the data set.

### Conclusion

Linear regression is a tool accustomed to analyzing the relationship between the variables but it not applicable practically. In this article, we have discussed, About regression and its types What is a regression model and how is it selected? Example of linear regression. Uses of linear regression Steps for implementing the statistical regression and Advantages and disadvantages of linear regression.

### Recommended Articles

This is a guide to Regression in Machine Learning. Here we discuss an introduction, types of Regression examples and implementing it with advantages and disadvantages. You can also go through our other related articles to learn more –