unsupervisedLearning

Unsupervised Learning

  • Definition: A machine learning technique where the algorithm identifies patterns and relationships in unlabeled data without user assistance.

  • Structure is derived by clustering based on the relationships among various variables in the data.

Key Concepts

Overview of Unsupervised Learning

  • Clustering: Grouping similar data points.

  • Dimensionality Reduction: Techniques like Principal Component Analysis (PCA) that reduce the number of features while preserving significant information.

  • Applications: Customer segmentation, anomaly detection, gene expression analysis, recommendation systems.

  • Benefits: Handles large volumes of data, uncovers unknown patterns.

Comparison to Supervised Learning

  • Supervised Learning: Uses labeled data to predict outcomes.

  • Unsupervised Learning: Utilizes unlabeled data to find hidden structures.

Clustering Techniques

Overview

  • Purpose: Groups similar data points together.

  • Applications: Market segmentation, social network analysis.

K-means Algorithm

  • Input: The number of clusters (K) and the training set.

  • Process: Randomly initializes cluster centroids, assigns data points to nearest centroids, updates centroid positions based on assigned data points.

K-means Optimization

  • Objective Function: Minimizes the within-cluster sum of squares to optimize the placement of clusters.

  • Mathematical representation: J = (1/m) * Σ ||x(i) - µc(i)||^2.

  • Initialization: K should be less than the number of training data points.

  • Random Initialization: Important to avoid local optima by repeating the initialization multiple times to find the best clustering.

Elbow Method for Determining Optimal K

  • Plots within-cluster sum of squares (WCSS) against different K values.

  • The ideal K is identified where the rate of decrease in WCSS slows down significantly (the 'elbow').

Silhouette Analysis

  • Measures how similar a data point is to its own cluster compared to others.

  • Silhouette Score (S(i)): S(i) = (b(i) - a(i)) / max(a(i), b(i)).

  • Average score ranges from -1 to 1, with values closer to 1 indicating better clustering.

Limitations of K-means

  • Sensitivity to Initial Conditions: Initial placement affects final clusters.

  • Choice of K: Must be predetermined, which can be challenging.

  • Outliers Sensitivity: Clusters can be distorted by outliers.

  • Assumption of Cluster Shape: K-means assumes spherical and equally sized clusters.

  • Performance in High Dimensions: Can degrade due to the curse of dimensionality.

Advanced Clustering Techniques

  • Hierarchical Clustering: Builds a tree of clusters, can be agglomerative or divisive.

  • DBSCAN: Groups densely packed points, effective in finding arbitrarily shaped clusters and handling noise.

  • Gaussian Mixture Models (GMM): Assumes data is generated from mixtures of Gaussian distributions providing a probabilistic approach.

Dimensionality Reduction

Challenges and Goals

  • Challenges: Computational complexity, overfitting, and difficult visualization.

  • Goals: Reduce dimensionality while preserving important information.

Principal Component Analysis (PCA)

  • Definition: An orthogonal transformation that transforms data into a new coordinate system where variances are maximized.

  • Process: Involves computing eigenvalues and eigenvectors from the covariance matrix to identify principal components.

  • Steps in PCA: Preprocess data, compute covariance matrix, calculate eigenvectors/values, and project data onto principal components.

Applications of PCA

  • Image Compression: Retains essential features while reducing data size.

  • Noise Reduction: Enhances signal quality by focusing on principal components.

  • Feature Extraction: Simplifies data for better visualization and analysis.

Pitfalls of PCA

  • PCA does not prevent overfitting on its own.

  • Leads to loss of interpretability as principal components may not have clear meanings.

Other Dimensionality Reduction Techniques

  • t-SNE: Excellent for visualizing high-dimensional data while capturing local relationships but may distort global structure.

  • UMAP: Preserves both global and local structure, and is faster/scalable than t-SNE.

Acknowledgment

  • Lecture notes and labs referenced from DeepLearning.AI and medium.com for educational purposes.