1. Home
  2. Explore
  3. Computer Science
  4. Machine Learning Models Overview

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Machine Learning Models Overview

Transcript

Every major machine learning model  explained in 25 minutes. In this video,   I'll be doing a high level overview of each of  these machine learning models, since if I went   into detail for each one, this video would be,  very, very long. Literally every single one of   these models can have an entire video dedicated  to them. In fact, I will probably do that sometime   down the line. If there's a specific model  you want me to cover in the future, just put it in the comments below. I give you anywhere  from 0 to 100% of my word, that I'll cover it.  First off, if you hear the words "machine  learning" and think to yourself *a clueless dude*,   then here's a simple definition. Machine learning  is basically giving computers a bunch of data and   letting them slowly figure things out instead of  hard-coding every tiny instruction . All machine   learning can be split into two categories:  supervised learning and unsupervised learning.

Supervised learning is when the model is trained  on labeled data, meaning for every input, there's   already a correct answer provided. For example,  imagine showing a child thousands of pictures of   cats and dogs, each one labeled with what it is.  Over time, the child learns to tell them apart on   their own. Supervised learning works the same way,  you feed the model thousands of labeled examples, and it learns the patterns that connect the  inputs to the correct answers. The model learns   by comparing its predictions to those correct  answers and adjusting itself until it gets better.   Think of it like studying with an answer key. You  already know what the right answers are, and you   keep practicing until you can get them right on  your own. Within supervised learning, there are   two main types of tasks. The first is regression,  where the goal is to predict a continuous

numerical value. Continuous just means the output  can be any number along a range, not just a fixed   set of options. Think of things like predicting a  house price, forecasting tomorrow's temperature,   or estimating someone's salary. The second is  classification, where the goal is to predict   a discrete category. Discrete means the output  is one of a fixed set of options. There's no in   between. Either the email is spam or it isn't.  Either the tumor is malignant or it's benign. Either the image is a cat, a dog…you get the idea.  Now, not all data comes with labels. Sometimes you   just have a massive pile of raw data and no idea  what's inside it — no answer key, no guidance,   nothing. That's where unsupervised learning comes  in. Instead of learning from labeled examples,   the model looks at all the data that has no  labels, and has to figure out the patterns and

structure on its own. For example, imagine dumping  a million customer transactions into a model with   no instructions. Unsupervised learning can look  at that data and automatically discover that there   are distinct groups of customers: big spenders,  occasional browsers, and discount hunters. Nobody   told it those groups existed. It found them on  its own. We'll get into that later. The simplest regression model is called Linear Regression. The  idea is straightforward. Think of it like drawing   the best-fitting straight line through a scatter  plot of data points. The goal is simple: predict   an output Y, called the dependent variable, based  on an input X, called the independent variable.   For example, let's say we want to predict a  student's exam score based on how many hours   they studied. Every student in our dataset becomes  a dot on a graph — hours studied on the X axis,

exam score on the Y axis. Linear Regression draws  the best-fitting line through all those dots. So   if a new student studied for 6 hours and we wanted  to predict their score, trace up from 6, hit the   line, and read across. That's our prediction. The  equation looks like this. Y-hat is the predicted   output. Beta zero is the intercept, where the line  crosses the Y-axis. Beta one is the slope, how much Y changes for every one unit increase in X.  And X is the input feature. In reality though, one   variable rarely tells the whole story, which leads  to multiple linear regression, with its bigger,   more intimidating older brother equation.  Each X represents a different independent   variable - hours studied, hours slept, assignments  completed, and so on. Each corresponding Beta   coefficient tells you how much that specific  feature contributes to the prediction.

Linear Regression is best used when you need to  predict a continuous numerical value and there's a   clear relationship between your inputs and output.  Next up is Logistic Regression, and despite the   name, it's not actually used to predict continuous  values like Linear Regression. Instead it's used   for classification, meaning the output is a  category, not a number. The most common case   is binary classification, where the answer is one  of two things: yes or no, true or false, 0 or 1.

