Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Semi-Supervised Clustering — Label Spreading vs KMeans

Compares a semi-supervised approach (Label Spreading) against a fully unsupervised baseline (KMeans) on the sklearn handwritten digits dataset. Simulates a realistic scenario where only 20% of data carries labels — common in medical imaging, fraud detection, and network anomaly detection.

Results

Method Accuracy on Unlabelled Data
Label Spreading (KNN kernel, α=0.8) ~90%
KMeans (unsupervised baseline) n/a — no label info

Label Spreading consistently outperforms purely unsupervised clustering when even a small fraction of labels is available.

Key Concepts

  • Label Spreading — graph-based semi-supervised algorithm that propagates known labels to unlabelled samples through a KNN similarity graph
  • Must-Link / Cannot-Link constraints — pairwise constraints that guide clustering without requiring full labels
  • Elbow Method — WCSS plotted against K to select the optimal number of clusters

Visualisations

  • Cluster distribution across 10 KMeans groups
  • Elbow curve (WCSS vs K) for cluster selection
  • Must-Link vs Cannot-Link constraint illustration

Tech Stack

Python · scikit-learn · NumPy · Matplotlib

How to Run

pip install numpy matplotlib scikit-learn
mkdir results
python main.py

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages