Implementing some methods from scratch for clustering and dimensionality reduction in Python and applying them to the Iris dataset.
-
K-Means Clustering
This is one of the simplest and most commonly used clustering methods. It involves randomly initializing "k" cluster centers, assigning each data point to the nearest cluster center, and then iteratively updating the cluster centers based on the points assigned to them until convergence.
-
Mean-Shift Clustering
This is a density-based clustering method that involves shifting each data point towards regions of higher density by averaging the data points in a window around the point. The process is repeated until the points converge.
-
DBSCAN
Density-Based Spatial Clustering of Applications with Noise groups points based on density. It defines clusters as areas with many nearby points, using parameters ε (epsilon) and MinPts. It identifies noise points and can find clusters of various shapes and sizes, making it robust and effective for outlier detection.
-
PCA
Principal Component Analysis is a dimensionality reduction technique that identifies the directions (principal components) along which the variance of the data is maximized. It projects the data onto these components, ordered by the amount of variance they explain. By retaining the top components, PCA helps in reducing the dimensionality of the dataset while preserving the most important information.
-
LDA
Linear Discriminant Analysis is a supervised dimensionality reduction technique used for classification tasks. It aims to find the linear combinations of features that best separate multiple classes in the data. By maximizing the between-class variance and minimizing the within-class variance, LDA projects the data onto a lower-dimensional space where the classes are well-separated. It helps in improving classification accuracy by focusing on the discriminative information in the data.