Photo: Yuiizaa September

Day-57 Math Behind the ML with Python-4 (Linear Algebra-Vectors)

Samet Girgin
PursuitOfData
Published in
2 min readNov 14, 2019

--

Linear Algebra is one another subject that we should be familiar to advance in machine learning. Linear algebra can be used in images and photos in computer vision applications, encoding categorical data, linear regression, regularization, deep learning and etc. (For details look over this link).

The series will continue in the same manner so the subtopics contain some brief explanations and the practices in Python. Let’s start with Vector.

Vectors:

Vectors, and vector spaces, are fundamental to linear algebra, and they’re used in many machine learning models. Vectors describe spatial lines and planes, enabling to perform calculations that explore relationships in multi-dimensional space.

Vector Addition

At its simplest, a vector is a numeric element that has both magnitude and direction

Vector Multiplication:

Vector multiplication can be performed in three ways: Scalar Multiplication, Dot Product Multiplication and Cross Product Multiplication

From left to right, one by one: Scalar Multiplication, Dot Product Multiplication and Cross Product Multiplication

The below notebook includes some calculations to understand the intuition of the vector multiplication and how to apply these in Python:

I hope to write about some advanced topics later on. Please follow me from my Twitter, Linkedin and Medium pages. Have a good ML journey.

References and Further Readings:

https://machinelearningmastery.com/examples-of-linear-algebra-in-machine-learning/

https://courses.edx.org/courses/course-v1:Microsoft+DAT256x+3T2019/courseware/bc6a0702b886405fad4f7a888702e252/59091f9f4cc6442b91180c8e0fb301f7/?child=first

--

--

Samet Girgin
PursuitOfData

Data Analyst, Petroleum & Natural Gas Engineer, PMP®