Your journey into ML starts here. Use the arrows to navigate.
Machine Learning (ML) is a field of artificial intelligence where we teach computers to learn from data and make predictions or decisions, without being explicitly programmed for the task.
It's about finding patterns in data.
The core idea is called training. We show the model data, it makes guesses, we provide feedback on how wrong it was, and it adjusts itself. This repeats thousands of times until its guesses are accurate enough.
1. Input Data
The "textbook"
2. ML Algorithm
The "learner"
3. Trained Model
The "expert"
We typically split data into a training set (to build the model) and a testing set (to see how well it performs on new data).
ML models are typically categorized by how they learn from data.
Learning from labeled data (like a student with an answer key). The goal is to predict an outcome for new, unseen data.
Learning from unlabeled data (like exploring a city without a map). The goal is to discover hidden patterns in the data.
There's also Reinforcement Learning, where models learn by trial and error to achieve a goal, like playing a game.
Classification models predict a discrete category or class.
Goal: Is this email Spam or Not Spam?
Real-world Example: Email filtering, medical diagnosis, fraud detection.
Common Algorithm: Decision Trees, Logistic Regression.
from sklearn.tree import DecisionTreeClassifier
# Is it a cat or a dog?
features = [[1], [0]] # 1=meows, 0=barks
labels = ['cat', 'dog']
model = DecisionTreeClassifier().fit(features, labels)
prediction = model.predict([[1]]) # predicts 'cat'
Regression models predict a continuous numerical value.
Goal: What will be the price of this house?
Real-world Example: Stock price prediction, weather forecasting.
Common Algorithm: Linear Regression, Gradient Boosting.
from sklearn.linear_model import LinearRegression
# Predict price based on size
size_sqft = [[1500], [2000]]
price = [300000, 450000]
model = LinearRegression().fit(size_sqft, price)
prediction = model.predict([[1800]]) # predicts a price
Clustering algorithms group similar data points together without any prior labels.
Goal: Can we find distinct groups of customers based on their spending habits?
Real-world Example: Customer segmentation, grouping related news articles.
Common Algorithm: K-Means Clustering.
from sklearn.cluster import KMeans
# Find 3 groups of shoppers
shopper_data = [[...], [...]]
model = KMeans(n_clusters=3)
model.fit(shopper_data)
groups = model.labels_ # shows group for each shopper
You have a dataset of customer info and you want to predict if a customer will renew their subscription (Yes/No). What type of ML problem is this?
Hyperparameters are the "knobs" we set before training to control the learning process. Choosing the right ones is crucial.
Example: Let's see how changing the number of clusters ('K') hyperparameter affects our customer groups.
We often use automated methods like Grid Search or Random Search to test many hyperparameter values and find the best combination for our model.
Deep Learning is a powerful subfield of ML that uses Artificial Neural Networks with many layers (hence, "deep"). These networks are inspired by the structure of the human brain and are fantastic at finding complex patterns in massive datasets.
Used In:
Self-Driving Cars, Siri & Alexa, ChatGPT, Medical Imaging Analysis
Think of a single neuron as a tiny decision-maker. It takes in several pieces of evidence (inputs), weighs their importance, and then makes a simple decision (output).
Analogy: Deciding to bring an umbrella.
Neurons don't work alone. They are connected in layers. Each connection has a weight, which is just a number representing its importance.
Analogy: A panel of advisors.
Imagine you are making a big decision. You listen to several advisors (input neurons). You trust some advisors more than others. The amount of trust you give each advisor is their "weight".
The "weights" are the main things a neural network LEARNS during training.
A stronger weight (thicker line) means the input is more important to the neuron's decision.
The network learns by adjusting its connection weights over and over. It's a three-step loop:
The "number of clusters" in K-Means is a setting you must choose before training. What is this type of setting called?
Next Up: The Technical Deep Dive!
In our next workshops, we will move from concepts to code. We'll start building, training, and testing these models ourselves. Get ready!