# # Introduction to Machine Learning: How We Arrive at Linear Regression

> Source: <https://dev.to/moraa_omwoyo/-introduction-to-machine-learning-how-we-arrive-at-linear-regression-hhc>
> Published: 2026-05-23 22:28:09+00:00

Before we talk about Linear Regression, we first need to understand the bigger idea it belongs to Machine Learning.
Machine Learning is the reason applications today can:
But what exactly is Machine Learning?
Machine Learning is a branch of Artificial Intelligence where we teach computers to learn patterns from data instead of explicitly programming every rule.
In traditional programming:
You give the computer rules + data → it gives you answers.
In Machine Learning:
You give the computer data + answers → it learns the rules.
Think of teaching a child:
You say:
You must manually define every rule.
You show the child many examples:
Eventually, the child learns the pattern:
“Oh… adding numbers follows a pattern.”
That is exactly how Machine Learning works.
The main goal is simple:
To help machines learn patterns from data and make predictions on new, unseen data.
There are three main types:
The model learns from:
Example:
This is where Linear Regression belongs.
The model is given data without answers and tries to find patterns on its own.
Example:
The model learns through:
Example:
Once we focus on supervised learning, we usually ask questions like:
These are called regression problems.
A regression problem is when we try to predict a continuous numerical value.
Examples:
This is different from classification, where we predict categories like:
Now that we understand regression problems, we can introduce one of the simplest solutions:
Linear Regression
Linear Regression is a supervised learning algorithm used to predict continuous values by finding a relationship between input and output variables.
Because many real-world relationships can be approximated using a straight line.
Example:
These relationships often follow a pattern that can be simplified as:
“As X increases, Y also increases (or decreases) in a predictable way.”
Linear Regression tries to draw a best-fit line through data points.
This line is used to:
Mathematically, it is written as:
y = mx + c
Next we will do a deep dive into Linear Regression; Buckle up!
