K-Means on n-Dimensional Data

This lesson will focus on K-Means on n-dimensional data in Python.

We'll cover the following

K-means on n-dimensional data

For clustering n-dimensional data, we can use the same procedure. The only difference is that we first need to reduce the number of dimensions to 2. For reducing dimensions, we will use a technique called Principal Component Analysis (PCA). We do not need to go into the details of how this technique works since the details are out of the scope of this course. We can reduce data to 2 dimensions by using the PCA class available in sklearn.decomposition. We will cluster the reduced data.

We will be using the Default of Credit Card Dataset. This dataset originally had two classes. Naturally, if we do not have the class labels, we would make two clusters for this example.

Get hands-on with 1400+ tech skills courses.