Course contentsShow
← Computer Science
Lesson 2816 of 2,87263. Classical ML AlgorithmsFree lesson

What is Linear Regression?

Understanding linear regression as a supervised learning method for predicting continuous outcomes from input features.

What is Linear Regression?

You'll learn what linear regression is and how it models the relationship between input features and continuous outcomes.

The Core Idea

Linear regression is a supervised learning method that predicts a continuous numeric value (the label) based on one or more input features. It assumes the relationship between features and the output can be approximated by a straight line (or hyperplane in multiple dimensions).

Think of it like this: if you're predicting house prices based on square footage, linear regression finds the best-fit line through your training data points. Once trained, you can slide along that line to predict prices for new houses you haven't seen before.

How It Works

The model learns a mathematical equation of the form:

predicted_value = (weight_1 × feature_1) + (weight_2 × feature_2) + ... + bias

During training, the algorithm adjusts the weights (slopes) and bias (intercept) to minimize the difference between predicted values and actual labels in your training data. This difference is measured by a loss function (typically mean squared error).

Why It Matters

Linear regression is a fundamental regression problem technique—you're predicting continuous numbers, not categories. It's interpretable (you can see exactly how each feature influences the prediction), fast to train, and serves as an excellent baseline model before trying more complex approaches.

The model works best when the true relationship between features and labels is approximately linear, making feature engineering crucial for success.

Key Takeaway: Linear regression learns a linear equation mapping input features to continuous predictions, making it the simplest and most interpretable supervised learning method for regression tasks.