Course contentsShow
← Machine Learning and Deep Learning
Lesson 187 of 3,5383. Linear RegressionFree lesson

What is Linear Regression?

Understanding regression as predicting continuous values and the core idea of fitting a line to data points.

What is Linear Regression?

You'll learn: The fundamental supervised learning technique for predicting continuous numerical values by fitting a straight line through data.

The Core Idea

Imagine plotting house prices against their square footage on a graph. You'd likely see that larger houses tend to cost more, forming a general upward trend. Linear Regression is the mathematical method that finds the "best-fit" straight line through these scattered points.

This line becomes your predictive model: give it a new house's square footage (an input you haven't seen before), and it slides along the line to predict the price (a continuous output value).

Regression = Predicting Numbers

The term "regression" in machine learning means predicting continuous values — numbers that can take any value within a range (like $150,000.50, or 72.3 degrees, or 3.14159 seconds). This contrasts with classification, which predicts discrete categories.

Linear Regression specifically assumes the relationship between your input features and the target value can be approximated by a linear equation (a straight line in 2D, or a flat plane/hyperplane in higher dimensions).

Fitting the Line to Data

The "learning" part happens when the algorithm examines your training data points and mathematically determines the line's position and slope that minimizes prediction errors. Each data point has some distance from the line — the algorithm finds the line that makes these distances as small as possible overall.

You've already learned about optimization and gradient descent — these are precisely the tools that power Linear Regression's line-fitting process!

Key Takeaway: Linear Regression predicts continuous values by finding the straight line that best fits your training data, then uses that line to make predictions on new inputs.