2 - ML_Numerical Vectors
2 - ML_Numerical Vectors
By:
Dr SOMARAJU SUVVARI
Assistant Professor,
Dept. of CSE, NIT Patna
Numerical Vectors
(Source: Machine Learning Foundations - Supervised, Unsupervised, and Advanced Learning
by Taeho Jo, springer publication)
Numerical Vectors
Numerical vector is defined as a finite ordered set of numerical values.
Every raw data should be converted into numerical vectors in using machine
learning algorithms for real problems.
x = [x1 x2 . . . xd ].
The addition and the deletion of two numerical vectors are simple operations on them.
The inner product of two numerical vectors generates a scalar value which indicates the
similarity between them, and the cosine similarity between them is a normalized
similarity metric between zero and one.
The outer product of two vectors generates a matrix as the opposite operation to the
inner product.
Numerical Vectors
A numerical vector is expanded into a matrix which consists of more than one
vectors as rows or columns.
The rows in the matrix are called row vectors, and the columns in it are called
column vectors.
Numerical Vectors
Operations on numerical vectors
Scalar value is a one dimensional vector.
A numerical vector is a finite ordered set which contains more than one scalar
value.
In the vector, the number of elements is fixed, whereas in the set, the number of
elements is variable.
In the numerical vector, its elements are always given as numerical vectors,
whereas in the set, its elements are always given as various types of data.
Operations on vectors are performed in the one to one style, whereas those on
sets are performed in the style of all possible pairs.
Numerical Vectors
Operations on numerical vectors
Addition, deletion, and the scalar multiplication are the binary operations on
numerical vectors - generate a numerical vector as their output.
Addition
x1 + 0 = x1
Numerical Vectors
Operations on numerical vectors
Addition, deletion, and the scalar multiplication are the binary operations on
numerical vectors - generate a numerical vector as their output.
Deletion
Scalar multiplication
It is used for representing a numerical vector as a scalar value which indicates the vector size.
The inner product is the summation of product of one to one element of two
vectors.
When two vectors are directed identically, the inner product is maximized, but
when they are directed perpendicular to each other, the inner product becomes
zero.
||x1|| = 1
Numerical Vectors
Operations on numerical vectors
Inner Product -
A vector may be converted into its normal form by dividing its element by its
norm.
Inner product of two vectors x1 = [x11 x12 . . . x1d ] and x2 = [x21 x22 . . . x2d ] is
Numerical Vectors
Operations on numerical vectors
Inner Product -
The relation between the inner product and the product of norms of two vectors is
expressed as
Orthogonality - when two vectors are in their perpendicular direction, the inner
product of them is given as zero value.
Two vectors are notated by x1 = [x11 x12 . . . x1d ] and x2 = [x21 x22 . . . x2d ], and if
x1・x2 = 0 two vectors, x1 and x2, are orthogonal.
When the norms of two vectors x1 and x2 are one as ||x1|| = ||x2|| = 1, and they are
orthogonal each other, this case is called orthonormal.
When two vectors, x1 and x2, are with same direction, ||x1||・||x2|| = ||x1・x2||
Numerical Vectors
Operations on numerical vectors
Outer Product -
Let us mention the operation which is opposite to the inner product, called outer
product.
Two vectors are given as x1 = [x11 x12 . . . x1d ] and x2 = [x21 x22 . . . x2d ].
A matrix is generated from applying the outer product to the two vectors.
Numerical Vectors
Operations on numerical vectors
Outer Product -
In the inner product, a scalar value is generated as the output, where as a d×d
matrix is generated in the outer product.
Only when all coefficients are zero, the linear combination of vectors becomes
zero vector; this case is called linearly independent of spans.
If the spans are linearly dependent on each other, a particular vector in the
spans is expressed by a linear combination of the others.
Numerical Vectors
Linear Independence
The set of vectors, v1, v2, . . . , vm, that is used for expressing the vector, x, is
called the spanning set of the vector, x.
The spanning set is notated by S = {v1, v2, . . . , vm}, and the linear combination
of the vectors in the spanning set is expressed for the vector x into
ci is a constant coefficient.
Numerical Vectors
Linear Independence
Example
x = [x1 x2 x3] , and the set, S = {[1 0 0], [0 1 0], [0 0 1]}, is expressed for the
vector, x, in
Let us mention the linear dependency among the vectors in the spanning set, v1,
v2, . . . , vm.
One among v1, v2, . . . , vm, vi is expressed by a linear combination of the others
in the spanning set, as shown
Numerical Vectors
Linear Dependence
For example, the spanning set, S = {[1 0 0], [0 1 0], [2 0 0]}, is a typical example
of the linear dependency, since v3 = 2・v1 + 0・v2.
Numerical Vectors
Matrix Operations
Addition
Multiplication
AB != BA
AI = A
AA-1 = I
Inverse Matrix
Step – 1
Numerical Vectors
Matrix Operations
Inverse Matrix (Gaussian-Jordan elimination process)
Step-2
Step-2
Numerical Vectors
Matrix Operations
It is represented as
Ax = c
x = A-1 c
Numerical Vectors
Vectors & Matrices
Determinant
Determinant
Determinant
We define the submatrix, Aij , where ith row and jth column are deleted
Determinant - Properties
If, at least, a row or a column is a zero vector, the determinant of the matrix is zero.
If the matrix, B, is obtained by interchanging any two columns or any two rows of the matrix, A,
the determinant of the matrix, B, becomes the negative determinant of the matrix, A;
|B| = −|A|
If, at least, two columns or two rows are identical to each other, the determinant of the matrix
becomes zero.
If the matrix, B, is obtained by multiplying any row or any column of the matrix, A, by a scalar
value, k, the determinant of the matrix, B, is |B| = k|A|.
Numerical Vectors
Vectors & Matrices
The Eigen vector is used for characterizing a matrix by multiplying itself with a scalar and is
called an Eigenvalue.
The Eigen value, λ, and the Eigen vector, v, are expressed as the matrix, A, mathematically
Av = λv
The matrix, A, in the left side of v is assumed as a square matrix, and the above equation is used
for diagonalizing a matrix into a simplified one.
The Eigen vector [v1 v2] and the Eigen value 𝜆 of the 2×2 matrix are expressed
as:
If an Eigen value of the matrix, A, is given as λ, the Eigen value of its inverse matrix is given as 1/λ.
If the Eigen value of the matrix, A is a diagonal matrix, are given as its Eigen values.
If an Eigen value of the matrix, A, is given as, the Eigen value of the matrix, An, is λn.
THANK YOU