CSE445 Machine Learning
Lecture 1:
Machine
Learning
Overview
Dr. Jilan Samiuddin (JSA)
Assistant Professor
North South University
Class Information
• Course Name: Machine Learning
• Course Code: CSE 445
• Credit Hours: 3
• Pre-requisites: CSE 348 or Consent from Instructor
2
Instructor Information
• Instructor Name: Dr. Jilan Samiuddin (JSA)
• Position: Assistant Professor, ECE
• Email: [Link]@[Link]
• Office: SAC 911
• Office hours: Posted in Canvas (Announcements)
3
Tentative Marks Distribution
• Attendance: 5%
• Project: 20%
• Quiz/Class Test: 20% (the worst quiz grade will be discarded)
• Midterm: 25%
• Final Exam: 30%
4
Class Rules
• General Conduct
• Punctuality: Arrive on time and stay for the entire class session.
• Respect: Treat instructors & classmates with respect and courtesy.
• Participation: Engage actively in discussions and group activities when required.
• No Disruptions: Avoid talking out of turn or engaging in off-topic activities.
• Phone Use: Keep mobiles in silent mode or turn off during class.
• Recording: Do not record lectures without the instructor’s permission.
• Academic Integrity
• Any kind of cheating is strictly prohibited
• Communication
• Office Hours: Attend during posted times or schedule appointments in advance.
• No makeup Quizzes
• You are responsible for ensuring your attendance
• If an attendance is not registered, it must be rectified within the same day in-person
5
Let’s discuss
• How many of you want to study abroad for higher education (Masters or PhD)?
6
Let’s discuss
• Take out a small piece of paper and write what you read:
CH4
Esc
• Becoming educated is more important than just being literate
• Moreover, morally educated (সুশিশিত) is way way way more important than just
being educated. In fact, there is no alternative to being morally educated.
Morally Educated >>>>>> Educated >> Literate
7
Introduction
• Machine Learning (ML) is a subset of Artificial Intelligence (AI) focused on enabling
computers to learn from data without explicit programming for each task
• It mimics human-like learning by identifying patterns and making data-driven decisions
• ML relies on statistical techniques to train algorithms and generate predictions
• By leveraging historical data, these algorithms provide valuable insights that help
businesses make informed, intelligent decisions.
I can learn Yes, I can
from learn from
experience. past data
Can you? with ML
Source: GeeksforGeeks
8
ML, AI and Deep Leaning (DL)
AI ML DL
Definition Machines that mimic A subset of AI where A subset of ML that
human intelligence (e.g., machines learn from uses neural networks
reasoning, learning, data without explicit with many layers ("deep"
decision-making) programming structures) to learn
patterns
Definition in lay terms The big picture AI’s learning engine ML’s supercharged brain
for tough tasks
Example Imagine building a self-driving car
The car’s ability to drive, The car learning to The car figuring out on
obey traffic rules, and recognize stop signs by its own that a blurry red
avoid collisions studying thousands of octagon is a stop sign,
labeled images even if it is partially
hidden
9
Why ML?
• Solving Complex Business Problems
→ Excels in areas like image recognition, NLP, and diagnostics
→ Learns from data without predefined rules
• Handling Large Volumes of Data
→ Processes massive data generated daily in the internet
→ Extracts insights and enables real-time decisions
• Automating Repetitive Tasks
→ Performs routine tasks with precision
→ Reduces manual workload and errors
• Personalized User Experience
→ Analyzes user behavior to deliver tailored content
• Self-Improving Performance
→ Continuously adapts and refines based on new data 10
How ML learns?
1. Data Input
• The system receives raw data (e.g., images, text, numbers) to analyze.
2. Algorithm Processing
• Algorithms identify patterns and relationships within the data.
3. Model Training
• The model adjusts its internal parameters using mathematical methods to learn from data.
4. Feedback Loop
• Predictions are compared to actual outcomes, and errors are minimized using techniques
like gradient descent.
5. Iteration and Learning
• The model improves through repeated exposure to data, enhancing accuracy over time.
6. Evaluation and Generalization
• Performance is tested on new, unseen data to ensure real-world reliability.
11
Types of ML
Supervised Unsupervised Semi-supervised Self-supervised Reinforcement
Learning Learning Learning Learning Learning
Involves training a Models work with Combines a small Uses un-labelled Trains an agent to
model on labeled input data that lacks amount of labeled data to generate its make decisions by
data, where each labels. The goal is to data with a large own labels through interacting with an
input is associated uncover hidden volume of unlabeled pretext tasks. These environment.
with a known patterns or data. This approach automatically Through trial and
output. The model groupings in the helps build models generated labels error, the agent
learns by comparing data without that generalize well, serve as supervision learns to maximize
its predictions to the predefined bridging the gap for training, enabling cumulative rewards
correct answers and categories. between supervised the model to learn without explicit
adjusting and unsupervised useful instructions.
accordingly. learning. representations
without manual
labeling.
12
Supervised Learning
Source: GeeksforGeeks 13
Supervised Learning Categories
1. Classification task
• The algorithm learns to assign input data to one of several predefined categories or labels.
This is useful when the output variable is categorical, meaning it represents distinct
classes.
• Example: Classify emails as “spam” or “not spam”
• Output type: Discrete categories or classes
• Common Algorithms: Decision Trees, Support Vector Machines (SVM), Logistic
Regression, k-Nearest Neighbors (KNN), Naive Bayes, Neural Networks (for classification)
2. Regression task
• The goal is to predict a continuous numerical value based on input features. The algorithm
tries to find the relationship between variables to make accurate numeric predictions.
• Example: Predict future stock prices using historical data
• Output Type: Continuous numerical values
• Common Algorithms: Linear Regression, Ridge Regression, Random Forest Regression,
Gradient Boosting Regressor, Neural Networks (for regression)
14
Unsupervised Learning
Source: GeeksforGeeks
15
Unsupervised Learning Categories
1. Clustering
• Aims to group similar data points into clusters based on shared characteristics or distances in
feature space. These clusters are formed in such a way that data points within the same group are
more similar to each other than to those in other groups.
• Example: Organizing articles into topics without prior labeling
• Common Algorithms: k-Means, Hierarchical Clustering, Gaussian Mixture Models (GMM)
2. Dimensionality Reduction
• Used to reduce the number of input features while preserving the most significant patterns in the
data. This helps in visualization, noise reduction, and improving the performance of other machine
learning algorithms.
• Example: Feature compression before feeding data into a classifier
• Common Algorithms: Principal Component Analysis (PCA), t-SNE, UMAP, Autoencoders
3. Association Rule Learning
• Identifies interesting relationships, correlations, or co-occurrences among items in large datasets.
These rules help in understanding how items or features are related.
• Example: Discovering that customers who buy bread often buy butter
• Common Algorithms: Apriori, Eclat, FP-Growth
16
Learners in ML
1. Lazy learners do not build a model during training – they simply
store the training data and wait until prediction time to
generalize
• They are slower at predicting but adapt easily to new data since they don’t
assume a fixed model
• Examples: Classification: k-NN, Regression: k-NN Regressor, Clustering:
Instance-based clustering (rare)
2. Eager Learners create a generalized model during training,
which is then used to make fast predictions on new data.
• They are faster at predictions but require retraining if new data is
introduced.
• Examples: Classification: SVM, Decision Trees, Regression: Linear
Regression, Clustering: k-Means (model-based) 17
Lazy Learners vs Eager Learners
Aspect Lazy Learners Eager Learners
Learning Model-based: Constructs a generalized model during
Instance-based: No explicit model is built.
Approach training.
Training Phase Minimal computation; simply stores training data. Computationally intensive; builds a model from the data.
Generalization
Generalizes at prediction time (on-the-fly). Generalizes during training (before seeing test data).
Timing
Memory Usage High (stores entire training dataset). Low (discards training data after model creation).
Prediction Speed Slower (processes data during each query). Faster (uses pre-built model for predictions).
Handling Training
Retains all training data for future predictions. Discards training data after model construction.
Data
Easily adapts to new data (just add to stored
Adaptability Requires retraining to incorporate new data.
dataset).
Training Time Short (only stores data). Long (computes model parameters/structures).
Prediction
High inference cost (e.g., distance calculations). Low inference cost (uses pre-computed model).
Complexity
k-Nearest Neighbors (k-NN), Case-Based
Examples Decision Trees, SVM, Neural Networks, Linear Regression.
Reasoning.
18
Data Preprocessing
• What: Preparing raw data for machine learning.
• Why: Garbage in = garbage out! Clean data = better models.
• Key Steps:
• Handle missing data (e.g., remove rows or fill gaps).
• Convert text/categories to numbers (e.g., "red" → 0, "blue" → 1).
• Scale features (e.g., normalize values between 0 and 1).
• Common techniques:
• Missing Data: Use mean/median or drop rows.
• Categorical Encoding: One-Hot Encoding (e.g., "cat" → [1,0], "dog" → [0,1]).
• Feature Scaling: Standardization (mean=0, variance=1) vs. Min-Max Scaling.
• Train-Test Split: Separate data into training (80%) and testing (20%).
• Example: Preparing a dataset of house prices.
19
Model Evaluation
• Goal: Ensure models work well on new, unseen data.
• Overfitting: Model memorizes training data but fails on test data.
• Key Terms:
• Accuracy: % of correct predictions (good for balanced classes).
• Precision: Trade-off for imbalanced data (e.g., fraud detection).
• Metrics and validation:
• Classification:
• Confusion Matrix: TP, TN, FP, FN.
• F1-Score: Balance precision and recall.
• Regression:
• MAE: Average error.
• R²: How well the model explains data variance.
20
Ethics in ML
• Bias: Models reflecting unfair stereotypes
• Criminal Justice Algorithms: Used to predict the likelihood of reoffending.
• Bias: Higher false positive rates for Black defendants
• Privacy: Using personal data without consent
• Transparency: "Black-box" models making unexplainable
decisions
• How to tackle:
• Fairness: Audit models for biased outcomes.
• Privacy Protections: Anonymize data; follow regulations
• Transparency: Use interpretable models (e.g., Decision Trees) or
explainability tools.
21
Challenges in ML
• Data Bias and Fairness
• Machine Learning models are only as reliable as the data they are trained on. If the data is
biased, the outcomes can be unfair or discriminatory. Ensuring fair representation and
regularly auditing models is essential.
• Security and Privacy
• Since ML systems depend on large volumes of data, they are vulnerable to data breaches and
misuse. Handling sensitive or personal information requires robust security measures and
strict adherence to privacy regulations.
• Interpretability and Explainability
• Many advanced ML models function as “black boxes,” making it difficult to understand how
decisions are made. This lack of transparency can hinder trust, accountability, and regulatory
compliance.
• Job Displacement and Automation
• The rise of automation powered by ML may replace certain types of jobs, especially in
repetitive or routine tasks. Preparing the workforce through upskilling and reskilling is key to
minimizing negative social impacts.
22
Current Trends
• AutoML: Tools like Auto-Sklearn automate model selection.
• Deep Learning: Revolutionizing image/text/speech tasks.
• AI for Good: Climate modeling, healthcare diagnostics.
• Ethical AI: Growing focus on fairness and regulations.
• Generative AI
23