0% found this document useful (0 votes)
12 views20 pages

Machine Learning

The document provides an overview of various machine learning concepts, including definitions, applications, and classifications such as supervised, semi-supervised, and reinforcement learning. It discusses algorithms like decision trees, linear regression, SVM, and logistic regression, along with their advantages and disadvantages. Additionally, it covers techniques like backpropagation, Bayes' Theorem, K-means clustering, and hierarchical clustering, highlighting their roles in machine learning tasks.

Uploaded by

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

Machine Learning

The document provides an overview of various machine learning concepts, including definitions, applications, and classifications such as supervised, semi-supervised, and reinforcement learning. It discusses algorithms like decision trees, linear regression, SVM, and logistic regression, along with their advantages and disadvantages. Additionally, it covers techniques like backpropagation, Bayes' Theorem, K-means clustering, and hierarchical clustering, highlighting their roles in machine learning tasks.

Uploaded by

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

1.

Define Machine Learning and Enlist Applications and classification of Machine


Learning

A machine learning system is trained rather explicitly programmed.

With Machine Learning, humans can input data as well as the answer excepted from the data and
outcome the rules.

Machine Learning is revolutionizing various industries and aspects of our daily lives.

In supervised learning, the algorithm learns from a "labeled" dataset, meaning each data point
includes both the input features and the corresponding correct output (label).

The goal is for the algorithm to learn a mapping from inputs to outputs so it can accurately predict
outputs for new, unseen data.

Applications of Machine Learning:-

1. Image and Speech Recognition 2. Machine Translation

3. Sentiment Analysis 4.Supervised Learning:

The model is trained on input-output pairs. It learns the relationship between them and then uses this
learned relationship to make predictions on new data where only inputs are provided.

Semi-Supervised Learning:

This approach combines elements of both supervised and unsupervised learning. It uses a small
amount of labeled data along with a large amount of unlabeled data for training.

It leverages the labeled data to guide the learning process on the unlabeled data, which can be
particularly useful when labeling data is expensive or time-consuming.

Reinforcement Learning:

Reinforcement learning involves an "agent" that learns to make a sequence of decisions in an


environment to maximize a cumulative reward. The agent learns through trial and error, receiving
rewards for desirable actions and penalties for undesirable ones.

The agent interacts with its environment, performs actions, and observes the consequences (rewards
or penalties). Based on this feedback, it adjusts its strategy (policy) to achieve its goal.

2. Explain Reinforcement Machine Learning and its applications


Reinforcement learning involves an "agent" that learns to make a sequence of decisions in an
environment to maximize a cumulative reward.

The agent learns through trial and error, receiving rewards for desirable actions and penalties for
undesirable ones.

The agent interacts with its environment, performs actions, and observes the consequences (rewards
or penalties). Based on this feedback, it adjusts its strategy (policy) to achieve its goal.

Reinforcement Learning (RL) is a paradigm of machine learning where an agent learns to make
decisions by interacting with an environment to achieve a specific goal.

Unlike supervised learning, which relies on labeled data, or unsupervised learning, which finds
patterns in unlabeled data, RL learns through trial and error based on a reward system.

Reinforcement Learning (RL) is a powerful paradigm that has achieved remarkable feats, from
mastering complex games to controlling robotic systems. However, like any machine learning
approach, it comes with its own set of advantages and disadvantages.

Applications of Reinforcement Learning:-

1. Gaming
2. Robotics
3. Autonomous Vehicles
4. Finance
5. Resource Management and Optimization
6. Personalized Recommendation Systems
7. Healthcare
8. Natural Language Processing (NLP)

Advantages of Reinforcement Learning

1. Ability to Learn Optimal Strategies in Complex Environments


2. Does Not Require Labeled Data
3. Goal-Oriented and Autonomous
4. Handles Uncertainty and Stochasticity
5. Potential for Innovation and Creativity

Disadvantages of Reinforcement Learning

1. Sample Inefficiency
2. Difficulty in Reward Function Design (Reward Shaping)
3. Exploration-Exploitation Dilemma
4. High Variance and Instability
5. "Black Box" Nature (Lack of Interpretability)
6. Safety Concerns During Training
7. Simulation-to-Real (Sim2Real) Gap

3. Explain decision tree Algorithm with Example


A Decision Tree is a powerful and intuitive supervised machine learning algorithm used for both
classification and regression tasks.

It builds a model in the form of a tree structure, where each internal node represents a "test" on an
attribute (feature), each branch represents the outcome of the test, and each leaf node represents a
class label (in classification) or a numerical value (in regression).

Imagine you're playing a 20-questions game. You ask a series of yes/no questions to narrow down
possibilities until you can identify the object.

A decision tree works similarly by asking a series of questions about the data to arrive at a
conclusion.

The core idea behind building a decision tree is to recursively split the dataset into smaller, more
homogeneous subsets based on the values of the attributes.

The goal at each step is to choose the attribute that best splits the data, leading to the purest possible
subsets.

Key Components of a Decision Tree:

Root Node

Internal Nodes (Decision Nodes)

Branches (Edges)

Leaf Nodes (Terminal Nodes)

Advantages of Decision Trees:

Easy to Understand and Interpret

Handle both Numerical and Categorical Data

Require Little Data Preprocessing

Non-parametric

Can Model Non-linear Relationships

Disadvantages of Decision Trees:

Prone to over fitting

Instability

Bias towards Dominant Classes

Greedy Approach

Applications:

Customer churn prediction


Fraud detection

Medical diagnosis

Credit risk assessment

Predicting stock prices (regression)

4. Explain linear regression in detail

Linear Regression is a fundamental supervised machine learning algorithm used for predicting a
continuous output variable based on one or more input features.

Despite its simplicity, linear regression remains a widely used and powerful tool in statistics and
machine learning for its interpretability and effectiveness in modeling linear relationships.

It works by finding the best-fitting straight line (or hyperplane in higher dimensions) that represents
the relationship between the input(s) and the output.

The goal of linear regression is to find the values of the coefficients (β0,β1, etc.) that minimize the
difference between the predicted values (Y^) and the actual observed values (Y). This is most
commonly achieved using the Ordinary Least Squares (OLS) method.

Example: Predicting House Prices

Let's say we want to predict the price of a house (Y) based on its size in square feet (X). We collect
data from several houses:

Size (sq ft) X Price ($1000s) Y

1000 200

1200 230

1500 280

1800 310

2000 350

When we plot this data, we see a general upward trend, suggesting a linear relationship. Linear
regression would then find the equation of the line that best fits these points, for example:

Price=50+0.15×Size

Here, β0=50 (meaning a house of 0 sq ft might theoretically cost $50,000, though this intercept might
not always be practically interpretable).

β1=0.15 (meaning for every additional square foot, the price of the house is predicted to increase by
$0.15 \times 1000 = $150).

If a new house comes on the market that is 1600 sq ft, we can predict its price:
Predicted Price=50+0.15×1600=50+240=290 ($290,000)
Types of Linear Regression:

Simple Linear Regression (SLR)

Multiple Linear Regression (MLR)

Polynomial Regression

Advantages of Linear Regression:

Simplicity and Interpretability

Speed

Foundation for Other Models

Well-Understood Statistical Properties

Disadvantages of Linear Regression:

Assumes Linearity

Sensitive to Outliers

Prone to Underfitting

Doesn't Handle Categorical Outputs

5.What do you mean by semi-supervised learning?

Semi-supervised learning (SSL) is a machine learning paradigm that combines elements of both
supervised learning and unsupervised learning.

semi-supervised learning offers a pragmatic and powerful solution for machine learning tasks where
obtaining sufficient labeled data is a significant bottleneck, allowing us to still leverage the vast
amounts of readily available unlabeled data.

