0% found this document useful (0 votes)
6 views19 pages

DLT Unit-1

Deep learning techniques

Uploaded by

Divya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views19 pages

DLT Unit-1

Deep learning techniques

Uploaded by

Divya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 19

DNR COLLEGE OF ENGINEERING & TECHNOLOGY, BHIMAVARAM

COMPUTER SCIENCE & ENGINEERING


DEEP LEARNING TECHNIQUES IV-ISEM UNIT-I BATCH:2021-25 REG:R20

1) Is AI a science or is it engineering? Or neither or both? Explain?


1) AI as a Science:
As a science, AI involves theoretical research aimed at understanding and modeling intelligent
behavior. It includes topics from computer science, mathematics, cognitive science, neuroscience,
and statistics. The scientific aspect of AI focuses on developing theories and models to explain
how intelligent systems (such as humans or animals) perceive, reason, learn, and make
decisions. This is typically seen in areas like:
a) Machine Learning (ML) theory: Understanding algorithms, statistical methods, and
probabilistic models.
b) Neural Networks and Deep Learning: Studying the structure of artificial neurons and how
these networks can replicate learning processes found in biological brains.
c) Cognitive Science: Modeling how human minds process information, and trying to replicate
aspects of human cognition in machines.
In this sense, AI is like any other scientific discipline that seeks to understand complex systems,
but its focus is specifically on intelligence—both natural and artificial.
2. AI as Engineering:
AI is also an engineering discipline because it involves applying scientific theories and
algorithms to create practical systems and technologies. The engineering side of AI focuses on:
Building AI systems: Implementing machine learning models, algorithms, and AI applications for
real-world use. This might involve anything from designing self-driving cars to developing
natural language processing tools or recommendation systems.
Software and hardware integration: AI systems often require specialized hardware (like GPUs)
and optimized software to process large amounts of data efficiently.
Scalability and performance: Engineering AI systems also involves making them robust, scalable,
and able to handle real-world complexity.
In this context, AI is like any other engineering discipline—it's about taking theoretical
knowledge and using it to create functioning, reliable, and useful products.
3. Is it Neither?
AI is unlikely to be considered "neither," since both the scientific and engineering components
are central to its development. However, if you take a very narrow view, one might argue that
certain areas of AI (like the purely theoretical aspects of cognitive modeling) are closer to
traditional science, while others (like building AI products for business or industry) are closer
to engineering.

2) Explain the difference between AI, ML and DL?


The terms AI (Artificial Intelligence), ML (Machine Learning), and DL (Deep Learning) are often
used Interchangeably, but they refer to different concepts and technologies, each with its own scope
and focus. Here's a breakdown of their differences:
1. Artificial Intelligence (AI):
AI is the broadest term of the three. It refers to the field of computer science focused on creating
systems that can perform tasks that typically require human intelligence. These tasks include
things like problem-solving, reasoning, perception, language understanding, decision-making, and
even creativity. AI can be divided into two major types:

Dr. BVS Varma, Professor & Vice Principal DNRCET A.Y: 2024-25 1
DNR COLLEGE OF ENGINEERING & TECHNOLOGY, BHIMAVARAM
COMPUTER SCIENCE & ENGINEERING
DEEP LEARNING TECHNIQUES IV-ISEM UNIT-I BATCH:2021-25 REG:R20

a) Narrow AI (Weak AI): AI systems designed to perform specific tasks, like playing chess,
recognizing speech, or recommending products. This is the kind of AI we encounter most
often today.
b) General AI (Strong AI): A more theoretical concept of AI that aims to replicate human-like
intelligence across a broad range of tasks. This is not yet realized and remains a long-term
goal of AI research.
AI encompasses a wide range of techniques and approaches to replicate intelligent behaviour,
including symbolic reasoning, rule-based systems, and machine learning.
2. Machine Learning (ML):
Machine Learning is a subset of AI that focuses on the development of algorithms that allow
systems to learn from data and improve their performance over time without being explicitly
programmed for every task. In other words, ML algorithms automatically find patterns in data
and use those patterns to make predictions or decisions.
There are three main types of machine learning:
a) Supervised Learning: The model is trained on a labelled dataset (where the input and
output are both provided). The goal is to learn a mapping from inputs to outputs. Examples
include classification (e.g., spam detection) and regression (e.g., predicting house prices).
b) Unsupervised Learning: The model is given input data without labels and tries to find
underlying patterns. Examples include clustering (e.g., customer segmentation) and
dimensionality reduction (e.g., PCA).
c) Reinforcement Learning: The model learns by interacting with an environment and
receiving feedback through rewards or penalties. It is often used in decision-making tasks,
such as training an AI agent to play video games or manage resources.
ML focuses on finding patterns in data and using them to make predictions, classifications, or
decisions.
3. Deep Learning (DL):
DL is a subset of Machine Learning that focuses on using neural networks—specifically deep
neural networks (DNNs) with many layers of processing units—to learn from large amounts of
data. Deep learning models are particularly effective in tasks that involve unstructured data,
such as:
a) Image and video recognition
b) Speech recognition
c) Natural language processing (NLP)
d) Autonomous driving
Deep learning algorithms use multi-layered neural networks to automatically extract high-level
features from raw data. For example, in image recognition, deep learning models can learn to
detect edges, textures, and objects without needing manual feature extraction, which was
required in traditional machine learning methods.

Dr. BVS Varma, Professor & Vice Principal DNRCET A.Y: 2024-25 2
DNR COLLEGE OF ENGINEERING & TECHNOLOGY, BHIMAVARAM
COMPUTER SCIENCE & ENGINEERING
DEEP LEARNING TECHNIQUES IV-ISEM UNIT-I BATCH:2021-25 REG:R20

3) Write down present and future scope of AI?


Present Scope of AI:
AI is already having a profound impact across various industries and fields. Some key areas where AI is
currently being applied include:
1. Healthcare:
Medical Imaging and Diagnostics: AI-powered tools are being used to analyze medical images
(like X-rays, MRIs, and CT scans) for signs of diseases such as cancer, heart conditions, and
neurological disorders. For example, AI algorithms can detect tumours more accurately than
human doctors in some cases.
a) Drug Discovery: AI is accelerating drug discovery by predicting molecular interactions,
identifying promising drug candidates, and even simulating clinical trials.
b) Personalized Medicine: AI is helping create customized treatment plans based on
individual patient data, including genetic information.
c) Virtual Health Assistants: AI-powered chat bots and virtual assistants provide 24/7
medical advice and monitor patient health remotely.
2. Finance:
a) Fraud Detection: AI models analyze transaction data in real-time to detect unusual
patterns and flag potential fraud.
b) Algorithmic Trading: AI algorithms analyze market data and execute trades at speeds and
volumes far beyond human capability.
c) Customer Service: AI-driven chat bots and virtual assistants handle customer queries,
provide financial advice, and manage account-related tasks.
d) Credit Scoring: AI uses alternative data to assess the creditworthiness of individuals or
businesses, improving access to credit, especially in underserved populations.
3. Autonomous Vehicles:
a) Self-Driving Cars: AI is the backbone of autonomous vehicle technologies, enabling vehicles
to recognize road conditions, detect pedestrians, and navigate safely.
b) Traffic Management: AI can optimize traffic flow and reduce congestion by analyzing
traffic patterns in real-time.
4. Manufacturing:
a) Predictive Maintenance: AI models predict when machinery will fail, allowing companies
to perform maintenance proactively and reduce downtime.
b) Robotic Process Automation (RPA): AI-driven robots and machines are used for assembly
lines, packaging, and other repetitive tasks, improving efficiency and precision.
c) Quality Control: AI systems monitor production quality by identifying defects and errors
during manufacturing.
5. Education:
a) Personalized Learning: AI can help tailor educational content to individual learning styles
and paces, allowing for more customized and effective learning experiences.
b) Automated Grading and Assessment: AI systems are being used to grade assignments,
essays, and tests more efficiently, reducing the burden on educators.
c) Virtual Tutors: AI-powered tutors provide additional support for students, answering
questions and guiding them through difficult concepts.

Dr. BVS Varma, Professor & Vice Principal DNRCET A.Y: 2024-25 3
DNR COLLEGE OF ENGINEERING & TECHNOLOGY, BHIMAVARAM
COMPUTER SCIENCE & ENGINEERING
DEEP LEARNING TECHNIQUES IV-ISEM UNIT-I BATCH:2021-25 REG:R20

Future Scope of AI:


The future of AI is promising, with significant advancements expected in both the breadth and depth of
its applications. Here are some areas where AI is likely to have an even greater impact in the future:
1. General AI (AGI - Artificial General Intelligence):
Human-Like Intelligence: Currently, AI is narrow (i.e., it is designed for specific tasks). The next
frontier is Artificial General Intelligence (AGI), which would have the capacity to perform any
intellectual task that a human being can. AGI could revolutionize every field by adapting to new,
unforeseen challenges and solving complex, multi-dimensional problems across domains.
Self-Improvement: AGI systems could potentially learn from experience, improve their own
algorithms autonomously, and develop new capabilities over time.
2. AI in Healthcare (Advanced Applications):
AI in Surgery: Robotics and AI are expected to play a key role in performing highly complex
surgeries with precision and minimal human intervention.
AI for Predictive Medicine: AI will help predict and prevent diseases based on genetic, lifestyle,
and environmental factors, allowing for precision medicine that proactively addresses health
issues.
Mental Health: AI could play a significant role in mental health by providing virtual counselling,
detecting early signs of depression or anxiety, and offering therapy via chat bots.
3. Autonomous Systems and Robotics:
Fully Autonomous Vehicles: In the future, we could see fully autonomous transportation systems
(cars, trucks, drones) widely deployed, revolutionizing logistics, delivery services, and public
transportation.
Robotics in Daily Life: AI-driven robots could assist with household chores, elderly care, and
rehabilitation, leading to more productive and comfortable living environments for individuals
and communities.
4. AI in Climate Change and Sustainability:
Climate Modelling and Prediction: AI could significantly improve climate models, helping predict
weather patterns, track climate change, and propose solutions for mitigating its effects.
Energy Optimization: AI will drive advancements in smart grids, improving energy efficiency
and integrating renewable energy sources (solar, wind) into national grids.
Sustainable Agriculture: AI could optimize farming practices to increase crop yield while
minimizing environmental damage, promoting sustainable agricultural practices.
5. AI for Creativity and Arts:
Generative AI: AI systems will continue to make strides in creativity, generating new art, music,
literature, and even movies. These systems could be used to co-create with humans or even
independently generate novel works that might challenge our understanding of creativity.
AI in Design: AI can revolutionize industries like architecture and fashion by offering automated
design suggestions, creating innovative products, or even tailoring designs to individual
preferences.

Dr. BVS Varma, Professor & Vice Principal DNRCET A.Y: 2024-25 4
DNR COLLEGE OF ENGINEERING & TECHNOLOGY, BHIMAVARAM
COMPUTER SCIENCE & ENGINEERING
DEEP LEARNING TECHNIQUES IV-ISEM UNIT-I BATCH:2021-25 REG:R20

4) What are SVM & kernel methods in Deep learning? Explain.


SVM (Support Vector Machine) and Kernel Methods in Deep Learning:
Support Vector Machines (SVMs) and Kernel methods are foundational concepts in machine
learning, primarily used for classification tasks, though they can also be applied to regression.
While they are not typically a part of deep learning models, understanding SVMs and kernel
methods can provide valuable
Support Vector Machines (SVMs):
Insight into classical machine learning techniques those have inspired or intersect with the
development of deep learning.
SVMs are supervised learning algorithms that are primarily used for classification but can also
be adapted for regression (known as Support Vector Regression, or SVR).
The primary goal of SVM is to find a hyper plane (in higher-dimensional space) that best
separates data into different classes. The key characteristics of SVM are
1. Maximizing the Margin:
o SVM tries to find the optimal hyper plane (a decision boundary) that maximizes the
margin, i.e., the distance between the closest points of each class (called support vectors).
A larger margin generally leads to better generalization of the model.
o In 2D, the hyper plane is simply a line, and in 3D, it’s a plane. In higher dimensions, it's a
hyper plane.
2. Support Vectors:
o These are the data points that are closest to the decision boundary. Only the support
vectors are crucial in defining the hyper plane; other points don’t affect the decision
boundary.
3. Linear and Non-linear SVMs:
o Linear SVM works well when the data is linearly separable, i.e., you can draw a straight
line (or hyper plane in higher dimensions) that perfectly divides the classes.
o However, real-world data is often non-linearly separable, so a transformation of the data
is required.

Kernel Methods:
Kernel methods are techniques used in SVMs to handle non-linearly separable data. The idea is to
map the original input features into a higher-dimensional space where a linear separator can exist.
This mapping is performed using a kernel function.
What is a Kernel?
o A kernel is a mathematical function that computes the inner product between two vectors in a
higher-dimensional feature space without explicitly mapping the data points to that space. This
is known as the "kernel trick".
o Essentially, it allows SVMs to operate in high-dimensional spaces without having to compute the
coordinates of the data in that space directly, thus avoiding computational cost.
Common Kernel Functions:
o Linear Kernel: No transformation is applied; the algorithm just works in the original feature
space.
K (x, x ′) = x T x ′ K(x, x') = x^T x' K(x, x′) = xTx′
o Polynomial Kernel: Maps data into higher dimensions based on polynomial features.
K(x, x′) = (xTx′+c) dK(x, x') = (x^T x' + c) ^dK(x, x′) = (xTx′+c) d

Dr. BVS Varma, Professor & Vice Principal DNRCET A.Y: 2024-25 5
DNR COLLEGE OF ENGINEERING & TECHNOLOGY, BHIMAVARAM
COMPUTER SCIENCE & ENGINEERING
DEEP LEARNING TECHNIQUES IV-ISEM UNIT-I BATCH:2021-25 REG:R20

o Radial Basis Function (RBF) / Gaussian Kernel: This is the most commonly used kernel. It

′∥22σ2)K(x,x')=\exp(-\frac{\|x-x'\|^2}{2\sigma^2}) K(x,x′)= exp(−2σ2∥ x−x′∥2)


allows the SVM to model highly non-linear decision boundaries. K(x,x′)=exp⁡(−∥x−x

o Sigmoid Kernel: Based on the sigmoid function, often used in neural networks. K(x,x
′)=tanh⁡(αxTx′+c)K(x, x') = \tanh(\alpha x^T x' + c)K(x,x′)=tanh(αxTx′+c)
Why Use Kernels?
o In many cases, the decision boundary in the original input space may not be linear. However, by
applying a kernel function, the SVM can implicitly map the data into a higher-dimensional space
where the problem becomes linearly separable.
o This transformation can lead to better performance on complex, non-linear datasets.

SVM in Deep Learning


While SVMs themselves are not deep learning models, they can be connected to deep learning in the
following ways:
1. SVM as a classifier for Deep Features:
o SVMs can be used as the final classification layer after a deep learning model (like a
convolution neural network) has extracted features from the data. This hybrid approach
is sometimes referred to as "Deep Learning + SVM."
o For example, after training a CNN on image data, you can extract the features from the
last hidden layer and apply an SVM to classify the images based on those features.
2. Learning Non-linear Decision Boundaries:
o Deep learning models, such as neural networks, can inherently learn non-linear decision
boundaries due to their architecture. This is similar to what kernel methods achieve
with SVMs. However, deep learning models often learn these boundaries through
complex layers of transformations rather than using an explicit kernel function.

Relationship between SVM and Deep Learning:


Deep learning models and SVMs have some conceptual overlap:
 Both can classify complex data.
 SVMs with non-linear kernels are a precursor to understanding how deep neural networks
handle non-linearities.
 Deep learning can be viewed as learning highly complex, non-linear mappings from the input to
the output, which can be somewhat analogous to the use of kernel methods in SVM.
However, deep learning models are more flexible and can learn to represent features at multiple levels
(e.g., pixel-level, feature-level, etc.), whereas SVMs are typically more constrained and rely on hand-
engineered features or limited kernel transformations.

Conclusion:
 SVM is a classical machine learning model used for classification tasks that tries to find the
optimal hyper plane to separate classes, using the concept of maximizing the margin.
 Kernel methods allow SVMs to work in non-linear spaces by applying a mathematical
transformation that implicitly maps the input data into a higher-dimensional feature space.
 While SVMs and kernel methods are not central to deep learning, they represent important
building blocks and concepts that have influenced the development of more complex models,
such as neural networks, which can inherently learn non-linear decision boundaries.
5) Write down brief history and evolution of AI?

Dr. BVS Varma, Professor & Vice Principal DNRCET A.Y: 2024-25 6
DNR COLLEGE OF ENGINEERING & TECHNOLOGY, BHIMAVARAM
COMPUTER SCIENCE & ENGINEERING
DEEP LEARNING TECHNIQUES IV-ISEM UNIT-I BATCH:2021-25 REG:R20

Brief History and Evolution of AI:


1. Early Foundations (Pre-1950s)
 Philosophical Beginnings: The idea of artificial intelligence dates back to ancient myths and
philosophical inquiries about human intelligence. Thinkers like Aristotle pondered the nature
of knowledge and reasoning.
 Mechanical Automatons: In the 18th and 19th centuries, inventors created mechanical devices
like automaton clocks and chess-playing machines that laid the groundwork for future
computational thinking.
2. The Birth of AI (1950s)
 Alan Turing: In 1950, Turing published his landmark paper, "Computing Machinery and
Intelligence," which proposed the famous Turing Test as a measure of a machine's ability to
exhibit intelligent behavior.
 Early AI Programs: In the mid-1950s, AI pioneers like John McCarthy and Marvin Minsky
started developing programs that could simulate basic human tasks. The first AI program, Logic
Theorist (1955), was created by Allen Newell and Herbert A. Simon.
3. The Golden Age and Early Challenges (1960s-1970s)
 Symbolic AI: Early AI research focused on symbolic reasoning, problem-solving, and knowledge
representation (e.g., General Problem Solver by Newell and Simon).
 Expert Systems: By the 1970s, expert systems like MYCIN were developed to make decisions
based on knowledge from specific domains, like medicine.
 The First AI Winter: Despite early optimism, limitations in hardware and programming
techniques led to a slowdown of funding and interest in AI by the late 1970s, referred to as the
AI Winter.
4. Rebirth and Knowledge-Based Systems (1980s)
 Expert Systems Expansion: Expert systems became commercially successful in industries like
medicine, finance, and engineering.
 Connectionism: Neural networks saw renewed interest with the development of the back
propagation algorithm (1986), which allowed for more efficient training of multi-layer
networks.
 AI Winter Redux: By the late 1980s, the limitations of expert systems, such as their inability to
learn or adapt, led to another period of stagnation.
5. Machine Learning and Data-Driven AI (1990s-2000s)
 Rise of Machine Learning: Researchers shifted focus to machine learning (ML), where systems
could learn from data rather than relying solely on pre-programmed rules. This included the
development of support vector machines and hidden Markov models.
 Data Explosion: The growth of the internet and digital data led to new opportunities for training
AI systems. Computers became more powerful, and algorithms began to handle larger datasets.
 IBM's deep blue (1997): Deep Blue defeated world chess champion Garry Kasparov, showcasing
AI's capability in strategic decision-making.
6. Deep Learning and the Modern AI Boom (2010s-Present)
 Deep Learning Revolution: Deep learning, a subset of machine learning involving multi-layered
neural networks, became the centerpiece of AI progress. Breakthroughs in architectures like
Convolution Neural Networks (CNNs) for image recognition and Recurrent Neural
Networks (RNNs) for sequence prediction fueled the rise of AI in fields such as computer
vision, speech recognition, and natural language processing.
 Landmark Achievements:

Dr. BVS Varma, Professor & Vice Principal DNRCET A.Y: 2024-25 7
DNR COLLEGE OF ENGINEERING & TECHNOLOGY, BHIMAVARAM
COMPUTER SCIENCE & ENGINEERING
DEEP LEARNING TECHNIQUES IV-ISEM UNIT-I BATCH:2021-25 REG:R20

o Google Deep Mind’s Alpha Go (2016) defeated a world champion Go player,


highlighting the power of deep reinforcement learning.
o OpenAI's GPT-3 (2020) demonstrated the potential of large language models,
achieving impressive human-like text generation and natural language understanding.
 AI in Everyday Life: AI-powered systems like Siri, Alexa, and Google Assistant became
ubiquitous in consumer devices, while industries saw the rise of self-driving cars,
personalized recommendations, and AI-driven healthcare diagnostics.
 Ethical and Social Challenges: As AI technologies advanced, concerns around bias, job
displacement, privacy, and the ethical use of AI became more pronounced, leading to increased
regulation and discussions around AI governance.
7. The Future (2024 and Beyond)
 AGI (Artificial General Intelligence): Researchers are exploring the path toward AGI, an AI
capable of generalizing knowledge and skills across diverse tasks. While AGI remains
speculative, breakthroughs in areas like multi-modal learning, meta-learning, and neuro
symbolic AI are seen as steps toward more versatile and autonomous systems.
 AI and Society: AI continues to transform industries such as healthcare, finance, law, and
entertainment, but also raises ongoing questions about the balance between innovation,
regulation, and its societal impact.
This history illustrates the shift from early theoretical ideas to modern, powerful systems reshaping the
world, with the future of AI holding both great promise and potential risks.

6) Define in your own words the terms: state, state space, search tree, Search node?
Here are simple definitions for each term:
1. State: A state represents a specific configuration or condition of a problem at a particular point
in time. It captures all the relevant information needed to describe the situation. For example, in
a puzzle game, a state might represent the current arrangement of tiles.
2. State Space: The state space is the entire set of all possible states that can be reached from the
initial state, considering all the legal moves or transitions that can be made. It's like the "map" of
all the possible situations you could encounter in the problem.
3. Search Tree: A search tree is a tree structure that represents the exploration of different states
starting from the initial state. The root is the initial state, and each node represents a possible
state that can be reached by applying actions or transitions. The tree branches out, showing all
possible sequences of actions that leads to different states.
4. Search Node: A search node is a single point in the search tree. It contains information about a
state (the configuration of the problem), as well as additional details like the cost of reaching
that state, the action that led to it, and possibly the parent node (the previous state). A node
represents a particular state along with metadata to aid in the search process.

7) How Random Forests are related to Decision trees. Discuss Decision tree algorithm?

Dr. BVS Varma, Professor & Vice Principal DNRCET A.Y: 2024-25 8
DNR COLLEGE OF ENGINEERING & TECHNOLOGY, BHIMAVARAM
COMPUTER SCIENCE & ENGINEERING
DEEP LEARNING TECHNIQUES IV-ISEM UNIT-I BATCH:2021-25 REG:R20

Random Forests & their Relation to Decision Trees:


1. Random Forests are an ensemble learning method that builds upon the concept of Decision
Trees. A random forest combines multiple decision trees to improve the overall performance,
stability, and accuracy compared to a single decision tree.
2. Decision Trees are a single predictive model, where each tree is built by recursively splitting the
data into branches based on feature values, aiming to make predictions
3. Random Forests improve on decision trees by aggregating (usually averaging or voting) the
predictions of many decision trees to reduce over fitting and variance. They use bagging
(bootstrap aggregation), which involves training each decision tree on a random subset of the
data and choosing random subsets of features for splitting at each node.

Decision Tree Algorithm:


A Decision Tree is a tree-like model used for classification and regression tasks. It breaks down a
dataset into smaller subsets while at the same time developing an associated tree structure. The goal is
to make predictions based on the feature values by following the branches of the tree.
Steps to Build a Decision Tree:
1. Selecting the Best Feature to Split On:
 The tree begins at the root node and selects the best feature to split the data based on a
criterion (such as Gini impurity, entropy, or variance reduction).
 For classification problems, the most common criteria for selecting a feature are:
 Gini Impurity: Measures the "impurity" of a set. A low Gini means that the set is dominated by
one class.
 Entropy: Measures the uncertainty in the dataset. Entropy is minimized when the data at each
node is pure (i.e., most examples belong to a single class).
 For regression tasks, we often use Mean Squared Error (MSE) to measure the quality of splits.
Splitting the Data:
 The data is split into two (or more) subsets based on the feature that gives the best result
according to the chosen criterion. This process is repeated recursively, forming nodes and
branches in the tree.
 The tree grows by creating child nodes for each possible split and continues splitting the data
until one of the stopping conditions is met (e.g., a maximum tree depth or a minimum number of
samples at a node).
 Stopping Criteria:
The tree may stop growing if:
 All samples at the node belong to the same class (pure node).
 The maximum tree depth is reached.
 The number of samples at the node is below a predefined threshold.
 The improvement in the splitting criterion is below a certain threshold.
Assigning a Prediction:
 Once the tree is fully grown, each leaf node (the terminal node) corresponds to a predicted class
(for classification) or a predicted value (for regression).
 For classification, the prediction for a leaf is typically the majority class of the data points in that
leaf.
 For regression, the prediction is the average value of the data points in the leaf.

Dr. BVS Varma, Professor & Vice Principal DNRCET A.Y: 2024-25 9
DNR COLLEGE OF ENGINEERING & TECHNOLOGY, BHIMAVARAM
COMPUTER SCIENCE & ENGINEERING
DEEP LEARNING TECHNIQUES IV-ISEM UNIT-I BATCH:2021-25 REG:R20

8) What are the assumptions of Gradient Boosting Algorithm & How can you improve the
performance?
Assumptions of the Gradient Boosting Algorithm:
Gradient Boosting is a powerful ensemble learning algorithm used for both regression and classification
tasks. It builds a model in a stage-wise fashion, where each new model corrects the errors made by the
previous ones. While the algorithm is highly flexible and does not require strict assumptions about the
underlying data distribution, there are some general assumptions and principles that guide its working:
1. Additive Model Assumption:
o Gradient Boosting assumes that the model can be constructed as a sum of many weak
learners (usually decision trees), where each subsequent tree aims to reduce the
residual error of the combined predictions from the previous trees.
o The idea is that the target function can be approximated by an additive series of weak
learners, making the model a non-linear sum of simpler models.
2. Independent and Identically Distributed (IID) Data:
o The data is assumed to be independent and identically distributed (i.i.d.), which is a
typical assumption in many machine learning algorithms. This means that the
observations in the dataset are assumed to be drawn from the same probability
distribution and are independent of each other.
o While Gradient Boosting can handle noisy data or complex structures, this assumption
still holds for optimal performance.
3. The Loss Function is Differentiable:
o Gradient Boosting optimizes a differentiable loss function using gradient descent. It
assumes that the loss function can be smoothly optimized using gradients.
o Common loss functions include Mean Squared Error (MSE) for regression and Log-Loss
for classification.
4. Weak Learners (Decision Trees)
o Gradient Boosting usually uses decision trees as the weak learners, and it assumes that
these decision trees are not overly complex (i.e., shallow trees) to prevent over fitting.
o It works under the assumption that a series of simple decision trees can capture
complex patterns in the data.
5. Model Over fitting:
o Like many machine learning algorithms, Gradient Boosting is prone to over fitting if not
tuned correctly. The number of trees (iterations), the depth of trees, and other hyper
parameters need to be carefully adjusted to avoid this issue.

How to Improve the Performance of Gradient Boosting


Here are several techniques and strategies that can be used to improve the performance of a Gradient
Boosting model:
1. Hyper parameter Tuning:
o Number of Trees (n_estimators): The number of boosting iterations (trees) is a key
hyper parameter. Too many trees can lead to over fitting, while too few may result in
under fitting. It’s crucial to perform cross-validation to find the optimal value.
o Learning Rate (eta): The learning rate controls how much the weights of the model are
adjusted with each iteration. A lower learning rate often improves generalization, but it
requires a higher number of trees to converge.

Dr. BVS Varma, Professor & Vice Principal DNRCET A.Y: 2024-25 10
DNR COLLEGE OF ENGINEERING & TECHNOLOGY, BHIMAVARAM
COMPUTER SCIENCE & ENGINEERING
DEEP LEARNING TECHNIQUES IV-ISEM UNIT-I BATCH:2021-25 REG:R20

o Maximum Depth of Trees (max_depth): Controlling the depth of individual decision


trees helps prevent over fitting. Shallower trees (usually 3-5 levels) often work well
with Gradient Boosting.
o Subsample: Using a fraction of the training data to build each tree (sub sampling) can
reduce over fitting. A typical value is between 0.5 and 1.0.
o Minimum Samples per Leaf (min_samples_leaf): This controls how many samples a
leaf node should have. Increasing it prevents the model from growing too deep and over
fitting to small variations in the data.
2. Regularization:
o Tree Pruning: Pruning weak branches during tree construction can prevent the model
from fitting to noise in the data.
o L1/L2 Regularization: Adding regularization terms to the loss function (such as L1 or
L2 regularization) can improve the model's ability to generalize by penalizing overly
complex trees.
3. Early Stopping:
o Validation Set: Monitoring the model's performance on a validation set during training
can help to stop the training process early to prevent overfitting. The model stops when
the performance on the validation set starts to degrade, which is often referred to as
early stopping.
4. Feature Engineering:
o Feature Selection: Removing irrelevant or highly correlated features can help the
Gradient Boosting model focus on the most important patterns in the data, reducing the
chance of over fitting.
o Feature Transformation: In some cases, creating new features based on domain
knowledge or transforming features to a more suitable scale can improve model
performance.
5. Boosting Variants:
o XGBoost: An optimized version of Gradient boosting that incorporates additional
regularization techniques, parallelization, and efficient handling of sparse data.
o LightGBM: A more efficient variant of Gradient boosting that focuses on speed and
memory efficiency, especially for large datasets.
o CatBoost: A variant of Gradient boosting that is specifically designed to handle
categorical features without requiring explicit preprocessing (e.g., one-hot encoding).
6. Cross-Validation:
o Using cross-validation to assess the model's performance can help identify the best
hyper parameters and prevent over fitting by testing the model's ability to generalize on
different data splits.
7. Out-of-Bag (OOB) Evaluation:
o This technique allows for an internal validation process during training without needing
a separate validation dataset. It can provide a more reliable estimate of generalization
performance, especially with random subsets of the data.
8. Handling Class Imbalance (for classification problems):
o When dealing with imbalanced datasets, class weighting or sampling techniques like
SMOTE (Synthetic Minority Over-sampling Technique) can help improve the model's
performance by giving more importance to the minority class.

Dr. BVS Varma, Professor & Vice Principal DNRCET A.Y: 2024-25 11
DNR COLLEGE OF ENGINEERING & TECHNOLOGY, BHIMAVARAM
COMPUTER SCIENCE & ENGINEERING
DEEP LEARNING TECHNIQUES IV-ISEM UNIT-I BATCH:2021-25 REG:R20

9) How is it possible to perform un-supervised learning with Random Forest?


Performing unsupervised learning with Random Forest is not typical in the traditional sense, since
Random Forest is primarily a supervised learning algorithm. It is designed for classification and
regression tasks, where it learns from labeled data. However, Random Forest can still be adapted for
some unsupervised learning tasks using specific techniques and variations. Here are a few ways to use

Random Forest for unsupervised learning:


1. Unsupervised Random Forest (Clustering and Dimensionality Reduction)
Random Forest can be adapted for unsupervised tasks like clustering and dimensionality reduction.
There are two primary methods for this:
a. Random Forest for Clustering (using Proximity Matrix)
 Proximity Matrix: In an unsupervised setting, one common approach is to use the concept of a
proximity matrix. When Random Forest builds trees, it uses random subsets of data to split
nodes. After building many trees, you can calculate how often two data points (samples) are
placed in the same leaf node (i.e., the "proximity" between the samples). If two samples are
often placed together in the same leaf across multiple trees, they are considered similar to each
other.
 Steps:
1. Train a Random Forest on your dataset.
2. Create a proximity matrix: For each pair of data points, measure how often they end
up in the same leaf across all trees.
3. Cluster data: You can now use this proximity matrix as a measure of similarity between
the data points and apply clustering algorithms (like hierarchical clustering or k-
means) on this matrix.
 This approach is a kind of unsupervised learning because it doesn't require any labeled data.
The clusters formed can be based on the similarity between the samples, as measured by the
Random Forest’s tree structure.

b. Multidimensional Scaling (MDS) or t-SNE for Visualization:


After calculating the proximity matrix, you can apply dimensionality reduction techniques such as
1. Multidimensional Scaling (MDS) or t-SNE to project the data into 2D or 3D space for visualization.
These methods help to visualize high-dimensional data by preserving the pair wise distances or
similarities computed in the proximity matrix.
2. Isolation Forest for Anomaly Detection
Although not traditional clustering or dimensionality reduction, Isolation Forest is an unsupervised
variant of Random Forest specifically designed for anomaly detection. It works by isolating anomalies
instead of profiling normal data points, making it an effective method for identifying outliers.
 How it works:
o Isolation Forest builds a forest of trees, but instead of focusing on traditional decision-
making like classification or regression, it isolates observations. The idea is that outliers
or anomalies are easier to isolate because they differ from the majority of the data.
o Anomalous points are those that are isolated quickly (i.e., require fewer splits to be
separated from the rest of the data), while normal points tend to take more splits to
isolate.

Dr. BVS Varma, Professor & Vice Principal DNRCET A.Y: 2024-25 12
DNR COLLEGE OF ENGINEERING & TECHNOLOGY, BHIMAVARAM
COMPUTER SCIENCE & ENGINEERING
DEEP LEARNING TECHNIQUES IV-ISEM UNIT-I BATCH:2021-25 REG:R20

 Application: This technique is used in anomaly detection tasks, where you do not have labels
for the data and you want to identify rare, unusual instances in a dataset (e.g., fraud detection,
network intrusion detection).
3. Feature Importance for Unsupervised Feature Selection
While Random Forest is traditionally used for supervised tasks, it can still be useful in an unsupervised
setting for feature selection. For instance, in clustering or dimensionality reduction tasks where you
don’t have labels but still want to reduce the dimensionality or select important features, you can use
the concept of feature importance from Random Forests.
 Steps:
1. Train a Random Forest model on your data.
2. Evaluate the feature importance based on how much each feature contributes to
reducing the impurity (Gini or Entropy) in the trees.
3. Rank the features and choose the most important ones, which can then be used for
further analysis, such as clustering or visualization.
4. Random Forest for Generating Synthetic Data (Semi-supervised Learning)
In a more advanced scenario, Random Forest can be used to generate synthetic data in an unsupervised
manner, particularly in semi-supervised learning. In this case, if you have a small amount of labeled
data, you could use a Random Forest to label a much larger dataset and create a larger training set for
subsequent supervised learning.
 For example, if you have a small set of labeled data, you can train a Random Forest to predict
labels for the unlabeled data. After labeling, you can either:
 Use the labels for further supervised learning.
 Apply clustering or other unsupervised methods to analyze the unlabeled samples.

10) Explain how random forests give output for classification and regression problems?

A) Random Forests are an ensemble learning technique that can be used for both classification and
regression problems. The idea behind Random Forests is to combine the predictions of multiple
individual decision trees to improve accuracy and reduce the risk of over fitting. Here's how they give
output for both types of problems:
1. Classification Problem:
In classification tasks, Random Forests predict the class label (category) for an input data point based
on the majority vote of the individual decision trees in the forest.
Steps:
 Building Decision Trees: Random Forest builds multiple decision trees (often hundreds or
thousands) using bootstrapped samples of the training data. Each decision tree is trained on a
random subset of the data and features.
 Making Predictions: When a new data point is given to the model, each tree in the forest
independently makes a prediction. Each tree assigns a class label (e.g., "A", "B", or "C").
 Majority Voting: The Random Forest aggregates the predictions of all the trees using majority
voting. The class that appears most frequently across the trees is the predicted class label for
the data point.
Example:
 Imagine a Random Forest trained to classify animals into categories like "Cat", "Dog", and
"Rabbit".

Dr. BVS Varma, Professor & Vice Principal DNRCET A.Y: 2024-25 13
DNR COLLEGE OF ENGINEERING & TECHNOLOGY, BHIMAVARAM
COMPUTER SCIENCE & ENGINEERING
DEEP LEARNING TECHNIQUES IV-ISEM UNIT-I BATCH:2021-25 REG:R20

 When given a new data point (e.g., an animal with certain features), each tree might classify it as
"Dog", "Dog", "Cat", "Dog", etc.
 If the majority of trees classify it as "Dog", then the Random Forest predicts that the animal is a
"Dog".
2. Regression Problem:
In regression tasks, Random Forests predict a continuous value (e.g., price, temperature, or age).
Instead of using majority voting, the Random Forest aggregates the outputs of individual trees by
averaging their predictions.
Steps:
 Building Decision Trees: Random Forest builds multiple regression trees using bootstrapped
samples of the training data. Each tree is trained to predict a continuous value based on the
input features.
 Making Predictions: When a new data point is given to the model, each tree makes a prediction
(a continuous value).
 Averaging the Predictions: The Random Forest combines the outputs of all the trees by
calculating the average of the predicted values. This averaged value is the final prediction for
the data point.
Example:
 Imagine a Random Forest model trained to predict house prices based on features like size,
location, and number of bedrooms.
 For a new house, each decision tree might predict a different price (e.g., $250,000, $270,000,
$265,000, etc.).
 The Random Forest will average these predictions and output the final predicted price (e.g.,
$260,000).
Key Advantages of Random Forest for Both Classification and Regression:
 Reduced Over fitting: Since Random Forests aggregate the predictions from many trees, they
tend to be less sensitive to noise and over fitting compared to individual decision trees.
 Robustness: They are less likely to make errors based on small fluctuations in the data.
 Flexibility: Random Forests can handle both classification and regression tasks with minimal
adjustments.

10) Explain how random forests give output for classification and regression problems?
Random Forests are ensemble learning methods that use multiple decision trees to make predictions.
They operate slightly differently for classification and regression problems, but the underlying principle
is similar: they aggregate predictions from a "forest" of trees to improve accuracy and reduce over
fitting.
1. Classification with Random Forests:
In classification tasks, the Random Forest algorithm makes predictions by following these steps:
1. Building Trees: Random Forests create multiple decision trees, each trained on a random
subset of the dataset. Each tree is trained on a bootstrapped sample (random sampling with
replacement) and with a random subset of features, which reduces correlations between the
trees.
2. Voting Mechanism: When making a prediction, each tree in the forest independently predicts a
class label for the input data point.
3. Majority Voting: The final prediction is determined by majority voting. The class that receives
the most votes from the individual trees is selected as the output of the Random Forest.

Dr. BVS Varma, Professor & Vice Principal DNRCET A.Y: 2024-25 14
DNR COLLEGE OF ENGINEERING & TECHNOLOGY, BHIMAVARAM
COMPUTER SCIENCE & ENGINEERING
DEEP LEARNING TECHNIQUES IV-ISEM UNIT-I BATCH:2021-25 REG:R20

For example, if a Random Forest with 100 trees predicts an input as “Class A” by 60 trees and “Class B”
by 40 trees, the final output will be “Class A” since it received the majority of votes.

2. Regression with Random Forests


In regression tasks, Random Forests follow a similar approach, but instead of voting, they use
averaging:
1. Tree Predictions: Each decision tree generates a continuous numeric prediction instead of a
class label. These predictions are usually based on the mean or median of the target values in
the leaf nodes.
2. Averaging: The final output is calculated by taking the average (or sometimes the median) of all
the individual tree predictions. This helps in reducing the variance and providing a more stable,
accurate prediction.
For instance, if five trees in the forest predict the values 10, 12, 11, 13, and 14, the final prediction will
be the average of these values, which is (10+12+11+13+14 )/5=12.

Advantages of Random Forests


 Reduced Over fitting: Random Forests are less prone to over fitting compared to individual
decision trees because they rely on a group of trees with diverse training data and feature sets.
 Improved Accuracy: By combining the predictions of multiple trees, Random Forests generally
produce more accurate results.

11). Discuss about Probabilistic Modeling in detail?


Probabilistic modeling is a powerful statistical approach used to represent uncertainties in data and
make predictions based on probability distributions. It’s a fundamental concept in fields like machine
learning, data science, and statistics.
1. Definition and Purpose
Probabilistic modeling involves creating models that use probability distributions to describe
and predict the likelihood of various outcomes. It’s particularly useful when dealing with
incomplete, noisy, or uncertain data. The goal is to represent the underlying structure of the
data and quantify the uncertainty, providing a framework to make informed predictions.
2. Components of Probabilistic Models
A probabilistic model typically has the following components:
 Random Variables: Represent quantities of interest that can take different values
based on some underlying probability distribution.
 Probability Distributions: Describe the likelihood of each possible value of the random
variable. For example, Gaussian (Normal) distribution, Binomial distribution, etc., can be
used based on the nature of the data.
 Conditional Probabilities: Show the probability of one event given that another event
has occurred often used in Bayesian networks and Markov models.
3. Types of Probabilistic Models
 Bayesian Networks: Directed acyclic graphs where nodes represent random variables,
and edges represent conditional dependencies between them. These are often used in
complex systems, such as medical diagnosis or recommendation engines.
 Markov Models: These models assume that the future state depends only on the
current state (not past states). The simplest is the Markov Chain, which is often used in
text generation and sequence modeling.

Dr. BVS Varma, Professor & Vice Principal DNRCET A.Y: 2024-25 15
DNR COLLEGE OF ENGINEERING & TECHNOLOGY, BHIMAVARAM
COMPUTER SCIENCE & ENGINEERING
DEEP LEARNING TECHNIQUES IV-ISEM UNIT-I BATCH:2021-25 REG:R20

 Hidden Markov Models (HMM): Extend Markov Models to systems where the states
are not directly visible (hidden). HMMs are used in speech recognition and time-series
analysis.
4. Applications of Probabilistic Modeling
 Natural Language Processing (NLP): Used for tasks like speech recognition, machine
translation, and text generation, where uncertainty and variability are high.
 Computer Vision: Probabilistic models help in object detection and recognition by
handling uncertain pixel data and predicting potential objects.
 Financial Modeling: Used to predict stock prices and economic indicators, where
market behaviors are inherently uncertain.
5. Advantages and Challenges
 Advantages: Probabilistic models are flexible, can handle uncertainty, and provide
interpretable predictions with confidence intervals. They are highly suitable for
decision-making where risk and uncertainty are present.
 Challenges: Probabilistic models can be computationally complex and may require a
large amount of data to accurately estimate distributions. Selecting the correct model
and ensuring proper assumptions are also critical for accurate results.

12) Describe the role of Artificial Intelligence in Natural Language Processing?


Role of Artificial Intelligence in Natural Language Processing (NLP):
Artificial Intelligence (AI) plays a transformative role in Natural Language Processing (NLP), enabling
machines to understand, interpret, and generate human language. Here’s a breakdown of AI’s impact on
NLP:
1. Understanding Human Language
AI-based models, particularly through deep learning, allow computers to analyze vast amounts
of language data and extract meaningful patterns. AI techniques like word embeddings (e.g.,
Word2Vec, Glove) help systems understand relationships between words based on their usage
context. This understanding is crucial for applications like sentiment analysis, which identifies
positive or negative tones in text, and machine translation, which translates languages while
preserving context and meaning.
2. Contextual Language Models
Advanced AI models like BERT (Bidirectional Encoder Representations from
Transformers) and GPT (Generative Pre-trained Transformer) use neural networks to
capture context in language. These models are pre-trained on large datasets and then fine-tuned
for specific NLP tasks, allowing them to understand the nuances of language, such as sarcasm,
idioms, or ambiguous meanings. This makes AI models capable of performing tasks like
summarization, question-answering, and text completion.
3. Automated Text Generation
AI’s role in text generation has led to the creation of highly sophisticated chat bots and virtual
assistants. Models like GPT-3 use AI to generate human-like text based on the input they
receive. This technology is used in customer service bots, virtual assistants (like Siri and Alexa),
and creative applications where coherent and contextually appropriate text is needed.
4. Speech Recognition and Text-to-Speech (TTS)
AI is critical in converting spoken language into text (speech recognition) and vice versa (text-
to-speech). By using AI-driven NLP models, systems can process accents, intonations, and even
noise in the background, allowing for real-time transcription and voice-controlled applications.

Dr. BVS Varma, Professor & Vice Principal DNRCET A.Y: 2024-25 16
DNR COLLEGE OF ENGINEERING & TECHNOLOGY, BHIMAVARAM
COMPUTER SCIENCE & ENGINEERING
DEEP LEARNING TECHNIQUES IV-ISEM UNIT-I BATCH:2021-25 REG:R20

