WOLFRAM NOTEBOOK

Quick Foundation: Vector Spaces

Visualizing entities as points (represented by a list of numbers) in vector spaces

Single numbers (1D)

Simple case

Which numbers are closer to each other?
{1,6,8,19,7,21}
Let’s visualize them:
In[]:=
NumberLinePlot[{1,6,8,19,7,21}]
Out[]=

Let’s make it a little more complex ...

Which numbers are closer to each other?
In[]:=
numbers=RandomSample[Join[RandomReal[{10,13},10],RandomReal[{25,28},10],RandomReal[{1,7},50],RandomReal[{30,40},50]]]
In[]:=
numbers//Column
Visualization helps:
In[]:=
NumberLinePlot[numbers]
Out[]=

Distance of one entity from another ...

Out[]=
What is the distance from one number to another?
In[]:=
21-19
Out[]=
2
In[]:=
21-1
Out[]=
20
Which number is further away from 21?

Pairs of numbers (2D)

Simple example

Let’s move to 2 dimensions.
Say something is represented by 2 numbers. Here are 4 such things:
{{1,3},{3,4},{7,7},{8,10}}
How far are they from each other?
Out[]=

Can you think of something represented by 2 numbers?

Geographic coordinates: Latitude and Longitude

In[]:=
coordinates={{41.837,-87.681},{39.763,-89.670},{40.115,-88.273}};
In[]:=
GeoListPlot[GeoPosition/@coordinates,GeoRange->
200
mi
,GeoLabelsTrue]
Out[]=

Similar idea as the first example with pairs of numbers:

Out[]=

What problem can we solve with such numbers?

Triplets (3D)

Simple example

Let’s move to 3 dimensions.
Say something is represented by 3 numbers. Here are 10 such things:
How far are they from each other?

A single point

Can you think of something represented by 3 numbers?

What about digital representation of colors?
Out[]//InputForm=
RGBColor[1, 0, 0]
Out[]//InputForm=
RGBColor[0, 1, 0]
Out[]//InputForm=
RGBColor[0, 0, 1]

100 colors

N Dimensions

Movies in 3 dimensional feature space

If we were to represent movies in 3 dimensions (just like the colors) ...
Instead of Red, Green and Blue,
say we somehow measure genre of the content: Comedy, Sci Fi, Action

Movies in n-dimensional feature space

Instead of three, choose as many dimensions as you want.
  • Comedy,
  • Tragedy,
  • Informative,
  • Action,
  • SciFi,
  • Romance,
  • Historic,
  • Apocalyptic, .....
  • Strong Female Protagonist, .....
  • Year in which it was created,
  • Won an Oscar,
  • People who watched and rated the movies in Feature Space

    Wolfram Cloud

    You are using a browser not supported by the Wolfram Cloud

    Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.


    I understand and wish to continue anyway »

    You are using a browser not supported by the Wolfram Cloud. Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.