Simplified Machine Learning: Part 2
Supervised Learning
In the last part, we talked about how supervised learning is all about feeding a model input data along with the correct output labels, so it can learn and make predictions when given new data. Basically, it’s like training a student with the right answers so they can ace future tests.
Supervised learning can be divided into two main types: Regression and Classification.
Types of Supervised Learning
- Regression: This is used when we want to predict a continuous value. Think of it like guessing the price of a house based on its size, location, and number of rooms.
- Classification: This is used when the output falls into clear-cut categories. For example, deciding whether an email is spam or not — there’s no in-between!
How Supervised Learning Works
- Training Data: We give the model a dataset that contains input features and the correct answers (labels).
- Learning Process: The model studies the data and finds patterns to link inputs with the right outputs.
- Prediction: Once trained, the model can make educated guesses when given new data.
- Evaluation: We test the model using fresh data it hasn’t seen before to see how well it performs.
Example: Linear Regression in Supervised Learning
Let us take a very classic example of Supervised Learning: Linear Regression, which is used for regression tasks. It helps predict continuous values by figuring out a straight-line relationship between input and output. Basically, linear regression is used when the output depends linearly on input.
The formula for simple linear regression looks like this, which you must be familiar with:
y = mx + b
Where:
- y is the predicted value,
- m is the slope (how much y changes when x increases),
- x is the input feature,
- b is the intercept (the starting value when x = 0).
How it works?
- Training data: We give a set of input values x, and output values y to the model which have a linear relationship.
- Learning process: Model finds a linear relationship between input and output by finding values of m and c. How does it do that? We will see later!
- Prediction: When given new input, model predicts output based on above formula.
- Evaluation: We evaluate model’s performance based on cost function, and if it is not performing well, we adjust the values of m and c. But what is cost function? We will see that in the next part.
Conclusion
Supervised learning is a great starting point in machine learning. It’s all about training models with labeled data so they can make accurate predictions. Whether it’s classifying emails or predicting prices, mastering supervised learning is the first step toward building smarter AI models.
In next part, we will see an example of Linear regression and see what is what is Cost function.
See you there!