How Semi-Supervised Learning Works (General Idea):

Initial Training (Supervised Phase)

Pseudo-Labeling/Propagating Labels (Unsupervised/Hybrid Phase).

Key Assumptions in Semi-Supervised Learning:

Applications of Semi-Supervised Learning:

Text Classification: Classifying large volumes of text documents (e.g., news articles, emails) where
only a small portion is manually labeled.

Image Classification

Speech Recognition

Web Content Classification


Fraud Detection

Bioinformatics

Sources

6. Explain K-means Clustering?

The K-Means algorithm is iterative, meaning it repeats a process until a certain condition is met
(convergence).

K-Means Clustering is an unsupervised machine learning algorithm that is used to partition 'n'
observations into 'k' clusters, where each observation belongs to the cluster with the nearest mean
(centroid). In simpler terms, it's a way to group similar data points together without any prior
knowledge of what those groups might be.

Imagine you have a large collection of unlabeled items (e.g., customer data, images, documents), and
you want to organize them into distinct groups based on their inherent similarities. K-Means
clustering helps you achieve this.

Key Concepts:

Clusters: Groups of data points that are similar to each other.

Centroids: The center point of each cluster. It's the mean of all data points belonging to that cluster.

K: The number of clusters you want the algorithm to identify. This is a pre-defined value that you, as
the user, need to specify.

Here are the steps:

Advantages of K-Means Clustering:

Simplicity and Speed

Scalability

Versatility

Disadvantages and Limitations of K-Means Clustering:

1. Requires pre-defining 'K 2. Sensitivity to Initial Centroids

3. Assumes Spherical Clusters 4. Sensitive to Outliers

5. Requires Numerical Data

Applications of K-Means Clustering:

1. Customer Segmentation 2. Image Segmentation & Compression

3. Document Clustering 4. Anomaly Detection

5. Genomic Clustering 6.Geographical Grouping


7. What is SVM? State the advantages and disadvantages of SVM?

Support Vector Machine (SVM) is a powerful and versatile supervised machine learning algorithm
primarily used for classification tasks, though it can also be adapted for regression.

Its core idea is to find an optimal "hyperplane" that best separates data points into different classes.

Support Vector Machines (SVMs) are powerful and versatile supervised machine learning algorithms
used for both classification and regression tasks. They are particularly well-known for their
effectiveness in classification. Let's break down their advantages and disadvantages:

In summary, SVMs are a strong choice for problems with clear class separation, high-dimensional
data, or when robustness to certain types of outliers is desired.

However, their computational cost on large datasets, sensitivity to parameter tuning, and lack of direct
probability outputs are important considerations.

Advantages of SVM:

Effective in High-Dimensional Spaces

Memory Efficient

Versatile Kernels

Robust to Over fitting

Disadvantages of SVM:

Computationally Intensive

Parameter Tuning

Less Interpretability

Doesn't Directly Provide Probabilities

Applications of SVM:

Image Classification: Object recognition, facial recognition.

Text Classification: Spam detection, sentiment analysis.

Bioinformatics: Protein classification, cancer diagnosis.

Handwritten Digit Recognition: Classifying handwritten numbers.

Face Detection.

8.What is logistic regression?

Logistic Regression is a fundamental supervised machine learning algorithm used for classification
tasks, particularly for predicting the probability of a binary (two-class) outcome.
Despite its name containing "regression," it's primarily a classification algorithm because its output is
a probability that can be mapped to a discrete class.

Logistic Regression is a fundamental and widely used supervised machine learning algorithm
primarily employed for classification tasks.

Despite "regression" in its name, it's a classification algorithm because its main purpose is to predict a
categorical outcome, not a continuous one.

The core idea of logistic regression is to model the probability that a given input instance belongs to a
certain class.

It's particularly well-suited for binary classification problems, where there are only two possible
outcomes (e.g., Yes/No, True/False, 0/1).

It can also be extended for multi-class classification (Multinomial Logistic Regression).

Advantages of Logistic Regression:

Simplicity and Interpretability

Outputs Probabilities

Efficient and Fast

Robust to Outliers (compared to Linear Regression)

Good Baseline Model

Disadvantages of Logistic Regression:

Assumes Linearity in Log-Odds

Doesn't Handle Complex Relationships Well

Sensitive to Feature Engineering: Its performance heavily relies on good feature engineering.

Cannot Solve Non-linear Problems Directly

Applications of Logistic Regression:

Spam Detection

Medical Diagnosis

Credit Risk Assessment

Customer Churn Prediction

Marketing

Fraud Detection

9. What is back propagation?


Back propagation (short for "backward propagation of errors") is a cornerstone algorithm in training
artificial neural networks (ANNs).

It's the mechanism that allows a neural network to "learn" from its mistakes and adjust its internal
parameters (weights and biases) to make more accurate predictions.

Back propagation, short for "backward propagation of errors," is the fundamental algorithm used to
train Artificial Neural Networks (ANNs). It's a cornerstone of deep learning and is what allows neural
networks to learn from data and improve their performance over time.

At its core, back propagation is an efficient method for computing the gradient of the loss function
with respect to the weights and biases of a neural network.

This gradient tells us how much each weight and bias in the network needs to be adjusted to reduce
the error between the network's predictions and the true target values.

Back propagation is the enabling force behind the practical application of neural networks in almost
every field where complex pattern recognition, prediction, or generation from data is required.

Advantages of Backpropagation:

1. Efficiency
2. Foundation for Deep Learning
3. Versatility
4. Automatic Feature Learning
5. Simplicity of Concept (High-Level)

Disadvantages of Backpropagation:

1. Computationally Intensive
2. Sensitive to Initial Weights
3. Local Minima
4. Vanishing/Exploding Gradients
5. Requires Labeled Data
6. Requires Differentiable Activation Functions, Applications of Backpropagation

10.Explain bayes Theorem?

Bayes' Theorem, also known as Bayes' Rule or Bayes' Law, is a fundamental concept in probability
theory and statistics.

It provides a mathematical framework for updating the probability of a hypothesis as new evidence or
information becomes available.

In simpler terms, it tells you how to revise your initial beliefs about an event's likelihood when you
get new data.

Bayes' Theorem provides a powerful and logical way to combine prior knowledge with new evidence
to arrive at more informed and accurate probabilities, making it indispensable in fields that deal with
uncertainty and decision-making under incomplete information

Advantages of Bayes' Theorem in Machine Learning:


1. Probabilistic Reasoning and Handling Uncertainty
2. Incorporates Prior Knowledge (Prior Probabilities)
3. Interpretable Results
4. Robust to Missing Data (in some contexts)
5. Less Prone to Overfitting with Limited Data (especially Naive Bayes)
6. Continuous Learning (Bayesian Inference)

Disadvantages of Bayes' Theorem in Machine Learning:

1. Dependence on Prior Probability


2. Computational Complexity (for complex Bayesian Models)
3. The "Naiveté" of Naive Bayes
4. Sensitivity to Data Distribution Assumptions
5. Difficulty with Rare Events (without proper handling)
6. Requires Careful Model Specification

Applications of Bayes' Theorem:

Medical Diagnosis

Spam Filtering

Machine Learning (Naive Bayes Classifier)

Finance

11.What is Hierarchical Clustering in Machine Learning?

Hierarchical Clustering is an unsupervised machine learning algorithm that groups similar data points
into clusters without requiring a predefined number of clusters.

Unlike "flat" clustering methods like K-Means, which partition data into a fixed number of clusters,
hierarchical clustering builds a tree-like hierarchy of clusters, making it a powerful tool for exploring
the inherent structure of your data.

The output of hierarchical clustering is a dendrogram, which is a tree diagram that visually represents
the nested clusters and the order in which they were merged or split.

Despite its computational cost for very large datasets, hierarchical clustering remains a valuable tool,
particularly for exploratory data analysis, where understanding the intrinsic hierarchical structure of
the data is more important than simply partitioning it into a fixed number of groups.

Two Main Types of Hierarchical Clustering:

Agglomerative Clustering (Bottom-Up Approach):

Divisive Clustering (Top-Down Approach):

Advantages of Hierarchical Clustering:

No need to pre-specify K

Intuitive Visualization (Dendrograms)


Reveals Nested Structures

Flexible

Disadvantages of Hierarchical Clustering:

Computationally Expensive

Space Complexity

Irrevocable Decisions (Greedy Approach)

Sensitivity to Noise and Outliers.

12. Explain support vector in Machine Learning.

Support vectors are the data points from the training set that are closest to the decision boundary
(hyperplane) that separates the classes. They are the points that are most difficult to classify correctly.

In essence, support vectors are the "heroes" of the SVM algorithm.

They are the essential pieces of information from your training data that truly matter for building a
robust and effective classification model.

They are called "support vectors" because they literally "support" or "define" the optimal hyperplane
and the margin.

If you were to remove any of the support vectors, the position and orientation of the optimal
hyperplane would change. Conversely, if you remove any data points that are not support vectors (i.e.,
those that lie well beyond the margin), the hyperplane's position would remain unchanged.

SVMs are a powerful and versatile tool in machine learning, particularly well-suited for complex
classification problems in high-dimensional spaces, but they require careful tuning and can be
computationally demanding for very large datasets.

Advantages of Support Vector Machines (SVMs)

1. Effective in High-Dimensional Spaces


2. Robust to Overfitting
3. Versatility with Kernel Trick
4. Memory Efficient
5. Clear Margin of Separation
6. Global Optimum

Disadvantages of Support Vector Machines (SVMs)

1. Computationally Intensive for Large Datasets


2. Difficulty in Choosing the Right Kernel Function
3. Lack of Probability Estimates
4. Sensitivity to Noise and Outliers (Hard Margin SVM)
5. Difficult to Interpret.
6. Performance with Overlapping Classes

Applications of Support Vector Machines (SVMs)


1. Image Classification and Recognition
2. ext Classification and Natural Language Processing (NLP)
3. Bioinformatics and Medical Diagnosis
4. Fraud Detection
5. Forecasting
6. Biometric Authentication
7. Generalized Predictive Control (GPC)

13. What is artificial neuron network with its advantages disadvantages and application?

An Artificial Neural Network (ANN), often simply called a "neural network," is a computational
model inspired by the structure and function of the human brain's biological neural networks.

It's a core component of Artificial Intelligence (AI) and the foundation of deep learning.

Artificial Neural Networks (ANNs), often simply called Neural Networks (NNs), are computational
models inspired by the structure and function of the human brain.

They consist of interconnected "neurons" organized into layers: an input layer, one or more hidden
layers, and an output layer.

Each connection between neurons has a weight, and neurons have activation functions that process the
information. ANNs learn by adjusting these weights and biases through a process called training,
typically using algorithms like back propagation, to minimize the difference between their output and
the desired output.

In essence, ANNs are incredibly powerful tools for handling complex, non-linear problems and
learning from vast amounts of data, forming the backbone of what we now call "deep learning."
However, their effective application often requires significant computational resources, large datasets,
and careful tuning.

Advantages of Artificial Neural Networks (ANNs)

1. Pattern Recognition and Complex Problem Solving


2. Adaptability and Self-Learning
3. Generalization Capability
4. Parallel Processing
5. Fault Tolerance (Graceful Degradation)
6. Ability to Handle Noisy and Incomplete Data
7. Feature Extraction

Disadvantages of Artificial Neural Networks (ANNs)

1. "Black Box" Nature (Lack of Interpretability)


