Start studying
Module 2 · Maths for Data Module contents
Module 2  ·  Card 4 / 13beginner

Vectors

In data science, a vector is an ordered list of numbers that represents an observation or a variable.

In geometry, a vector represents a direction and magnitude pointing from the origin to a location in space.

For example, a house with three bedrooms, two bathrooms, and eighty square metres forms a three-element vector.

The number of values contained in a vector defines its dimensionality or the number of coordinates it spans.

Representing records as numerical vectors allows computers to compare similarities and apply linear algebra operations.

Learn in depth ↓
Module 02 · Maths for Data · 13 concepts
In depth  /  15 lines

Vectors, in more detail

Vectors serve as the primary bridge between physical observations and algebraic computation in data science.

To a computer, a vector is an ordered one-dimensional array of numerical values.

To a mathematician, it is an element of a vector space that can be added and scaled according to axioms.

To a visual thinker, a two-dimensional vector points to a coordinate pair on a flat Cartesian plane.

In a dataset, each individual row can be viewed as an observation vector spanning multiple feature dimensions.

Similarly, an entire column can be viewed as a feature vector containing measurements across all observed rows.

Vectors can be arranged vertically as column vectors or horizontally as row vectors.

By default, linear algebra literature treats individual vectors as column vectors unless specified otherwise.

The length or dimension of a vector indicates how many distinct numerical measurements it carries.

When two observations have matching dimensions, algorithms can measure the distance and angle between them.

A crucial rule is that vector operations require matching dimensionality across the participating vectors.

You cannot add a three-dimensional vector directly to a five-dimensional vector in standard linear algebra.

Beginners often confuse the mathematical dimension of a vector with the number of rows in a whole dataset.

Feature dimensions refer to the attributes measured on each single entity rather than the total count of entities.

Treating observations as vectors unlocks the geometric and algebraic tools used throughout data science.

Want the full technical article? Wikipedia ↗
Test yourself

One question on this card. Every option explains itself once you pick, right or wrong.

Question 1
A real estate dataset records bedrooms, bathrooms, and floor area for each home. How does linear algebra represent one house?
Maths for Data

13 concepts in this module, then a graded test with every answer explained.

Study this module →
↑↓ move↵ openesc close