...

/

Dimensionality Reduction in Plotly

Dimensionality Reduction in Plotly

Learn how to harness Plotly figures to enhance insights and understand common dimensionality reduction techniques.

Our data

Here we use the cancer dataset to perform dimensionality reduction using principal component analysis (PCA).

Press + to interact
# Import libraries
import pandas as pd
import numpy as np
# Import datasets
cancer = pd.read_csv('/usr/local/csvfiles/breast_cancer.csv')
print(cancer.head())

Principal component analysis

Just a brief definition first: Principal component analysis (PCA) aims to transform a high-dimensional feature space into a lower-dimensional space while still trying to retain as much information in the data as possible.

The idea behind this is that if we are dealing with a dataset with many features, we can represent the data in a much lower dimensional space ...