2. Large Data Requirements
3. Computationally Intensive
4. Overfitting
5. Difficulty in Hyperparameter Tuning
6. Sensitivity to Input Data Quality and Preprocessing
7. Local Minima Problem (for older training methods)

Applications of Artificial Neural Networks (ANNs)


1. Image and Computer Vision
2. Natural Language Processing (NLP)
3. Forecasting and Prediction
4. Healthcare and Medicine
5. Robotics and Control SystemsFinance
6. Recommendation Systems
7. Gaming

14.What is optimization? Give optimization algorithm.

In Machine Learning, optimization refers to the process of finding the best set of parameters (or
weights and biases) for a model that minimizes (or sometimes maximizes) a predefined objective
function.

This objective function is typically called a loss function (or cost function or error function), and it
quantifies how well the model is performing on its given task.

In essence, optimization algorithms are the core engines that enable machine learning models to learn
from data by iteratively refining their internal parameters to minimize prediction errors.

Optimization, in a general sense, refers to the process of finding the best possible solution from a set
of available alternatives. The "best" solution is typically defined by minimizing or maximizing a
specific objective function, often subject to certain constraints.

Optimization is the core process of training a model. Machine learning models learn by adjusting their
internal parameters (like weights and biases in a neural network) to minimize a loss function (or cost
function).

The loss function quantifies how "bad" the model's predictions are compared to the actual values.

Advantages of Optimization:-

1. Enables Model Training and Learning


2. Improved Model Performance and Accuracy
3. Efficiency and Speed of Training
4. Handling Complex Model Architectures and Data
5. Robustness and Stability
6. Enabling Advanced Machine Learning Techniques

Disadvantages of Optimization:-

1. Computational Cost

2. Local Minima/Saddle Points

3. Hyperparameter Sensitivity

4. Slow Convergence

5. Oscillation/Instability

6. Requires Differentiability
7. Data Quality and Preprocessing

15.What is encoder and decoders state their applications.

Encoder

An encoder in machine learning is a component or a model that transforms input data into a
different, often more compact and meaningful, representation. This new representation is
typically a lower-dimensional vector that captures the most salient features or underlying patterns of
the original data. This process is often called encoding or feature extraction.

Encoders are fundamental components in many machine learning architectures, particularly in deep
learning. They serve the purpose of transforming raw input data into a more compact, meaningful, and
often lower-dimensional representation. This encoded representation is then used for various
downstream tasks.

In summary, encoders are incredibly powerful tools for automated feature engineering, dimensionality
reduction, and enabling complex deep learning architectures.

However, their benefits come with challenges related to computational cost, interpretability, and the
inherent trade-off between compression and information retention.

Advantages of Encoders in Machine Learning

1. Dimensionality Reduction
2. Feature Learning and Representation Learning
3. Noise Reduction and Robustness
4. Enabling Complex Architectures and Tasks
5. Data Compression

Disadvantages of Encoders in Machine Learning

1. "Black Box" Nature / Lack of Interpretability


2. Computational Cost of Training
3. Hyperparameter Tuning Complexity
4. Information Loss (Inherent in Compression)
5. Sensitivity to Data Quality
6. Potential for Overfitting

Decoder

In machine learning, a decoder is a component or a model that performs the inverse operation of an
encoder.

While an encoder transforms input data into a compact, meaningful representation a decoder takes this
encoded representation and reconstructs or generates the original data or a desired output from that
representation.

Think of it as the process of "unpacking" or "interpreting" the compressed information.

A decoder is the "creation" or "reconstruction" engine in many machine learning models. It takes the
abstract, compressed information provided by an encoder (or a sampled latent vector) and brings it
back to a human-interpretable or task-specific format, whether that's an image, a sentence, or a
reconstructed version of the original input.

Decoders are incredibly powerful for synthesizing new data, translating information between
domains, and understanding learned representations. However, their complexity often comes with
high computational demands, challenges in controlling output, and potential issues with quality and
diversity of generated content.

