Learn practical skills, build real-world projects, and advance your career
from google.colab import drive
drive.mount('/content/drive')
Mounted at /content/drive

Visualizing High Dimensional MNIST Dataset with PCA and t_SNE

Introduction

Humans can't visualize more then three dimensions but many a times data is available in more then three dimensions so to visualize the data in 2 or 3 dimension which humans can visualize. we reduce the high dimensional data to 2/3 dimensions through Dimensionality reduction techniques like PCA and t-SNE.

Objective : we will take a data set of 784 dimensions and conver it in to 2 and 3 dimensions to visualize it.#
#importing library 
import numpy as np
import pandas as pd

# for visualization purpose
import seaborn as sns
import matplotlib.pyplot as plt

# for preprocessing purpose
from sklearn.preprocessing import StandardScaler

# for doing PCA
from sklearn import decomposition

# for t-SNE implemention 
from sklearn.manifold import TSNE