BRAINWARE UNIVERSITY
[PCC-CSM601] [Machine Learning and its Applications]
MODULE- 5 (CLASS NOTES)
Machine Learning Algorithms with Real-Life Use Cases
1. Introduction to Machine Learning
Machine Learning (ML) is a crucial subfield of Artificial Intelligence (AI) that empowers computer systems
to automatically learn and improve from experience without being explicitly programmed for each task. At
its core, ML enables machines to recognize patterns, draw insights from data, and make decisions with
minimal human intervention. By analyzing large volumes of structured or unstructured data, ML models can
make predictions, identify trends, and automate decision-making processes. It is widely used in applications
such as recommendation systems (like those used by Netflix and Amazon), financial forecasting, self-driving
cars, speech recognition, and more. The goal is to create models that generalize well on unseen data to perform
specific tasks efficiently and accurately.
Machine Learning algorithms are broadly classified into three primary types based on the nature of the
learning task:
• Supervised Learning – where the model learns from labelled datasets.
• Unsupervised Learning – where the model tries to find hidden patterns or structures in unlabelled
data.
• Reinforcement Learning – where an agent learns to make decisions by interacting with an
environment and receiving feedback in the form of rewards or penalties.
2. Supervised Learning Algorithms
Supervised learning is one of the most widely used paradigms in machine learning. In this approach, models are trained
using labeled datasets, where each data point is associated with a corresponding output label. The objective of
supervised learning is to learn a mapping function from inputs (features) to outputs (labels), which can then be used
to make predictions on new, unseen data. This technique is especially valuable when historical data is available and
future events or behaviors need to be forecasted. Supervised learning is primarily divided into classification and
regression tasks.
3. Classification Algorithms
Classification involves predicting a categorical outcome, i.e., the data is classified into different classes or categories.
Below are some of the most commonly used classification algorithms with real-time applications and datasets.
2025-26 Prepared by: Department of CSE-AI (Brainware University, Barasat)
BRAINWARE UNIVERSITY
3.1 Logistic Regression
Logistic Regression is a statistical method used for binary and multi-class classification tasks. Despite its name, it is
used for classification rather than regression problems. It works by estimating the probability that a given input belongs
to a particular category using the logistic (sigmoid) function, which outputs values between 0 and 1. If the probability
crosses a certain threshold (usually 0.5), the input is classified into one class; otherwise, it goes into the other.
Real-time dataset example: PIMA Indian Diabetes Dataset
This dataset contains medical data of female patients of Pima Indian heritage, including features like number of
pregnancies, blood pressure, BMI, and glucose level. Logistic regression can be trained using this dataset to predict
whether a person is likely to develop diabetes (label: 1) or not (label: 0). By learning from this labeled data, the model
can generalize to new patient data to assess diabetes risk.
3.2 Decision Trees
A Decision Tree is a tree-like structure used for decision-making and classification. It splits the dataset into smaller
subsets based on feature values, forming a tree with branches (conditions) and leaves (outcomes). Decision Trees are
highly interpretable and do not require normalization or scaling of data. They are used in domains where interpretability
and transparency of decisions are important.
Real-time dataset example: Titanic Dataset
This dataset contains information about passengers on the Titanic, such as age, sex, class, fare paid, and whether they
survived. A Decision Tree can use this data to learn patterns like: "If a passenger is female and in 1st class, they are
more likely to survive." After training, the tree can predict survival chances of passengers in hypothetical scenarios.
It’s commonly used in education (student performance prediction), finance (loan eligibility), and marketing
(customer response analysis).
3.3 Support Vector Machines (SVM)
Support Vector Machine is a powerful classifier that finds the optimal hyperplane that separates data points of
different classes in a high-dimensional space. SVM performs well even when the data is not linearly separable by using
kernel functions to project data into higher dimensions. It is widely used in text classification, bioinformatics, and
image recognition due to its robustness and high accuracy.
Real-time dataset example: Breast Cancer Wisconsin Dataset
This dataset contains features derived from breast cancer cell images, such as cell radius, texture, perimeter, and area.
The target label is whether the tumor is benign or malignant. An SVM model trained on this data can effectively classify
tumors in new patients. This kind of classification helps in early diagnosis and treatment, potentially saving lives.
4. Regression Algorithms
Regression tasks involve predicting continuous values. The model learns from the relationship between
independent variables and a dependent variable, aiming to minimize prediction error.
2025-26 Prepared by: Department of CSE-AI (Brainware University, Barasat)
BRAINWARE UNIVERSITY
4.1 Linear Regression
Linear Regression is the most fundamental regression technique. It assumes a linear relationship between the input
variables and the output, and fits a straight line (or a hyperplane in multi-dimensional space) to best match the data.
The goal is to minimize the difference between the predicted and actual values using a method called least squares.
Real-time dataset example: Boston Housing Dataset
This dataset includes features like the number of rooms, average area income, proximity to employment centers, and
crime rate. The target variable is the median house price in a given area. Linear Regression can learn how each of these
features influences house prices and make price predictions for new listings. Such models are used by real estate
companies and urban planners for market analysis and property valuation.
5. Unsupervised Learning
Unlike supervised learning, unsupervised learning deals with unlabeled data. The goal is to identify hidden patterns
or groupings in the data without predefined labels. This is particularly useful in exploratory data analysis, data
compression, and customer segmentation.
5.1 K-Means Clustering
K-Means is a popular clustering algorithm that divides data into K clusters based on feature similarity. It starts by
selecting K random centroids and then iteratively assigns each data point to the nearest centroid and updates the centroid
positions based on the cluster's mean. The process continues until the centroids stabilize.
Real-time dataset example: Mall Customers Dataset
This dataset includes customer data such as annual income and spending score. K-Means can group customers into
clusters such as:
• High income, high spenders
• Low income, high spenders
• High income, low spenders, etc.
Retailers use such segmentation to target customers more effectively through personalized offers, improving
customer engagement and sales. It’s also used in image segmentation, market basket analysis, and document
clustering.
6. Real-Life Applications of Machine Learning
6.1 Healthcare
Algorithms Used:
• Logistic Regression: For binary disease prediction (e.g., diabetes, cancer) because it outputs probabilities
useful for classification.
2025-26 Prepared by: Department of CSE-AI (Brainware University, Barasat)
BRAINWARE UNIVERSITY
• Decision Trees & Random Forests: For interpretability in diagnosis, treatment outcome prediction, and
patient risk stratification.
• Support Vector Machines (SVM): Used in medical imaging classification tasks (e.g., tumor detection).
• Neural Networks / Deep Learning: For complex tasks like analyzing medical images (X-rays, MRI), drug
discovery, and real-time monitoring data.
• K-Nearest Neighbors (KNN): For simpler diagnostic tasks based on similarity to known patient data.
Healthcare data can be noisy and complex; models like Random Forests and deep learning handle this well, while
logistic regression provides interpretable results for doctors.
6.2 Finance
Algorithms Used:
• Anomaly Detection Algorithms (Isolation Forest, One-Class SVM): For fraud detection by spotting
unusual transaction patterns.
• Gradient Boosting Machines (XGBoost, LightGBM): For credit scoring and risk assessment due to their
high accuracy on tabular financial data.
• Time Series Models (ARIMA, LSTM Neural Networks): For stock market prediction by analyzing
temporal patterns.
• Logistic Regression: For binary outcomes like loan default prediction.
Financial datasets are highly structured with temporal components. Ensemble models and time series methods
capture complex relationships and temporal dependencies well.
6.3 Retail
Algorithms Used:
• Collaborative Filtering & Matrix Factorization: For recommendation engines (based on user-item
interaction).
• K-Means Clustering: For customer segmentation by grouping similar purchasing behaviors.
• Decision Trees & Random Forests: For churn prediction by modeling customer behavior.
• Linear Regression: For inventory demand forecasting.
Retail data often involves user preferences and transactional patterns that benefit from clustering and collaborative
filtering. Regression helps forecast sales trends.
6.4 Transportation
Algorithms Used:
• Convolutional Neural Networks (CNNs): For image recognition in autonomous driving (object detection,
lane detection).
• Reinforcement Learning: For decision-making in self-driving cars and route optimization.
• Time Series Models (LSTM): For traffic congestion prediction based on historical traffic data.
• K-Means & Hierarchical Clustering: For fleet segmentation and route grouping.
2025-26 Prepared by: Department of CSE-AI (Brainware University, Barasat)
BRAINWARE UNIVERSITY
Transportation data includes image, sensor, and temporal data requiring different models — CNNs for images, RL
for dynamic control, and LSTM for time-series traffic data.
6.5. Smart Cities
Algorithms Used:
• K-Means Clustering: For segmenting regions based on energy or water usage patterns.
• Regression Models (Linear, Random Forest Regression): For forecasting energy consumption and water
demand.
• Image Recognition (CNNs): For waste classification.
• Anomaly Detection Algorithms: For monitoring air quality and detecting pollution spikes.
Smart city data comes from multiple sensor types and requires clustering for segmentation, regression for forecasting,
and CNNs for visual recognition tasks.
2025-26 Prepared by: Department of CSE-AI (Brainware University, Barasat)