Advantages of Decoders in Machine Learning

1. Generative Capabilities
2. Reconstruction and Denoising
3. Transformation and Translation
4. Understanding and Exploration of Latent Space
5. Controllable Generation

Disadvantages of Decoders in Machine Learning

1. Computational Intensity and Resource Demands


2. Difficulty in Controlling Output (for Unconditional Generation)
3. Mode Collapse (in GANs)
4. Quality and Realism Issues
5. Interpretability (Less of a "Black Box" than Encoders, but Still Limited)
6. Dependency on Encoder/Latent Space Quality
7. Ethical Concerns (for Generative Decoders)

16. Write short note on convolution neural network.

A Convolution Neural Network (CNN or ConvNet) is a specialized type of Artificial Neural Network
(ANN) primarily designed to process data that has a known grid-like topology, such as images.

They are exceptionally good at tasks like image classification, object detection, and image
recognition, and have become the state-of-the-art for many computer vision problems.

The key innovation of CNNs lies in their use of specialized layers that leverage the spatial
relationships within the data, unlike traditional ANNs which treat input features as independent.

In essence, CNNs have revolutionized how machines "see" and interpret the visual world, making
them indispensable in almost every domain that deals with image and video data.

Advantages of CNNs:

Automatic Feature Learning

Parameter Sharing

Local Connectivity

Translation Invariance

High Accuracy

Applications of Convolution Neural Networks:


CNNs are the workhorse of modern computer vision and have numerous real-world applications:

Image Classification and Recognition:

Identifying objects in photos (e.g., cat, dog, car).

Facial recognition (unlocking phones, security).

17. What is logistic regression state its use.

Logistic Regression is a fundamental and widely used supervised machine learning algorithm
primarily employed for classification tasks.

Despite "regression" in its name, it's a classification algorithm because it predicts a categorical
outcome, not a continuous one.

The core idea of logistic regression is to model the probability that a given input instance belongs to a
certain class.

It's particularly well-suited for binary classification problems, where there are only two possible
outcomes. It can also be extended for multi-class classification.

In summary, logistic regression is a powerful and widely used classification algorithm that models the
probability of a binary outcome.

Its simplicity, interpretability, and effectiveness make it a go-to choice for numerous real-world
prediction and classification tasks.

Key Characteristics:

Probabilistic Output

Linear Decision Boundary

Interpretability

Assumptions

Sources

18. Differentiate between Supervised and Unsupervised Learning


Feature Supervised Learning Unsupervised Learning
Data Type Labeled data (input-output pairs) Unlabeled data (inputs only)
Discover hidden patterns,
Goal Predict outcomes for new data
structures, or insights
Direct feedback from correct No direct feedback; relies on
Feedback
labels (error signal) intrinsic data properties
Clustering, Dimensionality
Common Tasks Classification, Regression
Reduction, Association
Generally simpler to evaluate Often harder to interpret and
Complexity
performance validate results
Requires significant human effort Less human effort for data
Human Effort
for data labeling labeling, more for interpretation
Spam detection, medical Customer segmentation, anomaly
Applications
diagnosis, price prediction detection, data compression
Linear/Logistic Regression, K-Means, PCA, Hierarchical
Algorithms
SVM, Decision Trees, NN Clustering, Autoencoders

19. Differentiate between Linear and Logistic Regression

Linear Regression Logistic Regression


Feature
Task Regression Classification
Categorical (binary/multi-class)
Dependent Var. Continuous numerical value
label
Output Any real number (−∞,+∞) Probability (0 to 1)
Sigmoid function applied to a
Function Linear equation: Y=β0+∑βiXi linear combination: p=1+e−(β0
+∑βiXi)1
Not applicable directly (linear Linear (straight line/plane in
Decision B'dary
model for prediction) feature space)
Log Loss / Binary Cross-Entropy
Loss Function Mean Squared Error (MSE)
Loss
Coefficients show change in log-
Coefficients directly show
Interpretability odds of positive class for unit
change in Y for unit change in X
change in X