Examples include Google Assistant, Amazon Alexa, and Apple Siri, which rely heavily on AI to
understand spoken language and respond accurately.
5. Sentiment and Emotion Analysis
AI-powered NLP models analyze the emotional tone behind text, making them valuable for
businesses monitoring customer feedback on social media, reviews, and surveys. These models
can classify language as positive, negative, or neutral and even detect specific emotions like
anger, joy, or frustration. This application helps businesses respond effectively to customer
sentiment and improve their services.

13) Interpret the concept of Over fitting & Under fitting with a suitable example?
Over fitting and Under fitting:
In machine learning, over fitting and under fitting are two key concepts that affect a model's
performance and generalizability. Understanding these concepts is essential for building models that
can make accurate predictions on new data.
Over fitting:
Definition: Over fitting occurs when a model learns the training data too well, capturing noise and
outliers rather than the underlying pattern. As a result, the model performs very well on training data
but poorly on new, unseen data. This usually happens when the model is too complex relative to the
data, such as when using too many features or a complex algorithm without sufficient data.
Example: Suppose we are training a model to predict house prices based on features like
location, size, and age of the property. If our model also starts memorizing specific features
unique to the training data, like individual house IDs or extremely rare features, it will perform
well on training data but struggle with new data that doesn’t have these unique details.
Visual Representation:
 A graph showing the model’s curve closely following the data points in the training set,
but with complex, wavy patterns, which does not generalize well to unseen data points.
Prevention:
 Reduce model complexity by using fewer features or simpler models.
 Use techniques like cross-validation to monitor how well the model generalizes.
 Apply regularization techniques (e.g., L1 or L2 regularization) to penalize complex
models.
Under fitting:
Definition: Under fitting occurs when a model is too simple to capture the underlying patterns in the
data, resulting in poor performance on both the training and test sets. This usually happens when the
model lacks the complexity needed for the task, such as using too few features or a too-basic algorithm.
Example: Let’s say we are using a linear model to fit data with a complex, nonlinear
relationship. The linear model may fail to capture the intricate details in the data, resulting in
inaccurate predictions even on the training set.
Visual Representation:
 A graph showing a straight line that doesn't follow the pattern of the data points well,
indicating that the model is too simple to capture the underlying trend.
Prevention:
 Increase model complexity, for instance, by using polynomial features or more
sophisticated algorithms like decision trees or neural networks.
 Experiment with different features or data preprocessing techniques to help the model
capture more relevant patterns.

Dr. BVS Varma, Professor & Vice Principal DNRCET A.Y: 2024-25 17
DNR COLLEGE OF ENGINEERING & TECHNOLOGY, BHIMAVARAM
COMPUTER SCIENCE & ENGINEERING
DEEP LEARNING TECHNIQUES IV-ISEM UNIT-I BATCH:2021-25 REG:R20

14. Explain the four types of machine learning?


The Four Types of Machine Learning:
Machine learning can be broadly categorized into four types based on the learning approach and the
nature of the data available for training. These are:
1. Supervised Learning
a. Definition: In supervised learning, the model is trained on a labeled dataset, meaning
that each training example is paired with an output label. The algorithm learns by
comparing its predictions to the actual labels and adjusting to reduce errors.
b. Example: Image classification, where a model is trained to identify images of animals
with labeled data (e.g., images labeled as "cat,""dog," etc.). Another example is spam
detection in emails, where the model learns to classify emails as "spam" or "not spam."
c. Common Algorithms: Linear regression, logistic regression, support vector machines
(SVM), and neural networks.
2. Unsupervised Learning
a. Definition: In unsupervised learning, the model is provided with data that has no labels.
The algorithm tries to find patterns, groupings, or structures within the data.
Unsupervised learning is useful for exploratory data analysis and understanding
complex datasets.
b. Example: Clustering customers based on purchasing behavior to identify different
segments (e.g., frequent shoppers, seasonal shoppers). Another example is anomaly
detection, such as identifying unusual patterns in credit card transactions that may
indicate fraud.
c. Common Algorithms: K-means clustering, hierarchical clustering, principal component
analysis (PCA), and association rules.
3. Semi-Supervised Learning
a. Definition: Semi-supervised learning is a combination of supervised and unsupervised
learning. In this approach, the model is trained on a small amount of labeled data along
with a larger amount of unlabeled data. This is useful when labeled data is scarce or
expensive to obtain.
b. Example: In a medical diagnosis application, there may be limited labeled data (e.g.,
patient records with diagnoses), but a large amount of unlabeled data. The model can
learn from both, improving its accuracy by using the unlabeled data to better
understand the structure of the dataset.
c. Common Algorithms: Variants of supervised algorithms can be adapted for semi-
supervised learning, such as semi-supervised SVM or graph-based methods.
4. Reinforcement Learning
a. Definition: In reinforcement learning, an agent learns to make decisions by performing
actions in an environment to maximize cumulative reward over time. The model
receives feedback in the form of rewards or penalties, which it uses to learn the best
strategy or policy for achieving a specific goal.
b. Example: Training a robot to navigate a maze or teaching a game-playing AI to play
chess. In these scenarios, the agent learns by trial and error, receiving positive feedback
for correct actions (like moving closer to the maze exit or winning the game) and
negative feedback for wrong actions.
c. Common Algorithms: Q-learning, Deep Q Networks (DQN), and policy gradient
methods.

Dr. BVS Varma, Professor & Vice Principal DNRCET A.Y: 2024-25 18
DNR COLLEGE OF ENGINEERING & TECHNOLOGY, BHIMAVARAM
COMPUTER SCIENCE & ENGINEERING
DEEP LEARNING TECHNIQUES IV-ISEM UNIT-I BATCH:2021-25 REG:R20

15) The confusion matrix of win/loss prediction of a cricket match is given below. Compute
precision, accuracy, sensitivity and specificity?
Actual
Actual loss
win
Predicted wins 85 4
Predicted loss 2 9

1) Precision = (TP)/ (TP + FP) = 35/ (35 + 2) = 97% This is win percentage
2) Accuracy= (TP+TN)/ (TP+TN+FP+FN) = (85+9)/ (8 5 + 9 + 2 + 4) =94%
3) Sensitivity= (TP)/ (TP + FN) = 85/ (85+4) = 95%
4) Specificity= (TN)/ (TN + Fp) = 9/ (9 + 2) =81%

Dr. BVS Varma, Professor & Vice Principal DNRCET A.Y: 2024-25 19

You might also like