1. What is a Well-posed Learning Problem?
• A learning problem is well-posed if it is clearly defined in terms of:
1. Task (T): What the system needs to do.
2. Performance Measure (P): How success is evaluated.
3. Experience (E): The data or interactions the system learns from.
Examples:
• Playing chess (T), performance measured by win rate (P), experience of past games (E).
• Spam filtering (T), accuracy of classification (P), labeled emails (E).
2. List different issues in Machine Learning.
1. Data-related issues: noise, missing values, insufficient data.
2. Overfitting and underfitting.
3. Bias–variance tradeoff.
4. Choice of hypothesis representation (linear, trees, neural nets, etc.).
5. Scalability and computational efficiency.
6. Evaluation and generalization to unseen data.
7. Handling high-dimensional data (curse of dimensionality).
8. Ethical issues: fairness, transparency, interpretability.
3. Identify appropriate problems for Decision Tree Learning.
Decision trees are best suited when:
• Data is categorical or discrete.
• The hypothesis space can be expressed as a disjunction of conjunctions (IF–THEN rules).
• The target function is discrete-valued (classification).
• Examples are described by attribute–value pairs.
• The goal is to learn interpretable rules.
4. Differentiate True Error and Sample Error.
True Error Sample Error
Error of hypothesis on the entire distribution of Error of hypothesis measured on the training
instances (all possible data). sample (finite set of data).
Also called generalization error. Also called training error or empirical error.
Cannot be calculated exactly (distribution is
Can be directly computed from the training set.
unknown).
May underestimate or overestimate the true
Indicates long-term performance on unseen data.
error.
5. What is a Perceptron?
• A Perceptron is the simplest type of artificial neural network (introduced by Frank
Rosenblatt, 1958).
• It is a binary linear classifier that maps input features to an output (0 or 1) using a weighted
sum and an activation function.
1. Hypothesis Space vs Version Space
Hypothesis Space Version Space
The complete set of all possible hypotheses that can be The subset of hypotheses that are
represented in a given learning problem. consistent with the training data.
Defined before seeing data. Derived after applying training data.
Hypothesis Space Version Space
Contains only consistent hypotheses
May include many inconsistent hypotheses.
(between S and G).
2. Concept Learning (with Example)
• Definition: Concept learning is the task of inferring a Boolean-valued function (concept) from
training examples of its input and output.
• Goal: Identify a general rule that classifies unseen instances correctly.
• Example: Learning the concept "bird" from examples of animals with features like wings,
feathers, and ability to fly.
3. Issues in Decision Tree Learning
1. Overfitting due to too many branches.
2. Bias toward attributes with many values.
3. Handling continuous-valued attributes.
4. Handling missing values.
5. Scalability with large datasets.
(Any 3 points are enough for 3 marks.)
4. Gradient Descent vs Stochastic Gradient Descent (SGD)
Gradient Descent Stochastic Gradient Descent
Uses the entire training set to compute gradient. Uses one training example at a time.
Slower, more stable convergence. Faster updates, but noisy convergence.
Suitable for smaller datasets. Suitable for large-scale, online learning.
5. Hypothesis & Estimating Accuracy
• Hypothesis: A function that maps inputs to outputs, representing the learned model.
• Estimating Accuracy:
o Use a test set (unseen data) to compute error rate.
o Or use cross-validation to estimate generalization accuracy.
1. What is a Version Space?
• A Version Space is the set of all hypotheses in the hypothesis space HH that are consistent
with the training examples DD.
• Bounded by S (most specific hypotheses) and G (most general hypotheses).
• Represents all possible consistent concepts learned so far.
2. Remarks on Version Spaces and Candidate Elimination
• Version Space = all consistent hypotheses with data.
• Candidate Elimination = algorithm to compute version space efficiently.
• Maintains only boundary sets (S and G).
• Provides complete knowledge of what is learned.
• Limitation: sensitive to noise, large hypothesis spaces.
3. Define Entropy and Information Gain
• Entropy (H): A measure of uncertainty/impurity in data.
H(S)=−∑pilog2piH(S) = - \sum p_i \log_2 p_i
• Information Gain (IG): Reduction in entropy due to splitting on an attribute.
IG(S,A)=H(S)−∑∣Sv∣∣S∣H(Sv)IG(S, A) = H(S) - \sum \frac{|S_v|}{|S|} H(S_v)
• Used in decision tree learning (ID3, C4.5).
4. Neural Network Representation
• A Neural Network is a set of interconnected nodes (neurons) organized in layers:
o Input Layer: takes features.
o Hidden Layers: perform weighted computations and non-linear transformations.
o Output Layer: produces final prediction.
• Each connection has a weight; learning adjusts these weights.
• Represents complex, non-linear functions.
15. Define True Error and Sample Error
• True Error: Error rate of hypothesis over the entire data distribution (generalization error).
• Sample Error: Error rate measured only on the training data (empirical error).
• Sample error may not equal true error due to limited/biased training data.
1. Bayes Theorem
P(h∣D)=P(D∣h) P(h)P(D)P(h|D) = \frac{P(D|h)\,P(h)}{P(D)}
• Relates posterior probability P(h∣D)P(h|D) to prior P(h)P(h), likelihood P(D∣h)P(D|h), and
evidence P(D)P(D).
2. Case-Based Reasoning (CBR)
• Solving new problems by reusing solutions of similar past cases.
• Steps: retrieve → reuse → revise → retain.
3. Remarks on Explanation Learning
• Learns by deriving general rules from a single example using prior knowledge.
• Focuses on why a concept applies, not just data patterns.
• Produces compact, logically sound hypotheses.
4. Benefits of Augmenting Search Operators with Prior Knowledge
• Reduces search space.
• Speeds up learning.
• Improves accuracy by guiding towards more promising hypotheses.
5. Temporal Difference (TD) Learning
• A reinforcement learning method that learns directly from raw experience without a model
of the environment.
• Updates predictions based on difference between consecutive estimates.
6. Maximum Likelihood Hypothesis
• The hypothesis hMLh_{ML} that maximizes likelihood of observed data:
hML=argmaxhP(D∣h)h_{ML} = \arg\max_h P(D|h)
7. Example of Text Classification using Bayesian Learning
• Spam filtering: Bayesian classifier uses words (features) to calculate probability that an email
is spam or not spam.
8. FOIL (First-Order Inductive Learner)
• An algorithm for learning first-order logic rules from examples.
• Extends inductive logic programming to handle relational data.
9. Basic Steps of EM Algorithm
1. Initialize parameters randomly.
2. E-step: Estimate missing/hidden variables using current parameters.
3. M-step: Maximize likelihood by updating parameters.
4. Repeat until convergence.
10. Q-Learning
11. Gibbs Algorithm (Stochastic Learning Rule)
12. Mistake-Bound Model of Learning
• Defines an upper bound on the number of mistakes a learner will make before correctly
learning a concept.
13. Explanation-Based vs Inductive Learning
Explanation-Based Inductive
Uses prior domain knowledge + a single example. Learns generalizations from multiple examples.
Deductive process. Inductive process.
Produces compact, theory-driven rules. Produces data-driven hypotheses.
14. Advantages of Using Rule Sets in ML
• Human-interpretable.
• Flexible (can represent exceptions).
• Easy to update/modify.
• Naturally suited for classification tasks.
30. Key Components of Reinforcement Learning Task
1. Agent – learner/decision maker.
2. Environment – external system.
3. States (S) – situations the agent encounters.
4. Actions (A) – choices available to agent.
5. Rewards (R) – feedback signal.
6. Policy (π) – mapping from states to actions.
7. Value Function – predicts future rewards.
1. Well-posed Learning Problem
According to Tom Mitchell (1997): A computer program is said to learn from experience (E) with
respect to some class of tasks (T) and performance measure (P), if its performance at tasks in T, as
measured by P, improves with experience E.
So, a learning problem is well-posed if it specifies:
1. Task (T): What the system should learn/do.
2. Performance Measure (P): How success is evaluated.
3. Experience (E): The data or feedback available to the learner.
Examples
1. Spam Email Classification
• Task (T): Classify emails as “spam” or “not spam”.
• Performance (P): Accuracy of classification.
• Experience (E): A dataset of labeled emails.
2. Playing Chess
• Task (T): Play chess against an opponent.
• Performance (P): Percentage of games won.
• Experience (E): Previous games played.
3. Medical Diagnosis
• Task (T): Predict whether a patient has a certain disease.
• Performance (P): Diagnostic accuracy compared with actual outcomes.
• Experience (E): Historical patient records with symptoms and diagnoses.
In short: A well-posed learning problem = (T, P, E) clearly defined.
2. What is decision tree? Explain the Issues in decision tree learning.
• A decision tree is a supervised learning method used for classification and regression.
• It represents a model in the form of a tree, where:
o Internal nodes represent tests on attributes.
o Branches represent outcomes of the test.
o Leaf nodes represent class labels or predictions.
• The goal is to split data into subsets that are as pure as possible with respect to the target
variable.
• Popular algorithms: ID3, C4.5, CART.
Example: In a medical diagnosis tree, a node might test “Fever = Yes/No,” leading to different
branches for possible diseases.
Issues in Decision Tree Learning
1. Overfitting
o Trees can grow too complex, fitting noise in the training data.
o Needs pruning or limiting tree depth.
2. Bias Toward Attributes with Many Values
o Attributes with many distinct values (like ID numbers) may seem to give high
information gain, but they don’t generalize well.
3. Handling Continuous-Valued Attributes
o Need to find the best thresholds (e.g., age > 40).
4. Handling Missing Values
o Some training data may have missing attribute values. Decision trees must handle
these gracefully.
5. Scalability and Efficiency
o Building trees can be computationally expensive for large datasets with many
attributes.
6. Noise in Data
o Incorrect labels or errors in attributes can mislead tree construction.
3. Write a short notes on Perceptron Training Rule.
Perceptron Training Rule
• The Perceptron is a simple linear classifier introduced by Frank Rosenblatt (1958).
• It learns a linear decision boundary by adjusting weights based on errors made during
training.
Remarks
• Continues updating until all training examples are correctly classified or maximum iterations
are reached.
• Guarantee: If data is linearly separable, the algorithm converges to a correct solution.
• Limitation: Cannot solve problems that are not linearly separable (e.g., XOR).
4. Explain Multilayer Neural Network
Introduction
• A Multilayer Neural Network (MLN) is an extension of the simple perceptron.
• Unlike a single-layer perceptron, which can only represent linearly separable functions, an
MLN introduces hidden layers that allow it to learn non-linear decision boundaries.
Architecture
• Input Layer: Accepts raw features.
• Hidden Layers: One or more layers of neurons between input and output. Each neuron
applies a weighted sum followed by a non-linear activation function (e.g., sigmoid, tanh,
ReLU).
• Output Layer: Produces predictions (e.g., class labels or regression values).
Advantages
• Can approximate any continuous function (Universal Approximation Theorem).
• Learns complex, non-linear decision boundaries.
• Used in real-world applications: image recognition, NLP, speech processing.
Limitations
• Requires large datasets and computational power.
• Training can be slow.
• May suffer from overfitting without proper regularization.
In summary: Multilayer Neural Networks overcome the limitation of perceptrons by using hidden
layers and non-linear activations, making them powerful for real-world machine learning tasks.
5. Explain the Procedure to Estimate the Difference in Error Between Two Learning Methods
Introduction
• In machine learning, we often compare two algorithms (say A and B) to determine which one
generalizes better.
• Since errors estimated on training data may not reflect true performance, we use statistical
methods to estimate the difference in error.
Procedure
1. Collect a Dataset
o Use a common dataset for both methods to ensure fairness.
2. Split the Data
o Use k-fold cross-validation or a train/test split.
o Ensures that error estimates are not biased by the choice of a single test set.
Remarks
• If dˉ>0\bar{d} > 0: Algorithm B performs better.
• If dˉ<0\bar{d} < 0: Algorithm A performs better.
• If difference not statistically significant: Both algorithms perform comparably.
7. Identify Different Perspectives and Issues in Machine Learning
Perspectives in Machine Learning
Machine learning can be understood from several perspectives:
1. Learning as Function Approximation
o The goal is to approximate an unknown target function f:X→Yf: X \to Y.
o Example: Approximating spam classifier function from email features.
2. Learning as Probability Estimation
o ML methods estimate probability distributions over data.
o Example: Naïve Bayes estimates P(Class∣Features)P(Class|Features).
3. Learning as Search
o Learning is seen as searching through the hypothesis space for the best hypothesis
consistent with training data.
4. Learning as Optimization
o Many algorithms (e.g., neural networks, SVMs) minimize a loss function using
optimization techniques like gradient descent.
5. Learning as Knowledge Acquisition
o ML can be viewed as acquiring structured knowledge, such as rules or decision trees,
which can be interpreted and applied.
Issues in Machine Learning
1. Data-Related Issues
o Noise: Incorrect or random labels.
o Missing values: Incomplete data.
o Insufficient data: Leads to poor generalization.
2. Overfitting and Underfitting
o Overfitting: Learner fits training data too well, including noise.
o Underfitting: Learner fails to capture patterns in data.
3. Bias–Variance Tradeoff
o High bias: Oversimplified models.
o High variance: Overly complex models sensitive to noise.
4. Representation of Hypothesis
o Choosing whether to use trees, linear functions, neural networks, rules, etc.
5. Evaluation of Hypotheses
o Using test sets, cross-validation, error estimation to measure generalization.
6. Scalability and Efficiency
o Algorithms must handle large-scale, high-dimensional data efficiently.
7. Ethical and Social Issues
o Bias in data → unfair predictions.
o Interpretability and transparency in models.
8. Explain Backpropagation Algorithm
Introduction
• Backpropagation (BP) is the most widely used algorithm for training multilayer neural
networks.
• It is a form of supervised learning that uses the gradient descent method to minimize the
error function.
Working Principle
Steps of the Backpropagation Algorithm
1. Initialize weights randomly (small values).
2. For each training example:
o Perform forward pass to compute outputs.
o Compute error at output layer.
o Perform backward pass to propagate error.
o Update weights using gradient descent.
3. Repeat until error is minimized or convergence.
Advantages
• Can train deep, multi-layer networks.
• Handles non-linear decision boundaries.
• Widely used in modern deep learning.
Limitations
• May get stuck in local minima.
• Requires careful choice of learning rate.
• Computationally expensive for large networks.
9.
Example Sky AirTemp Humidity Wind Water Forecast Enjoy Sport
1 Sunny Warm Normal Strong Warm Same Yes
2 Sunny Warm High Strong Warm Same Yes
3 Rainy Cold High Strong Warm Change No
Example Sky AirTemp Humidity Wind Water Forecast Enjoy Sport
4 Sunny Warm High Strong Cool Change Yes
Find-S Algorithm Steps
• Start with the most specific hypothesis:
h=(∅,∅,∅,∅,∅,∅)
Step 1: Example 1 (Positive: Yes)
h=(Sunny,Warm,Normal,Strong,Warm,Same)h = (Sunny, Warm, Normal, Strong, Warm, Same)
Step 2: Example 2 (Positive: Yes)
Compare with Example 1:
• Sky: Sunny = Sunny → keep Sunny
• AirTemp: Warm = Warm → keep Warm
• Humidity: Normal vs High → generalize to ?
• Wind: Strong = Strong → keep Strong
• Water: Warm = Warm → keep Warm
• Forecast: Same = Same → keep Same
So:
h=(Sunny,Warm,?,Strong,Warm,Same)h = (Sunny, Warm, ?, Strong, Warm, Same)
Step 3: Example 3 (Negative: No)
• Ignore negative examples in Find-S.
• Hypothesis remains:
h=(Sunny,Warm,?,Strong,Warm,Same)h = (Sunny, Warm, ?, Strong, Warm, Same)
Step 4: Example 4 (Positive: Yes)
Compare with current hh:
• Sky: Sunny = Sunny → keep Sunny
• AirTemp: Warm = Warm → keep Warm
• Humidity: ? → remains ?
• Wind: Strong = Strong → keep Strong
• Water: Warm vs Cool → generalize to ?
• Forecast: Same vs Change → generalize to ?
Final hypothesis:
h=(Sunny,Warm,?,Strong,?,?)h = (Sunny, Warm, ?, Strong, ?, ?)
Final Answer (Find-S Hypothesis):
(Sunny, Warm, ?, Strong, ?, ?)( Sunny,\; Warm,\; ?,\; Strong,\; ?,\; ? )
10. Identify Different Perspectives and Issues in Machine Learning
Perspectives in Machine Learning
Machine learning can be looked at from several viewpoints:
1. Learning as Function Approximation
o ML learns a mapping from inputs XX to outputs YY.
o Example: Approximating a spam filter function that maps emails → {spam, not
spam}.
2. Learning as Probability Estimation
o ML models estimate probabilities of outcomes given inputs.
o Example: Naïve Bayes classifier estimates P(Class∣Features)P(Class|Features).
3. Learning as Search
o Learning is seen as searching through the hypothesis space for the best hypothesis
consistent with data.
o Example: Decision tree search for splits that maximize information gain.
4. Learning as Optimization
o Many ML algorithms optimize a loss function.
o Example: Neural networks minimize error via gradient descent.
5. Learning as Knowledge Acquisition
o ML can extract interpretable structures like rules, trees, and logic expressions,
enabling humans to gain knowledge.
Issues in Machine Learning
1. Data-Related Issues
o Noise: Wrong labels or corrupted features.
o Missing values: Some attributes unavailable.
o Insufficient data: Leads to poor generalization.
2. Overfitting and Underfitting
o Overfitting: Learner fits noise instead of true patterns.
o Underfitting: Learner fails to capture important structure.
3. Bias–Variance Tradeoff
o High bias → oversimplified models.
o High variance → overly complex models that do not generalize.
4. Choice of Hypothesis Representation
o Should we use linear models, trees, rules, or neural networks? Representation
strongly affects learning ability.
5. Evaluation of Hypotheses
o Generalization ability must be tested with cross-validation, test sets, and error
estimation techniques.
6. Scalability and Efficiency
o Real-world applications demand algorithms that work efficiently on large-scale, high-
dimensional data.
7. Ethical and Social Concerns
o Bias in data may cause unfair predictions.
o Interpretability and accountability are crucial in domains like healthcare or finance.
13. Explain the Difference in Error of Two Hypotheses
In machine learning, comparing two hypotheses (say h1h_1 and h2h_2) is important to know which
one generalizes better. This is usually done by comparing their true error and sample error.
4. Estimating the Difference
• Since errorDerror_D is unknown, we use statistical estimation:
o Compute errorS(h1)error_S(h_1) and errorS(h2)error_S(h_2).
o Estimate confidence intervals for true error difference using Hoeffding or Chernoff
bounds.
o Larger training sets → more accurate error estimation.
Summary
• The difference in error between two hypotheses helps us decide which hypothesis is better.
• True error reflects real-world performance, but since it’s unknown, we estimate it using
sample error and probability bounds.
14. Explain Advanced Topics in Artificial Neural Networks
Artificial Neural Networks (ANNs) have advanced significantly beyond simple perceptrons and
multilayer feedforward networks. Some key advanced topics include:
1. Deep Neural Networks (DNNs)
• Networks with multiple hidden layers.
• Capable of automatically learning complex hierarchical features.
• Example: Deep learning for image recognition (CNNs) and speech recognition
(RNNs/Transformers).
2. Convolutional Neural Networks (CNNs)
• Specialized for image and spatial data.
• Use convolution layers to capture local patterns (edges, textures).
• Applications: Face recognition, medical imaging, autonomous driving.
3. Recurrent Neural Networks (RNNs) and LSTMs
• Designed for sequential data (time series, text, speech).
• RNNs maintain memory of past inputs but suffer from vanishing gradients.
• LSTM (Long Short-Term Memory) and GRU solve this by introducing gating mechanisms.
4. Autoencoders
• Unsupervised networks for dimensionality reduction and feature learning.
• Learn compressed representation of data (encoding → decoding).
• Applications: Denoising, anomaly detection.
5. Generative Adversarial Networks (GANs)
• Two networks (Generator & Discriminator) compete in a game.
• Generator creates fake data, Discriminator distinguishes real vs fake.
• Applications: Image synthesis, data augmentation, style transfer.
6. Reinforcement Learning with Neural Networks
• Neural networks combined with reinforcement learning → Deep Q-Learning.
• Used in robotics, autonomous vehicles, and AlphaGo (Google DeepMind).
7. Transfer Learning and Pretrained Models
• Instead of training from scratch, reuse models trained on large datasets.
• Example: Using BERT (NLP) or ResNet (CV) as feature extractors.
8. Explainable Neural Networks
• Advanced research into making neural networks interpretable.
• Techniques: LIME, SHAP, Attention mechanisms.
Perfect Here are exam-ready answers for both your questions (with clear structure).
16. What is Decision Tree? Explain the Issues in Decision Tree Learning
Decision Tree
• A decision tree is a supervised learning algorithm used for classification and regression.
• Structure:
o Internal nodes → test on attributes.
o Branches → outcomes of the test.
o Leaf nodes → decision/class label.
• Example: A weather-based tree predicting “Play Tennis: Yes/No”.
Issues in Decision Tree Learning
1. Overfitting
o Tree becomes too large, fitting noise in data.
o Controlled by pruning or setting max depth.
2. Attribute Selection Bias
o Information gain favors attributes with many values (e.g., ID numbers).
o Solution: Use Gain Ratio (C4.5) or other corrected measures.
3. Handling Continuous Attributes
o Must find threshold splits (e.g., “Age > 40”).
4. Handling Missing Values
o Some instances have unknown attribute values → need strategies like fractional
assignment or surrogate splits.
5. Scalability & Efficiency
o Training can be slow with large, high-dimensional datasets.
6. Noisy Data & Errors
o Incorrect attribute values or mislabeled data degrade accuracy.
Summary:
Decision trees are simple and interpretable, but issues like overfitting, attribute bias, missing values,
continuous attributes, and noise must be handled for good performance.
16. What is Decision Tree? Explain the Issues in Decision Tree Learning
Decision Tree
• A decision tree is a supervised learning algorithm used for classification and regression.
• Structure:
o Internal nodes → test on attributes.
o Branches → outcomes of the test.
o Leaf nodes → decision/class label.
• Example: A weather-based tree predicting “Play Tennis: Yes/No”.
Issues in Decision Tree Learning
1. Overfitting
o Tree becomes too large, fitting noise in data.
o Controlled by pruning or setting max depth.
2. Attribute Selection Bias
o Information gain favors attributes with many values (e.g., ID numbers).
o Solution: Use Gain Ratio (C4.5) or other corrected measures.
3. Handling Continuous Attributes
o Must find threshold splits (e.g., “Age > 40”).
4. Handling Missing Values
o Some instances have unknown attribute values → need strategies like fractional
assignment or surrogate splits.
5. Scalability & Efficiency
o Training can be slow with large, high-dimensional datasets.
6. Noisy Data & Errors
o Incorrect attribute values or mislabeled data degrade accuracy.
17. Write a Short Note on Perceptron Training Rule
• The Perceptron is the simplest neural network used for binary classification.
• It learns a linear decision boundary by adjusting weights.
The perceptron is the simplest type of artificial neural network used for binary classification. The
perceptron training rule updates the connection weights to correctly classify training examples.
Initially, weights are assigned small random values. For each input, the perceptron computes the
weighted sum of inputs and applies an activation function (step function) to produce an output. If
the output matches the target, no change is made; otherwise, the weights are updated using the
rule:
and bias where tt is the target output, oo is the perceptron output, and η\eta is
the learning rate. This iterative process continues until all training examples are classified correctly or
a maximum number of iterations is reached. The rule guarantees convergence if the training data is
linearly separable, but it fails on problems that are not linearly separable (e.g., XOR).
Remarks
• Converges if data is linearly separable.
• Fails on non-linear problems (like XOR).
• Basis for advanced neural networks.
18. Explain Multilayer Neural Network
Introduction
A Multilayer Neural Network (MLNN) is an extension of the perceptron model that overcomes the
limitation of handling only linearly separable problems. It consists of multiple layers of neurons: an
input layer, one or more hidden layers, and an output layer.
Structure
1. Input Layer – Accepts raw features (e.g., pixel values in an image).
2. Hidden Layers – Contain neurons that learn intermediate representations using nonlinear
activation functions (e.g., sigmoid, ReLU, tanh).
3. Output Layer – Produces final prediction (classification or regression).
Working
• Each neuron computes a weighted sum of inputs, adds a bias, and passes it through an
activation function.
• Nonlinear activations allow the network to model complex, non-linear decision boundaries.
• Training is done using Backpropagation with gradient descent to minimize error.
Advantages
• Can solve problems not solvable by a single-layer perceptron (e.g., XOR problem).
• Automatically extracts complex features from data.
• Forms the basis of deep learning (with many hidden layers).
Applications
• Image recognition (e.g., handwritten digit classification).
• Natural Language Processing (e.g., sentiment analysis).
• Medical diagnosis, speech recognition, robotics.
Summary:
Multilayer neural networks are powerful models capable of learning complex mappings from inputs
to outputs, making them the foundation of modern deep learning systems.
19. Explain the Procedure to Estimate the Difference in Error Between Two Learning Methods
Introduction
When comparing two learning methods (say Algorithm A and Algorithm B), we need to determine
whether the difference in their performance (error rates) is statistically significant or due to random
chance.
Example
Suppose Algorithm A has 15% error, Algorithm B has 18% error.
• Mean difference = -3% (A is better).
• A t-test shows p < 0.05 → A is significantly better.
20. Analyze the Relation between Maximum Likelihood and Least-Squared Error Hypotheses
Introduction
Two important approaches in machine learning for selecting hypotheses are:
1. Maximum Likelihood Estimation (MLE) – chooses the hypothesis that makes the observed
data most probable.
2. Least-Squared Error Hypothesis (LSE) – chooses the hypothesis that minimizes the squared
difference between predicted and actual values.
Although they seem different, under certain conditions they are closely related.
That is, maximizing the likelihood of data under Gaussian noise is equivalent to minimizing squared
error.
• This shows LSE can be interpreted as a special case of MLE under the Gaussian error
assumption.
Summary
• MLE is a general framework for parameter estimation.
• LSE is equivalent to MLE when noise follows a Gaussian distribution.
• This relationship explains why least-squares methods are widely used in regression.
21. Write a Short Notes on K-Nearest Neighbour (K-NN) Learning
Introduction
K-Nearest Neighbour (K-NN) is a lazy learning algorithm and an example of instance-based learning.
Instead of building an explicit model, it classifies a new instance based on the classes of its nearest
neighbors in the training set.
Working of K-NN
1. Choose the value of K (number of neighbors).
2. For a new instance xx, compute distance (e.g., Euclidean, Manhattan) between xx and all
training examples.
3. Select the K nearest neighbors.
4. Predict the class by majority voting among neighbors (for classification) or average (for
regression).
Key Characteristics
• Non-parametric: Makes no assumptions about data distribution.
• Lazy learning: No explicit training phase, computation happens at prediction time.
• Distance metric plays a crucial role in accuracy.
Advantages
• Simple and intuitive.
• Effective for well-structured datasets.
• Naturally handles multi-class problems.
Disadvantages
• Computationally expensive for large datasets (requires distance calculation for each query).
• Performance sensitive to choice of K and distance metric.
• Struggles with high-dimensional data (curse of dimensionality).
Applications
• Handwritten digit recognition (MNIST dataset).
• Recommendation systems.
• Medical diagnosis.
Perfect Let’s prepare long, exam-style answers for Q22, Q23, and Q24.
22. Short Notes on Prolog-EBG
Introduction
• Prolog-EBG is an implementation of Explanation-Based Generalization (EBG) in the Prolog
programming language.
• It combines inductive learning with deductive reasoning to learn general rules from specific
training examples.
Working of Prolog-EBG
1. Input: A positive training example, background knowledge (domain theory), and a target
concept.
2. Explanation: Uses Prolog’s inference engine to explain why the example is a valid instance of
the concept.
3. Generalization: Removes irrelevant details and constructs a generalized rule that covers
similar cases.
4. Output: A new rule (hypothesis) in Prolog form, which can be used for future reasoning.
Features
• Produces logic-based hypotheses.
• Avoids overfitting by relying on background knowledge.
• Well-suited for knowledge-rich domains like medical diagnosis or planning.
23. Explain Sequential Covering Algorithm
Introduction
The Sequential Covering Algorithm is a rule-learning method used in inductive learning. Instead of
learning a whole decision tree, it learns a set of rules one by one that collectively describe the target
concept.
Steps of Sequential Covering Algorithm
1. Initialize Rule Set: Start with an empty set of rules.
2. Learn One Rule:
o Use a rule-growing strategy (e.g., FOIL, CN2) to create a rule that covers some
positive examples while avoiding negatives.
3. Add Rule to Hypothesis: Insert the learned rule into the hypothesis set.
4. Remove Covered Examples: Remove the positive examples that the rule explains.
5. Repeat until all positive examples are covered or stopping criteria are met.
Example
If the task is to predict “Play Tennis”, a rule might be:
IF Outlook = Sunny AND Humidity = Normal THEN PlayTennis = Yes
Then another rule is generated for cases not covered by the first.
Advantages
• Produces human-readable rules.
• Efficient for problems where rule-based knowledge is desirable.
• Works well in noisy domains.
Disadvantages
• Sensitive to the order in which rules are learned.
• May overfit if rules are too specific.
24. What is Reinforcement Learning? Explain Q-Learning Algorithm
Reinforcement Learning (RL)
• RL is a type of machine learning where an agent learns to make decisions by interacting with
an environment.
• The agent receives rewards (positive/negative) and aims to maximize cumulative reward
over time.
Key Components of RL
1. Agent – Learner/decision maker.
2. Environment – External system agent interacts with.
3. State (S) – Current situation.
4. Action (A) – Choice made by the agent.
5. Reward (R) – Feedback from environment.
6. Policy (π) – Strategy that defines action selection.
Q-Learning Algorithm
Q-Learning is a model-free RL algorithm that learns an action-value function (Q-function) estimating
the expected utility of taking an action in a state.
Algorithm Steps
1. Initialize Q-values arbitrarily for all state-action pairs.
2. Repeat for each episode:
o Observe current state ss.
o Choose an action aa (using ε-greedy: explore or exploit).
o Execute action → observe reward rr and next state s′s'.
o Update Q-value:
▪ α\alpha: learning rate.
▪ γ\gamma: discount factor.
3. Until convergence → Q-values approximate the optimal action-value function Q∗Q^*.
Advantages of Q-Learning
• Does not require a model of the environment.
• Can handle stochastic transitions and rewards.
• Guaranteed to converge to the optimal policy under suitable conditions.
Applications
• Game playing (e.g., AlphaGo, Atari games).
• Robotics navigation.
• Resource management and scheduling.
25. What are Sequential Covering Algorithms? Describe the working of a Sequential Covering
Algorithm with a suitable example.
Introduction
• Sequential Covering Algorithms are rule-learning algorithms used in machine learning to
generate a set of rules that describe a target concept.
• Instead of building one large hypothesis (like decision trees), they learn rules sequentially
until all training examples are covered.
• Common algorithms: FOIL, CN2, and AQ.
Working of Sequential Covering Algorithm
Step 1: Initialize Rule Set
• Start with an empty set of rules.
Step 2: Learn a Rule
• Grow a single rule using training examples.
• The rule should cover as many positive examples as possible while excluding negatives.
Step 3: Add Rule to Hypothesis
• Add the learned rule to the hypothesis set.
Step 4: Remove Covered Examples
• Remove the positive examples explained by the rule.
Step 5: Repeat
• Continue the process until all positive examples are covered or stopping criteria is reached.
Example – Play Tennis Dataset
Suppose we want to predict Play Tennis (Yes/No).
1. First rule generated:
2. IF Outlook = Sunny AND Humidity = Normal THEN Play = Yes
(Covers 3 positive examples)
3. Remove those examples.
4. Second rule generated:
5. IF Outlook = Overcast THEN Play = Yes
(Covers remaining positives with Overcast condition)
6. Continue until all positive cases are explained.
Advantages
• Produces human-readable rules.
• Efficient in noisy domains.
• Flexible: Can use heuristics like information gain for rule selection.
Disadvantages
• Sensitive to rule order.
• Risk of overfitting if rules are too specific.
26. Explain the concept of Q-learning. How does it estimate the optimal action-value function?
Provide the Q-update formula.
Introduction
• Q-learning is a model-free reinforcement learning algorithm.
• It helps an agent learn the best action-selection policy in an environment by estimating an
action-value function (Q-function).
Concept of Q-Learning
• In reinforcement learning, the agent interacts with the environment:
o Observes state (s).
o Takes an action (a).
o Receives a reward (r).
o Moves to a new state (s’).
• The Q-function represents the expected future reward of taking action aa in state ss and
following the optimal policy thereafter.
Q∗(s,a)=expected sum of discounted rewards if action a is taken in state sQ^*(s,a) = \text{expected
sum of discounted rewards if action } a \text{ is taken in state } s
How Q-Learning Estimates the Optimal Q-function
1. Initialize all Q-values arbitrarily (often zero).
2. For each interaction:
o Choose an action using an exploration strategy (e.g., ε-greedy).
o Observe reward and next state.
o Update the Q-value using the Q-update formula.
3. Over time, Q-values converge to the optimal Q-function Q∗Q^*.
Example
• Robot in a gridworld learns to reach a goal.
• States = positions in grid.
• Actions = {Up, Down, Left, Right}.
• Rewards = +10 for reaching goal, -1 for each step.
• Q-learning updates action-values until the robot learns the shortest path.
Advantages
• Does not require a model of the environment.
• Works with stochastic transitions/rewards.
• Guaranteed to converge to the optimal policy.
27. Explain Locally Weighted Regression with Suitable Example
Introduction
• Locally Weighted Regression (LWR) is a type of instance-based learning where the learner
does not build a global model but instead fits a model locally around the query point.
• It is a non-parametric regression technique that assigns higher weights to nearby training
examples and lower weights to distant ones.
• Often referred to as a form of lazy learning because computation happens at query time.
Example
Suppose we want to predict house prices based on size (in [Link]):
• Training data:
o (1000 [Link], $200K)
o (1500 [Link], $250K)
o (2000 [Link], $300K)
• Query: 1600 [Link].
• LWR assigns higher weights to 1500 [Link] example (closest), moderate weight to 2000 [Link],
and lowest to 1000 [Link].
• A weighted regression line is fitted, giving a prediction close to $260K.
Advantages
• Adapts to local variations in data.
• No need to assume a single global model.
• Flexible, works well with nonlinear data.
Disadvantages
• Computationally expensive at query time.
• Requires careful choice of bandwidth parameter τ\tau.
• Sensitive to irrelevant or noisy features.
28. Explain How Analytical Learning Can Be Performed Using Perfect Domain Theories. What are
the Key Assumptions Made in Such Settings?
• Analytical Learning is a machine learning approach that uses a perfect domain theory
(complete and correct knowledge of the environment) along with specific training examples.
• The most common technique here is Explanation-Based Learning (EBL).
• The goal is to generalize from a single example using background knowledge.
How Analytical Learning Works with Perfect Domain Theories
1. Input:
o A positive example of a target concept.
o A perfect domain theory (axioms, rules, background knowledge).
2. Explanation:
o Use deductive reasoning to explain why the example satisfies the concept.
3. Generalization:
o Remove irrelevant details from the explanation to form a general rule that applies to
many situations.
4. Output:
o A generalized hypothesis derived logically from theory + example.
Example
• Task: Learn the concept “Safe-to-Drive(Car)”.
• Domain Theory: A car is safe if it has good brakes, working lights, and no engine failure.
• Training Example: A Toyota Corolla with good brakes, working lights, and no engine failure is
safe.
• Explanation: From the domain theory, the example is safe.
• Generalization: "Any car with good brakes, working lights, and no engine failure is safe to
drive."
Thus, one example + perfect domain theory → generalized concept.
Key Assumptions in Analytical Learning
1. Perfect Domain Theory – The background knowledge is complete, correct, and consistent.
2. Deterministic World – No uncertainty; conclusions are logically valid.
3. Sufficient Example – Even one example can be generalized if theory supports it.
4. Relevance – The learner can identify which attributes are relevant to the concept.
Advantages
• Requires very few training examples.
• Produces strong, logically consistent hypotheses.
• Efficient in knowledge-rich domains.
Limitations
• Unrealistic assumption of having a perfect domain theory.
• Sensitive to errors or incompleteness in background knowledge.
30. Describe how prior knowledge can be used to alter the search objective in machine learning.
What is its impact on hypothesis space exploration?
In machine learning, learning a hypothesis is often seen as a search problem in the hypothesis space.
The learner must search for the best hypothesis that fits the training data. Without guidance, this
search can be slow and may lead to suboptimal solutions.
Ways Prior Knowledge Alters the Search Objective
1. Biasing the Search (Inductive Bias):
o Prior knowledge introduces preferences for certain types of hypotheses (e.g.,
simpler ones – Occam’s Razor).
o Example: In decision trees, preferring trees with fewer nodes avoids overfitting.
2. Restricting Hypothesis Space:
o Prior knowledge can eliminate hypotheses that are impossible or irrelevant.
o Example: If we know that humidity does not affect “Safe-to-Drive” decisions, we can
ignore it during search.
3. Guiding Evaluation Functions:
o In heuristic search (e.g., ID3), prior knowledge can change how the algorithm
evaluates candidate splits, giving higher weight to features known to be useful.
4. Adding Constraints:
o Domain rules can constrain learning so that hypotheses violating them are discarded.
o Example: In medical diagnosis, a hypothesis suggesting “headache → cancer” may be
constrained by known medical facts.
Impact on Hypothesis Space Exploration
• Reduced Complexity: Hypothesis space becomes smaller, making search faster.
• Improved Generalization: Prior knowledge prevents overfitting to noise, since irrelevant
hypotheses are excluded.
• Risk of Bias: Incorrect prior knowledge may misguide learning and prevent discovery of the
true hypothesis.
• Efficient Learning: Learner requires fewer training examples when guided by strong prior
knowledge.
31. Define Reinforcement Learning. Explain its Main Components and the Structure of the Learning
Task.
Definition
Reinforcement Learning (RL) is a learning paradigm where an agent learns to make decisions by
interacting with an environment. The agent takes actions, receives feedback in the form of rewards
or penalties, and aims to learn a policy that maximizes cumulative reward over time.
It is based on trial-and-error learning and delayed rewards, unlike supervised learning which uses
direct labeled examples.
Main Components of RL
1. Agent:
The learner/decision-maker (e.g., a robot, software program).
2. Environment:
Everything the agent interacts with. It provides states and rewards in response to the agent’s
actions.
3. State (S):
A representation of the current situation (e.g., robot’s location in a grid).
4. Action (A):
Choices available to the agent (e.g., move left, right, up, down).
5. Reward (R):
Numerical feedback from the environment (positive or negative). Guides learning.
6. Policy (π):
A mapping from states to actions that defines the agent’s behavior.
7. Value Function (V(s) or Q(s,a)):
Predicts the expected future rewards. Helps evaluate how good a state or action is.
8. Model (optional):
Some RL methods use a model of the environment to simulate outcomes.
Example
• Chess RL Agent:
o State = current board position.
o Action = move a piece.
o Reward = +1 for win, -1 for loss, 0 for draw.
o Policy = strategy to play chess.
32. Explain the basic structure of a Genetic Algorithm (GA) with an illustrative example.
Introduction
A Genetic Algorithm (GA) is a search and optimization technique inspired by the principles of natural
selection and genetics. It belongs to the family of evolutionary algorithms and is useful for solving
complex optimization problems where traditional methods fail.
The basic idea is to evolve a population of candidate solutions (chromosomes) over successive
generations, using selection, crossover, and mutation operators.
Basic Structure of GA
1. Initialization:
o Start with a population of randomly generated solutions (chromosomes).
2. Evaluation (Fitness Function):
o Each chromosome is evaluated using a fitness function that measures how well it
solves the problem.
3. Selection:
o Select the fittest individuals to act as parents for the next generation. Common
methods: Roulette Wheel Selection, Tournament Selection.
4. Crossover (Recombination):
o Combine two parent chromosomes to produce offspring by exchanging parts of their
structure.
5. Mutation:
o Randomly alter some genes to maintain diversity and avoid premature convergence.
6. Replacement:
o Form a new population by replacing less fit individuals with offspring.
7. Termination:
o Repeat steps (evaluation → selection → crossover → mutation → replacement) until
a stopping condition is met (e.g., maximum generations or satisfactory fitness).
Steps:
1. Initial Population: Suppose we randomly select 4 chromosomes:
o 01101 (13), 10110 (22), 00111 (7), 11100 (28)
2. Fitness Evaluation:
o f(13)=169, f(22)=484, f(7)=49, f(28)=784
3. Selection:
o Higher fitness → more chance of selection. (28 and 22 are chosen more often).
4. Crossover:
o Cross 10110 and 11100 → offspring 10100 (20), 11110 (30).
5. Mutation:
o Randomly flip a bit in 10100 → 10101 (21).
6. Replacement:
o New population: {11100, 10110, 10101, 11110}.
7. Termination:
o Continue until best fitness found (x=31 → f(x)=961).
33. Define analytical learning. How does it differ from inductive learning?
Definition of Analytical Learning
Analytical learning is a machine learning approach in which the system uses prior domain knowledge
(theory) along with observed training examples to derive hypotheses. It focuses on deductive
reasoning from perfect or near-perfect domain theories.
• Instead of generalizing directly from examples, it combines background knowledge +
examples to explain and learn.
• Example: In a medical diagnosis system, if we already know medical laws about how diseases
cause symptoms, the system can explain why a patient with certain symptoms has a disease.
Difference Between Analytical and Inductive Learning
Aspect Analytical Learning Inductive Learning
Learns directly from training
Learning Basis Uses prior domain theory + examples
examples
Deductive (applies rules to derive Inductive (generalizes from specific
Type of Reasoning
hypothesis) cases)
Dependence on Requires fewer examples (since prior
Requires many labeled examples
Data theory is strong)
Aspect Analytical Learning Inductive Learning
May be less accurate if training data
Accuracy More accurate if domain theory is correct
is noisy
Decision Trees, Naïve Bayes, Neural
Example Explanation-Based Learning (EBL)
Networks
Example
• Analytical Learning: If domain theory states “All birds can fly except penguins”, and we
observe “Tweety is a bird and flies”, we can deduce Tweety is not a penguin.
• Inductive Learning: Without prior theory, we would just observe many bird examples and
generalize “Most birds fly.”
Learning Multilayer Networks using Gradient Descent
1. Introduction
• A multilayer network (or multilayer perceptron, MLP) consists of an input layer, one or more
hidden layers, and an output layer.
• Each neuron computes a weighted sum of inputs, passes it through a nonlinear activation
function (e.g., sigmoid, ReLU, tanh).
• The goal of learning is to adjust the weights so that the network correctly maps input
examples to desired outputs.
• This is achieved using the gradient descent algorithm, applied through Backpropagation.
4. Illustrative Example
Suppose we have:
• Input: (x1,x2)(x_1, x_2)
• One hidden layer with neurons h1,h2h_1, h_2
• One output neuron yy.
1. Forward pass → compute activations.
2. Compute error at output neuron.
3. Backpropagate to hidden neurons.
4. Update all weights using gradient descent rule.
5. Advantages
• Can learn non-linear decision boundaries.
• Can approximate any continuous function (Universal Approximation Theorem).
• Works well for image recognition, NLP, and complex AI tasks.