Introduction to AI
Online B.Com · Sem 5
0% complete
0/7 lessons
Lesson 2 of 7Accounting AI · Digital Marketing
Supervised vs Unsupervised Learning
Introduction to AI
About the video
Lec-23: Supervised vs Unsupervised learning with real life example
Gate Smashers
Study notes
Machine learning systems learn patterns from data, and the two main ways they learn are supervised and unsupervised learning. Supervised learning trains on labelled data (inputs with known correct answers) to predict outcomes, while unsupervised learning works on unlabelled data to discover hidden groups or structures. Knowing the difference helps you pick the right approach for business and finance problems such as loan approval, fraud detection and customer segmentation.
Supervised Learning
- Definition: the model learns from labelled data, where each input (features) comes with the correct output (label).
- It works like a student learning with a teacher: the model's predictions are checked against known answers and errors are corrected during training.
- Steps: collect labelled data, split it into training and test sets, train the model, evaluate its accuracy, then predict on new data.
- Real-life example: a bank trains a model on past loan applications marked 'repaid' or 'defaulted' so it can predict whether a new applicant is likely to default.
- Goal: learn a mapping from input X to output Y, so that Y can be predicted for unseen X.
Types of Supervised Learning
- Classification: the output is a category, e.g. email is 'spam' or 'not spam', or a transaction is 'fraud' or 'genuine'.
- Regression: the output is a continuous number, e.g. predicting a house price, next month's sales or a company's revenue.
- Common algorithms: linear regression, logistic regression, decision trees, support vector machines (SVM), k-nearest neighbours (KNN).
- Simple linear regression formula: Y = a + bX, where Y = predicted value, X = input variable, a = intercept (value of Y when X is 0), b = slope (change in Y for a one-unit change in X).
Unsupervised Learning
- Definition: the model learns from unlabelled data, with no correct answers given, and finds patterns or structure on its own.
- It is like learning without a teacher: the algorithm groups or organises data based on similarities and differences.
- Real-life example: an e-commerce or retail company groups customers by purchase behaviour (frequency, spend, product types) to design targeted offers, without knowing the groups in advance.
- Main tasks: clustering (grouping similar items, e.g. K-means), association (finding items that occur together, e.g. market basket analysis using the Apriori algorithm), and dimensionality reduction (e.g. PCA).
- Finance use: spotting unusual transactions that do not fit normal patterns (anomaly detection) to flag possible fraud.
Supervised vs Unsupervised: Direct Comparison
- Data: supervised uses labelled data; unsupervised uses unlabelled data.
- Aim: supervised predicts a known type of outcome; unsupervised discovers hidden patterns or groups.
- Evaluation: supervised accuracy can be measured directly against true labels; unsupervised results are harder to measure because there is no correct answer.
- Effort and cost: supervised needs time and money to label data; unsupervised can use raw data but its results need human interpretation.
- Typical tasks: supervised means classification and regression; unsupervised means clustering, association and dimensionality reduction.
Key terms
- Labelled data
- Data where each example includes the correct output or answer, such as a transaction marked 'fraud' or 'genuine'.
- Feature
- An input variable used by a model, such as income, age or transaction amount.
- Classification
- A supervised task that predicts a category or class.
- Regression
- A supervised task that predicts a continuous numerical value.
- Clustering
- An unsupervised task that groups similar data points together without predefined labels.
- Association rule learning
- An unsupervised method that finds items or events that frequently occur together, as in market basket analysis.
- Training and test data
- Training data is used to teach the model; test data is held back to check how well it performs on unseen cases.
- Anomaly detection
- Identifying data points that differ greatly from normal patterns, often used to flag possible fraud.
Takeaways
- Supervised learning needs labelled data and predicts known outcomes; unsupervised learning finds hidden patterns in unlabelled data.
- Use classification for categories and regression for numbers.
- Use clustering for grouping customers and association for finding items bought together.
- Supervised models are easier to evaluate, but labelling data costs time and money.
- In finance, supervised learning suits credit scoring, and unsupervised learning suits customer segmentation and spotting unusual transactions.
Contribute
Was this lesson helpful?
We read every rating and fix the weakest lessons first.