Introduction to
Machine Learning
By Ishika Bhattacharjee
What is machine learning?
Machine Learning (ML) is a branch of Artificial Intelligence (AI) that allows computers to
learn from data and make predictions or decisions without being explicitly programmed.
A computer program is said to learn from experience E with respect to some class of
tasks T and performance measure P, if its performance at tasks in T, as measured by P,
improves with experience E.
Example:
Task (T): Predict whether an email is spam.
Experience (E): Training on thousands of labeled emails.
Performance (P): Accuracy of spam detection improves over time.
~ Tom Mitchell, 1997
Types of Machine learning
Machine Learning can be broadly divided into these main types:
Supervised Learning Unsupervised Learning
Supervised learning is a machine learning paradigm Unsupervised learning is a machine learning
in which a model is trained on a labeled dataset paradigm where the model is trained on an
consisting of input–output pairs, with the objective unlabeled dataset containing only input variables
of learning a mapping function from inputs X to X, with the objective of discovering hidden
outputs Y, such that it can accurately predict the structures, groupings, or representations within the
output for unseen inputs. data without explicit target labels.
Mathematical Form:
→
f:X Y Mathematical Form:
Where X = features (inputs), Y= target (labels). →
f:X Patterns / Clusters / Reduced Dimensions
Other types:
[Link]-supervised Learning
[Link] Learning
Applications of ML
Supervised Learning Unsupervised Learning Semi-Supervised Learning Reinforcement Learning
Healthcare: Disease Marketing: Customer Healthcare: Disease detection Autonomous Vehicles: Self-
prediction (diabetes, segmentation (grouping from X-rays or MRIs where only driving cars learning road
cancer detection from buyers with similar a few are labeled. behavior.
medical scans). behavior). Finance: Fraud detection using Robotics: Robots learning to
Finance: Credit scoring, E-commerce: Market few labeled fraud cases + walk, pick objects, or navigate.
loan approval, fraud basket analysis many unlabeled transactions. Gaming & AI: AlphaGo (Google
detection. (Amazon/Flipkart E-commerce: Product DeepMind), chess engines,
Business: Sales “Frequently Bought classification when only some video game AI.
forecasting, churn Together”). items are labeled. Recommendation Systems:
prediction. Cybersecurity: Anomaly NLP (Text): Spam detection, Personalizing content on
Technology: Email spam detection for fraud, fake news detection with few Netflix/YouTube.
filtering, sentiment analysis malware, or intrusion. labeled examples. Smart Systems: Energy
(positive/negative reviews). Data Visualization: Speech & Image Recognition: management in smart grids,
Education: Predicting Reducing data dimensions Training voice assistants or elevator scheduling.
student performance from (PCA for plotting large image tagging with limited
attendance, study hours. datasets). labeled data.
Social Networks: Web & Social Media: Search
Community detection engines and content
(finding friend groups in moderation (flagging harmful
Facebook/Instagram). posts).
Bias - Variance Trade Off
click
Bias is the error due to systematic deviation of the model’s predictions from the true values.
Mathematically, for a true function f(x) and a model prediction f^(x):
Bias(x) = E[f^(x)]−f(x)]
Bias is the difference between predicted values and the correct values. A high bias model makes strong
assumptions, leading to large errors in both training and testing. It usually fits the data with a simple straight
line, missing important patterns and High Bias leads to underfitting.
Bias - Variance Trade Off
Variance is the error due to the model’s sensitivity to small fluctuations in the training data.
Mathematically:
Variance(x) = E[(f^(x)−E[f^(x)])^2]
Variance measures how much a model’s predictions change for different training data. High variance models
fit the training data too closely (complex fit) but perform poorly on unseen data and this leads to overfitting.
Such models have low training error but high test error.
Bias - Variance Trade Off
click again
The total expected error of a model can be expressed as:
Expected Error = {Bias}^2 + {Variance} + {Irreducible Error}
Bias² → Error from wrong assumptions (underfitting).
Variance →
Error from excessive complexity (overfitting).
Irreducible Error→ Noise in data that cannot be removed (e.g., measurement errors).
Tradeoff:
Increasing model complexity reduces bias but increases variance.
Simplifying the model reduces variance but increases bias.
The goal is to find a balance where total error is minimized.
Data 1. Structure
Structured Data
Fundamentals Definition: Data organized in rows and columns in a fixed
format.
Examples: Excel sheets, databases, student marks, sales
data.
Data is the foundation of Machine Learning.
Usage: Easy to store, process, and analyze using traditional
Before building models, we must understand tools (SQL, spreadsheets).
the data we have, how to collect it, and how
Unstructured data
to prepare it for analysis.
Definition: Data without a predefined format, hard to
organize in tables.
Examples: Text documents, emails, social media posts,
images, audio, video.
We can divide the typesof data on the basis of : Usage: Needs advanced methods like NLP, image
processing, or deep learning.
[Link]
[Link] Semi structured
[Link] Definition: Data that is partly organized but not fully tabular.
Examples: JSON files, XML files, web logs.
Usage: Can be parsed and partially structured for analysis.
Data 3. Nature
Fundamentals
Quantitave Data
Definition: Data that can be measured and expressed
numerically.
Subtypes:
[Link]: Countable values (e.g., number of students,
2. Source number of products sold).
[Link]: Any value in a range (e.g., height, weight,
temperature).
Primary Data
Usage: Regression, statistical analysis.
Collected directly by the researcher for a specific purpose.
Accurate and first-hand.
Examples: Surveys, experiments, interviews, sensor Qualitative Data
readings.
Definition: Data that describes qualities or categories, not
numeric values.
Subtypes:
Secondary data
[Link]: Names or labels without order (e.g., gender, city,
Collected earlier by someone else for a different purpose. blood group).
Less costly, readily available, may need cleaning. [Link]: Categories with order or ranking (e.g., grades: A > B
Examples: Government reports, research papers, online > C).
datasets (Kaggle, UCI). Usage: Classification problems in ML.