Put MLT
Put MLT
Exam Roll o Definition: Uses a mix of labeled and unlabeled data for
No.
training.
o Examples: Learning with small labeled datasets
Dr. K. N. Modi Institute of Engineering and Technology
combined with large unlabeled datasets.
MODINAGAR
4. Reinforcement Learning
o Definition: The model learns by interacting with the
ODD Semester Academic Session 2024-25
environment to maximize rewards.
Pre-University Test o Examples: Game-playing AI, Robotics.
Branch: o Algorithms: Q-Learning, Deep Q-Networks, Policy
Program: B.Tech CSE Sem. Vth Gradient Methods.
Subject Name: Machine Learning 5. Self-Supervised Learning
Subject Code: BCS055 Techniques
o Definition: A form of unsupervised learning where the
Total Marks:
Time: 3 Hr. 70 model generates its own labels.
o Examples: Contrastive learning, BERT for NLP.
6. Evolutionary Algorithms
Note: Attempt all Sections. If require any missing data; then choose o Definition: Uses optimization techniques inspired by
suitably.
natural evolution.
SECTION – A o Examples: Genetic Algorithms, Particle Swarm
Optimization.
2x7=
1) Attempt all questions in brief. 14 b) What are the steps used for making decision tree ?
a) Describe different types of machine learning algorithm.
Ans: Steps for Making a Decision Tree
Ans: Different Types of Machine Learning Algorithms
1. Select the Root Node: Start by choosing the best attribute using a
1. Supervised Learning selection criterion (e.g., Gini Index, Information Gain).
o Definition: The model learns from labeled data, mapping input to 2. Split the Dataset: Partition the dataset based on the selected attribute.
output. 3. Create Subtrees: Repeat the process recursively for each subset.
o Examples: Regression, Classification. 4. Stopping Criteria: Stop when all data points in a node belong to the
o Algorithms: Linear Regression, Logistic Regression, Support same class, or when further splitting adds no significant improvement.
Vector Machines, Neural Networks. 5. Pruning (Optional): Simplify the tree to avoid overfitting by removing
2. Unsupervised Learning branches with low importance.
o Definition: The model works with unlabeled data to find structure
or patterns.
o Examples: Clustering, Dimensionality Reduction.
o Algorithms: K-Means, DBSCAN, PCA (Principal Component c) Describe the difficulties faced in estimating the accuracy of hypotheses.
Analysis).
3. Semi-Supervised Learning Ans: Difficulties in Estimating the Accuracy of Hypotheses
1. Bias-Variance Tradeoff: Balancing bias and variance is challenging, as too o VC Dimension: Measures the capacity of a hypothesis class.
much focus on training accuracy may lead to overfitting. o Sample Complexity: Minimum number of training samples
2. Insufficient Data: Limited or non-representative data can distort accuracy required for accurate learning.
estimates. o Generalization Bound: Theoretical limits on model
3. Imbalanced Datasets: Skewed class distributions make accuracy metrics performance for unseen data.
misleading.
4. Cross-Validation Errors: Improper cross-validation techniques can yield f) How to avoid overfiting in decision tree model ?
unreliable estimates. Ans: Avoiding Overfitting in Decision Tree Models
5. Overfitting: High accuracy on the training set may not generalize well to
unseen data. 1. Pruning: Remove branches that have little impact on overall accuracy.
2. Restrict Tree Depth: Limit the depth to reduce complexity.
3. Minimum Samples: Set a threshold for the minimum number of
samples required for splitting.
d) Explain different phases of genetic algorithm. 4. Cross-Validation: Use techniques like k-fold cross-validation to test
the model’s robustness.
5. Feature Selection: Use only the most relevant features.
6. Regularization: Apply penalties for overly complex trees.
Ans: Phases of Genetic Algorithm
g) What are the applications of machine learning ?
1. Initialization: Generate a population of potential solutions (chromosomes)
randomly. Ans: Applications of Machine Learning
2. Selection: Choose the fittest individuals based on a fitness function.
3. Crossover: Combine pairs of individuals to produce offspring by 1. Healthcare: Disease prediction, medical imaging analysis, drug
exchanging genetic material. discovery.
4. Mutation: Introduce random changes to maintain diversity and explore 2. Finance: Fraud detection, credit scoring, algorithmic trading.
new solutions. 3. Retail: Recommendation systems, inventory management, customer
5. Evaluation: Compute the fitness of new offspring. segmentation.
6. Termination: Stop when a termination criterion (e.g., maximum 4. Autonomous Vehicles: Object detection, path planning, and driving
generations, optimal fitness) is met. automation.
5. Natural Language Processing: Chatbots, sentiment analysis,
e) Write short note on computational learning theory. translation.
6. Manufacturing: Predictive maintenance, quality control, robotics.
Ans: Computational Learning Theory 7. Agriculture: Crop monitoring, yield prediction, pest control.
8. Gaming: Game AI, player behavior analysis.
Definition: A subfield of AI and ML that focuses on quantifying the
computational complexity and feasibility of learning algorithms.
Key Concepts:
SECTION – B
o PAC Learning (Probably Approximately Correct): Framework for
assessing learning feasibility. 2) Attempt any three of the following: 7x3=
21 4. Reinforcement Learning
a) What are the advantages and disadvantages of different types of
machine learning algorithm ? Advantages:
o Ideal for decision-making problems.
Ans: Supervised Learning o Learns from interactions and feedback.
o Handles dynamic environments well.
Advantages: Disadvantages:
o Produces accurate predictions for labeled data. o Requires significant computation and time.
o Easy to understand and implement for simple problems. o Difficult to design reward functions.
o Useful in regression and classification tasks. o May converge to suboptimal policies.
Disadvantages:
o Requires large amounts of labeled data.
o May overfit if the model is too complex.
b)Write short note on Artificial Neural Network (ANN).
o Struggles with high-dimensional data without feature selection.
Ans: An Artificial Neural Network (ANN) is a computational model inspired
2. Unsupervised Learning by the human brain's structure and functionality. It consists of layers of
interconnected nodes (neurons):
Advantages:
o Works with unlabeled data. 1. Structure:
o Identifies hidden patterns or clusters in the data. o Input Layer: Receives input features.
o Reduces dimensionality and noise. o Hidden Layers: Process inputs using weights, biases, and
Disadvantages: activation functions.
o Difficult to evaluate results. o Output Layer: Produces the final prediction or classification.
o May produce meaningless clusters without proper tuning. 2. Key Features:
o Sensitive to initialization and scaling of data. o Activation Functions: Introduce non-linear transformations.
Examples: ReLU, Sigmoid, Tanh.
3. Semi-Supervised Learning o Learning: Uses backpropagation to adjust weights to minimize
error.
Advantages: o Types: Feedforward Neural Networks, Convolutional Neural
o Reduces labeling costs. Networks (CNNs), Recurrent Neural Networks (RNNs).
o Combines the benefits of supervised and unsupervised learning.
3. Applications:
o Image and speech recognition, natural language processing,
Disadvantages:
and robotics.
o Performance depends on the quality of labeled and unlabeled
data.
o Algorithm complexity increases.
c) Describe the difficulties faced in estimating the accuracy of hypotheses.
Ans. K-Nearest Neighbor (K-NN) is a simple, non-parametric, instance- 6. Evaluate the Model:
based machine learning algorithm used for classification and regression o Use metrics like accuracy (classification) or mean squared error
tasks. It predicts the output for a data point based on the outputs of its (regression) to evaluate performance.
closest neighbors in the feature space.
b) Briefly explain the inductive learning problem.
Steps in K-NN Algorithm:
Ans: Inductive Learning involves generalizing from specific examples
1. Load the Data: to form rules or hypotheses that can predict outcomes for new, unseen
examples. The main challenge is finding a hypothesis that correctly explains 7x1=
the training data and generalizes well to unseen data. 7) Attempt any one part of the following: 7
a) What is reinforcement learning? Explain passive reinforcement & active
Key Concepts in Inductive Learning: reinforcement learning ?
1. Noise in Data: Mislabeled or irrelevant data may mislead the learning algorithm. 1. Fixed Policy: The agent does not explore alternative actions.
2. Underfitting and Overfitting: Ensuring the learned hypothesis is neither too 2. Evaluation: Learns the value of states under the fixed policy.
simplistic nor too complex. 3. Learning Methods:
3. Computational Complexity: Searching through a large hypothesis space can be o Monte Carlo Methods: Estimate value functions by averaging
computationally expensive. rewards from complete episodes.
o Temporal Difference (TD) Learning: Updates the value function
using differences between consecutive estimates: V(s)←V(s)
+α[R+γV(s′)−V(s)]V(s) \leftarrow V(s) + \alpha \left[ R + \gamma V(s') - a′a'a′: Next action.
V(s) \right]V(s)←V(s)+α[R+γV(s′)−V(s)] RRR: Immediate reward.
α\alphaα: Learning rate.
Active Reinforcement Learning: γ\gammaγ: Discount factor.
In active reinforcement learning, the agent explores the environment and Steps in the Q-Learning Process:
improves its policy over time to maximize cumulative rewards.
The agent learns an optimal policy π∗\pi^*π∗, which determines the best action 1. Initialize Q-Table:
to take in any state. o Create a table with all possible state-action pairs initialized to 0 or
small random values.
Characteristics:
2. Loop Until Convergence:
1. Policy Improvement: The agent dynamically updates its policy based on the o Repeat for each episode:
feedback. 1. Initialize State:
2. Exploration vs. Exploitation: Start in an initial state sss.
o Exploration: Try new actions to discover better policies. 2. Choose Action:
o Exploitation: Use the current best-known policy to maximize rewards. Use an action selection strategy (e.g., ϵ\epsilonϵ-
3. Learning Methods: greedy):
o Q-Learning: Learns the optimal action-value function (Q∗(s,a)Q^*(s, With probability 1−ϵ1-\epsilon1−ϵ, select
a)Q∗(s,a)). the action with the highest Q(s,a)Q(s,
o Policy Gradient Methods: Optimize the policy directly using gradient- a)Q(s,a).
based methods. With probability ϵ\epsilonϵ, select a
random action to explore.
b) Describe Q-learning algorithm processes 3. Take Action and Observe Reward:
Perform the selected action aaa.
Observe the immediate reward RRR and the next
Ans: Q-Learning is a model-free reinforcement learning algorithm that
state s′s's′.
enables an agent to learn the optimal action-value function Q∗(s,a)Q^*(s, 4. Update Q-Value:
a)Q∗(s,a) by interacting with the environment. Update Q(s,a)Q(s, a)Q(s,a) using the Q-learning
update rule.
Key Concepts: 5. Transition:
Set s←s′s \leftarrow s's←s′ for the next iteration.
1. Action-Value Function (Q(s,a)Q(s, a)Q(s,a)):
o Measures the expected cumulative reward of taking action aaa in state 3. Convergence:
sss, followed by the optimal policy. o Repeat the above steps for multiple episodes until Q(s,a)Q(s,
2. Bellman Equation: a)Q(s,a) stabilizes or reaches convergence.
o Q-Learning uses the Bellman optimality equation to iteratively update
Q(s,a)Q(s, a)Q(s,a): Q(s,a)←Q(s,a)+α[R+γmaxa′Q(s′,a′)−Q(s,a)]Q(s, a) \
leftarrow Q(s, a) + \alpha \left[ R + \gamma \max_{a'} Q(s', a') - Q(s, a) \
right]Q(s,a)←Q(s,a)+α[R+γa′maxQ(s′,a′)−Q(s,a)] where:
s′s's′: Next state.
Advantages of Q-Learning:
Challenges:
Applications of Q-Learning: