GeekCoding101 · Originally published Apr 25, 2024 · Topics: machine-learning, notes
Machine learning approaches fall into three main groups: supervised learning, unsupervised learning and reinforcement learning. Semi-supervised learning sits between the first two. Every trained model also faces the same two risks, underfitting and overfitting, and both hurt how well it generalizes to new data.
These are my notes from Machine Learning for Absolute Beginners - Level 1. I picked it up while working through Andrew Ng’s Supervised Machine Learning: Regression and Classification. That course is solid, but it’s dry, so I wanted something lighter alongside it. This one is genuinely beginner-friendly. I finished it in about 2.5 hours, probably because the Andrew Ng course had already given me a head start.
The types of machine learning at a glance
| Type | Training data | Goal | Typical tasks |
|---|---|---|---|
| Supervised | Labeled | Predict a known label or value | Classification, regression |
| Unsupervised | Unlabeled | Find meaningful patterns automatically | Clustering, anomaly detection, dimension reduction |
| Semi-supervised | Mostly unlabeled, then labeled via clustering | Turn unlabeled data into training data | Labeling a dataset to train a supervised model |
| Reinforcement | No fixed dataset; feedback from interaction | Reach an end goal through a sequence of actions | Games, robotics, real-time recommendations |
Applied AI (Shallow AI)
An industrial robot that handles a specific, small, pre-programmed task is an example of Applied AI, also called Shallow AI. It does one narrow job well and nothing beyond it.
How a model is trained and used
There are two phases:
- Training phase: labeled training dataset → ML training → trained model
- Inference phase: new, unlabeled input → processed by the trained model → output with labels (predictions)
The point of training is generalization: the model should work on data it has never seen, not just on its training set. Underfitting and overfitting are the two main obstacles to that.
Underfitting vs overfitting
Underfitting
An underfit model performs poorly on the training data and also fails to generalize to new data. It hasn’t captured the pattern at all.
Possible reasons:
- The model is too simple
- The dataset isn’t good enough
An ideal training process moves from underfitting → better fitting → a good fit.
Overfitting
An overfit model performs well on the training data but fails to generalize to new data. It has learned the training set too closely, noise included.
Possible reasons and mitigations:
| Reason | Mitigation |
|---|---|
| Training data isn’t a true representation of the real data distribution | Use a much larger training dataset, and evaluate on a separate test dataset |
| Model is too complex | Keep the model as simple as the data allows |
| Training dataset is too small | Collect more data |
I go deeper on overfitting, including regularization, in my Day 11–12 notes from the Andrew Ng course.
Supervised learning
Supervised learning trains on labeled data. Two tasks are typical:
Classification
The model predicts which category an input belongs to. Don’t confuse this with clustering, which belongs to unsupervised learning. One common classification algorithm is Support Vector Machines (SVM). SVM is also a standard example of a shallow learning algorithm, meaning classic ML rather than deep neural networks.
Regression
Regression is a set of statistical methods for estimating the strength of the relationship between a dependent variable and one or more independent variables. Common types:
- Linear regression
- Logistic regression (despite the name, it’s used for classification)
- Polynomial regression
Unsupervised learning
The goal is to automatically identify meaningful patterns in unlabeled data.
Clustering
Clustering identifies instances with shared attributes and groups them into clusters. Objects in the same cluster are more similar to each other than to objects in other clusters. The algorithm’s output is a set of labels that assigns each data point to one of the identified clusters.
Example uses:
- Customer segmentation (for example, by demographic information)
- Anomaly or outlier detection
- Image segmentation
Dimension reduction
A common challenge for supervised learning is having too many input features. Dimension reduction acts as a pre-processing step:
large dataset → dimension reduction → smaller dataset → train a supervised learning model
Semi-supervised learning
Semi-supervised learning sits between supervised and unsupervised learning. It works like this:
unlabeled dataset → clustering → clusters 1, 2, 3… → label the dataset → use the labeled dataset to train a supervised model
Reinforcement learning
Reinforcement learning (RL) is a different approach from supervised and unsupervised learning:
- It doesn’t learn from a fixed group of labeled or unlabeled examples.
- It’s a framework for goal-based decision-making: reaching a complex objective by performing sequences of actions.
- The machine learns how to behave by interacting with its environment while focusing on an end goal.
- It tries things, gets feedback, and learns from that feedback. The feedback on a chosen strategy is often delayed.
Where it’s used:
- Chess and computer games in general, where it has reached superhuman performance
- Training robots to perform tasks in dynamic environments
- Building real-time recommendations
The decision-making agent
Because RL has an end goal, it needs a reward mechanism that pushes learning in the right direction. RL builds a prediction model from trial-and-error feedback, using insight from previous iterations. Knowledge of how to reach a specific goal gets reinforced again and again through experience.
My take on the course
This course really is designed for absolute beginners, and it’s a good fit if a more rigorous course feels heavy. My one suggestion: the quizzes are too easy. Most of them repeat what was just explained, with no variations or ambiguity to actually challenge you.
FAQ
What are the main types of machine learning? Supervised learning (labeled data), unsupervised learning (unlabeled data) and reinforcement learning (learning from interaction and rewards). Semi-supervised learning combines elements of the first two.
What’s the difference between underfitting and overfitting? An underfit model does poorly on both training data and new data. An overfit model does well on training data but poorly on new data.
Is clustering the same as classification? No. Classification is supervised: it predicts known labels. Clustering is unsupervised: it discovers groups in unlabeled data.
How is reinforcement learning different from supervised learning? Supervised learning learns from labeled examples. Reinforcement learning learns from feedback (rewards) while taking actions toward a goal, and that feedback is often delayed.
Is Machine Learning for Absolute Beginners - Level 1 worth it? It’s a quick, friendly overview. It took me about 2.5 hours. The quizzes won’t challenge you much, so pair it with a deeper course if you want rigor.
Thanks for reading! Questions or corrections are welcome via the contact page.