For example, we might want to predict whether a  patient has a disease or not, based on their age,   blood pressure, and cholesterol levels. The model  simply outputs a yes or a no. The core idea is   this: Logistic Regression takes the same linear  regression equation we already know, but instead   of outputting a raw number, it passes it through  something called a sigmoid function which produces an S-shaped curve, which looks like this. This  function squishes the output into a value between   0 and 1, which we interpret as a probability. So  if the model outputs 0.85, that means it’s 85%   confident the patient has the disease. Then we  apply a cutoff. Usually 0.5. If it's above 0.5,   it's a yes, and if it's below 0.5, then it's a no.  Logistic Regression is best used when you need to

classify something into one of two categories and  the relationship between your inputs and output   is relatively straightforward. Naïve Bayes is a  classification algorithm built on two different   parts. The "Bayes" part comes from Bayes' Theorem,  a mathematical formula for updating your belief   about something based on new evidence. The "Naïve"  part comes from a bold assumption the algorithm   makes: that all input features are completely  independent of each other — meaning one feature has absolutely no influence on another. Take spam  detection as an example. When Naïve Bayes looks   at an email, it scans each word independently and  asks: "given that this email is spam, how likely   is it to contain this word?" It does this for  every single word, multiplies the probabilities   together, and compares the result for spam vs.  not spam. Whichever comes out higher wins. The key

formula behind this is Bayes' Theorem. What Bayes'  Theorem is really saying is: take what you already   believed, update it based on new evidence, and you  get a smarter, more informed probability. That's   it. Naïve Bayes is best used when you need a fast,  lightweight classifier — especially on text data.   If your data is text-heavy and you need something  reliable without a lot of computational overhead, Naïve Bayes is a solid pick. Our next model,  is K-Nearest Neighbors, or KNN for short. The   core idea of it is simple: to predict what  something is, take a look at what's around   it. In K-Nearest Neighbors, you classify a new  data point by looking at the k-closest points   in your training data and take a majority vote. Imagine you walk into a party you have no idea   what kind of party it is. Instead of asking the  host you just look at the people standing closest

to you. If the 3 nearest people are all talking  excitedly about Python, you're probably at a tech   meetup. If they're all holding guitars and wearing  vintage band t-shirts, you're at a music event.   You didn't need to survey the entire room, you  just looked at your nearest neighbors and made   a call. KNN does the exact same thing. The 'K' in  KNN is just a number you choose. For instance, if K = 3, then it looks at the 3 closest data points.  If k = 5, it looks at the 5 closest. Once it finds   those neighbors, it does one of two things,  depending on the task. First is Classification.   This means it takes a majority vote. Whatever  class most of the neighbors belong to, that's   the prediction. The other is Regression. Here,  it takes the average of the neighbors' values   as the prediction. So how does KNN figure out  who it's "nearest neighbors" are? Typically it

uses something called Euclidean Distance, which  is just a fancy way of saying the straight-line   distance between two points. It works well for  As a rule of thumb, if your dataset is small and   the relationships between data points are based on  similarity, KNN is a solid choice. Support Vector   Machines, or SVM for short, is a classification  algorithm that works by finding the best possible boundary, called a hyperplane, that separates two  classes of data. The goal is not just to find any   boundary that separates the data, but the one with  the maximum margin, which is the distance between   the boundary and the nearest data points from each  class. To understand this visually, imagine two   groups of dots on a graph, red dots and blue dots.  There are many possible lines you could draw to

separate them, but Support Vector Machines finds  the one that is furthest away from the closest   dots on both sides. Those closest dots are called  support vectors. They're the data points that are   literally holding up the boundary. Support Vector  Machine's entire goal is to maximize the margin.   Now here’s where it gets interesting. What if  the data isn’t separable by a straight line?  Support Vector Machines solve this using  something called the Kernel Trick, which basically transforms the data into a higher dimension where  it suddenly does become separable. You can think   of it like lifting dots off a flat table into  3D space so a flat plane can now separate them   perfectly. That’s what allows SVMs to handle  more complex, non-linear data. That's badass.  SVM works best when you have a clear  margin of separation between classes,   and when working with high-dimensional data —  such as text classification or image recognition.

We're now going to transition into trees. No not  those trees. I'm talking about Decision Trees. A   Decision tree is exactly what it sounds like - a  tree-like structure of decisions that leads to a   prediction. It's literally a tree of yes-or-no  questions. It works by repeatedly splitting the   data into smaller and smaller groups based on  the most informative feature at each step, until   it reaches a final answer. Each step narrows down  the possibilities until you arrive at the answer. For example, imagine you're trying to predict  whether someone will buy a product. The tree   might start by asking: "Is the person over 30?" If  yes, then then it goes down one branch. If no, it   goes down another. Then it asks another question,  and another, until it reaches a final prediction:   buy, or don't buy. Each point where the tree makes  a decision is called a node. The very first node   at the top is called the root node. It's the  most important split in the entire tree. The

final nodes at the bottom, where the predictions  live, are called leaf nodes. Decision Trees are   most useful when you need a model that is easy to  interpret and explain. You can literally follow   the branches and see exactly how the prediction  was made. For example, a bank might use a Decision   Tree to predict whether a loan applicant should  be approved — starting with questions like income level, credit score, and employment status, each  split narrowing down the risk profile until a   final decision is reached. Next is Random Forests.  A Random Forest is essentially a team of Decision   Trees, and as the name suggests, a whole forest  of them. The idea is simple: instead of relying   on one Decision Tree to make a prediction, why  not build hundreds of them and let them vote?   Here's how it works. Random Forest builds a large  number of Decision Trees, but with two key twists:

Number one is Random Data Sampling. Each tree is  trained on a random subset of the training data,   rather than the full dataset. This means each tree  sees a slightly different version of the data and   learns slightly different patterns. Number two is  random feature selection. At each split, instead   of considering all features, each tree only  considers a random subset of the features. This   forces diversity across the trees, which helps  cancel out the mistakes of the other decision trees. This approach of combining multiple models  together is called ensemble learning — and it's   what makes Random Forest so powerful. Next up is  XGBoost. Aside from sounding like it belongs in a   Fast and Furious movie, XGBoost — which stands for  Extreme Gradient Boosting is a powerful machine   learning algorithm where each tree is designed  to learn from the mistakes from the previous

one. Instead of building trees independently like  Random Forest, XGBoost builds them sequentially.   The core idea behind XGBoost is a technique called  boosting. The sequential nature allows each tree   to focus on the errors that the previous tree got  wrong. The "gradient" part of the name refers to   how XGBoost measures and corrects those errors.  It uses a mathematical technique called gradient   descent to minimize a loss function, which  is just a measure of how wrong the model's predictions are. Each new tree is built in the  direction that reduces that error the most.

XGBoost is best used when you need maximum  predictive performance on structured,   tabular data. Now, let's get into neural networks.  If there's one topic in this entire video that has   fundamentally changed the world, it's this one.  Neural Networks are the engine behind modern AI,   deep learning, large language models like ChatGPT,  image generation, self-driving cars, all of it   traces back to Neural Networks. Loosely inspired  by the human brain, a Neural Network is made up of layers of interconnected nodes, similar to our  brain's neurons. There are three types of layers:   an Input layer, Hidden Layers, and the Output  Layer. The Input Layer is where the data enters   the network. Each node in this layer represents  one feature, such as age, income, or pixel value.   The Hidden layers are the layers in between, where  the actual learning happens. Here the network   learns to detect patterns and relationships in  the data by adjusting the connections between

the nodes. Then lastly, the Output layer. This  is where the final prediction comes out. The   connections between neurons each have a weight — a  number that determines how much influence one node   has on the next. During training, the network  adjusts these weights to minimize its errors,   gradually getting better at making predictions.  Neural Networks are best used when your data is   complex and high dimensional such as images,  audio, or text — where traditional algorithms struggle to find patterns on their own. Next  up is a specific type of neural network called   a Convolutional Neural Network, or in short,  CNN. And no, I don't mean the news channel.   The CNN I'm talking about is actually good  at telling you what to pay attention to.

