The unsupervised learning is a type of ML where the the model is trained on the unlabeled data. The unlabeled data is the data without predefined outputs.
In previous post we've explained there are three methods how ML can learn and that supervised learning method requires the dataset with define features (input variables) and the labels (output/target variables). Unlike supervised learning, the unsupervised learning aims to uncover hidden patterns, relationships, or structures within the data. When compared the unsupervised learning method is much more complicated than the supervised.
To get a better perspective the example of the supervised learning would be a teacher guiding a student, while unsupervsied learning is like the stundet which explores a new topic without any instructions, trying to make sense of the material on their own.
In this blog post we will cover the basics of the unsupervised learning and we'll explore the concept of the unsupervised learning, its key techniques, applications, advantages and disadvantages.
To get a better perspective the example of the supervised learning would be a teacher guiding a student, while unsupervsied learning is like the stundet which explores a new topic without any instructions, trying to make sense of the material on their own.
In this blog post we will cover the basics of the unsupervised learning and we'll explore the concept of the unsupervised learning, its key techniques, applications, advantages and disadvantages.
The concept of unsupervised learning
There are three fundamental elements of unsupervised learning and these are Input data, Learning objective, and evaluation.
- Input data - The data provided to the algorithm consist of features \(X\) (input variables). There are no corresponding labels (target/output variables) \(y\). For example the data represents the customer information, features (input variables) could include ade, location, and spending habits.
- Learning Objective - the goal is to identify the patterns, relationships, or structures in the data. The learning objective (goal) must be intially clearly defined. This goal can involve grouping similar data points, reducing dimensionality, or detecting anomalies.
- Evaulation - the evaluation in case of supervsied lerning is easy and simple. However, evaluating the performance of unsupervised learning models can be challenging since there are no preefined lables to compare predictions against. Evaluation often relies on metrics like sillouette score or domain expertise.
Types of unsupervised learning
The types of unsupervised learning can be broadly categorized into clustering, dimensionality reduction, and anomaly detection.
- Clustering - is the process of grouping data samples (points) based on their similarities. Each group is called cluster. For example grouping customers based on their pruchasing behavior to idetify disticnt customer segments. The popular unsupervised learning algorithms are k-Means clustering, Hierarchical Clustering, Density-Based Spatial Clustering, Density-Based spatial Clustering (DBSCAN)
- Dimensionality reduction - are collection of methods that is used for reducing the number of features in the dataset while retaining as much information as possible. This method is extremely useful in case of visualization of high-dimensional data or speeding up computations. The example of dimensionality reduction is the reduction of a dataset with thousand input variables (features) to two dimensions for visualization. Popular algorithms that are most commonly used are Principal component analysis (PCA), t-Distributed Stohastic Neighbor Embedding (t-SNE), and autoencoders.
- Anomaly Detection - involves identifying data points that deviate significantly from the rest of the data. The example of anomaly detection is the detection of fraudulent transactions in financial datasets. The popular algorithms that are cononly used for anomaly detection are isolation forest, gaussian mixture nodels (GMM), and one class SVM.
How Unsupervised Learning Works?
The simiplifed version of the unsupervised learning method consist of the following steps as data collection, data preprocessing, algorithm selection, training the model, and analysis and interpretation.
- Data Collection - the goal is to gather unlabeled data relevant to the problem you want to solve.
- Data Preprocessing - this is classic step which si also used in supervised learning method. The goal of this step is to clean and normalize the data to ensure the consistency. This might involve handling the missing values or scaling/normalizing numerical features.
- Algorithm Selection - the selection of unsupervised learning algorithm that suits your goal (clustering, dimensionality reduction, or anomaly detection}. In theory this approach is ok but in practice after goal definition based on the dataset i.e. if it is clustering, dimensionality reduction or anomaly detection in practice the best approach is after the goal definition select several unupervised ML algorithms and perform inital training.
- Training the Model - in this step the data is fed to he algorithm, which will analyze it to uncover patterns of structures.
- Analysis and Interpreation - The results of unsupervised learning require domain knowledege to interpret effectively. For example after clustering was successfully conducted on a dataset using K-Meains these clusters must be labeled or described by experts.
Advantages nad disadvantages of unsupervised learning
The advantages of unsupervised learning method are:
- No Labeled Data required - Unsupervised learning eliminates the need for costly and time-consuming data labeling
- Exploratory Analysis - It's perfect for exploring new dataset to indetify patterns or hidden strcutres.
- Scalability . many usupervised learning algorithms can handle large dataset efficiently.
- Interpretability - the results obtained from the ML algorihtm after unsupervised learning can be very difficutl to interpret without domain expertise.
- No Ground Truth - Since there are no labels, evaluating the quality of the model's output is challenging
- Sensitivity to Data Quality - Unsupervsied learning heavily depends on the quality of the input data. Noisy or irrelevant features can mislead the model.
Popular Applications of Unsupervised Learning
Some popular applications of unsupervised learning method are customer segmentation, recommender systems, fraud detection, genomics and bioinformatics, social network analysis, image compression,... The exampe of customer segmentation are identification of distinct customer groups based on their behaviour to enable targeted marketing. Recommender system example is grouping user with similar preferences ot make personalized recommendations. The example of fraud detection is spotting anomalous transactions or behaviors that could indicate fraud. In field of genomics nad bioinforamtics is to indetify gene clusters or patterns in genetic data. In case of socail network analysis the UL can be used to to group users based on tehir interations ot indentify communities. In example of iamge compression is reducing the size of image data while preserving ots essential features.
Comparison of supervised and unsupervised learning methods
Aspect | Supervised Learning | Unsupervised Learning |
---|---|---|
Data Type | Labeled (X,y) | Unlabeled (X only) |
Goal | Predict labels for new data |
Discover patterns or strucutres |
Example Task | Classifying emails as spam or not |
Grouping customers into segments |
Common algorithms | Linear Regression, Random Forest, Support Vector Machines |
k-Means, PCA, DBSCAN |
Evaluation | Accuracy, Precision, Recall, F1-Score |
Sulhouette Score, Inertia, Domain Expertise |