appengine.ai
Published in

appengine.ai

Understanding Vectors

Vectors in machine learning are very helpful in explaining algorithms.

Vectors are quantities that need to be described using both magnitude and direction. here the magnitude of a vector means length or size. vector is represented by a directed line segment. vectors are used all over mathematics and science. as data is represented in a systematic way in vectors and it also has the ability to analyze data with the help of a feature vector. they play an important role in machine learning and are extremely helpful over here.

In machines, learning vectors are used in describing numeric and symbolic data called features. due to their amazing ability in analyzing data they are extremely useful in pattern processing and machine learning. feature vectors are used in image processing, speech recognition, and spam-fighting initiatives.

In a vector, point A is called the initial point and point B is called the terminal point.

  • Vector Mathematics:

Here we shall be looking at vector dot-product and vector-scalar multiplication.

  1. Vector dot products.

Here by using the dot( ) function on a Numpy array we are going to calculate dot products between two vectors.

# dot product vectors

from numpy import vectors

a = array([4, 2, 4])

print(a)

b = array([1, 1, 1])

print(b)

c = a.dot(b)

print(c)

10

2. Vector-Scaler Multiplication.

We can multiply a vector by a scalar in the effect of scaling the magnitude of the vector.

# vector-scalar multiplication

from numpy import vectors

a = array([2, 1, 4])

print(a)

s = 0.5

print(s)

c = s*a

print(c)

[1.0, 0.5, 2.0]

Hence we can say that vectors which are the concept of linear algebra from mathematics are important components of Machine Learning and Artificial Intelligence.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store