Anyways, CNNs are designed specifically  for processing data that has a grid-like   structure — most commonly images. While a  regular Neural Network treats every input   feature equally and independently, a CNN is  smart enough to understand that in an image,   nearby pixels are related to each other and should  be looked at together. The core idea behind a CNN   is the convolution operation — instead of  looking at the entire image all at once, the network slides a small filter across the  image, scanning it piece by piece and detecting   patterns like edges, shapes, and textures. In the  early layers, the network picks up simple patterns   like edges and corners. In the deeper layers, it  starts combining those simple patterns into more   complex ones — like eyes, ears, and eventually  entire faces. It's like going from recognizing   individual letters, to words, to full sentences.  CNNs are best used when your data has spatial

structure — meaning the position and relationship  of features matters. They are the go-to choice for   image recognition, video analysis, and medical  imaging. If Neural Networks are the engine of   modern AI, Transformers are the turbo boost. Now  when I say "transformers" and you think of this,   then all I have to say is *get help dude*, and  allow me to clarify. Transformers are a type of AI architecture that can read and understand entire  sentences at once, rather than one word at a time.   It completely changed the way machines process  and understand language. ChatGPT, Google Gemini,   and virtually every modern large language model  you've heard of is built on this architecture.   Before Transformers, models processed data  sequentially, one word at a time, in order.   This made it slow and difficult to understand long  range relationships in text. For example, in the

sentence "The trophy didn't fit in the suitcase  because it was too big" — well, what does the   word "it" refer to? While humans figure this out  instantly, older AI models struggled because they   processed words one by one and lost context along  the way. Transformers solved this with a mechanism   called attention, specifically self-attention.  Instead of processing words one at a time,   the Transformer looks at the entire sequence  at once and figures out which words are most relevant to each other. This ability to understand  context across an entire sequence is what makes   Transformers so powerful. Next up are Generative  Adversarial Networks or GANs. These are one of the   most creative ideas in machine learning. Instead  of predicting a label or classifying an input,   GANs are designed to generate entirely new data  — images, audio, video, or text. The way they do   this is through a two-player game between two  neural networks that are essentially trying

to outsmart each other. The first is called the  Generator — its job is to create fake data that   looks as realistic as possible. The second is  called the Discriminator — its job is to look   at data and decide whether it's real or fake.  The two networks are trained simultaneously,   in direct competition with each other. Think of it  like a art forger and an art detective. The forger   keeps producing fake paintings, trying to fool the  detective. The detective keeps getting better at spotting fakes. So the forger has to get better  too. Back and forth, round after round, until   the forger is so good that even the detective  can't tell the difference anymore. That's exactly   how a GAN trains. GANs are best used when the goal  is to generate new, realistic data rather than   classify or predict existing data. They are behind  some of the most impressive AI applications you've   seen — deepfakes, AI generated art, synthetic  data generation, and photo realistic image

synthesis. A classic example is face generation —  given no real photos, a GAN can generate thousands   of completely fictional yet photorealistic  human faces from scratch. Impressive,   slightly unsettling, and a little bit illegal in  the wrong hands. Next up is K-Means Clustering,   which is an unsupervised learning algorithm.  That means there are no labels, no right answers,   and no one telling the model what to look for,  like I explained earlier. Instead, K-Means is given a dataset and tasked with finding natural  groups or clusters — within the data entirely on   its own. You tell the algorithm how many clusters  you want — that's the K — and it figures out the   best way to divide the data into that many  groups. Each group is defined by a centroid,   which is just the center point of that cluster.  The algorithm assigns every data point to the   nearest centroid, then recalculates the  centroids based on the new assignments,

and repeats this process until the clusters  stop changing. K-Means is best used when you   want to discover natural groupings in unlabeled  data. It's widely used in customer segmentation.   For example, a retail company might use  K-Means to group customers into clusters   based on purchasing behavior, allowing them to  tailor marketing strategies to each group. PCA,   or Principal Component Analysis, is  another unsupervised learning technique, but unlike K-Means which finds groups, PCA is  about dimensionality reduction. In plain English,   that means taking a dataset with a lot of features  and compressing it down into fewer features,   while still keeping as much of the  important information as possible. To understand why this matters, imagine you  have a dataset with 100 features. Not all   of those features are equally useful. Some are  redundant and barely relevant, and feeding all

100 into a model is inefficient and can actually  hurt performance. PCA solves this by finding the   directions in the data where the most variation  exists — called principal components — and   projecting the data onto those directions,  effectively summarizing the most important   information in fewer dimensions. Under the hood,  PCA computes something called the covariance   matrix. This matrix helps figure out which  directions in the data have the most variation, and projects the data onto those directions.  It's kind of like taking the perfect selfie,   you find the best angle with the best lighting  that captures you in all your beautiful glory. PCA   is best used when you have high dimensional data  and need to reduce complexity before feeding it   into another model, or when you want to visualize  high dimensional data in 2D or 3D. It's widely   used in image compression. If your data has  too many features and your model is struggling,

PCA is often the first tool to reach for. Lastly  we have Reinforcement Learning. Reinforcement   Learning is all about learning through trial and  error. The core idea is built around three things:   an agent, an environment, and a reward. The agent  is the learner — the thing making decisions. The   environment is everything the agent interacts  with. And the reward is the feedback signal — a   score the agent receives after taking an action,  telling it whether that action was good or bad. The agent's goal is simple: maximize its total  reward over time. It's kind of like training   a dog. Every time the dog does something  right, you give it a treat. Every time it   does something wrong, no treat. Over time, the  dog figures out exactly what behavior gets the   most treats. Reinforcement Learning works the  same way. What makes Reinforcement Learning   powerful is that the agent doesn't need to be  told what the right answer is — it discovers

it on its own through exploration and feedback.  Over thousands or even millions of iterations,   it learns a policy — which is a strategy for  deciding what action to take in any given   situation to maximize its reward. Reinforcement  learning is increasingly being used in robotics,   and autonomous vehicles. And If you've ever been  amazed by what modern AI can do, there's a good   chance Reinforcement Learning had something to do  with it. Now before we continue, quick question: Have you noticed that learning machine  learning hands-on is weirdly frustrating? Everything’s either too  theoretical, too confusing,   or so boring it feels like homework.  That’s actually the exact reason I built   my newsletter…to fix that problem and make  machine learning not just easier…but fun. if you really want to go deep and actually  practice machine learning hands-on,   I just launched The Gradient Descent Pro  Tier — this is where you don't just learn,   but apply through practice.

Every week you get a hands-on coding environment  where you're actively implementing machine   learning concepts yourself, complete with  visual demos, step-by-step explanations,   real-world tasks, hints, and full  solutions. And that’s just the coding side. You also get weekly quizzes at three  difficulty levels — Easy, Medium,   and Hard — that don’t just tell you you’re  wrong, but explains why. And every week you get a beautifully illustrated visual  cheat sheet packed with Python snippets   and key concepts — the kind of thing  you'll actually keep open while coding. And on top of all of that, you also get a  completely free machine learning ebook. It   covers the fundamentals: the different types  of ML, the algorithms you'll actually use,   and the math behind it all, in an  easy-to-understand, digestible format.

All of this is normally it’s $9.99/month, but  the first 100 subscribers get the Founding   Member deal: everything locked in permanently  for $5/month. That’s basically one latte. Once   those spots are gone, they’re gone. So don't  sleep on it. The link’s in the description.   And that's every major machine learning  model you need to know — and remember,   this was just a high level overview. If you want  a deep dive into any particular model, drop it in the comments below and I'll make it happen. We  covered a lot of ground today, but you don't need   to master all of this at once. Pick one, go deep,  and build from there. If you found this helpful,   subscribe, because there's a lot more where  this came from. I'll see you in the next one.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent