Regression in Machine Learning explained with examples
Start writing a post
Lifestyle

Regression in Machine Learning explained with examples

Introduction

21
Regression in Machine

Today, IEEE Spectrum reported how AI would soon make coding unnecessary for young software professionals. On the same day, there was another report that the Indian AI & ML researchers in IIT-Delhi have developed an AI-based technology to detect the presence of cancer-causing carcinogens in chemical structures.

Reading these two news items on the same day made me wonder how widespread the use of Artificial Intelligence is and how rapidly it is progressing in all sectors. Machine Learning - a subset of AI - is also generally coupled with AI.

The rise in popularity of machine learning and artificial intelligence is marked by the steep rise in demand for ML & AI MS Degrees as well as AI ML Certification courses around the world. A professional who is pursuing an AI ML Course would have come across the word ‘Regression’ quite often. So, let us take a look at this topic in detail and try to answer questions such as what is artificial intelligence, what is Regression in Machine learning, what are the different types of Regression in machine learning, and what are some of the reliable AI ML courses to propel your career in the Indian AI domain.

What is Regression in Machine Learning

Regression is a supervised learning method used for predictive modelling by Machine learning algorithms to predict continuous outcomes by investigating the relationship between independent variables - called features or predictors - and a dependent variable - called outcome or target. It is primarily used for predicting, forecasting, time series modeling, and determining the intervariable causal-effect relationship. Machine Learning models need accurate data (training data) so that the ML models are able to make accurate predictions.

Regression involves plotting a graph between the variables so that they best fit the given datapoints. Using this plotted graph, the machine learning model makes predictions about the data. So, Regression shows a line or curve that intersects all the datapoints on the target-predictor graph in such a manner that there is the least minimum vertical distance between the datapoints and the regression line. This distance between the datapoints and line is a marker of whether or not a model has captured a strong relationship between the predictors and the target.

A few examples of Regression include:

  • Predicting rain using temperature and other factors
  • Predicting road accidents due to rash driving
  • Determining Market trends.

<iframe width="560" height="315" src="https://www.youtube.com/embed/NUXdtN1W1FE" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Different types of Regression in Machine Learning

There are several types of Regression techniques used in the AI ML sector. The most commonly used Regression techniques are

  • Logistic Regression
  • Linear Regression
  • Polynomial Regression

Let’s look at them in detail.

Logistic Regression in Machine Learning

Logistic Regression is a supervised learning algorithm capable of solving a particular type of problem called classification problems. Classification problems constitute dependent variables in a binary or discrete format, like in the form of 0s or 1s, True or False, Spam or not spam, Yes or No, etc. This predictive analysis algorithm works on the concept of probability, using the sigmoid function or logistic function - a complex cost function. These sigmoid function models the data in logistic Regression. The function can be represented as:

f(X) = 1 / (1+e-x)

where,

  • f(x) is the output between the 0 and 1 values,
  • X is the input value to the function, and
  • E is the base of the natural logarithm.

When we input values (data) into the function, it gives an S-curve as follows:

Logistic Regression uses the threshold levels concept, where values more than the threshold level are rounded up to 1, and values less than the threshold level are rounded up to 0.

Logistic Regression can further be classified into 3 types:

  • Binary(0/1, pass/fail)
  • Multi(cats, dogs, lions)
  • Ordinal(low, medium, high)

Linear Regression in Machine Learning

Linear Regression is another statistical regression method used for predictive analysis. This simple and easy algorithm works on Regression by showing the relationship between the independent variable on the X-axis and the dependent variable on the Y-axis. So, it is called linear Regression. Linear Regression with only one input variable (x) is called simple linear Regression, and the ones with more than one input variable are called multiple linear Regression.

In the below example, we are predicting the salary of an employee based on the number of years of experience.

The mathematical equation for this Linear Regression is

Y= aX+b

where Y represents the dependent or target variables,

X represents the independent or predictor variables, and

a and b are the linear coefficients

The popular applications of linear Regression include

  • Analyzing trends and sales estimates
  • Real estate prediction
  • Salary forecasting
  • Arriving at ETAs in traffic.

