```
In [1]:
```%matplotlib notebook

```
```

```
In [2]:
```import numpy as np
from dimensionality_reduction import generate_A, generate_B, generate_C
from dimensionality_reduction import plot_3d, plot_pca, plot_lowdim, PCA

```
In [3]:
```# Generate dataset A and show the first few values
A_data, A_colors = generate_A()
A_data[:10]

```
Out[3]:
```

```
In [4]:
```# Show dataset A
plot_3d(A_data, A_colors, "Dataset A")

```
```

```
In [5]:
```# Generate dataset A and show the first few values
B_data, B_colors = generate_B()
B_data[:10]

```
Out[5]:
```

```
In [6]:
```plot_3d(B_data, B_colors, "Dataset B")

```
```

```
In [7]:
```# Generate dataset C and show the first few values
C_data, C_colors = generate_C()
C_data[:10]

```
Out[7]:
```

```
In [8]:
```plot_3d(C_data, C_colors, "Dataset C")

```
```

- How many dimensions is the dataset embedded in? That is, how many dimensions does the data have as it is given?
- How many dimensions does the dataset *actually* vary along? That is, what is the minimum number of dimensions you need to describe the data?

```
In [9]:
```# Plot the A dataset
plot_3d(A_data, A_colors, "A data")
plot_pca(A_data, 1)

```
```

```
In [10]:
```# Plot the B dataset
plot_3d(B_data, B_colors, "B data")
plot_pca(B_data, 2)

```
```

```
In [11]:
```# Plot the C dataset
plot_3d(C_data, C_colors, "C data")
plot_pca(C_data, 2)

```
```

```
In [15]:
```# documentation for plot_pca
plot_pca??

```
In [16]:
```# documentation for PCA
PCA??

```
In [17]:
```# documentation for np.linalg.eig
np.linalg.eig??

```
In [18]:
```plot_lowdim(A_data, A_colors, "Dataset A")

```
```

```
In [19]:
```plot_lowdim(B_data, B_colors, "Dataset B")

```
```

```
In [20]:
```plot_lowdim(C_data, C_colors, "Dataset C")

```
```

*manifold*. A more sophisticated dimensionality reduction technique would be required to project dataset C down to two dimensions in a way that makes sense.