<?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 Christos Panourgias on Medium]]></title>
        <description><![CDATA[Stories by Christos Panourgias on Medium]]></description>
        <link>https://medium.com/@panourgiaschris?source=rss-f71d1f7fc22d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-ujbxeedQJaHRGtraFzrFg.png</url>
            <title>Stories by Christos Panourgias on Medium</title>
            <link>https://medium.com/@panourgiaschris?source=rss-f71d1f7fc22d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 22:54:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@panourgiaschris/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[Clustering with DBSCAN]]></title>
            <link>https://medium.com/@panourgiaschris/clustering-with-dbscan-b573a6056ad1?source=rss-f71d1f7fc22d------2</link>
            <guid isPermaLink="false">https://medium.com/p/b573a6056ad1</guid>
            <category><![CDATA[clustering-algorithm]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[clustering]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Christos Panourgias]]></dc:creator>
            <pubDate>Mon, 27 Mar 2023 19:30:42 GMT</pubDate>
            <atom:updated>2023-03-29T12:32:50.823Z</atom:updated>
            <content:encoded><![CDATA[<p>DBSCAN (Density-Based Spatial Clustering of Applications with Noise) is a clustering algorithm that groups together points that are close to each other based on a density criterion. In contrast with other Clustering models such as K-means, DBSCAN can identify clusters of arbitrary shapes and does not require the number of clusters to be specified beforehand. It is less sensitive to noise and can handle clusters of different densities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KqWII7sFp1JL0EXwJGpqFw.png" /><figcaption>Credits -&gt; <a href="https://github.com/NSHipster/DBSCAN">https://github.com/NSHipster/DBSCAN</a></figcaption></figure><p>In order to have a satisfying result using the DBSCAN algorithm it is assumed that the different clusters in the data have a relatively similar density, where by density we mean the number of points that exist in every neighborhood N(x, ε) that is defined by a radius ε and a data point x. This claim can be optically verified by observing the DBSCAN example in the middle of the above image, where the points around the blue cluster, that have somewhat of a different density, are considered to be a part of the orange cluster.</p><p>The only parameters needed to implement DBSCAN are:</p><ul><li><strong>MinPts</strong> = The minimum points that a neighborhood of a data point needs to have in order for the data point to be considered a core point of the cluster</li><li><strong>ε = </strong>The radius of the neighborhoods (i.e. how big we want our “circles” around the center data point to be )</li></ul><p>Based on those parameters, the DBSCAN algorithm divides data points into three categories:</p><ol><li><strong>Core Point : </strong>This type of data point has density ≥ MinPts. Meaning that the number of data points in N(x, ε) is greater than or equal to MinPts.</li></ol><p>Example : MinPts = 4, ε = 3 then x is a core point</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sSKjsb-X_gh3xpIrtEvXCQ.png" /></figure><p><strong>2. Border Point : </strong>This type of data point has density &lt; MinPts but distance(y, cp) ≤ ε where cp is a core point. Meaning that those points do not have the density required to be core points but they are also not that far away from a core point to be considered noise.</p><p>Example : MinPts = 4, ε = 3 then y is a border point</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P69EUMCjcECKxjAUdyz7Kg.png" /></figure><p><strong>3. Noise Point :</strong> This type of data point has density &lt; MinPts and, distance(z, cp) ≥ ε. Meaning that it doesn’t have the density required to be a core point and it is far away from any core point.</p><p>Example : MinPts = 4, ε = 3 then z is a noise point</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ti8iIuDZl6n1UeWk1cP_BQ.png" /></figure><p>And so based on that process of categorization of data points, the DBSCAN algorithm goes as follows:</p><ol><li>Iterate over every data point and classify it in one of those three categories</li><li>Eliminate all noise points</li><li>Consider all core points that lie close to each other to be in the same cluster ( Meaning that if cp_1 and cp_2 are core points and distance(cp_1, cp_2) ≤ ε then cp_1 and cp_2 are considered to be in the same cluster. )</li><li>Assign every border point in a cluster of core points based on their distance ( border points that lie exactly in the midpoint between two clusters have to be solved separately, maybe flip a coin ;D )</li></ol><p>The task of finding the clustering algorithm that best fits our data among the multitude of clustering models is sometimes difficult and time-consuming, so it would be helpful to list the pros and cons of using the DBSCAN algorithm to cluster our data in order to have a clearer picture of when it will produce satisfying results.</p><p><strong>DBSCAN Advantages :</strong></p><ul><li>Identifies clusters of arbitrary shapes.</li><li>Does not need the number of clusters to be specified.</li><li>It has high efficiency on small and medium size datasets.</li><li>It detects outliers and does not include them in the clusters.</li></ul><p><strong>DBSCAN Limitations :</strong></p><ul><li>The choice of the parameters can significantly affect the clustering results.</li><li>It is an impractical algorithm for large datasets due to its complexity of O(n²).</li><li>The clusters of our data need to have relatively similar density, otherwise the algorithm will struggle to come up with a satisfying result.</li><li>In high-dimensional spaces points tend to be far away from each other which makes it difficult for the algorithm to find meaningful clusters.</li></ul><p>Below is an example of an implementation of the DBSCAN algorithm in Python using scikit-learn.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2RNPfBbDonsm9_h3pxybww.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dpq5aeP5PceFbHGuaPW8hQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*l3lJ3kWvrwjF_D0aUQsmnw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vi9wlPJmgLbbs2P0Huy7sg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*4c6LUT30o8kGLc8ne1FXKg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b573a6056ad1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>