Machine learning
(a) Define Machine Learning.
Machine Learning is a branch of Artificial Intelligence that enables a computer system
to learn from data and improve performance automatically without explicit
programming.
Definition:
“A computer program learns from experience E with respect to task T and performance
measure P if its performance at task T improves with experience E.”
Applications:
Speech recognition
Image classification
Recommendation systems
(b) Explain Regression Model.
A regression model is a supervised learning technique used to predict continuous
numerical values by establishing a relationship between dependent and independent
variables.
Linear Regression Equation:
Y = a+ bx
SECTION A
Q1. Attempt all questions in brief.
(a) Define Machine Learning.
is a branch of Artificial Intelligence that enables a computer system to learn from data and
improve performance automatically without explicit programming.
Definition:
“A computer program learns from experience E with respect to task T and performance
measure P if its performance at task T improves with experience E.”
Applications:
• Speech recognition
• Image classification
• Recommendation systems
(b) Explain Regression Model.
A regression model is a supervised learning technique used to predict continuous numerical
values by establishing a relationship between dependent and independent variables.
Linear Regression Equation: Y = a+ bx
Where:
• Y = dependent variable
• A = intercept
• B = regression coefficient
• X = independent variable
Uses:
• Weather forecasting
• Sales prediction
• House price prediction
(c) What is ANN?
(ANN) is a computational model inspired by the human brain consisting of interconnected
neurons that process information.
Structure of ANN:
1. Input Layer
2. Hidden Layer
3. Output Layer
Features:
• Learns from examples
• Handles non-linear problems
• Used in pattern recognition
(d) Explain Well Defined Learning Problems.
A learning problem is said to be well defined when the following three components are
properly specified:
1. Task (T): Work to be performed
2. Performance Measure (P): Criteria to evaluate performance
3. Experience (E): Training data or previous experience
Example:
• Task: Spam filtering
• Performance Measure: Accuracy
• Experience: Collection of emails
(e) Define Decision Tree.
is a supervised learning algorithm represented in the form of a tree structure used for
classification and prediction.
Components:
• Root Node
• Decision Node
• Leaf Node
Advantages:
• Easy to understand
• Requires less data preprocessing
• Useful for decision making
Simple Diagram:
Root
/ \
Yes No
/ \
Class A Class B
(f) Explain Bayes Classifier.
based classifier is a probabilistic classifier that predicts the class label using conditional
probability.
Bayes Theorem: P(A/B) = P(B/A) P(A) / P(B)
Where:
• P (A/B) = posterior probability
• P(B/A) = likelihood
• P(A) = prior probability
• P(B) = evidence
Advantages:
• Simple and efficient
• Works well with large datasets
(g) Explain Q-Learning. (Chatgpt mei deko ye qns)
is a reinforcement learning technique in which an agent learns the best action using rewards
and penalties.
Q-Learning Update Formula:
Where:
• Q(s, a) = Q-value
• Alpha = learning rate
• r = reward
• Y gamma jese chatgpt mei deko= discount factor
Applications:
• Robotics
• Game playing
• Path optimization
SECTION B
Q2. Attempt any three of the following.
(a) Explain the role of Genetic Algorithm in
knowledge based technique.
is a search and optimization technique based on the principle of natural selection and
genetics. It is widely used in knowledge based systems to obtain optimal solutions for
complex problems.
Introduction
Genetic Algorithm (GA) works by generating a population of possible solutions and
improving them iteratively using genetic operators such as:
1. Selection
2. Crossover
3. Mutation
It follows the concept of “survival of the fittest”.
Components of Genetic Algorithm
1. Population
A set of possible solutions to the problem.
2. Chromosome
Representation of a solution.
3. Fitness Function
Measures the quality of a solution.
4. Genetic Operators
• Selection
• Crossover
• Mutation
Working of Genetic Algorithm
Step 1: Initialization
Generate an initial random population.
Step 2: Fitness Evaluation
Calculate fitness value of each chromosome.
Step 3: Selection
Select best chromosomes based on fitness.
Step 4: Crossover
Combine selected parents to produce offspring.
Step 5: Mutation
Randomly modify genes to maintain diversity.
Step 6: Replacement
Replace weaker solutions with better offspring.
Step 7: Termination
Process repeats until optimal solution is achieved.
Flow Diagram of Genetic Algorithm
Start
|
Initialize Population
|
Evaluate Fitness
|
Selection
|
Crossover
|
Mutation
|
New Population
|
Termination?
|
Yes ---> Stop
No ----> Repeat
Role in Knowledge Based Technique
1. Used for optimization problems
2. Helps in rule discovery
3. Improves decision making
4. Used in expert systems
5. Handles large search spaces efficiently
6. Provides near-optimal solutions
Applications
• Machine learning
• Robotics
• Scheduling
• Data mining
• Neural network training
Advantages
• Works for complex problems
• Provides global optimum solution
• Does not require derivative information
Disadvantages
• Computationally expensive
• Convergence may be slow
Conclusion
Genetic Algorithm is an efficient optimization technique used in knowledge based systems
for solving complex search and learning problems. It provides better and optimized solutions
through evolutionary operations.
(b) Differentiate between Genetic
Algorithm and Traditional Algorithm with
suitable example.
Introduction
and traditional algorithms are methods used to solve optimization and search problems.
Genetic Algorithm is inspired by biological evolution, while traditional algorithms follow
fixed mathematical procedures.
Difference between Genetic Algorithm and
Traditional Algorithm
Genetic Algorithm Traditional Algorithm
Based on natural evolution Based on fixed procedures
Works with population of solutions Works with single solution
Uses probabilistic approach Uses deterministic approach
Can escape local optimum May get trapped in local optimum
Suitable for complex problems Suitable for simple problems
Uses crossover and mutation Does not use genetic operators
Requires fitness function Requires exact mathematical model
Provides approximate optimal solution Provides exact solution
Working of Genetic Algorithm
Main Operations:
1. Selection
2. Crossover
3. Mutation
Formula of Fitness Evaluation:
Example
Problem:
Finding shortest route between cities.
Traditional Algorithm:
Uses Dijkstra algorithm with fixed path calculations.
Genetic Algorithm:
Generates multiple possible routes and improves them generation by generation.
Diagram
Traditional Algorithm:
Input --> Processing --> Output
Genetic Algorithm:
Population --> Selection --> Crossover --> Mutation --> Best Solution
Advantages of Genetic Algorithm over Traditional
Algorithm
1. Better for non-linear problems
2. Handles large datasets
3. Gives robust solutions
4. Suitable for optimization
Conclusion
Genetic Algorithm is more flexible and efficient for complex optimization problems
compared to traditional algorithms, whereas traditional methods are faster for simple and
well-defined problems.
(c) Explain various ANN architecture in
detail.
architecture refers to the arrangement of neurons and layers in a neural network system.
Types of ANN Architecture
1. Single Layer Feed Forward Network
In this architecture, information moves only in one direction from input layer to output layer.
Features:
• No hidden layer
• Simple structure
• Used for simple classification
Diagram
Input Layer -----> Output Layer
2. Multi Layer Feed Forward Network
Contains one or more hidden layers between input and output layers.
Features:
• Solves complex problems
• Uses backpropagation learning
• Most commonly used ANN
Diagram
Input --> Hidden Layer --> Output
3. Recurrent Neural Network (RNN)
In RNN, output of neurons is fed back as input.
Features:
• Has memory capability
• Used for sequential data
• Applied in speech recognition
Diagram
Input --> Hidden --> Output
^ |
|________|
4. Convolutional Neural Network (CNN)
Special type of ANN mainly used for image processing.
Features:
• Performs feature extraction
• Uses convolution operation
• High accuracy in image recognition
Basic Neuron Model
The output of neuron is:
Where:
• = inputs
• = weights
• = bias
• = activation function
Applications of ANN
1. Pattern recognition
2. Medical diagnosis
3. Image processing
4. Speech recognition
5. Forecasting systems
Advantages
• Learns automatically
• Handles noisy data
• Solves non-linear problems
Disadvantages
• Requires large training data
• High computational cost
Conclusion
ANN architectures are designed according to problem requirements. Different architectures
such as feed forward, recurrent and convolutional networks are used for various machine
learning applications.
(d) Describe any algorithm to implement
simulated annealing.
is a probabilistic optimization algorithm inspired by the annealing process in metallurgy.
It is used to obtain near-optimal solutions for difficult optimization problems.
Principle of Simulated Annealing
The algorithm allows occasional acceptance of worse solutions to avoid local minima.
Algorithm Steps
Step 1: Initialize
Choose initial solution and temperature.
Step 2: Generate Neighbor
Generate nearby solution randomly.
Step 3: Calculate Energy Difference
Step 4: Acceptance Criterion
If:
• , accept solution
• Else accept with probability:
Step 5: Reduce Temperature
Decrease temperature gradually.
Step 6: Repeat
Continue until stopping condition.
Flow Diagram
Start
|
Initial Solution
|
Generate Neighbor
|
Calculate Energy
|
Accept Solution?
|
Reduce Temperature
|
Stop?
Applications
• Traveling salesman problem
• Scheduling
• Neural network optimization
Advantages
1. Avoids local minima
2. Easy implementation
3. Effective for optimization
Disadvantages
1. Slow convergence
2. Requires parameter tuning
Conclusion
Simulated Annealing is an effective optimization technique that searches for global optimum
solutions by controlled randomization.
(e) Explain DBSCAN with its role in
forming clusters.
stands for Density Based Spatial Clustering of Applications with Noise. It is a clustering
algorithm that groups closely packed data points together.
Basic Concepts
1. Epsilon (ε)
Radius used to search neighboring points.
2. MinPts
Minimum number of points required to form a dense region.
3. Core Point
Point having at least MinPts neighbors.
4. Border Point
Point near a core point but with fewer neighbors.
5. Noise Point
Point that does not belong to any cluster.
Working of DBSCAN
Step 1:
Select an unvisited point.
Step 2:
Find neighboring points within ε distance.
Step 3:
If neighbors ≥ MinPts, create cluster.
Step 4:
Expand cluster recursively.
Step 5:
Mark remaining points as noise.
Diagram
Cluster 1 Noise Cluster 2
*** . ****
***** *****
Role in Forming Clusters
1. Detects arbitrary shaped clusters
2. Identifies noise and outliers
3. Does not require predefined number of clusters
4. Works well for spatial databases
Advantages
• Handles noisy data
• Finds irregular shaped clusters
• No need to specify number of clusters
Disadvantages
• Sensitive to parameter selection
• Not effective for varying densities
Applications
• Image processing
• Data mining
• Geographic data analysis
Conclusion
DBSCAN is a powerful density-based clustering algorithm capable of identifying meaningful
clusters and noise in large datasets efficiently.
SECTION C
Q3. Attempt any one part of the following.
3(a) Explain Back Propagation Algorithm
with suitable example.
is a supervised learning algorithm used for training multilayer Artificial Neural Networks
(ANN).
It minimizes error by adjusting weights in backward direction from output layer to hidden
layer.
Introduction
Back propagation means “propagation of error backward”.
The algorithm compares actual output with desired output and updates weights to reduce
error.
It is commonly used in:
• Pattern recognition
• Image processing
• Speech recognition
Structure of ANN
An ANN consists of:
1. Input Layer
2. Hidden Layer
3. Output Layer
Diagram
Input Layer --> Hidden Layer --> Output Layer
x1 h1 y
x2 h2
Working of Back Propagation Algorithm
Step 1: Initialization
Initialize weights and bias with small random values.
Step 2: Forward Propagation
Input values are passed through hidden layer to output layer.
Net Input Equation
Activation Function
The output is calculated using activation function.
Step 3: Error Calculation
Difference between actual and desired output is calculated.
Error Equation
Where:
• = Target output
• = Obtained output
Step 4: Backward Propagation
Error is propagated backward and weights are updated.
Weight Update Rule
Where:
• = learning rate
• = error term
• = input
Step 5: Repeat
Repeat process until minimum error is achieved.
Algorithm Steps
1. Initialize weights
2. Apply input vector
3. Calculate hidden layer output
4. Calculate final output
5. Compute error
6. Update weights
7. Repeat until convergence
Example
Suppose:
• Input = 0.5
• Desired Output = 1
Network computes output = 0.7
Error:
The error is propagated backward and weights are adjusted to improve output accuracy.
Advantages
1. High accuracy
2. Learns complex patterns
3. Suitable for non-linear problems
Disadvantages
1. Training is time consuming
2. Requires large data
3. May get trapped in local minima
Applications
• Face recognition
• Medical diagnosis
• Stock prediction
• Character recognition
Conclusion
Back Propagation Algorithm is one of the most important learning algorithms in ANN. It
improves network performance by minimizing error through repeated weight adjustment.
3(b) Explain learning with any two learning
techniques with its expression for weight
updating.
learning is the process through which a machine improves its performance using experience
or training data.
Learning techniques define how weights in a neural network are updated.
Types of Learning Techniques
1. Supervised Learning
2. Unsupervised Learning
3. Reinforcement Learning
Here, two learning techniques are explained.
1. Supervised Learning
In supervised learning, input and desired output are provided to the system during training.
The network learns by minimizing error between actual and target output.
Working
• Input is applied
• Desired output is compared with actual output
• Error is calculated
• Weights are updated
Weight Updating Rule
Where:
• = target output
• = actual output
• = learning rate
• = input
Applications
• Spam detection
• Image classification
• Weather prediction
2. Unsupervised Learning
In unsupervised learning, only input data is provided.
The network automatically identifies hidden patterns and clusters.
Working
• Input patterns are grouped
• Similar data forms clusters
• No target output is provided
Hebbian Weight Update Rule
Where:
• = input neuron
• = output neuron
• = learning rate
Applications
• Clustering
• Market analysis
• Pattern discovery
Comparison of Learning Techniques
Supervised Learning Unsupervised Learning
Uses labeled data Uses unlabeled data
Target output available No target output
Error correction possible No direct error correction
High accuracy Used for pattern discovery
Diagram
Supervised Learning:
Input --> Target Output --> Error Correction
Unsupervised Learning:
Input --> Pattern Discovery --> Clustering
Advantages
1. Improves prediction accuracy
2. Learns automatically from data
3. Useful in intelligent systems
Conclusion
Learning techniques help neural networks adapt and improve performance. Supervised
learning uses labeled data for prediction, while unsupervised learning identifies hidden
patterns from unlabeled data.
SECTION C
4(a) Write Short Note on:
(i) Sampling Theory
(ii) Bayes Theorem
(i) Sampling Theory
is a method used to convert a continuous signal into a discrete signal by taking samples at
regular intervals of time.
It is widely used in:
• Digital communication
• Machine learning
• Signal processing
• Image processing
Nyquist Sampling Theorem
According to Nyquist theorem:
“A continuous signal can be completely reconstructed if it is sampled at a rate greater than or
equal to twice the highest frequency present in the signal.”
Sampling Formula
Where:
• = sampling frequency
• = maximum frequency of signal
Types of Sampling
1. Ideal Sampling
Samples are taken instantaneously.
2. Natural Sampling
Pulse width is finite.
3. Flat Top Sampling
Amplitude remains constant during sampling period.
Diagram of Sampling
Continuous Signal --> Sampler --> Discrete Signal
Applications
1. Audio processing
2. Digital television
3. Speech recognition
4. Machine learning datasets
Advantages
• Easy digital storage
• Efficient signal processing
• Reduces noise effect
Conclusion
Sampling theory forms the basis of digital communication and data processing systems by
converting analog information into digital form efficiently.
(ii) Bayes Theorem
is a mathematical theorem used to determine conditional probability.
It plays an important role in:
• Machine learning
• Data mining
• Classification problems
• Spam filtering
Bayes Theorem Formula
Where:
• = posterior probability
• = likelihood
• = prior probability
• = evidence probability
Explanation
Bayes theorem helps in predicting probability of an event based on prior knowledge.
Example
Suppose:
• Probability of disease = 0.01
• Probability of positive test given disease = 0.99
Bayes theorem calculates actual probability of disease after observing test result.
Applications
1. Naive Bayes classifier
2. Medical diagnosis
3. Email spam filtering
4. Risk analysis
Advantages
• Simple probabilistic model
• Works well with large datasets
• Fast computation
Conclusion
Bayes theorem is a powerful probabilistic approach used in intelligent systems for prediction
and classification.
4(b) Explain any comparing learning
technique with suitable example.
techniques are compared based on training method, data requirement and output generation.
The major learning techniques are:
1. Supervised Learning
2. Unsupervised Learning
3. Reinforcement Learning
Here, supervised and unsupervised learning are compared.
Comparison between Supervised and
Unsupervised Learning
Supervised Learning Unsupervised Learning
Uses labeled data Uses unlabeled data
Target output available No target output
Learns from examples Learns from hidden patterns
High prediction accuracy Used for clustering
Requires training data No predefined output
1. Supervised Learning
In supervised learning, input and desired output are provided during training.
Diagram
Input --> Learning Model --> Predicted Output
^
|
Target Output
Weight Update Formula
Where:
• = target output
• = actual output
• = learning rate
Example
Email spam detection where emails are labeled as spam or non-spam.
2. Unsupervised Learning
In unsupervised learning, only input data is given.
The system identifies hidden structures automatically.
Diagram
Input Data --> Clustering --> Groups
Hebbian Learning Formula
Example
Customer segmentation in marketing.
Advantages of Learning Techniques
1. Automatic learning
2. Pattern discovery
3. Better decision making
Conclusion
Supervised learning is mainly used for prediction problems while unsupervised learning is
used for discovering hidden patterns and clustering.
5(a) Explain the followings:
(i) Generalization
(ii) Multilayer Network
(i) Generalization
is the ability of a machine learning model to perform accurately on unseen data after training.
A good model should not only memorize training data but also predict correctly for new
inputs.
Importance of Generalization
1. Improves prediction accuracy
2. Prevents overfitting
3. Makes model reliable
Types
1. Good Generalization
Model performs well on both training and testing data.
2. Poor Generalization
Model performs well only on training data.
Diagram
Training Data --> Learning --> Testing on New Data
Overfitting and Underfitting
Overfitting
Model memorizes training data.
Underfitting
Model fails to learn patterns.
Applications
• Image recognition
• Medical diagnosis
• Speech processing
Conclusion
Generalization is an essential property of machine learning systems for achieving better
performance on unseen data.
(ii) Multilayer Network
is an Artificial Neural Network containing one or more hidden layers between input and
output layers.
It is also known as Multilayer Feed Forward Network.
Structure of Multilayer Network
1. Input Layer
2. Hidden Layer
3. Output Layer
Diagram
Input Layer --> Hidden Layer --> Output Layer
Working
• Input signals are processed in hidden layers
• Weights are adjusted using back propagation
• Final output is generated
Neuron Output Equation
Where:
• = inputs
• = weights
• = bias
Features
1. Solves complex non-linear problems
2. Learns hidden patterns
3. High prediction capability
Applications
• Pattern recognition
• Speech recognition
• Forecasting systems
• Medical diagnosis
Advantages
• High accuracy
• Learns complex relationships
• Adaptive learning
Disadvantages
• High computational cost
• Requires large training data
Conclusion
Multilayer networks are powerful ANN models capable of solving complex classification and
prediction problems efficiently.
5(b) Explain any comparing learning
technique with suitable example.
learning techniques are methods through which machines acquire knowledge from data.
The commonly used learning techniques are:
1. Supervised Learning
2. Unsupervised Learning
3. Reinforcement Learning
Here, supervised learning and reinforcement learning are compared.
Comparison between Supervised Learning
and Reinforcement Learning
Supervised Learning Reinforcement Learning
Uses labeled data Uses rewards and penalties
Learns from training examples Learns through interaction
Immediate feedback available Delayed feedback
Used for classification Used for decision making
1. Supervised Learning
The system learns using input-output pairs.
Example
Handwritten digit recognition.
Weight Update Rule
2. Reinforcement Learning
Agent learns by interacting with environment and receiving rewards.
Q-Learning Formula
Diagram
Agent <---- Reward ---- Environment
|
Action
Applications
1. Robotics
2. Game playing
3. Self-driving cars
Advantages
• Learns automatically
• Improves decision making
• Handles dynamic environment
Conclusion
Different learning techniques are suitable for different applications. Supervised learning is
mainly used for prediction tasks while reinforcement learning is useful in intelligent decision-
making systems.
SECTION C
6(a) Explain Reinforcement Learning with
suitable example.
is a type of machine learning in which an agent learns by interacting with the environment
and receiving rewards or penalties.
The main objective is to maximize cumulative reward by selecting optimal actions.
Components of Reinforcement Learning
1. Agent
The learner or decision maker.
2. Environment
The external system with which the agent interacts.
3. State
Current situation of the environment.
4. Action
Operation performed by the agent.
5. Reward
Feedback received after performing an action.
Working of Reinforcement Learning
1. Agent observes current state.
2. Agent performs an action.
3. Environment changes state.
4. Reward or penalty is received.
5. Agent updates learning policy.
The process repeats until optimal behavior is achieved.
Diagram of Reinforcement Learning
Reward
Agent <-------- Environment
|
| Action
v
Environment State
Q-Learning Algorithm
is the most popular reinforcement learning algorithm.
Q-Learning Formula
Where:
• = current Q-value
• = learning rate
• = reward
• = discount factor
• = next state
Example of Reinforcement Learning
Robot Navigation
A robot moves inside a maze:
• Correct path → positive reward
• Wrong path → penalty
The robot learns the shortest path after repeated trials.
Types of Reinforcement Learning
1. Positive Reinforcement
Encourages desired behavior through rewards.
2. Negative Reinforcement
Discourages unwanted behavior through penalties.
Applications
1. Robotics
2. Self-driving cars
3. Game playing
4. Recommendation systems
5. Industrial automation
Advantages
1. Learns automatically from experience
2. Suitable for dynamic environments
3. Improves decision making
Disadvantages
1. Requires large training time
2. High computational cost
3. Exploration may be risky
Conclusion
Reinforcement Learning is an important machine learning technique where intelligent agents
learn optimal actions through interaction with environment using rewards and penalties.
6(b) Explain Support Vector Machine
(SVM) in detail.
(SVM) is a supervised machine learning algorithm used for classification and regression
problems.
It separates data points using an optimal hyperplane with maximum margin.
Introduction
SVM mainly focuses on finding the best decision boundary between classes.
It is widely used in:
• Image classification
• Face detection
• Text categorization
• Bioinformatics
Basic Concepts of SVM
1. Hyperplane
A decision boundary separating different classes.
2. Support Vectors
Nearest data points to the hyperplane.
3. Margin
Distance between support vectors and hyperplane.
Diagram of SVM
Class A * * * Hyperplane o o o Class B
----------------
Working of SVM
1. Input training data is provided.
2. Algorithm identifies support vectors.
3. Hyperplane with maximum margin is selected.
4. New data is classified based on hyperplane position.
SVM Decision Function
Where:
• = weight vector
• = input vector
• = bias
Types of SVM
1. Linear SVM
Used when data is linearly separable.
2. Non-Linear SVM
Uses kernel functions for complex data.
Kernel Functions
1. Linear Kernel
2. Polynomial Kernel
3. Radial Basis Function (RBF) Kernel
4. Sigmoid Kernel
Advantages
1. High accuracy
2. Effective for high-dimensional data
3. Works well with small datasets
Disadvantages
1. Slow for large datasets
2. Kernel selection is difficult
3. High memory usage
Applications
1. Handwriting recognition
2. Face detection
3. Medical diagnosis
4. Text classification
5. Fraud detection
Conclusion
Support Vector Machine is a powerful supervised learning algorithm that provides efficient
classification by constructing an optimal hyperplane with maximum margin separation.
Explain K-Means Clustering Algorithm with suitable example.
Important points usually asked:
Definition of clustering
Steps of K-Means
Centroid calculation
Advantages & disadvantages
Applications
Diagram of clusters
Formula often used:
Possible Q7(b)
Explain Naive Bayes Classifier with suitable example.
Topics usually expected:
Bayes theorem
Conditional probability
Working of Naive Bayes
Advantages/disadvantages
Applications in spam filtering
Main formula: