Unit-2 Advanced Concepts of Modeling in AI - Question Answers
Unit-2 Advanced Concepts of Modeling in AI - Question Answers
Q1: What is supervised learning and how does it differ from other machine learning
approaches?
Supervised learning is a machine learning paradigm where an algorithm learns from labeled
training data to make predictions or decisions. The algorithm is "supervised" because it learns
from example inputs paired with their correct outputs. This differs from unsupervised learning
(which uses unlabeled data) and reinforcement learning (which learns through trial and error
with rewards/penalties).
Q1: What is unsupervised learning and what types of problems is it used for?
Unsupervised learning is a type of machine learning where algorithms identify patterns in data
without labeled responses or guidance. It's used for:
• Discovering hidden structures in data
• Clustering similar data points
• Dimensionality reduction
• Anomaly detection
• Feature learning
• Density estimation
• Market basket analysis
Q1: What is reinforcement learning and what are its key components?
Reinforcement learning is a machine learning approach where an agent learns to make decisions
by performing actions in an environment to maximize cumulative rewards. Key components
include:
• Agent: The decision-maker or learner
• Environment: The world with which the agent interacts
• State: The current situation of the agent in the environment
• Action: What the agent can do in each state
• Reward: Feedback from the environment after an action
• Policy: The agent's strategy for selecting actions
• Value function: Estimation of future rewards
• Model: The agent's representation of the environment (optional)
Q1: What is a neural network and how does it work at a basic level?
A neural network is a computational model inspired by the human brain's structure. At a basic
level, it consists of interconnected nodes (neurons) organized in layers. Each neuron:
1. Receives input, either from data or other neurons
2. Applies weights to these inputs
3. Sums the weighted inputs
4. Passes this sum through an activation function
5. Outputs the result to the next layer
Through training (typically using backpropagation), the weights are adjusted to minimize
prediction error on training data.
Q2: Explain the purpose of activation functions in neural networks and name three
common ones.
Activation functions introduce non-linearity into neural networks, allowing them to learn
complex patterns and relationships in data. Without activation functions, neural networks would
be equivalent to linear regression regardless of their depth. Three common activation functions:
1. Sigmoid: Maps values to a range between 0 and 1; useful for binary classification output
layers but can suffer from vanishing gradient problems
2. ReLU (Rectified Linear Unit): Returns input if positive, otherwise returns zero;
computationally efficient and helps solve vanishing gradient problems
3. Tanh (Hyperbolic Tangent): Maps values to a range between -1 and 1; often used in
hidden layers of recurrent networks
Q1: What is the difference between classification and regression in machine learning?
Classification and regression are both supervised learning tasks but differ in their outputs:
• Classification predicts discrete class labels or categories (e.g., spam/not spam,
dog/cat/bird)
• Regression predicts continuous numerical values (e.g., house prices, temperature, stock
prices)
Classification evaluates performance using metrics like accuracy, precision, recall, and F1-score,
while regression uses metrics like mean squared error, mean absolute error, and R-squared.
Q3: What is the bias-variance tradeoff in the context of regression and classification
models?
The bias-variance tradeoff refers to the balance between two sources of error:
• Bias: Error from oversimplified assumptions in the model (underfitting)
• Variance: Error from sensitivity to fluctuations in the training data (overfitting)
High-bias models (e.g., linear regression) are simpler but may miss important patterns. High-
variance models (e.g., complex decision trees) can capture detailed patterns but may fit noise in
training data. The goal is to find a sweet spot that minimizes total error.
Techniques like regularization, ensembling, and cross-validation help manage this tradeoff.
Clustering & Association Models
Q1: What is clustering in machine learning and what are its main objectives?
Clustering is an unsupervised learning technique that groups similar data points together based
on their features or characteristics. Its main objectives include:
• Discovering natural groupings in data
• Reducing dimensionality for visualization
• Identifying outliers or anomalies
• Preprocessing for other algorithms
• Customer/market segmentation
• Document categorization
• Image segmentation
Hierarchical clustering:
• Creates a tree of clusters (dendrogram)
• Doesn't require specifying number of clusters beforehand
• Can be agglomerative (bottom-up) or divisive (top-down)
• Computationally more expensive (O(n²) or worse)
• Not sensitive to initialization
• Can handle irregular or nested cluster shapes
• Provides multiple partitioning levels for analysis
Q3: What are association rules and what is the Apriori algorithm used for?
Association rules are if-then statements that help discover relationships between seemingly
unrelated data in a database or other information repository. They take the form "if X, then Y"
where X and Y are itemsets.
The Apriori algorithm is a classic algorithm used for mining frequent itemsets for association
rule learning. It:
• Identifies items that frequently appear together in transactions
• Uses a "bottom-up" approach, extending frequent itemsets one item at a time
• Prunes candidates using the principle that all subsets of a frequent itemset must also be
frequent
• It is commonly used in market basket analysis to discover relationships between products
purchased together
• Can be applied to other domains like web usage mining, intrusion detection, and
bioinformatics
Deep Learning Models (ANN & CNN)
Q1: What are the key differences between traditional neural networks (ANNs) and
convolutional neural networks (CNNs)?
Key differences include:
Traditional Neural Networks (ANNs):
• Fully connected layers where each neuron connects to all neurons in adjacent layers
• Don't preserve spatial relationships in input data
• Prone to overfitting with image data due to high parameter count
• Typically used for tabular data, time series, or text
Q2: Explain the concept of deep learning and why it has become so prominent in recent
years.
Deep learning refers to neural networks with multiple hidden layers (hence "deep") that can learn
hierarchical representations of data. Each layer learns increasingly abstract features, enabling the
model to automatically discover patterns without manual feature engineering.
Its prominence has grown due to:
1. Availability of large datasets (big data)
2. Increased computational power, especially GPUs and TPUs
3. Algorithmic improvements (better activation functions, normalization techniques, etc.)
4. Demonstrated breakthrough performance in computer vision, speech recognition, and
natural language processing
5. Transfer learning capabilities that allow leveraging pre-trained models
6. Open-source frameworks like TensorFlow and PyTorch that make implementation
accessible
7. Success in solving previously intractable problems across diverse domains
Q3: What are some techniques used to prevent overfitting in deep learning models?
Techniques to prevent overfitting in deep learning include:
1. Regularization methods:
• L1/L2 regularization (weight decay)
• Dropout (randomly deactivating neurons during training)
• Early stopping (halting training when validation performance starts degrading)
2. Data augmentation:
• Creating modified versions of training examples (rotations, flips, etc.)
• Adds diversity without requiring new data collection
3. Batch normalization:
• Normalizes layer inputs to stabilize training
• It has regularizing effects that improve generalization
4. Transfer learning:
• Starting with pre-trained models and fine-tuning for specific tasks
6. Ensemble methods:
• Combining multiple models to reduce variance
7. Data collection:
• Gathering more training data when possible