What is a vector?¶
A vector can be understood in two complementary ways: as an ordered list of numbers or as a geometric object in space.
In ML, a feature vector is an ordered list of values, where each entry represents a feature of the object:
Each coordinate represents the value of the object for one specific feature.
Geometrically, the same vector can be interpreted as a point (or arrow) in an n-dimensional space, where each axis corresponds to one feature. In this space, the feature vector describes the object’s position based on its feature values.

Figure 1:Algebraic vs. geometric representation of a vector. Source: Duda (1997)
Dot product¶
The dot product is an operation that takes two vectors and returns a single number (a scalar). It measures how much two vectors point in the same direction.
For two vectors:
the dot product is defined as:
or explicitly:
Orthogonality¶
Two vectors are orthogonal if their dot product is equal to zero. This means they are perpendicular to each other in geometric space.
For two vectors:
Example: Orthogonal vectors
Projection¶
Projection describes how much of one vector lies in the direction of another vector. Geometrically, it can be seen as the “shadow” of a vector when it is projected onto another vector.
There are two related forms of projection: scalar projection and vector projection. The scalar projection is derived from the vector projection and represents only the length of the projection. The vector projection, on the other hand, gives the full projected vector, including both direction and magnitude.
The scalar projection of a onto b is:
The vector projection of a onto b is:

Figure 2:Projection of vector a onto vector b. Source: Wikipedia (2025)
- Duda, R. O. (1997). Pattern Recognition for HCI. Princeton University Archive. https://www.cs.princeton.edu/courses/archive/fall08/cos436/Duda/PR_model/f_vecs.htm
- Wikipedia. (2025). Scalar projection. Wikipedia, The Free Encyclopedia. https://en.wikipedia.org/w/index.php?title=Scalar_projection&oldid=1280429209