20. Differentiate between Biological Neural Network and Artificial Neural Network
Biological Neural Network Artificial Neural Network
Feature
(BNN) (ANN)
Artificial Neuron (mathematical
Basic Unit Neuron (biological cell)
function)
Electrochemical (spikes, Numerical (floating-point
Signal Type
neurotransmitters) numbers)
Synapses, complex Weighted connections,
Communication
chemical/electrical interactions mathematical operations
Synaptic plasticity (dynamic, Weight/bias adjustment (during
Plasticity/Learning
real-time changes) training, often static after)
Primarily supervised
Primarily unsupervised,
Learning Paradigm (backpropagation), some
reinforcement, lifelong learning
unsupervised
Highly complex, 3D, recurrent, Layered, often feedforward, more
Architecture
diverse neuron types regular structure
Extremely energy-efficient (e.g., Can be very energy-intensive,
Energy Consumpt.
~20W for human brain) especially for large models
Learns from experience, often Typically requires vast amounts
Data Needs
with minimal examples of labeled data for training
High fault tolerance, self-repair, Can be brittle; requires explicit
Robustness
adaptation robustness mechanisms
"Black box" in terms of Often "black box" (difficult to
Interpretability
conscious thought pathways interpret decisions)
Intelligence, consciousness, Solve specific computational
Goal
survival, perception, control problems (e.g., classification)

21. Differentiate between linear and non-linear Svm.


Feature Linear SVM Non-linear SVM
Data is linearly separable (or Data is not linearly separable in
Separability
nearly so) original space
A straight line, flat plane, or A curved or complex decision
Decision Boundary
hyperplane boundary
Uses the Kernel Trick to map
Method Directly finds a linear hyperplane data to a higher-dimensional
space
Can be more computationally
Generally faster and more
Computation intensive, especially for large
efficient
datasets
More complex model, can
Simpler model, less prone to capture intricate patterns, higher
Complexity
overfitting on simple data risk of overfitting if kernel
parameters aren't tuned
Uses a Linear Kernel (dot Uses various non-linear Kernels
Kernel Function
product: K(xi,xj)=xi⋅xj) (e.g., RBF, Polynomial, Sigmoid)
Text classification, high- Image classification,
dimensional sparse data, when bioinformatics, complex pattern
Typical Use Cases
interpretability of feature weights recognition where data is
is desired inherently non-linear

22. Differentiate between logistic regression and svm without kernel.

Support Vector Machine


Feature Logistic Regression
(Linear SVM)
Model probability of class Find maximum-margin
Primary Goal
membership hyperplane for separation
Geometric model, margin
Core Idea Statistical model, log-odds
maximization
Decision score (distance from
Output Type Probabilities (0 to 1)
hyperplane), then class label
Loss Function Log Loss (Binary Cross-Entropy) Hinge Loss
More sensitive (all points Less sensitive (focuses on
Outlier Sens.
contribute to loss) support vectors)
Decision B'dary Linear (where probability is 0.5) Linear (max-margin hyperplane)
Can be unstable without
Perfect Sep. Robustly finds optimal boundary
regularization

23. Differentiate between encoder and decoder in machine learning.


Feature Encoder Decoder
Understands and transforms Generates output from a given
Function
input into a representation representation
Context vector (from encoder) +
Input Raw input data/sequence (optionally) previously generated
output
A compact, fixed-size context The final desired output sequence
Output
vector/embedding or data
Feature extraction, context Sequence generation,
Goal
capture, dimensionality reduction reconstruction, transformation
Processes full input to create a Generates output step-by-step
Process
summary (often autoregressive)
No direct generation feedback Uses feedback from its own prior
Feedback Loop
during its operation outputs to generate next
Analysis, understanding, Generation, synthesis,
Typical Use
representation learning transformation

You might also like