Code for dimensionality reduction and visualization.