Page 127 - Touhpad Ai
P. 127
AI REBOOT
Answer the following questions:
1. If a matrix has 6 elements, what are the possible orders it can have?
2i
2. Construct a 3 × 2 matrix where each element is given by a = .
ij j
Transpose of a Matrix
T
A matrix obtained by interchanging the rows and columns of a matrix. Transpose of a matrix A is denoted by A′ or A .
For example:
1 4
12 3
T
A= A OR A = 24
‘
45 6 23 36
×
32
×
Vector Arithmetic
Vectors are the basis of linear algebra. Vectors are used in the training of machine learning algorithms. When describing
the machine learning algorithm, the target variable is usually expressed as a vector with a lowercase y.
A vector is defined as a list of numbers in one-dimensional form. For example:
2
–5 [1 –3 6]
4
(one column) (one row)
A vector is an object that has both a magnitude and a direction. It is represented as a + b + ck where i, j, k are the
j
i
directions along the x, y, and z axes respectively.
Applications of Vectors
Vectors are widely used in machine learning. Let us go through each:
u Representing data points: Each data point in a dataset is typically represented as a vector. For example, a house with
features like number of rooms, size, and price can be represented as a vector [rooms, size, price]. This format allows
algorithms to process and analyse data mathematically.
u Feature vectors in image, text and audio processing: In fields like computer vision or natural language processing
(NLP), raw data (like images or text) is converted into numerical feature vectors. These vectors help in comparing,
clustering, or classifying images, texts, or audio based on similarity.
u Distance calculation (similarity/dissimilarity): Vectors allow calculation of distances (like Euclidean or cosine
similarity) between data points to measure how similar or different they are. This is crucial in algorithms like k-Nearest
Neighbors (k-NN), clustering, and recommendation systems.
u Model parameters and weights: In models like linear regression or neural networks, the weights and biases are
vectors that define how inputs are transformed into outputs. These vectors are updated during training to minimize
error (loss).
u Gradient and optimisation: Gradients (used in optimisation algorithms like gradient descent) are vector quantities
that show the direction and rate of the steepest increase in a function. They help in improving model accuracy.
Mathematics for AI 125

