ML Assignment 2 PDF
ML Assignment 2 PDF
MUKHTAJ KHAN
SUBMITTED BY: AROOJ KHAN
MSCS 1st SEMESTER
SUBJECT: TOPICS IN MACHINE LEARNING
Linear
Non linear
Polynomial
Radial basis function (RBF)
Sigmoid
Kernels are mathematical functions that measure the similarity or distance between data points
in a transformed feature space. They are widely used in classification, regression, and clustering
tasks.
Kernels play a crucial role in various machine learning algorithms. They enable complicated
pattern identification by allowing us to turn data into higher-dimensional feature spaces. This
technical study gives an overview and analysis of various kernel types:
1) Linear
2) Non-linear
3) Polynomial
4) Radial basis function (RBF)
5) Sigmoid kernels.
We discuss their characteristics, mathematical formulations, and applications in machine
learning.
1) Linear Kernel:
The linear kernel is a type of kernel function used in machine learning, particularly
in support vector machines (SVMs) and other kernel-based algorithms. It
represents a linear relationship between data points in the feature space and is one
of the simplest types of kernels.
Mathematically:
The linear kernel computes the dot product between two input vectors, x and y, in
the original feature space:
K(x, y) = x · y
Here, the dot product represents the sum of the element-wise multiplication of
corresponding components of the vectors.
The linear kernel is widely used in various applications, including text
classification, image recognition, and sentiment analysis.
2) Non-linear:
Non-linear kernels enable SVMs to capture complex, non-linear patterns in the
data by mapping it into a higher-dimensional feature space. Non-linear kernels are
employed when the data points are not linearly separable in the original feature
space. By transforming the data into a higher-dimensional space, non-linear
kernels allow SVMs to find non-linear decision boundaries that can accurately
classify the data.
Mathematically:
A non-linear kernel function computes the similarity or distance between two input
vectors, x and y, in the transformed feature space:
K(x, y) = ϕ(x) · ϕ(y)
Here, ϕ(x) and ϕ(y) represent the mappings of the input vectors x and y into the
higher-dimensional feature space. The non-linear kernel effectively calculates the
dot product between the transformed vectors, allowing SVMs to operate in the
higher-dimensional space without explicitly computing the transformations.
Non-linear kernels have broad applications in various domains, including image
classification, natural language processing, bioinformatics, and more.
3) Polynomial kernel
The polynomial kernel is a type of non-linear kernel used in machine learning. It
enables SVMs to capture non-linear patterns in the data by mapping it into a
higher-dimensional feature space using polynomial functions.
The polynomial kernel computes the similarity or distance between two input
vectors, x and y, in the transformed feature space. It is defined as:
K(x, y) = (α * (x · y) + c)^d
Here, α represents a scaling factor, c is a constant term, and d is the degree of the
polynomial. The dot product (x · y) represents the sum of the element-wise
multiplication of corresponding components of the vectors.
The polynomial kernel is commonly used in applications such as image
classification, natural language processing, and text analysis, where the data
exhibits non-linear relationships.
5) Sigmoid kernel
The sigmoid kernel is a mathematical formula used in machine learning to measure
the similarity between pairs of data points. It takes two data points and calculates a
value based on their inner product and some parameters.
By using the sigmoid kernel, the algorithm can analyze the relationships between
the objects and create decision boundaries that separate them. This allows it to
distinguish between different types of objects and classify new, unseen objects
based on their similarities to the ones it has seen before.
Mathematically:
Mathematically, the sigmoid kernel is defined as:
K(x, y) = tanh(a * x^T * y + c)
In this equation, x and y are data points, x^T is the transpose of x, and a and c are
parameters of the kernel.
While the sigmoid kernel has been used in the past, it is less commonly used
compared to other kernel functions such as the linear, polynomial, or radial basis
function (RBF) kernels, which are often more effective in various machine
learning tasks.