<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Anand Raj on Medium]]></title>
        <description><![CDATA[Stories by Anand Raj on Medium]]></description>
        <link>https://medium.com/@anandraj.1rn17ee005?source=rss-769e673022a9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9UR6d0fr_AUJ88wImLSEOw.jpeg</url>
            <title>Stories by Anand Raj on Medium</title>
            <link>https://medium.com/@anandraj.1rn17ee005?source=rss-769e673022a9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 06:22:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@anandraj.1rn17ee005/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Enhancing Multi-Layer Perceptron Performance: Demystifying Optimizers]]></title>
            <link>https://pub.towardsai.net/enhancing-multi-layer-perceptron-performance-demystifying-optimizers-57255d5950e4?source=rss-769e673022a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/57255d5950e4</guid>
            <category><![CDATA[multi-layer-perceptron]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[stochastic-gradient]]></category>
            <dc:creator><![CDATA[Anand Raj]]></dc:creator>
            <pubDate>Wed, 28 Feb 2024 20:02:00 GMT</pubDate>
            <atom:updated>2024-02-28T20:02:00.774Z</atom:updated>
            <content:encoded><![CDATA[<h4>Choosing the Right Optimizer for MLPs</h4><h3>Introduction</h3><p>Optimizers are algorithms or methods used to adjust the attributes of a model, such as its weights and learning rate, in order to minimize the error or loss function during the process of training a machine learning model. The main objective of an optimizer is to find the optimal set of parameters that result in the best performance of the model on the given dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*47skUygd3tWf3yB9A10QHg.gif" /><figcaption>Optimizers in 3D. Image source: <a href="https://miro.medium.com/v2/resize:fit:1358/1*47skUygd3tWf3yB9A10QHg.gif">TDS</a></figcaption></figure><h3>Gradient Descent</h3><p>Gradient Descent (GD) is a first-order optimization algorithm used to minimize the cost function in machine learning and optimization problems. It iteratively updates the parameters of a model in the direction of the steepest descent of the cost function with respect to those parameters. The algorithm works by calculating the gradient of the cost function at a particular point and then updating the parameters in the opposite direction of the gradient. GD can be computationally expensive, especially for large datasets, as it requires storing and processing the entire dataset in memory for each iteration. Hence, Stochastic Gradient Descent (SGD) was introduced. SGD processes one sample or mini-batch at a time. SGD tends to converge faster and is more computationally efficient, especially for large datasets.</p><h3>Stochastic Gradient Descent</h3><p>Stochastic Gradient Descent (SGD) is an optimization algorithm used to minimize a cost function in machine learning. Unlike traditional Gradient Descent (GD), which computes gradients using the entire dataset, SGD updates model parameters using only one training example (or a small subset, called mini-batch) at a time. This makes SGD more computationally efficient and suitable for large datasets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*GHRwDwYf0pCd_OsLW5qBBw.png" /><figcaption>Mathematical Formulation for SGD.</figcaption></figure><p>SGD introduces more noise in parameter updates compared to GD, which can result in more erratic convergence behavior and slower convergence in some cases. Hence, we introduce the concept of momentum.</p><p><a href="https://keras.io/api/optimizers/sgd/">Code implementation of Optimizers for SGD.</a></p><h3>Momentum + SGD</h3><p>Momentum is an optimization algorithm used to accelerate Gradient Descent (GD) and its variants, such as Stochastic Gradient Descent (SGD), by introducing a momentum term that smooths out the update process and helps overcome local minima. The momentum algorithm maintains a moving average of the gradients and updates the parameters in a direction that aligns with the accumulated gradients.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*E9CTpuIJMABOVs1_kvOwlQ.png" /><figcaption>Mathematical Formulation for Momentum + SGD.</figcaption></figure><p>Momentum is a powerful optimization algorithm that accelerates convergence and helps overcome local minima by introducing momentum into the parameter updates. However, it requires careful tuning of the momentum parameter and may exhibit inertia or increased memory usage in some cases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_zzPeCKpoeH9kdtJ.png" /><figcaption>Image source: <a href="https://production-media.paperswithcode.com/methods/Screen_Shot_2020-05-28_at_3.25.40_PM_Y687HvA.png">PapersWithCode</a></figcaption></figure><h3>Nesterov Accelerated Gradient</h3><p>Nesterov Accelerated Gradient (NAG) is an optimization algorithm that improves upon the standard Momentum method by taking into account the future gradient. It allows the algorithm to “look ahead” before making a step in the parameter space, resulting in faster convergence and better performance, especially in the presence of noisy gradients.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*nIt4SLX9el3yAZpd-kdJSw.png" /><figcaption>Mathematical Formulation for Nesterov Accelerated Gradient (NAG)</figcaption></figure><p>NAG offers faster convergence, improved accuracy, and less oscillation compared to standard Momentum, but it requires careful tuning of hyperparameters and involves additional computational complexity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PpTH25uainGfUURf.png" /><figcaption>Image Source: <a href="https://miro.medium.com/v2/resize:fit:1027/1*6MEi74EMyPERHlAX-x2Slw.png">TDS</a></figcaption></figure><h3>Adagrad</h3><p>Adagrad, short for Adaptive Gradient Algorithm, is an optimization algorithm designed to adjust the learning rate for each parameter adaptively based on its historical gradients. It is particularly useful in settings where different parameters have vastly different scales or where the gradients of some parameters are sparse.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*zxwxlcwFVrGSXhUdH7LmeQ.png" /><figcaption>Mathematical Formulation for Adagrad.</figcaption></figure><p>As Adagrad accumulates the squared gradients in the denominator, the learning rates for each parameter decrease monotonically over time. This can lead to excessively small learning rates for parameters associated with frequently occurring features, resulting in slow convergence or premature convergence. It also suffers from inefficiency for non-convex problems, and high memory requirements.</p><p><a href="https://keras.io/api/optimizers/adagrad/">Code implementation of Optimizers for Adagrad.</a></p><h3>RMSprop</h3><p>RMSprop, short for Root Mean Square Propagation, is an optimization algorithm commonly used for training deep neural networks. It addresses some of the limitations of the Adagrad algorithm by adapting the learning rates dynamically based on the magnitude of recent gradients.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*vDPa7PzBrndIUVGvI40aUQ.png" /><figcaption>Mathematical Formulation for RMSProp.</figcaption></figure><p>It offers advantages such as adaptive learning rates, efficient handling of sparse gradients, and improved convergence speed but may suffer from hyperparameter sensitivity and increased memory requirements.</p><p><a href="https://keras.io/api/optimizers/rmsprop/">Code implementation of Optimizers for RMSProp.</a></p><h3>Adadelta</h3><p>Adadelta is an adaptive learning rate optimization algorithm that aims to address some of the limitations of other adaptive algorithms like Adagrad and RMSprop. It dynamically adapts the learning rates based on the magnitude of recent gradients and accumulated gradients over time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*P8pRj0dolkY5GYthH5aOXg.png" /><figcaption>Mathematical Formulation for Adadelta.</figcaption></figure><p>It offers advantages such as no need for a learning rate hyperparameter, memory efficiency, and effective handling of sparse gradients but may be sensitive to initialization parameters and involve computational overhead.</p><p><a href="https://keras.io/api/optimizers/adadelta/">Code implementation of Optimizers for Adadelta.</a></p><h3>Adafactor</h3><p>Adafactor is an adaptive learning rate optimization algorithm that is particularly suitable for training deep learning models with large sparse datasets. It adapts the learning rate based on the statistics of the gradients and the parameter updates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*iTT2bJ8cNfB9XX-6ZGbgdw.png" /><figcaption>Mathematical Formulation for Adafactor.</figcaption></figure><p>Its advantages include adaptivity, memory efficiency, and suitability for handling large sparse datasets, but it may require hyperparameter tuning and involve additional computational complexity. While Adafactor shares some similarities with Adagrad in terms of adaptivity and gradient scaling, it introduces several modifications and improvements to enhance its performance, particularly for large-scale optimization problems with sparse datasets.</p><p><a href="https://keras.io/api/optimizers/adafactor/">Code implementation of Optimizers for Adafactor.</a></p><h3>Follow-the-Regularized-Leader</h3><p>FTRL, which stands for Follow-the-Regularized-Leader, is an optimization algorithm commonly used in machine learning for training linear models, particularly in settings where the data is sparse or high-dimensional. FTRL optimizes the regularized loss function by maintaining an adaptive learning rate for each feature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*2qH82DjdVk1n-LoVqrHs_Q.png" /><figcaption>Mathematical Formulation for FTRL.</figcaption></figure><p>FTRL (Follow The Regularized Leader) is a powerful online learning algorithm widely used in large-scale machine learning applications, particularly in recommendation systems and online advertising. Its advantages include sparse updates for memory efficiency, built-in L1 and L2 regularization for preventing overfitting, adaptive learning rates based on feature frequency and magnitude, and robustness to noisy and sparse data. However, FTRL comes with certain disadvantages. It involves complex computations compared to simpler algorithms like SGD, requiring careful parameter tuning and potentially leading to higher computational overhead. Understanding and interpreting FTRL can be challenging, making it less intuitive compared to traditional optimization methods. Additionally, FTRL may not be suitable for all optimization problems, particularly those that are non-convex or involve highly non-linear relationships between features and targets.</p><p><a href="https://keras.io/api/optimizers/ftrl/">Code implementation of Optimizers for FTRL.</a></p><h3>Adam</h3><p>The Adam optimizer, short for Adaptive Moment Estimation, is an adaptive learning rate optimization algorithm that computes individual adaptive learning rates for different parameters. It combines the advantages of two other popular optimization algorithms, AdaGrad and RMSProp, by incorporating both first and second moment estimates to adaptively adjust the learning rates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*BlScWYWuMmUliM7eSBWRaA.png" /></figure><p>The Adam optimizer offers several advantages, including adaptive learning rates that adjust for each parameter individually, leading to faster convergence rates and robust performance across various optimization tasks. Its ability to handle noisy or sparse gradients and non-stationary objectives makes it suitable for complex optimization problems. However, these advantages come with some trade-offs. Adam requires additional memory to store separate adaptive learning rates for each parameter, which can be a limitation for memory-constrained environments. Moreover, its performance is sensitive to the choice of hyperparameters, such as learning rate and momentum parameters, and finding the optimal settings may require careful tuning. Additionally, the theoretical properties of Adam are not well understood, particularly in non-convex and non-smooth optimization scenarios, which can make its behavior unpredictable in certain cases.</p><p><a href="https://keras.io/api/optimizers/adam/">Code implementation of Optimizers for Adam.</a></p><h3>AdamW</h3><p>AdamW is a variant of the Adam optimizer that incorporates weight decay directly into the update step, addressing the weight decay convergence issue observed in the original Adam optimizer. The mathematical formula for AdamW is similar to Adam, but it adds the weight decay term to the parameter update step, ensuring that the weight decay penalty is applied consistently during optimization. This modification helps stabilize training and prevents the model’s parameters from growing too large during training, improving generalization performance. The advantages of AdamW include faster convergence and better generalization compared to Adam, especially in scenarios with large-scale datasets or complex models. However, like Adam, AdamW requires careful tuning of hyperparameters such as the learning rate and momentum parameters to achieve optimal performance. Additionally, the computational overhead of AdamW may be higher than traditional weight decay methods, as it requires additional calculations during optimization. Despite these considerations, AdamW is widely used in deep learning applications and has demonstrated effectiveness in improving training stability and performance.</p><p><a href="https://keras.io/api/optimizers/adamw/">Code implementation of Optimizers for AdamW.</a></p><h3>Adamax</h3><p>Adamax is a variant of the Adam optimization algorithm that extends it to be more memory efficient and stable when dealing with large gradients. It is particularly useful in deep learning applications where large datasets and complex models are common.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*obVKUbxS7gxi44I10ie3og.png" /><figcaption>Mathematical Formulation for Adamax.</figcaption></figure><p>Its advantages include memory efficiency, stability with large gradients, and adaptive learning rates, but it may require tuning of hyperparameters and involve additional computational complexity.</p><p><a href="https://keras.io/api/optimizers/adamax/">Code implementation of Optimizers for Adamax.</a></p><h3>Nadam</h3><p>Nadam optimizer is an extension of the Adam optimizer, which combines the ideas of Adam with Nesterov momentum. It stands for “Nesterov-accelerated Adaptive Moment Estimation.” Like Adam, Nadam computes adaptive learning rates for each parameter, but it also incorporates the Nesterov accelerated gradient (NAG) method for faster convergence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*9A2a2dirbOZQjMeLMilx-w.png" /><figcaption>Mathematical Formulation for Nadam.</figcaption></figure><p>Nadam optimizer combines benefits of Adam and Nesterov momentum, leading to faster convergence and better generalization. Handles non-stationary objectives and sparse gradients well. Automatic adjustment of learning rates for each parameter. Some of the drawbacks include that it requires tuning of hyperparameters such as learning rate, momentum parameters, and epsilon. It might suffer from performance degradation on some tasks compared to simpler optimizers due to increased computational complexity.</p><p><a href="https://keras.io/api/optimizers/Nadam/">Code implementation of Optimizers for Nadam.</a></p><h3>Lion</h3><p>The Lion optimizer is a stochastic-gradient-descent method that uses the sign operator to control the magnitude of the update, unlike other adaptive optimizers such as Adam that rely on second-order moments. This make Lion more memory-efficient as it only keeps track of the momentum.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*DeGEN-fbS2lEv2rY.png" /><figcaption>Image source: <a href="https://miro.medium.com/v2/resize:fit:1400/format:webp/1*GJX_qBT0Em6gFwxybt5KVw.png">lionOptimizer</a></figcaption></figure><p><a href="https://keras.io/api/optimizers/lion/">Code implementation of Optimizers for Lion.</a></p><h3>Loss Scale Optimizer</h3><p>The Loss Scale Optimizer is a technique used in deep learning to mitigate the issue of gradient underflow or overflow, particularly when training with very small or very large gradient values. This approach involves dynamically adjusting the loss scale during training to maintain numerical stability and prevent numerical precision issues, such as vanishing or exploding gradients.</p><p>The basic idea behind the Loss Scale Optimizer is to scale the loss function by a certain factor, referred to as the loss scale factor. This factor is typically adjusted dynamically during training based on the magnitude of the gradients encountered. When gradients become too small or too large, the loss scale factor is adjusted accordingly to bring the gradients back within a manageable range.</p><p>By using the Loss Scale Optimizer, deep learning models can be trained more effectively and efficiently, as it helps to prevent numerical instability issues that can hinder convergence and degrade performance. However, it’s important to note that implementing the Loss Scale Optimizer requires careful tuning and experimentation to determine the optimal scaling strategy for a given model and dataset.</p><p>Overall, the Loss Scale Optimizer is a valuable technique for improving the numerical stability of deep learning training algorithms and enabling the training of more complex and deeper neural networks.</p><p><a href="https://keras.io/api/optimizers/loss_scale_optimizer/">Code implementation of Optimizers for Loss Scale Optimizer.</a></p><h3>Learning rate schedules API</h3><p>Learning rate schedules in machine learning refer to the strategy of adjusting the learning rate during training to optimize the performance of the model. Learning rate schedules can help improve convergence, prevent overfitting, and achieve better generalization. Various learning rate schedules are available in machine learning libraries such as TensorFlow, PyTorch, and Keras, often provided through dedicated APIs.</p><p>Here’s an example of how learning rate schedules are typically implemented in TensorFlow and PyTorch:</p><h4>TensorFlow:</h4><p>In TensorFlow, learning rate schedules can be implemented using the tf.keras.optimizers.schedules module. You can define a learning rate schedule and pass it to the optimizer during model compilation. Here&#39;s an example of using the ExponentialDecay schedule:</p><pre>import tensorflow as tf<br><br>initial_learning_rate = 0.1<br>lr_schedule = tf.keras.optimizers.schedules.ExponentialDecay(<br>    initial_learning_rate, decay_steps=10000, decay_rate=0.96, staircase=True<br>)<br><br>optimizer = tf.keras.optimizers.SGD(learning_rate=lr_schedule)</pre><h4>PyTorch:</h4><p>In PyTorch, learning rate schedules can be implemented using the torch.optim.lr_scheduler module. You can define a scheduler and attach it to the optimizer. Here&#39;s an example of using the StepLR scheduler:</p><pre>import torch<br>import torch.optim as optim<br>import torch.optim.lr_scheduler as lr_scheduler<br><br>optimizer = optim.SGD(model.parameters(), lr=0.1)<br>scheduler = lr_scheduler.StepLR(optimizer, step_size=30, gamma=0.1)</pre><p>In this example, the learning rate will be multiplied by 0.1 every 30 epochs.</p><p>These are just a few examples of learning rate schedules available in TensorFlow and PyTorch. Depending on your specific use case, you may choose different schedules such as ReduceLROnPlateau, CosineAnnealingLR, CyclicLR, etc. Each schedule has its own parameters and usage patterns, so it&#39;s essential to experiment and choose the one that best suits your needs.</p><h3>Comparison of All Optimizers — Which one to be chosen when?</h3><p>Choosing the right optimizer depends on various factors such as the nature of the problem, the architecture of the neural network, the dataset size, and computational resources available. Here’s a brief comparison of popular optimizers and when to choose them:</p><p><strong>Stochastic Gradient Descent (SGD):</strong></p><ul><li>Use SGD when you have a large dataset and limited computational resources.</li><li>It’s a good baseline optimizer for simple models and linear regression.</li></ul><p><strong>Adam:</strong></p><ul><li>Adam is suitable for most deep learning tasks due to its adaptive learning rate and momentum.</li><li>It works well with large datasets and complex architectures.</li><li>However, it may not converge well with small datasets or on problems with sparse gradients.</li></ul><p><strong>AdamW:</strong></p><ul><li>Choose AdamW when training deep neural networks to prevent overfitting.</li><li>It incorporates weight decay directly into the parameter update step, improving generalization performance.</li></ul><p><strong>Nadam:</strong></p><ul><li>Nadam combines Nesterov momentum with the adaptive learning rate of Adam.</li><li>It often achieves faster convergence than Adam on deep neural networks.</li></ul><p><strong>RMSprop:</strong></p><ul><li>Use RMSprop when dealing with non-stationary objectives or noisy gradients.</li><li>It adapts the learning rate separately for each parameter, making it suitable for online and non-stationary settings.</li></ul><p><strong>Adagrad:</strong></p><ul><li>Adagrad is effective for sparse data and convex optimization problems.</li><li>However, it may accumulate the squared gradients over time, leading to a diminishing learning rate.</li></ul><p><strong>Adadelta:</strong></p><ul><li>Adadelta is an extension of Adagrad that addresses its diminishing learning rate issue.</li><li>It dynamically adjusts the learning rate based on a moving window of gradient updates, making it suitable for long training sessions.</li></ul><p><strong>Adagrad:</strong></p><ul><li>Adagrad is effective for sparse data and convex optimization problems.</li><li>However, it may accumulate the squared gradients over time, leading to a diminishing learning rate.</li></ul><p><strong>Adadelta:</strong></p><ul><li>Adadelta is an extension of Adagrad that addresses its diminishing learning rate issue.</li><li>It dynamically adjusts the learning rate based on a moving window of gradient updates, making it suitable for long training sessions.</li></ul><p><strong>Adamax:</strong></p><ul><li>Adamax is a variant of Adam that replaces the L2 norm with the infinity norm.</li><li>It is less sensitive to the choice of learning rate hyperparameters.</li></ul><p><strong>RMSprop:</strong></p><ul><li>RMSprop is an adaptive learning rate method that divides the learning rate by an exponentially decaying average of past squared gradients.</li><li>It works well for non-stationary objectives and can converge faster than vanilla SGD.</li></ul><p><strong>Adafactor:</strong></p><ul><li>Adafactor is an adaptive learning rate method designed specifically for the training of deep neural networks.</li><li>It adapts the learning rate per parameter, using statistics based on the current gradient.</li></ul><p>Choosing the right optimizer involves experimentation and tuning hyperparameters based on the specific characteristics of your dataset and model. It’s often recommended to start with Adam or AdamW as they generally perform well across a wide range of tasks and then experiment with other optimizers to see if they offer any improvements for your particular problem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/0*CHdc1ILAI5obMeMs.gif" /><figcaption>Comparing different Optimizers. Image Source: <a href="https://editor.analyticsvidhya.com/uploads/121381obtV.gif">AnalyticsVidhya</a></figcaption></figure><h3>References</h3><ol><li>Code implementation for all Optimizers: <a href="https://keras.io/api/optimizers/">Keras.</a></li><li><a href="https://medium.com/@yash9439/lion-optimizer-73d3fd18abe9">Lion Optimizer.</a></li><li><a href="https://towardsdatascience.com/optimizers-for-training-neural-network-59450d71caf6">Optimizers.</a></li><li><a href="https://towardsdatascience.com/a-visual-explanation-of-gradient-descent-methods-momentum-adagrad-rmsprop-adam-f898b102325c">A Visual Explanation of Gradient Descent Methods</a>.</li></ol><p>Hope you liked the article!!!!</p><p>You may reach out to me on <a href="https://www.linkedin.com/in/anand-raj-gwu/"><strong>LinkedIn</strong></a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57255d5950e4" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/enhancing-multi-layer-perceptron-performance-demystifying-optimizers-57255d5950e4">Enhancing Multi-Layer Perceptron Performance: Demystifying Optimizers</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Clustering unveiled: The Intersection of Data Mining, Unsupervised Learning, and Machine Learning]]></title>
            <link>https://pub.towardsai.net/clustering-unveiled-the-intersection-of-data-mining-unsupervised-learning-and-machine-learning-a8c9feefb46f?source=rss-769e673022a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8c9feefb46f</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[unsupervised-learning]]></category>
            <category><![CDATA[clustering-algorithm]]></category>
            <category><![CDATA[data-mining]]></category>
            <category><![CDATA[clustering]]></category>
            <dc:creator><![CDATA[Anand Raj]]></dc:creator>
            <pubDate>Mon, 22 Jan 2024 16:01:42 GMT</pubDate>
            <atom:updated>2024-01-22T16:01:42.676Z</atom:updated>
            <content:encoded><![CDATA[<h4>Decoding Patterns with Clustering Algorithms like K-means, Hierarchical Technique, and DBSCAN (Density-based)</h4><h3>Table of Contents</h3><ol><li><a href="#b890">Introduction</a></li><li><a href="#e6d4">K- Means Clustering Technique</a><br>- <a href="#ba4d">Metrics for Clustering</a><br>- <a href="#bea2">K-means algorithm</a><br>- <a href="#ea28">Lloyd’s algorithm (approximation approach)</a><br>- <a href="#06eb">Initialization Sensitivity</a><br>- <a href="#baad">K-means++ Initialization</a><br>- <a href="#3adc">Limitations of K-means</a><br>- <a href="#92bc">K-medoids with PAM algorithm</a><br>- <a href="#605d">Determining the right K</a><br>- <a href="#d3fb">Time and Space Complexity</a></li><li><a href="#1c16">Hierarchical Clustering Technique</a><br>- <a href="#dda1">Agglomerative Hierarchical Clustering</a><br>- <a href="#01a8">Proximity methods </a><br>- <a href="#effa">Time and Space Complexity</a><br>- <a href="#98dc">Advantages and Limitations</a></li><li><a href="#af9a">DBSCAN Clustering Technique</a><br>- <a href="#63a1">DBSCAN algorithm</a><br>- <a href="#bedc">Determining the hyperparameters</a><br>- <a href="#b2d2">Advantages and Limitations</a></li><li><a href="#72b7">Applications</a></li><li><a href="#803e">References</a></li></ol><h3><strong>Introduction</strong></h3><p>Clustering is a topic that can be associated with both Data Mining and Machine Learning. Clustering involves grouping similar data points together based on certain features or characteristics. In the context of Data Mining, clustering is often used as a technique to discover patterns, structures, or relationships within a dataset. It can help identify natural groupings or clusters in the data, which may have inherent meaning or significance. In the realm of Machine Learning, clustering is considered a type of unsupervised learning. Unsupervised learning involves exploring and analyzing data without labeled outputs or target variables. Clustering algorithms are used to automatically identify patterns or groupings in the data without any predefined categories. In summary, clustering is a technique that can be applied in both the Data Mining and Machine Learning domains, and it plays a significant role in tasks related to pattern discovery, data exploration, and unsupervised learning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*uxvxmo_fyAVxWCMU-z8TOQ.png" /><figcaption>Image source: <a href="https://images.unsplash.com/photo-1444703686981-a3abbc4d4fe3?q=80&amp;w=2070&amp;auto=format&amp;fit=crop&amp;ixlib=rb-4.0.3&amp;ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D">Unsplash</a></figcaption></figure><h3>1. K- Means Clustering Technique</h3><h4>Metrics for Clustering</h4><p>Before delving into the diverse clustering algorithms, it’s essential to comprehend the metrics associated with clustering. This understanding will provide a stronger foundation for exploring the intricacies of clustering methods.</p><p><strong>Mathematical Representation</strong></p><p>The Dunn index is often expressed mathematically as the ratio of the minimum inter-cluster distance to the maximum intra-cluster distance. Here’s a more detailed representation:</p><p>Let <em>d</em>inter​(<em>Ci</em>​,<em>Cj</em>​) be the distance between clusters <em>Ci</em>​ and <em>Cj</em>​, and <em>d</em>intra​(<em>Ck</em>​) be the distance within cluster <em>Ck</em>​. Where, k is number of clusters.</p><p>The mathematical formula for the Dunn index (<em>D</em>) is given by:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/212/1*Dc4uix8P0GCn3k9j00lyHQ.png" /></figure><p>In simpler terms, the Dunn index compares the smallest distance between different clusters to the largest distance within any single cluster. A higher Dunn index suggests better-defined and more separated clusters, indicating a potentially better clustering solution.</p><p><strong>Geometrical representation</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*gsr6YWCihbkKKoxQl9cIgQ.png" /><figcaption>Dunn Index. Image Source: Author</figcaption></figure><p>Here, is the simple geometric representation with two clusters C1(data points — yellow stars) and C2 (data points — blue stars) plotted across feature 1(F1) and feature 2(F2). Where the red line depicts the nearest distance between data point in cluster C1 and cluster C2(inter-cluster distance). Blue and yellow lines depict the farthest distance between the points within the cluster C1 and cluster C2, respectively. The ratios of these values helps us determine Dunn Index.</p><p>There are many other metrics available but the core idea is remains the same, as mentioned below:</p><ol><li>Lower intra-cluster distance.</li><li>Higher inter-cluster distance.</li></ol><h4>K-means algorithm</h4><p>The K-Means algorithm minimizes an objective function that represents the sum of squared distances between data points and their assigned cluster centroids. The goal is to find cluster assignments and centroid positions that minimize this overall distance. Let’s delve into the mathematical formulation of the K-Means objective function:</p><p><strong>Objective Function (Sum of Squared Distances):</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*4_yX15O8VzzHKxGfA5S85w.png" /><figcaption>Image by Author</figcaption></figure><p>The goal of the K-Means algorithm is to find cluster assignments <em>ci</em>​ and centroid positions <em>μk</em>​ that minimize the objective function <em>J</em>. The mathematical formulation of the K-Means objective function is NP-hard to solve due to the combinatorial nature of exploring all possible assignments of data points to clusters, making an exhaustive search computationally infeasible. Iterative algorithms like Lloyd’s offer a pragmatic approach by iteratively refining cluster assignments and centroids, providing a computationally efficient approximation to the optimal solution.</p><h4><strong>Lloyd’s algorithm (approximation approach)</strong></h4><p>Lloyd’s algorithm, also known as the K-Means algorithm, is an iterative optimization approach for clustering that aims to minimize the K-Means objective function. It serves as an approximation method to find a locally optimal solution for the NP-hard K-Means problem. Here’s an elaboration on the key steps of Lloyd’s algorithm:</p><p><strong>1. Initialization:</strong></p><ul><li>Randomly select K initial centroids from the dataset.</li></ul><p><strong>2. Iterative Assignment and Update:</strong></p><p><strong><em>a. Assignment Step:</em></strong></p><ul><li>Assign each data point to the nearest centroid based on Euclidean distance.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/283/1*PNWFNzuta0LSZND0bBXIkw.png" /></figure><p><strong><em>b. Update Step:</em></strong></p><ul><li>Recalculate the centroids based on the mean of the data points assigned to each cluster.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*6AWlchgmLnrkp-5BN-gDXA.png" /></figure><p><strong>3. Convergence:</strong></p><ul><li>Repeat the assignment and update steps until convergence, typically when there is little or no change in cluster assignments or centroid positions between iterations.</li></ul><p>Lloyd’s algorithm is sensitive to the initial placement of centroids and may converge to a local minimum of the objective function. Therefore, it is common to run the algorithm multiple times with different initializations and choose the solution with the lowest objective value.</p><p>Lloyd’s algorithm provides a practical and computationally efficient solution to the K-Means clustering problem. By iteratively updating cluster assignments and centroids, it converges to a locally optimal solution. Its simplicity, efficiency, and scalability make it a widely adopted algorithm for clustering tasks in various fields, despite the challenges associated with local optima.</p><h4><strong>Initialization Sensitivity</strong></h4><p>Lloyd’s algorithm is susceptible to convergence to local minima, and the quality of the solution depends on the initial centroid positions. Hence, suffers from initialization sensitivity. Thus, we introduce K-means++ technique to tackle this problem.</p><p>We can understand from the below geometric representations the importance of choosing initial centroids and slight variation in them can result in different K-means clustering.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*QKLWwdrgXcJxYw8Gocd7aA.png" /><figcaption>Optimal clustering is closed to Original points but Sub-optimal clustering is undesirable simply because slightly different initial centroids were selected. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*TAORe_SXVICoRbXv_E-SQg.png" /><figcaption>For Optimal case plus marks are the final centroids obtained after series of 6 iteration. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hXRxigVdixkdZeqxMYEVSQ.png" /><figcaption>Iteration 1 shows initial centroids selected randomly and after series of iterations we arrive at the final optimal clusters. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*orH5a39qZljecMge0JR25g.png" /><figcaption>For Sub-Optimal case plus marks are the final centroids obtained after series of 5 iteration. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H6eR_ADR9Y6whnLod2hKkQ.png" /><figcaption>Iteration 1 shows initial centroids selected randomly and after series of iterations we arrive at the final sub-optimal undesirable clusters when comapred to the original points. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><p>To mitigate sensitivity to initial centroid selection in K-Means we employ K-Means++ with a smarter initialization scheme, reducing the risk of converging to suboptimal solutions and enhancing the algorithm’s overall performance. The probabilistic selection of initial centroids in K-Means++ promotes a more representative and diverse set, leading to improved clustering results.</p><h4>K-means++ Initialization</h4><p>The K-Means++ initialization technique aims to improve the convergence and final quality of clusters in the K-Means algorithm by selecting initial centroids more strategically. The key steps of K-Means++ are as follows:</p><ol><li><strong><em>Initialization:</em></strong></li></ol><ul><li>The first centroid is randomly selected from the data points.</li></ul><p>2. <strong><em>Probabilistic Selection:</em></strong></p><ul><li>Subsequent centroids are chosen with a probability proportional to the square of the Euclidean distance from the point to the nearest existing centroid.</li><li>This probabilistic approach ensures that new centroids are placed at a considerable distance from each other, promoting a more even spread across the dataset.</li></ul><p>3. <strong><em>Repeat Until K Centroids are Chosen:</em></strong></p><ul><li>Steps 1 and 2 are repeated until K centroids are selected.</li></ul><p>4. <strong><em>K-Means Algorithm with K-Means++ Initialization:</em></strong></p><ul><li>The selected centroids are then used as the initial centroids in the standard K-Means algorithm.</li></ul><p>The benefits of K-Means++ include a reduction in the number of iterations required for convergence and an improved likelihood of finding a better global optimum. This initialization scheme is particularly effective in addressing the sensitivity of K-Means to the initial placement of centroids, resulting in more stable and representative clustering outcomes.</p><h4>Limitations of K-means</h4><ul><li>K-Means tend to produce clusters of approximately equal sizes, which may not be suitable for datasets with unevenly distributed or hierarchical structures.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nn949zvnXPAGJ2OXYNKmFQ.png" /><figcaption>Clusters of different sizes are clustered very differently from original points due to its uneven size. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><ul><li>K-Means assumes that clusters have similar densities, which may not hold in cases where clusters have varying densities. It may struggle to adapt to clusters with regions of varying data point concentration.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vEFkBozYG783Jfb1Jd7Hiw.png" /><figcaption>Clusters with different densities clustered sub-optimally. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><ul><li>K-Means assumes clusters to be spherical. If clusters have non-globular shapes, such as elongated structures or irregular geometries, K-Means may fail to represent the underlying structure accurately, leading to suboptimal results.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YL7FGFbp3NbLtJzz5--KNw.png" /><figcaption>Clusters with non-globular shapes clustered sub-optimally. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><ul><li>K-Means is sensitive to outliers, as it minimizes the sum of squared distances. Outliers can disproportionately influence the centroid positions, leading to clusters that are skewed or misplaced.</li><li>The centroids generated by K-Means may not have clear and meaningful interpretations, especially in high-dimensional spaces or when dealing with complex, heterogeneous data. Each centroid is a point in the feature space but may not correspond to a recognizable or easily interpretable data point. This can be overcome by K-Medoids clustering technique explained in the next section.</li></ul><p>One solution to overcome these limitations, is to use many clusters. Find parts of clusters, but the major task here is we need to put these smaller parts of clusters together, to achieve optimal clusters as per original points.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9CJ4RILhyz3fUVaYMg7bxw.png" /><figcaption>Overcoming the limitations by forming many smaller clusters with a greater K. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><h4>K-medoids with PAM algorithm</h4><p>The K-Medoids technique uses an algorithm called the PAM algorithm (Partitioning Around Medoids). The PAM algorithm is a partitional clustering algorithm, similar to K-Means, but it focuses on selecting representative points (data points) in each cluster known as “medoids” instead of centroids.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*LPZDgXuB6OOEGo1APxoIkA.png" /></figure><p>Here’s an overview of how the PAM algorithm works in the context of K-Medoids:</p><ol><li>Initialization:</li></ol><ul><li>Initially, K data points are selected as the medoids.</li></ul><p>2. Assignment:</p><ul><li>Each data point is assigned to the closest medoid based on a chosen distance metric (commonly using measures like Euclidean distance).</li></ul><p>3. Update:</p><ul><li>For each cluster, the data point that minimizes the sum of distances to all other points in the cluster is selected as the new medoid.</li></ul><p>4. Iteration:</p><ul><li>Steps 2 and 3 are iteratively repeated until there is minimal or no change in the assignment of points to clusters and the selection of medoids.</li></ul><p>5. Final Clusters:</p><ul><li>The final clusters are determined by the data points assigned to the medoids.</li></ul><p>The PAM algorithm is more robust to outliers compared to K-Means, as it directly chooses medoids as representatives, which are less influenced by extreme values. It is especially suitable for situations where the mean (used in K-Means) may not be a meaningful representative, and the medoid provides a more interpretable and robust choice.</p><p>K-Medoids, utilizing the PAM algorithm, is commonly used in situations where the interpretability of clusters and robustness to outliers are crucial considerations. In addition, it also has an advantage of kernelization over K-means.</p><h4>Determining the right K</h4><p>The Elbow Method is a popular technique for determining the optimal number of clusters (K) in a dataset when using clustering algorithms like K-Means or K-Medoids. The idea behind the method is to observe the relationship between the number of clusters and the within-cluster sum of squared distances (inertia or error). The “elbow” in the plot represents a point where increasing the number of clusters ceases to result in a significant reduction in the sum of squared distances.</p><p>Here’s an illustrative interpretation of an Elbow Method plot. In the example, the elbow point is at K = 3, suggesting that three clusters are a reasonable choice for the given dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/0*Tur74ix3IjC7DzcD.png" /><figcaption>Image source: <a href="https://www.oreilly.com/api/v2/epubs/9781788295758/files/assets/995b8b58-06f1-4884-a2a1-f3648428e947.png">OReilly media</a></figcaption></figure><h4>Time and Space Complexity</h4><p><strong>1. Time Complexity:</strong></p><ul><li>O(I * K * n * d), where I is the number of iterations, K is the number of clusters, n is the number of data points, and d is the number of dimensions.</li></ul><p><strong>2. Space Complexity:</strong></p><ul><li>O(n * d), where n is the number of data points and d is the number of dimensions.</li></ul><p>Hence, both time and space complexity are linear for the K-means technique and its variants (K-means++, K-medoids).</p><h3>2. Hierarchical Clustering Technique</h3><p>Hierarchical clustering is a technique used in unsupervised machine learning to group similar data points into clusters in a hierarchical structure. The key feature of hierarchical clustering is that it creates a tree-like structure, called a dendrogram, which visually represents the relationships and structures within the data.</p><p>There are two main types of hierarchical clustering: agglomerative and divisive.</p><p>Agglomerative hierarchical clustering starts with individual data points as separate clusters and iteratively merges the most similar clusters, forming a hierarchical structure. In contrast, divisive hierarchical clustering begins with all data points in a single cluster and progressively divides the least similar clusters, generating a hierarchical tree that represents the relationships within the dataset. Both methods create dendrograms for visualizing clustering structures.</p><h4>Agglomerative Hierarchical Clustering</h4><p>The more popular hierarchical clustering technique is Agglomerative Clustering. Agglomerative Hierarchical Clustering algorithm is a bottom-up approach that starts with individual data points as separate clusters and progressively merges them based on their proximity matrix. The process continues until all data points belong to a single cluster. Here is a step-by-step explanation of the agglomerative hierarchical clustering algorithm:</p><ol><li>Initialization:</li></ol><ul><li>Treat each data point as a singleton cluster. Initially, there are N clusters for N data points.</li></ul><p>2. Compute the proximity matrix:</p><ul><li>Calculate the proximity (distance) between each pair of clusters.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RZzV7ysY_uwlnOK9NfYLoA.png" /><figcaption>Let’s consider N=12 data points starting from p1 to p12 with a proximity matrix. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><p>3. Find Closest Pair of Clusters:</p><ul><li>Identify the pair of clusters with the smallest proximity. This pair will be merged in the next step.</li></ul><p>4. Merge Closest Clusters:</p><ul><li>Combine (merge) the two clusters identified in step 3 into a new cluster. The proximity matrix is updated to reflect the distances between the new cluster and the remaining clusters.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hk_CxeIGomZp6g_FjReZSQ.png" /><figcaption>After some merging steps, we have some clusters C1 to C5. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GvYHEYBzOh79pS_Q_OPKfw.png" /><figcaption>We need to merge the two closest clusters (C2 and C5) and update the proximity matrix. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g9zTI8sWqvX_lorrP_PtGQ.png" /><figcaption>We can employ different Proximity methods(min, max, group average, etc.) available to update this Proximity Matrix after every merge. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><p>5. Repeat Steps 2 to 4:</p><ul><li>Iterate steps 2 to 4 until only a single cluster remains, capturing the hierarchical structure of the data.</li></ul><p>6. Dendrogram Construction:</p><ul><li>Construct a dendrogram to visualize the hierarchy of cluster mergers. The height at which two branches merge in the dendrogram represents the proximity at which the corresponding clusters were combined.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*tqH7oAfWq3LDDKwFuGKO0w.png" /><figcaption>Here we see a dendrogram constructed for a system with 6 data points through Agglomerative Hierarchical Clustering. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><p>7. Cutting the Dendrogram:</p><ul><li>Determine the number of clusters by “cutting” the dendrogram at a certain height. The height at the cut represents the proximity threshold for forming clusters.</li></ul><h4>Proximity methods</h4><p>In Agglomerative Hierarchical Clustering, proximity methods refer to the metrics used to calculate the dissimilarity or similarity (proximity) between clusters. These methods play a crucial role in determining how clusters are merged during the agglomeration process. Common proximity methods include:</p><p><strong><em>MIN method / Single Linkage (Nearest Neighbor):</em></strong></p><ul><li>The proximity between two clusters is defined as the minimum distance between any pair of points, one from each cluster. It is sensitive to outliers and tends to form elongated clusters.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sIYfLvNN7tdteCvCygQrMg.png" /><figcaption>MIN method —minimum distance between any pair of points, one from each cluster. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kXz9QKFZ_VIq5LHvja_aLw.png" /><figcaption>Agglomerative Hierarchical Clustering using MIN proximity method. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KsaffhzaHly_6Msz-dwGfA.png" /><figcaption>MIN proximity method can handle non-elliptical shapes. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*M8d-iiijlX8Qq8y7RIBZYA.png" /><figcaption>MIN proximity method is sensitive to noise and outliers. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><p><strong><em>MAX method / Complete Linkage (Farthest Neighbor):</em></strong></p><ul><li>The proximity between two clusters is defined as the maximum distance between any pair of points, one from each cluster. It is less sensitive to outliers than single linkage and tends to form more compact clusters.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dig9C4QRd-YShNaGFl9SkA.png" /><figcaption>MAX method — maximum distance between any pair of points, one from each cluster. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gcjVTwLIkCbJSKyYhBzeig.png" /><figcaption>Agglomerative Hierarchical Clustering using MAX proximity method. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*Za9Hwy8iTns1zArQsLzCpg.png" /><figcaption>MAX proximity method is less susceptible to noise and outliers. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*Qa2HYIFdnNHAeMk1mvNCwQ.png" /><figcaption>MAX proximity method tends to break large clusters. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><p><strong><em>Group Average method / Average Linkage:</em></strong></p><ul><li>The proximity between two clusters is defined as the average distance between all pairs of points, one from each cluster. It balances sensitivity to outliers and tends to produce clusters of moderate compactness.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RvHqESDwe8pqnQVW3Zt8Xg.png" /><figcaption>Group Average method —average distance between all pairs of points, one from each cluster. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t34qkoutdZfRIOI93blGrw.png" /><figcaption>Agglomerative Hierarchical Clustering using Group Average proximity method. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><p><strong><em>Centroid Linkage:</em></strong></p><ul><li>The proximity between two clusters is defined as the distance between their centroids (means). It can be less sensitive to outliers than single linkage but may lead to non-compact clusters.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sNhhkxKYI662bzi8elAcbQ.png" /><figcaption>Centroid method — the distance between the centroids (means) of two clusters. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><p><strong><em>Ward’s linkage:</em></strong></p><ul><li>Ward’s linkage, a proximity method in Agglomerative Hierarchical Clustering, minimizes the increase in variance within merged clusters. It tends to form compact and evenly sized clusters, making it less sensitive to outliers than some other linkage methods. Similar to group average with distance between points is a squared distance.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H_kk4V-ptunPEJJYvTUqug.png" /><figcaption>Comparison of different proximity methods used for Agglomerative Hierarchical Clustering. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><h4>Time and Space Complexity</h4><p>The time and space complexity of hierarchical clustering algorithms depends on several factors including the number of data points (N), the dimensionality of the data (D), and the specific implementation of the algorithm.</p><p><strong>Time Complexity:</strong></p><ul><li>The time complexity is often in the range of O(N² log N) to O(N³). The dominant factor is the computation of pairwise distances between clusters, which requires O(N²) operations in each iteration. The logarithmic factor accounts for the hierarchical structure.</li></ul><p><strong>Space Complexity:</strong></p><ul><li>The space complexity is usually O(N²) for storing the dissimilarity matrix between clusters. Additional memory may be required for storing the hierarchical tree structure (dendrogram).</li></ul><h4>Advantages and Limitations</h4><p>Advantages of Hierarchical Clustering:</p><ol><li>Hierarchical Structure Representation:</li></ol><ul><li>Provides a natural and intuitive representation of the hierarchical relationships within the data through dendrograms, allowing for a clear visualization of clusters at different scales.</li></ul><p>2. No Predefined Number of Clusters:</p><ul><li>Does not require specifying the number of clusters in advance, making it suitable for datasets where the number of clusters is not known beforehand.</li></ul><p>3. Flexibility in Interpretation:</p><ul><li>Offers flexibility in interpreting clustering results at different levels of granularity, allowing users to explore the data structure at various resolutions.</li></ul><p>Limitations of Hierarchical Clustering:</p><ol><li>Computational Complexity in time and space:</li></ol><ul><li>Hierarchical clustering’s computational cost increases with large datasets due to proximity matrix calculations and dendrogram updates, posing challenges in memory storage for extensive datasets.</li></ul><p>2. Sensitivity to Noise and Outliers:</p><ul><li>Sensitive to noise and outliers, particularly in agglomerative clustering methods that may merge clusters based on proximity, leading to distorted clusters.</li></ul><p>3. No objective function is directly minimized.</p><ul><li>Hierarchical clustering lacks a direct objective function to minimize during the clustering process, making it challenging to quantitatively assess the quality of clustering results and compare different hierarchical structures objectively.</li></ul><h3>3. DBSCAN Clustering Technique</h3><p>DBSCAN (Density-Based Spatial Clustering of Applications with Noise) is a clustering algorithm designed to identify clusters of arbitrary shapes in a dataset, while also marking data points that do not belong to any cluster as noise.</p><p>Here’s an elaboration on DBSCAN:</p><ol><li><strong><em>Density-Based Clustering:</em></strong></li></ol><ul><li>DBSCAN operates based on the concept of density, defining clusters as dense regions separated by sparser areas. It doesn’t assume a spherical cluster shape and can identify clusters of varying shapes and sizes.</li></ul><p><strong><em>2. Parameter:</em></strong></p><ul><li>DBSCAN requires two parameters: the radius (<em>ε</em>) that defines the neighborhood around a point, and the minimum number of points (<em>MinPts</em>) within that radius to consider a point a core point.</li></ul><p><strong><em>3. Core Points, Border Points, and Noise:</em></strong></p><ul><li>DBSCAN classifies data points into three categories: core points, which have a sufficient number of neighboring points within a specified radius; border points, which are within the radius of a core point but do not have enough neighbors themselves; and noise points, which have insufficient neighbors and do not belong to any cluster.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*EHzYnRjV403XlNJRtOiWAQ.png" /><figcaption><em>Core Point, Border Point and Noise point </em>with <em>ε = 1 and MinPts=4</em>. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oU7iY5Y71jQVBm2DnVryfw.png" /><figcaption>DBSCAN Clustering Technique with <em>ε = 10 and MinPts=4</em>. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><p><strong><em>4. Density-Reachable (Density Edge) Points:</em></strong></p><ul><li>A point <em>P</em> is density-reachable from another point <em>Q</em> with respect to parameters <em>ε</em> (radius) and <em>MinPts</em> (minimum number of points), if there exists a chain of points <em>P</em>1​,<em>P</em>2​,…,<em>Pn</em>​ where <em>P</em>1​=<em>Q</em> and <em>Pn</em>​=<em>P</em>, such that each <em>Pi</em>+1​ is directly density-connected to <em>Pi</em>​, and the distance between consecutive points is within <em>ε</em>. That is, if Q and P are core points and distance QO is less than or equal to <em>ε</em> then QP forms a density edge.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/340/1*pIbNnvOE60xDma9K-KQqwA.png" /><figcaption>qp — <em>Density Edge. </em>Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><p><strong><em>5. Density-Connected Points:</em></strong></p><ul><li>Two points <em>P</em> and <em>Q</em> are density-connected with respect to parameters <em>ε</em> and <em>MinPts</em> if there exists a point <em>O</em> such that both <em>P</em> and <em>Q</em> are density-reachable from <em>O</em>. In other words, they are part of the same cluster or connected by a chain of density-reachable points.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*DsICrlXfWG_qVBhUzjW0hg.png" /><figcaption>p and q are density connected points. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><h4>DBSCAN algorithm</h4><p>DBSCAN (Density-Based Spatial Clustering of Applications with Noise) is a clustering algorithm designed to discover clusters of arbitrary shapes in a dataset based on the density of data points. Let’s delve into the details of the DBSCAN algorithm:</p><ol><li>Initialization:</li></ol><ul><li>Choose two parameters: <em>ε</em> (radius) and <em>MinPts</em> (minimum number of points) required to form a dense region. These parameters guide the algorithm’s sensitivity to density.</li></ul><p>2. Point Classification:</p><ul><li>For each data point in the dataset, determine whether it is a core point, a border point, or a noise point:</li><li>Core Point: Has at least <em>MinPts</em> data points, including itself, within a distance of <em>ε</em>.</li><li>Border Point: Has fewer than <em>MinPts</em> data points within <em>ε</em>, but is density-reachable from a core point.</li><li>Noise Point: Does not meet the criteria for core or border points.</li></ul><p>3. Cluster Formation:</p><ul><li>Form clusters by connecting core points and their density-reachable neighbors. Each core point starts a new cluster, and any density-reachable point becomes part of the cluster. The process continues until no more density-reachable points can be added to the cluster.</li></ul><p>4. Border Point Assignment:</p><ul><li>Assign border points to the cluster of their density-reachable core point.</li></ul><p>5. Noise Points:</p><ul><li>Mark noise points that are neither core points nor density-reachable from any core point.</li></ul><p>The steps of DBSCAN are executed until all points have been classified. The algorithm results in clusters of varying shapes and sizes, and it identifies noise points that do not belong to any cluster.</p><h4>Determining the hyperparameters</h4><p><strong><em>Rule of Thumb for MinPts:</em></strong></p><ul><li>A common rule of thumb is to set <em>MinPts</em> to roughly twice the dimensionality of the dataset. For example, in a two-dimensional space, <em>MinPts</em> might be set to 4. This provides a balance between sensitivity to local density and avoiding overfitting.</li></ul><p><strong><em>Knee Point Detection (elbow method) for Eps (ε):</em></strong></p><ul><li>Look for a “knee point” in the <em>k</em>-distance plot, which signifies a transition from dense to sparse regions. This can help determine a suitable <em>ε</em>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*a12H7HP9-qsrkx4ebeh7rA.png" /><figcaption>Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><h4>Advantages and Limitations</h4><p>Advantages of DBSCAN technique:</p><ol><li>Robust to Noise:</li></ol><ul><li>DBSCAN is robust to outliers and noise, as it classifies points that do not fit into dense regions as noise.</li></ul><p>2. Handles Arbitrary Cluster Shapes:</p><ul><li>The algorithm can identify clusters with arbitrary shapes and is not limited to predefined geometries.</li></ul><p>3. Automatic Cluster Number Determination:</p><ul><li>DBSCAN does not require specifying the number of clusters in advance, adapting to the inherent density structure of the data.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uNymEg46rffAsRdEcj8IUQ.png" /><figcaption>Here, we see noise points are not clustered and all arbitrary shapes are neatly clustered as desired. Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><p>Limitations of DBSCAN technique:</p><ol><li>Sensitive to Parameters:</li></ol><ul><li>The performance of DBSCAN can be sensitive to the choice of <em>ε</em> and <em>Min Pts</em> parameters.</li></ul><p>2. Difficulty with Varying Density:</p><ul><li>Struggles with datasets where clusters have varying densities, as a single <em>ε</em> may not suit all regions.</li></ul><p>3. Difficulty with High-Dimensional Data:</p><ul><li>The curse of dimensionality can impact the effectiveness of distance-based measures in high-dimensional spaces.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rrj05ai-CIIjBlouXEDD3Q.png" /><figcaption>Datasets with varying densities can result in completely different cluster for slight variation in Eps(<em>ε</em>). Image source: <a href="https://cs.wmich.edu/alfuqaha/summer14/cs6530/lectures/ClusteringAnalysis.pdf">cs.wmich.edu_alfuqaha</a></figcaption></figure><h4>Time and Space complexity</h4><p>The time and space complexity of DBSCAN (Density-Based Spatial Clustering of Applications with Noise) depend on several factors, including the implementation details, the size of the dataset, and the chosen data structures.</p><p><strong>Time Complexity:</strong></p><ul><li>In the worst-case scenario, the time complexity of DBSCAN is often considered to be around O(n²), where n is the number of data points. This is because, in the worst case, each data point needs to be compared with every other data point to determine density-reachability.</li></ul><p><strong>Space Complexity:</strong></p><ul><li>The space complexity of DBSCAN is typically O(n), where n is the number of data points. This is mainly due to the storage of the dataset itself and additional structures like the cluster assignments.</li></ul><h3>4. Applications</h3><p>Clustering finds diverse applications across industries. In marketing, it aids target audience segmentation; in biology, it helps classify species based on genetic similarities. E-commerce platforms employ clustering for customer behavior analysis, enhancing personalized recommendations. In healthcare, it supports disease profiling for tailored treatments. Clustering is a versatile tool, fostering insights and efficiency.</p><p>Have a look through the links provided in the reference section for detailed information.</p><h3>References</h3><p><a href="https://scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.html">K-means Code samples</a></p><p><a href="https://en.wikipedia.org/wiki/Cluster_analysis#Applications">Applications of clustering</a></p><p><a href="https://scikit-learn.org/stable/modules/generated/sklearn.cluster.DBSCAN.html">DBSCAN Code samples</a></p><p><a href="https://scikit-learn.org/stable/modules/generated/sklearn.cluster.AgglomerativeClustering.html">AgglomerativeClustering Code samples</a></p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>Hope you liked the article!!!!</p><p>You may reach out to me on <a href="https://www.linkedin.com/in/anand-raj-gwu/"><strong>LinkedIn</strong></a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8c9feefb46f" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/clustering-unveiled-the-intersection-of-data-mining-unsupervised-learning-and-machine-learning-a8c9feefb46f">Clustering unveiled: The Intersection of Data Mining, Unsupervised Learning, and Machine Learning</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unleashing the Power of Skrub: Revolutionizing Table Preparation for Machine Learning]]></title>
            <link>https://blog.stackademic.com/unleashing-the-power-of-skrub-revolutionizing-table-preparation-for-machine-learning-cdfe9dee8804?source=rss-769e673022a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/cdfe9dee8804</guid>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Anand Raj]]></dc:creator>
            <pubDate>Wed, 10 Jan 2024 02:43:34 GMT</pubDate>
            <atom:updated>2024-01-12T01:56:32.819Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LThTneRWoO6dC1jV8R9c9Q.png" /><figcaption>Image source: <a href="https://skrub-data.org/stable/_static/skrub_pipeline.svg">skrub</a></figcaption></figure><h3>Introduction</h3><p>In the ever-evolving landscape of data science, the quality and diversity of information play a pivotal role in the success of analytics and machine learning models. The recently unveiled skrub, formerly recognized as dirty_cat in the Python library landscape, is crafted to streamline the preparation of tables for machine learning processes. From fuzzy joining tables to advanced analytics, skrub empowers data scientists to extract valuable insights seamlessly.</p><p>Skrub simplifies the preparation of tables for machine learning tasks. It doesn’t aim to replace versatile tools like SQL or pandas, as these tools offer broader functionalities. Instead, Skrub focuses on providing higher-level operations specifically tailored for machine learning, often integrated seamlessly with scikit-learn through its pipelines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*ItFliaixzGmmrrW-z5r5Cg.png" /><figcaption>Image source: <a href="https://camo.githubusercontent.com/164c0ba9813d15bf0f2cb7cb504bbd60c79109aa2fbea51b231142c5f0386314/68747470733a2f2f736b7275622d646174612e6769746875622e696f2f737461626c652f5f7374617469632f736b7275622e737667">github_skrub.com</a></figcaption></figure><h4>Key Features of <strong>Skrub:</strong></h4><ul><li>Enables the segregation of training and testing operations, crucial for model selection and deployment in production.</li><li>Facilitates statistical and imperfect assembly, recognizing that machine-learning models can often extract meaningful signals even from noisy data.</li></ul><h3>Assembling Tables with Precision</h3><p>The process of assembling tables lies at the heart of effective analytics, often requiring the integration of information from diverse sources. Skrub excels at joining tables on keys of different types, including string, numerical, and datetime, with an impressive ability to handle imprecise correspondences.</p><h4>Fuzzy Joining for Seamless Integration</h4><p>Traditional dataframe joining can be challenging when keys vary. Enter fuzzy_join(), a game-changer in the world of table integration. Leveraging similarities in entries, this function intelligently selects the type of fuzzy matching based on column types, producing a similarity score for easy identification of less-than-perfect matches. No more pre-cleaning hassles — fuzzy_join() simplifies the process.</p><h4>Advanced Analysis Made Simple</h4><p>Skrub takes table joining to the next level with features like Joiner, AggJoiner, and AggTarget. Joiner enables fuzzy-joining multiple external tables using a scikit-learn transformer, perfect for constructing efficient Pipelines. AggJoiner performs 1:N joins by aggregating external tables first, while AggTarget derives powerful features from the target variable without risking data leakage.</p><h4>Efficient Column Selection in Pipelines</h4><p>Apart from joins, skrub also facilitates column selection within a pipeline, allowing data scientists to choose and discard columns dynamically. SelectCols and DropCols transformers provide this flexibility, enabling seamless data manipulation at different stages of analysis.</p><h4>Embark on a Journey with Embeddings</h4><p>Sourcing the right data for analysis is crucial, and skrub makes it easier with methods like datasets.get_ken_embeddings(). Access vectorial representations of common entities from Wikipedia effortlessly, enhancing your data collection process. Additionally, methods like datasets.fetch_world_bank_indicator() help retrieve valuable data for further analysis.</p><p>Follow the link to delve further into the examination of the merging process: <a href="https://skrub-data.org/stable/auto_examples/04_fuzzy_joining.html#sphx-glr-auto-examples-04-fuzzy-joining-py"><strong><em>Example with detailed explanation</em></strong></a>.</p><h3>Creating Feature Matrices with Encoding</h3><p>Transforming data into numerical features is essential for analytics and statistical learning. Skrub offers a variety of encoders catering to different data types.</p><ul><li>TableVectorizer: A turn-key solution applying data-specific encoders to different columns.</li><li>GapEncoder: Infers latent categories, providing interpretable results.</li><li>MinHashEncoder: A scalable encoding capturing string similarities, ideal for large databases.</li><li>SimilarityEncoder: Represents string similarities with different categories, useful for a small number of categories.</li></ul><h4>Datetime Encoding for Temporal Insight</h4><p>The DatetimeEncoder is tailored for encoding date and time, representing them as time in seconds since a fixed date. Additional features capture regularities like the week of the day and month of the year.</p><p>Find the link here to detailed explanation with an example:</p><p><a href="https://skrub-data.org/stable/auto_examples/01_encodings.html#example-table-vectorizer"><strong><em>Encoding: from a dataframe to a numerical matrix for machine learning</em></strong></a></p><p><a href="https://skrub-data.org/stable/auto_examples/02_feature_interpretation_with_gapencoder.html#example-gap-encoder"><strong><em>Feature interpretation with the GapEncoder</em></strong></a></p><h3>Efficient Cleaning with deduplicate()</h3><p>To ensure accurate results, deduplicate() merges variants of the same entry, tackling issues like typos. While crucial for operations requiring exact correspondences, it’s often unnecessary for machine learning models, thanks to skrub’s dirty-category encoder.</p><p>Follow the link for an elaborate example:</p><p><a href="https://skrub-data.org/stable/auto_examples/05_deduplication.html"><strong><em>Deduplicating misspelled categories</em></strong></a></p><h3>Limitations</h3><p>Semantic similarities are presently beyond the capabilities of the current methods. For instance, determining the similarity between “car” and “automobile” falls outside the scope of the implemented procedures.</p><p>Addressing such challenges typically falls within the purview of Natural Language Processing methods.</p><p>However, skrub remains valuable in scenarios involving typos and variations within this context.</p><h3>Conclusion</h3><p>In the realm of table preparation for machine learning, skrub emerges as a versatile and indispensable tool. From fuzzy joining to advanced analytics and efficient encoding, skrub simplifies complex operations, empowering data scientists to focus on extracting meaningful insights from their data. Unleash the power of skrub and elevate your machine learning endeavors to new heights!</p><p>Go ahead and explore skrub for yourself!!!!</p><p>You may reach out to me on LinkedIn.</p><p><a href="https://www.linkedin.com/in/anand-raj-4334a91b3/">https://www.linkedin.com/in/anand-raj-4334a91b3/</a></p><h3>References</h3><p><a href="https://github.com/skrub-data/skrub/tree/main?tab=readme-ov-file">Github link to the skrub repository</a></p><p><a href="https://skrub-data.org/stable/">Skrub’s Website</a></p><h3>Additional resources</h3><ul><li><a href="https://youtu.be/_GNaaeEI2tg">Introductory video (YouTube)</a></li><li><a href="https://youtu.be/lvDN0wgTpeI">JupyterCon 2023 talk (YouTube)</a></li><li><a href="https://www.dropbox.com/scl/fi/89tapbshxtw0kh5uzx8dc/Poster-Euroscipy-2023.pdf?rlkey=u4ycpiyftk7rzttrjll9qlrkx&amp;dl=0">EuroSciPy 2023 poster (Dropbox)</a></li></ul><h3>Stackademic</h3><p>Thank you for reading until the end. Before you go:</p><ul><li>Please consider <strong>clapping</strong> and <strong>following</strong> the writer! 👏</li><li>Follow us <a href="https://twitter.com/stackademichq">X</a> | <a href="https://www.linkedin.com/company/stackademic"><strong>LinkedIn</strong></a><strong> |</strong> <a href="https://www.youtube.com/c/stackademic"><strong>YouTube</strong></a><strong> | </strong><a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Discord</strong></a></li><li>Visit our other platforms: <a href="https://plainenglish.io/"><strong>In Plain English</strong></a><strong> | </strong><a href="https://cofeed.app/"><strong>CoFeed</strong></a><strong> | </strong><a href="https://venturemagazine.net/"><strong>Venture</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cdfe9dee8804" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/unleashing-the-power-of-skrub-revolutionizing-table-preparation-for-machine-learning-cdfe9dee8804">Unleashing the Power of Skrub: Revolutionizing Table Preparation for Machine Learning</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Logistic Regression’s Journey with Imbalanced Data]]></title>
            <link>https://pub.towardsai.net/logistic-regressions-journey-with-imbalanced-data-00a90fd4f1f4?source=rss-769e673022a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/00a90fd4f1f4</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Anand Raj]]></dc:creator>
            <pubDate>Mon, 08 Jan 2024 20:01:29 GMT</pubDate>
            <atom:updated>2024-01-10T23:27:29.446Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>Visual intuition behind the effect of imbalanced data on logistic regression</strong></h4><p>In the vast landscape of data-driven decision-making, class imbalance is a subtle yet influential factor that can significantly impact the performance of machine learning models. Class imbalance occurs when the distribution of instances across different classes in a dataset is uneven, with one class vastly outnumbering the others. This scenario is prevalent in various real-world applications, from medical diagnoses to fraud detection and sentiment analysis.</p><p>In the presence of class imbalance, models may exhibit a bias towards the majority class, leading to suboptimal performance on the minority class. The consequences of misclassification can be severe, primarily when the minority class represents critical or rare events. Understanding how to navigate the complexities introduced by imbalanced classes is crucial for building robust and reliable machine-learning models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*54X-Q_RXsb5GdRah.jpg" /><figcaption>Image Source: <a href="https://www.spotebi.com/wp-content/uploads/2020/10/create-balance-workout-motivation-spotebi-768x768.jpg">Spotebi.com</a></figcaption></figure><h4><strong>How does class imbalance occur?</strong></h4><p>There are many different sources of imbalanced datasets, and each one poses different difficulties for machine learning applications. The inherent class distribution captures instances in which imbalances arise from the classes’ inherent predominance in real-world circumstances. Positive cases may be far more rare than negative ones, for example, in fraud detection or rare disease diagnosis. When data collection procedures are intrinsically biased, such as when samples are drawn from particular demographics or geographic areas, imbalances are introduced via sampling bias. Mislabeled cases or missing data are examples of data collection problems that can lead to skewed class distributions. Some classes may be underrepresented in the dataset because of the expense and work involved in gathering data for them.</p><p>Common domains where imbalance occurs:</p><ul><li>Fraud Detection.</li><li>Claim Prediction</li><li>Default Prediction.</li><li>Churn Prediction.</li><li>Spam Detection.</li><li>Anomaly Detection.</li><li>Outlier Detection.</li><li>Intrusion Detection</li><li>Conversion Prediction.</li></ul><p>We will explore an instance where the imbalance in data increases, observing its impact on the decision surface.</p><p>I have used the <a href="https://www.kaggle.com/datasets/uciml/iris">iris dataset</a> from Kaggle and tweaked it a little as per our needs.</p><h4><strong>Let’s Consider these five scenarios:</strong></h4><p>Scenario 1: Balanced Dataset (<em>n</em>​Versicolor : <em>nVirginica </em>≈ <em>1:1</em>​) <br>Scenario 2: Imbalanced Dataset (<em>n</em>​Versicolor : <em>nVirginica</em> ≈ 1:2)<br>Scenario 3: Imbalanced Dataset (<em>n</em>​Versicolor : <em>nVirginica</em> ≈ 1:3)<br>Scenario 4: Imbalanced Dataset (<em>n</em>​Versicolor : <em>nVirginica</em>​ ≈ 1:4)<br>Scenario 5: Imbalanced Dataset (<em>n</em>​Versicolor : <em>nVirginica</em> ≈ 1:11)</p><p><strong>Scenario 1: </strong>“<em>Harmony in Equilibrium”</em> <br>(Balanced Dataset with n​Versicolor : nVirginica ≈ 1:1​) <br>An equal number of observations in Class Iris-Versicolor ≈ Class Iris-Virginica, creating a balanced symphony.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*SicKglzl960SZk3ulBuApg.png" /><figcaption>Scenario 1: Balanced Dataset (<em>n</em>​Versicolor : <em>nVirginica </em>≈ <em>1:1</em>​)</figcaption></figure><p>As we can see in the above image the decision surface linearly separates both classes quite well and this is because the proportions of data points in both the classes are equal.</p><p><strong>Scenario 2: </strong>“<em>The Delicate Imbalance </em>”<br>(Imbalanced Dataset with n​Versicolor : nVirginica ≈ 1:2​) <br>The count of observations in Class Iris-Versicolor is approximately half of the count in Class Iris-Virginica, revealing an uneven distribution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*liLSUA42Xy0epGQ0Ql3HZw.png" /><figcaption>Scenario 2: Imbalanced Dataset (<em>n</em>​Versicolor : <em>nVirginica</em> ≈ 1:2)</figcaption></figure><p>With a data point proportion of 1:2, noticeable misclassifications occur among some Iris-Versicolor instances. Contrasting this with the balanced dataset (Scenario 1), the decision surface undergoes alterations, leading to less effective linear separation of the classes.</p><p><strong>Scenario 3:</strong> “<em>The Tipping Scales</em>” <br>(Imbalanced Dataset with n​Versicolor : nVirginica ≈ 1:3​) <br>The count of observations in Class Iris-Versicolor is approximately one-third of the count in Class Iris-Virginica, showcasing a significant imbalance in the data distribution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*P17ymWxtaAPCWPvxIyPDjQ.png" /><figcaption>Scenario 3: Imbalanced Dataset (<em>n</em>​Versicolor : <em>nVirginica</em> ≈ 1:3)</figcaption></figure><p>With a data point proportion of 1:3, a substantial number of misclassifications emerge, affecting nearly half of the Iris-Versicolor instances. Comparing this with the previous imbalanced dataset (Scenario 2), the performance of the decision surface degrades further. The dominance of Class Iris-Virginica plays a key role, influencing the decision surface adversely.</p><p><strong>Scenario 4:</strong> “<em>The Unsettling Disparity</em>” <br>(Imbalanced Dataset with n​Versicolor : nVirginica ≈ 1:4​) <br>The count of observations in Class Iris-Versicolor is approximately one-fourth of the count in Class Iris-Virginica, illustrating a pronounced imbalance in the dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*uceNOzVl7vz-zpBCJoQpCg.png" /><figcaption>Scenario 4: Imbalanced Dataset (<em>n</em>​Versicolor : <em>nVirginica</em> ≈ 1:4)</figcaption></figure><p>With a data point proportion of 1:4, only a single data point in Class Iris-Versicolor is correctly classified, highlighting a severe imbalance. Comparing this with the preceding imbalanced dataset (Scenario 3), the performance of the decision surface further deteriorates. The overwhelming majority of data points in Class Iris-Virginica exerts significant influence, exacerbating the challenges in classification.</p><p><strong>Scenario 5:</strong> “<em>The Extreme Odds</em>” <br>(Highly Imbalanced Dataset with n​Versicolor : nVirginica ≈ 1:11​) <br>The count of observations in Class Iris-Versicolor is approximately one-eleventh of the count in Class Iris-Virginica, indicating an exceptionally skewed distribution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*Hwmbe5f7d1s5YZ7cK2VUfw.png" /><figcaption>Scenario 5: Imbalanced Dataset (<em>n</em>​Versicolor : <em>nVirginica</em> ≈ 1:11)</figcaption></figure><p>With a data point proportion of 1:11, every data point in the minority class faces misclassification. Contrasting this with the previous imbalanced dataset (Scenario 4), the performance of the decision surface experiences a significant decline. The substantial majority of data points belonging to Class Iris-Virginica exert a profound influence, leading to increased challenges in accurate classification.</p><h4><strong>Why does this happen? [Let’s do the Math]</strong></h4><p>This happens because logistic regression tries to find the best hyperplane that maximizes the distance of every data point to the optimal hyperplane (a.k.a Decision Surface). This is also called “Optimization”. The equation is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/1*2t-jGUI1_-M-Pabi3XjF9A.png" /></figure><p>Let’s take <strong>three cases </strong>as an example.</p><p><strong>Case 1: </strong>Both the classes are <strong>classified correctly</strong> with the <strong>Grey line</strong> as Decision Surface in the picture below.</p><p>Let’s assume we had a decision surface (<strong>The grey line represents the decision surface) that linearly separated both the classes perfectly, and the distance between the classes was</strong> 0.6 from the decision surface. The value of yi will be 1 for all the data points, as all the points are correctly classified if the black line is our decision surface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*OHCOC2p_8U21zOyv8YcWMQ.png" /><figcaption>Case 1: Imbalanced Dataset</figcaption></figure><p>Number of data points in Versicolor = 2<br>Number of data points in Virginica = 7</p><p>W(Transpose) * x = 0.6 {∀ Data points}<br>yi = 1 {All data points are correctly classified}</p><p>Let’s compute the value the below equation will return for this scenario.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/272/1*pMNDkxorsFefnRpYgRi4bQ.png" /></figure><p>∀ Data points in Virginica = 2*Σ (1*0.6) = 1.2<br>∀ Data points in Versicolor = 7*Σ (1*0.6) = 4.2<br><strong>∀ Data points in Versicolor and Virginica</strong> <strong>= 1.2 + 4.2 = 5.4</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*vqA09t16uEkUQadEsF2_Wg.png" /></figure><p><strong>Case 2: </strong>Only one<strong> classified correctly (</strong>Virginica class) with the <strong>Grey line</strong> as Decision Surface in the picture below.</p><p>Let’s assume that the distance of both the classes is 1 (<strong>Sigmoid will limit any distance value above 1 to 1</strong>) from the decision surface. The value of yi will be <strong>1</strong> for all the Virginica data points (All Virginica data points are classified correctly), and yi will be <strong>-1</strong> for all the Versicolor data points (All Virginica data points are classified incorrectly).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*-LFqCw5t5-rw-TNaVw3y2g.png" /><figcaption>Case 2: Imbalanced Dataset</figcaption></figure><p>Number of data points in Versicolor = 2<br>Number of data points in Virginica = 7</p><p>Transpose(W) * x = 1 (∀ Data points)<br>yi = 1 ∀ Versicolor data points (classified correctly)<br>yi = -1 ∀ Virginica data points (classified incorrectly)</p><p>Let’s compute the value the below equation will return for this scenario.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/272/1*pMNDkxorsFefnRpYgRi4bQ.png" /></figure><p>∀ Data points in Virginica = 7*Σ (1*1) = 7<br>∀ Data points in Versicolor = 2*Σ (-1*0) = 0<br><strong>∀ Data points in Versicolor and Virginica</strong> <strong>= 7 + 0= 7</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/1*Nrs_rWZ12pRbyAodXr2V0A.png" /></figure><p>Now, the agrmax function will take the highest value possible, which is 7 (Case 2).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*DCs6NudO1CT44UMpB1Hduw.png" /></figure><p>The corresponding W* (Optimal Decision Surface will be the one in <strong>Case 2</strong>), but we know it is not the optimal decision surface. This happens due to the imbalance in the classes and the majority class dominating the minority class.</p><p><strong>Case 3: </strong>Let’s take a scenario where the data is balanced.</p><p>Let’s assume we had a decision surface (<strong>The grey line represents the decision surface) that linearly separated both the classes perfectly and the distance between the classes was</strong> 0.6 from the decision surface. The value of yi will be 1 for all the data points, as all the points are correctly classified if the black line is our decision surface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*Yohru__EJycydovHMtQZsg.png" /><figcaption>Case 3: Balanced Dataset</figcaption></figure><p>Number of data points in Versicolor = 7<br>Number of data points in Virginica = 7</p><p>W(Transpose) * x = 0.6 {∀ Data points}<br>yi = 1 {All data points are correctly classified}</p><p>Let’s compute the value the below equation will return for this scenario.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/272/1*pMNDkxorsFefnRpYgRi4bQ.png" /></figure><p>∀ Data points in Virginica = 7*Σ (1*0.6) = 4.2<br>∀ Data points in Versicolor = 7*Σ (1*0.6) = 4.2<br><strong>∀ Data points in Versicolor and Virginica</strong> <strong>= 4.2 + 4.2 = 8.4</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/411/1*YTBq4UQ2V0KjPfoDV_UPdA.png" /></figure><p>Now, the agrmax function will take the highest value possible, which is 8.4 (Case 3). Therefore, it chooses the right decision surface, as shown in case 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*QjfUT3Lc1RneTj3HlnwwZg.png" /></figure><p>The below representation is what the <strong>Logistic Regression in scikit-learn returns</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*K26MFTxZxRyAen1Zw1T1HA.png" /><figcaption>Decision Surface given by sklearn</figcaption></figure><p>We saw that imbalanced data could influence the decision surface, resulting in the model’s lousy performance. Therefore, it’s essential to handle this imbalance in the data, which can be done in the following ways.</p><p>1.Resampling techniques<br>2. Data augmentation<br>3. Synthetic minority over-sampling technique (SMOTE)<br>4. Ensemble techniques<br>5. One-class classification<br>6. Cost-sensitive learning<br>7. Evaluation metrics for imbalanced data</p><p>These are just few ways there could be many more so keep exploring.</p><p>Here is the link to the code on my <a href="https://github.com/anandr07/Blogs/tree/main/Medium_Imbalance_Effect_on_LR">GitHub</a>.</p><p>Hope you liked the article!!!!</p><p>You may reach out to me on LinkedIn.</p><p><a href="https://www.linkedin.com/in/anand-raj-4334a91b3/">https://www.linkedin.com/in/anand-raj-4334a91b3/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=00a90fd4f1f4" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/logistic-regressions-journey-with-imbalanced-data-00a90fd4f1f4">Logistic Regression’s Journey with Imbalanced Data</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unraveling the World of ADAS: Enhancing Automotive Safety and Comfort]]></title>
            <link>https://medium.com/@anandraj.1rn17ee005/unraveling-the-world-of-adas-enhancing-automotive-safety-and-comfort-99989be4601d?source=rss-769e673022a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/99989be4601d</guid>
            <category><![CDATA[self-driving-cars]]></category>
            <category><![CDATA[automotive-industry]]></category>
            <category><![CDATA[autonomous-vehicles]]></category>
            <category><![CDATA[autonomous-driving]]></category>
            <category><![CDATA[automotive]]></category>
            <dc:creator><![CDATA[Anand Raj]]></dc:creator>
            <pubDate>Mon, 25 Dec 2023 16:06:44 GMT</pubDate>
            <atom:updated>2023-12-25T16:06:44.002Z</atom:updated>
            <content:encoded><![CDATA[<h3>Advanced driver assistance systems</h3><p>ADAS stands for Advanced driver assistance systems. It is a system that assists drivers with safe operation of vehicle with advanced technology.</p><p>Automated technology used by ADAS such as sensors and cameras, detect the surrounding obstacles or monitors the driver errors and responds accordingly, to mitigate the consequences of accidents. Majority of traffic collisions are caused due to human error. This can be avoided with ADAS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*NRifngj9Tn7gNfVrBmQs5A.png" /><figcaption>Importance Of ADAS (Image source: <a href="https://images.spiceworks.com/wp-content/uploads/2022/06/11052634/Importance-of-ADAS.png">Spiceworks.com</a> )</figcaption></figure><h4>Working of ADAS</h4><p>Automobiles are the foundation of the next generation of mobile-connected devices, with rapid advances being made in autonomous vehicles. Autonomous application solutions are partitioned into various chips, called systems on a chip (SoCs). These chips connect sensors to actuators through interfaces and high-performance electronic controller units (ECUs).</p><p>Self-driving cars use a variety of these applications and technologies to gain 360-degree vision, both near (in the vehicle’s immediate vicinity) and far. That means hardware designs are using more advanced process nodes to meet ever-higher performance targets while simultaneously reducing demands on power and footprint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*f92SIv_myCzc5TVUMcRF5g.jpeg" /><figcaption>ADAS features (Image source: <a href="https://www.financialexpress.com/wp-content/uploads/2023/03/adas-1.jpg">FinancialExpress.com</a>)</figcaption></figure><h3>Application of ADAS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*VcCbdCWABiGRUBNZcQoy0w.png" /><figcaption>Image source: <a href="https://d17ocfn2f5o4rl.cloudfront.net/wp-content/uploads/2019/01/Principal-ADAS-features.png">intellias.com</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*4JSAFJN3AUE-BSYkq4TvXg.png" /><figcaption>Image source: <a href="https://www.researchgate.net/profile/Umar-Zakir-Abdul-Hamid/publication/311981545/figure/fig1/AS:445003718762496@1483108562922/Examples-of-ADAS-Systems-Based-on-the-works-of-9-and-15.png">researchgate.net</a></figcaption></figure><p>In this section we will be discussing some of the many applications of ADAS. Namely, Adaptive Cruise Control (ACC), Automatic parking Assistance and Automatic Emergency Braking (AEB).</p><h4><strong>1. Adaptive Cruise Control</strong></h4><p>Adaptive Cruise Control (ACC) is designed to enhance the convenience and safety of driving by automatically adjusting a vehicle’s speed to maintain a safe following distance from the vehicle ahead. This technology represents a significant evolution from traditional cruise control systems, which maintain a constant speed set by the driver but do not account for changes in traffic flow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*9AgQUCuxO7qnR2FVeaV6lw.png" /><figcaption>The system will automatically match the speed of the vehicle ahead to maintain a safe distance. Image source: <a href="https://www.mgcars.com/images/adas/INFORGRAPHIC/en/MOBILE/ACC_2.png">mgcars.com</a></figcaption></figure><p>Here are the key features and functionalities of Adaptive Cruise Control:</p><p><strong>Dynamic Speed Control</strong>:</p><ul><li>ACC is equipped with sensors, typically radar or lidar, to continuously monitor the traffic conditions around the vehicle.</li><li>The system adjusts the vehicle’s speed in real-time to maintain a safe following distance from the vehicle in front.</li></ul><p><strong>Maintaining Safe Following Distance</strong>:</p><ul><li>Drivers can often set the preferred following distance based on their comfort level.</li><li>ACC automatically modulates the vehicle’s speed to ensure it stays within the preset distance from the leading vehicle.</li></ul><p><strong>Intelligent Acceleration and Deceleration</strong>:</p><ul><li>ACC can intelligently accelerate or decelerate the vehicle based on the speed of the traffic flow.</li><li>It is capable of bringing the vehicle to a complete stop in heavy traffic and resuming acceleration when conditions allow.</li></ul><p><strong>Integration with Stop-and-Go Traffic</strong>:</p><ul><li>Many modern ACC systems are designed to work in stop-and-go traffic situations.</li><li>The system can bring the vehicle to a complete stop and resume driving when the traffic starts moving again.</li></ul><p><strong>User-Adjustable Settings</strong>:</p><ul><li>Drivers usually have the flexibility to customize ACC settings, including the following distance and the system’s responsiveness.</li><li>Some systems offer different driving modes, such as a more aggressive or a more conservative setting.</li></ul><p><strong>Safety Features</strong>:</p><ul><li>ACC is often integrated with other safety features, such as forward collision warning and automatic emergency braking, to enhance overall safety.</li><li>The system can alert the driver and take preventive actions if a potential collision is detected.</li></ul><p><strong>Limitations and Driver Involvement</strong>:</p><ul><li>While ACC is an advanced system, drivers are still required to remain engaged and be ready to take control at any moment.</li><li>The system may have limitations in certain conditions, such as adverse weather or low-visibility scenarios.</li></ul><p>Link to video representation of ACC: <a href="https://www.youtube.com/watch?v=GInSPWZRFRM"><strong><em>Adaptive Cruise Control</em></strong></a></p><p>ACC is frequently part of a broader suite of ADAS technologies that may be integrated with lane-keeping assist, lane departure warning, and other safety features.</p><h4><strong>2. Automatic Parking</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jiwCaeCdnyayuPsgXzuthw.png" /><figcaption>Image source: <a href="https://www.nissan-global.com/EN/INNOVATION/TECHNOLOGY/ARCHIVE/INTELLIGENT_PARKING_ASSIST/">nissan-global.com</a></figcaption></figure><p>Automatic parking, also known as self-parking technology, is an advanced driver assistance system designed to assist drivers in parking their vehicles with minimal effort. This technology is particularly useful in urban environments where parking spaces are limited and maneuvering in tight spaces can be challenging. Automatic parking systems utilize a combination of sensors, cameras, and software algorithms to control the vehicle’s steering, acceleration, and braking during the parking process.</p><p>Here are the key features and functionalities of Automatic Parking Systems:</p><p><strong>Sensor Integration</strong>:</p><ul><li>Automatic parking systems typically rely on a variety of sensors, including ultrasonic sensors, cameras, radar, and lidar.</li><li>These sensors are strategically placed around the vehicle to detect the surrounding environment, including obstacles, pedestrians, and other vehicles.</li></ul><p><strong>360-Degree Coverage</strong>:</p><ul><li>The integration of multiple sensors provides a comprehensive, 360-degree view of the vehicle’s surroundings.</li><li>This extensive coverage allows the system to identify and analyze potential parking spaces and obstacles from all angles.</li></ul><p><strong>Parking Space Detection</strong>:</p><ul><li>Automatic parking systems use their sensors to identify suitable parallel or perpendicular parking spaces.</li><li>The system analyzes the available space and determines if the vehicle can safely fit into the identified parking spot.</li></ul><p><strong>Automated Steering Control</strong>:</p><ul><li>Once a suitable parking space is detected, the system takes control of the vehicle’s steering.</li><li>Automated steering ensures precise maneuvering into the parking space without the need for driver intervention.</li></ul><p><strong>Acceleration and Braking Control</strong>:</p><ul><li>The system manages the vehicle’s acceleration and braking during the parking process.</li><li>It ensures smooth and controlled movements, minimizing the risk of collisions with surrounding objects.</li></ul><p><strong>User Interface</strong>:</p><ul><li>Automatic parking systems often come with a user-friendly interface displayed on the vehicle’s infotainment screen.</li><li>Drivers can activate the system, select the type of parking (parallel or perpendicular), and monitor the parking process.</li></ul><p><strong>Hands-Free Parking</strong>:</p><ul><li>In advanced automatic parking systems, the driver may not need to touch the steering wheel or pedals during the parking maneuver.</li><li>Some systems even allow the driver to control the parking process remotely using a smartphone app.</li></ul><p><strong>Obstacle Avoidance</strong>:</p><ul><li>The system continuously monitors for obstacles during the parking maneuver and can automatically stop or adjust the trajectory to avoid collisions.</li></ul><p><strong>Integration with Surroundings</strong>:</p><ul><li>Advanced automatic parking systems can be integrated with other Advanced Driver Assistance Systems (ADAS), enhancing overall safety.</li><li>Some systems are capable of detecting pedestrians and cyclists in the vicinity of the parking space.</li></ul><p><strong>Limitations and Driver Oversight</strong>:</p><ul><li>While automatic parking systems are highly advanced, drivers are typically required to monitor the parking process.</li><li>Drivers may need to intervene in certain situations or take control if the system encounters challenges.</li></ul><p><strong>Variations</strong>:</p><ul><li>Automatic parking technology comes in various forms, including perpendicular parking, parallel parking, and even diagonal parking assistance.</li></ul><p>Link to video representation of <a href="https://www.youtube.com/watch?v=eVoL-IqqqTA"><strong><em>Automatic parking systems</em></strong></a>.</p><p>Automatic parking systems contribute to increased convenience, especially in urban environments where parking spaces are at a premium. They not only simplify the parking process but also help reduce the risk of parking-related accidents and collisions.</p><h4><strong>3. Automatic Emergency Braking</strong></h4><p>Automatic Emergency Braking (AEB), also known as Autonomous Emergency Braking or Collision Avoidance System, is a sophisticated safety feature in modern vehicles designed to mitigate or prevent collisions by automatically applying the brakes. This advanced driver assistance system employs sensors, cameras, and radar to monitor the road ahead for potential collision risks. When an imminent collision is detected and the driver does not take corrective action, AEB intervenes by automatically applying the brakes to either reduce the severity of the impact or avoid the collision altogether.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*bVO8n-0G-cqOQjGXfBnVfg.png" /><figcaption>AEB (Image source: <a href="https://conti-engineering.com/wp-content/uploads/2020/05/AEB_00-1024x498.jpg">conti_engineering.com</a>)</figcaption></figure><p>Here are the key features and functionalities of Automatic Emergency Braking:</p><p><strong>Sensor Technologies</strong>:</p><ul><li>AEB systems utilize various sensor technologies, including radar, lidar, and cameras, to continuously monitor the vehicle’s surroundings.</li><li>These sensors provide real-time data about the distance, speed, and trajectory of objects in the vehicle’s path.</li></ul><p><strong>Collision Detection</strong>:</p><ul><li>AEB systems are programmed to recognize potential collision risks, such as obstacles, vehicles, or pedestrians in the vehicle’s path.</li><li>Advanced systems can detect multiple objects and assess the severity of the potential collision.</li></ul><p><strong>Warning Alerts</strong>:</p><ul><li>Before applying the brakes, AEB systems typically issue visual and audible warnings to alert the driver about the imminent collision.</li><li>These warnings serve as an opportunity for the driver to take corrective action.</li></ul><p><strong>Autonomous Braking</strong>:</p><ul><li>If the driver does not respond to the warnings and the collision risk remains high, AEB autonomously initiates braking.</li><li>The system can apply the brakes with varying degrees of force, depending on the system’s assessment of the collision severity.</li></ul><p><strong>Speed Adaptation</strong>:</p><ul><li>AEB systems can adapt the braking force based on the speed of the vehicle and the speed of the potential collision object.</li><li>This adaptive approach helps optimize the braking performance for different driving conditions.</li></ul><p><strong>Pedestrian Detection</strong>:</p><ul><li>Many AEB systems are equipped with pedestrian detection capabilities, allowing them to identify and respond to pedestrians in the vehicle’s path.</li><li>Pedestrian detection enhances safety in urban environments and areas with high foot traffic.</li></ul><p><strong>Integration with Forward Collision Warning (FCW)</strong>:</p><ul><li>AEB is often integrated with Forward Collision Warning (FCW), which alerts the driver to an impending collision.</li><li>FCW provides an additional layer of warning before AEB takes action.</li></ul><p><strong>Benefits for Rear-End Collisions</strong>:</p><ul><li>AEB is particularly effective in preventing or mitigating rear-end collisions, which are common in various driving scenarios.</li><li>The system can apply the brakes rapidly, helping avoid or reduce the impact of rear-end crashes.</li></ul><p><strong>Safety Ratings and Standards</strong>:</p><ul><li>AEB systems contribute to vehicle safety ratings, and some regulatory bodies may encourage or require the inclusion of AEB in new vehicles.</li><li>Many automotive manufacturers prioritize AEB as a standard or optional feature in their vehicles.</li></ul><p><strong>Driver Override and Intervention</strong>:</p><ul><li>Drivers can typically override or intervene in the AEB system by applying manual braking or taking control of the vehicle.</li><li>AEB is designed to enhance driver assistance, not replace the driver’s responsibility.</li></ul><p><strong>Impact on Insurance</strong>:</p><ul><li>Some insurance providers offer discounts for vehicles equipped with AEB, recognizing the safety benefits and reduced collision risks.</li></ul><p>Link to video representation of AEB:<strong><em> </em></strong><a href="https://www.youtube.com/watch?v=DCP83Kdkm5s"><strong><em>Brake Assist Explained</em></strong></a></p><p>Automatic Emergency Braking is a critical safety feature that has proven to be effective in preventing or minimizing the severity of collisions. As automotive technology advances, AEB continues to evolve, with ongoing improvements in detection capabilities, response times, and integration with other safety systems. It represents a significant step toward achieving safer roads and reducing the impact of accidents on drivers, passengers, and pedestrians alike.</p><h4>Conclusion</h4><p>Advanced Driver Assistance Systems (ADAS) have emerged as a transformative force in the automotive industry, significantly enhancing vehicle safety, convenience, and overall driving experience. From features like Adaptive Cruise Control and Automatic Emergency Braking to innovations in parking assistance and lane-keeping technologies, ADAS is driving the evolution of safer and more intelligent vehicles. These systems not only assist drivers in navigating complex traffic scenarios but also contribute to the ongoing efforts to reduce accidents and fatalities on the road. As technology continues to advance, the integration of ADAS into mainstream vehicle models is expected to become more widespread, fostering a future where automobiles are not just modes of transportation but sophisticated partners in ensuring safer and more efficient journeys for all.</p><h4>References</h4><p><a href="https://www.synopsys.com/automotive/what-is-adas.html#b">Synopsys.com</a></p><p><a href="https://intellias.com/how-to-build-adas-technology-for-autonomous-driving/">Intellias.com</a></p><p><a href="https://www.nissan-global.com/EN/INNOVATION/TECHNOLOGY/ARCHIVE/INTELLIGENT_PARKING_ASSIST/">Nissan-global.com</a></p><p><a href="https://conti-engineering.com/areas-of-expertise/systems-functions/aeb-system/">conti-engineering.com</a></p><p>_________________________________________________________________</p><p>Hope you had a good time reading the blog!!!!</p><p>You may reach out to me on LinkedIn.</p><p><a href="https://www.linkedin.com/in/anand-raj-4334a91b3/">https://www.linkedin.com/in/anand-raj-4334a91b3/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99989be4601d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>