In [ ]:
import pandas as pd
from scipy import misc
from mpl_toolkits.mplot3d import Axes3D
import matplotlib
import matplotlib.pyplot as plt
In [ ]:
# Look pretty...
# matplotlib.style.use('ggplot')
plt.style.use('ggplot')
Create a regular Python list (not NDArray) and name it samples:
In [ ]:
# .. your code here ..
Code up a for-loop that iterates over the images in the Datasets/ALOI/32/ folder. Look in the folder first, so you know how the files are organized, and what file number they start from and end at.
Load each .png file individually in your for-loop using the instructions provided in the Feature Representation reading. Once loaded, flatten the image into a single-dimensional NDArray and append it to your samples list.
Optional: You can resample the image down by a factor of two if you have a slower computer. You can also scale the image from 0-255 to 0.0-1.0 if you'd like--doing so shouldn't have any effect on the algorithm's results.
In [ ]:
# .. your code here ..
Convert samples to a DataFrame named df:
In [ ]:
# .. your code here ..
Import any necessary libraries to perform Isomap here, reduce df down to three components and using K=6 for your neighborhood size:
In [ ]:
# .. your code here ..
Create a 2D Scatter plot to graph your manifold. You can use either 'o' or '.' as your marker. Graph the first two isomap components:
In [ ]:
# .. your code here ..
Chart a 3D Scatter plot to graph your manifold. You can use either 'o' or '.' as your marker:
In [ ]:
# .. your code here ..
Answer the first two lab questions!
Create another for loop. This time it should iterate over all the images in the Datasets/ALOI/32_i directory. Just like last time, load up each image, process them the way you did previously, and append them into your existing samples list:
In [ ]:
# .. your code here ..
Convert samples to a DataFrame named df:
In [ ]:
# .. your code here ..
Import any necessary libraries to perform Isomap here, reduce df down to three components and using K=6 for your neighborhood size:
In [ ]:
# .. your code here ..
Create a 2D Scatter plot to graph your manifold. You can use either 'o' or '.' as your marker. Graph the first two isomap components:
In [ ]:
# .. your code here ..
Chart a 3D Scatter plot to graph your manifold. You can use either 'o' or '.' as your marker:
In [ ]:
# .. your code here ..
In [ ]: