Back to Article
K-Means Clustering
Download Notebook

K-Means Clustering

Using the steps outlined in this video, implement K-means clustering using Pytorch pytorch.xyz libraries, for the unsupervised dataset created from the stacked \(m=2000\) data points of the two bivariate Gaussian distributions below:

A: mean \(\mu = (-0.5,-0.5)\) and covariance matrix \(\Sigma = \begin{pmatrix} 1 & 0.25 \\ 0.25 & 1 \end{pmatrix}\).

B: mean \(\mu = (0.5,0.5)\) and covariance matrix \(\Sigma = \begin{pmatrix} 1 & 0.25 \\ 0.25 & 1 \end{pmatrix}\).

In [2]:
# Place your code here
import torch
Back to top