Polynomial Regression in Machine Learning

Polynomial Regression models the non-linear dataset using a linear model. In some ways, it resembles multiple linear Regression. But it juxtaposes a non-linear curve between the x-value and the corresponding conditional y-values. For instance, imagine a dataset that consists of data points present in a non-linear fashion. In this case, linear Regression is not the best fit for those data points. Hence, to cover such data points, we must use Polynomial regression.

Polynomial Regression transfers the original features into polynomial features of a given degree and then models them using a linear model. This makes the data points best suitable to a polynomial line.

In Polynomial Regression, the Linear regression equation Y= b0+ b1x, is converted into the Polynomial regression equation Y= b0+b1x+ b2x2+ b3x3+.....+ bnxn.

So, n Polynomial regression, a single element has different degrees instead of multiple variables with the same degree.

Here,

  • X is our independent/input variable,
  • Y is the predicted/target output, and
  • b0, b1,... bn are the regression coefficients.

This model is again linear because the coefficients are still linear with quadratic coefficients.

Conclusion

Now that we have explained What is Regression in machine learning with examples, you must be in a better position to decide whether Artificial Intelligence & Machine Learning is the most suitable career choice for you. If you are interested in an Indian AI ML course, check out the Professional Certificate Program In AI And Machine Learning linked at the top of this article. We hope you the best of luck in your AI & ML journey!

Report this Content
This article has not been reviewed by Odyssey HQ and solely reflects the ideas and opinions of the creator.
the beatles
Wikipedia Commons

For as long as I can remember, I have been listening to The Beatles. Every year, my mom would appropriately blast “Birthday” on anyone’s birthday. I knew all of the words to “Back In The U.S.S.R” by the time I was 5 (Even though I had no idea what or where the U.S.S.R was). I grew up with John, Paul, George, and Ringo instead Justin, JC, Joey, Chris and Lance (I had to google N*SYNC to remember their names). The highlight of my short life was Paul McCartney in concert twice. I’m not someone to “fangirl” but those days I fangirled hard. The music of The Beatles has gotten me through everything. Their songs have brought me more joy, peace, and comfort. I can listen to them in any situation and find what I need. Here are the best lyrics from The Beatles for every and any occasion.

Keep Reading...Show less
Being Invisible The Best Super Power

The best superpower ever? Being invisible of course. Imagine just being able to go from seen to unseen on a dime. Who wouldn't want to have the opportunity to be invisible? Superman and Batman have nothing on being invisible with their superhero abilities. Here are some things that you could do while being invisible, because being invisible can benefit your social life too.

Keep Reading...Show less
Featured

19 Lessons I'll Never Forget from Growing Up In a Small Town

There have been many lessons learned.

41775
houses under green sky
Photo by Alev Takil on Unsplash

Small towns certainly have their pros and cons. Many people who grow up in small towns find themselves counting the days until they get to escape their roots and plant new ones in bigger, "better" places. And that's fine. I'd be lying if I said I hadn't thought those same thoughts before too. We all have, but they say it's important to remember where you came from. When I think about where I come from, I can't help having an overwhelming feeling of gratitude for my roots. Being from a small town has taught me so many important lessons that I will carry with me for the rest of my life.

Keep Reading...Show less
​a woman sitting at a table having a coffee
nappy.co

I can't say "thank you" enough to express how grateful I am for you coming into my life. You have made such a huge impact on my life. I would not be the person I am today without you and I know that you will keep inspiring me to become an even better version of myself.

Keep Reading...Show less
Student Life

Waitlisted for a College Class? Here's What to Do!

Dealing with the inevitable realities of college life.

116244
college students waiting in a long line in the hallway
StableDiffusion

Course registration at college can be a big hassle and is almost never talked about. Classes you want to take fill up before you get a chance to register. You might change your mind about a class you want to take and must struggle to find another class to fit in the same time period. You also have to make sure no classes clash by time. Like I said, it's a big hassle.

This semester, I was waitlisted for two classes. Most people in this situation, especially first years, freak out because they don't know what to do. Here is what you should do when this happens.

Keep Reading...Show less

Subscribe to Our Newsletter

Facebook Comments