The Curse of Dimensionality
import random
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
POINTS = 50
One dimension
x = random.sample(range(0, 100), POINTS)
y = np.zeros(POINTS)
fig = plt.figure()
axis = plt.axes()
fig.set_size_inches(8, 1)
plt.scatter(x, y)
axis.set_xlim((0, 100))
plt.xticks([], [])
plt.yticks([], [])
plt.title("One dimension")
plt.show()
Two dimensions
x = random.sample(range(0, 100), POINTS)
y = random.sample(range(0, 100), POINTS)
fig = plt.figure()
axis = plt.axes()
fig.set_size_inches(8, 8)
plt.scatter(x, y)
axis.set_xlim((0, 100))
axis.set_ylim((0, 100))
axis.set_xlabel("Dimension 1", fontsize=12)
axis.set_ylabel("Dimension 2", fontsize=12)
plt.xticks([], [])
plt.yticks([], [])
plt.title("Two dimensions")
plt.show()
Three dimensions
x = random.sample(range(0, 100), POINTS)
y = random.sample(range(0, 100), POINTS)
z = random.sample(range(0, 100), POINTS)
fig = plt.figure()
axis = fig.add_subplot(1,1,1,projection='3d')
fig.set_size_inches(8, 8)
axis.scatter(x, y, z)
axis.set_xlim(0, 100)
axis.set_ylim(0, 100)
axis.set_zlim(0, 100)
axis.set_xlabel("Dimension 1", fontsize=12)
axis.set_ylabel("Dimension 2", fontsize=12)
axis.set_zlabel("Dimension 3", fontsize=12)
plt.title("Three dimensions")
plt.show()