<?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 Joel Dirisam on Medium]]></title>
        <description><![CDATA[Stories by Joel Dirisam on Medium]]></description>
        <link>https://medium.com/@joelvarmadirisam?source=rss-df4bd9c3ddec------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*K0Ah8CCmFQtvwXL8AoByKg.png</url>
            <title>Stories by Joel Dirisam on Medium</title>
            <link>https://medium.com/@joelvarmadirisam?source=rss-df4bd9c3ddec------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 04:43:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@joelvarmadirisam/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[How Logistic Regression works?]]></title>
            <link>https://medium.com/analytics-vidhya/how-logistic-regression-works-c0d5a3949726?source=rss-df4bd9c3ddec------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0d5a3949726</guid>
            <category><![CDATA[logistic-regression]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Joel Dirisam]]></dc:creator>
            <pubDate>Mon, 24 Feb 2020 03:28:56 GMT</pubDate>
            <atom:updated>2020-03-21T08:44:45.964Z</atom:updated>
            <content:encoded><![CDATA[<p>Logistic Regression is basic machine learning algorithm which promises better results compared to more complicated ML algorithms. In this article I’m excited to write about its working.</p><blockquote>Starting off</blockquote><p>Any machine learning algorithm working can be represented in geometric space because it follows basic math premise. Think of it like this, your data points are set in some n-dimensional space where n is the number of features you have in your data. The below example is in a 2D space where <em>blue</em> represents one class and <em>orange</em> represents another.</p><p>The <em>yellow</em> line represents a plane which we have to fit such that this plane divides both classes of data points accurately. Let’s call this plane as W^T( as in we are transposing W).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*zPbPbqvuNa_DAu3N3Y6wag.jpeg" /></figure><p>WT is normal to the plane and finding it is the optimisation problem because we need to perform brute force analysis to see which WT plane or which values for WT matrix correctly classifies the data classes and it has to fit as many points as possible thereby making it distant enough from data points. So when we multiply WT with Xi we get Yi which is the output. Best or optimised WT plane gives us the Sum of all f(X) = Yi*WT*Xi (i=1..n) to be maximum.</p><p>Below are the 4 types of cases covering both positive and negative values for Yi.</p><p>Case 1: Y*WT*Xi &gt; 0 — when WT *Xi &gt;0 and Yi &gt;0</p><p>Case 2: Y*WT*Xi &gt; 0 — when WT *Xi &lt; 0 and Yi &lt; 0</p><p>Case 3: Y*WT*Xi &lt; 0 — when WT *Xi &lt; 0 and Yi &gt;0</p><p>Case 4: Y*WT*Xi &lt; 0 — when WT *Xi &gt; 0 and Yi &lt; 0</p><p>If you think the maximising the f(X) = Yi*WT*Xi is not the right approach. You are right. Why?</p><p>Allow me walk you through an example :)</p><p>Say we have four data points x1,x2,x3, x4 in a 2D space where x1 is positive class and x2,x3,x4 are negative classes.</p><p>Some of the normal planes are susceptible to outliers. How?</p><p>Take a case for 4 datapoints x1,x2,x3,x4, we get 50,-1,-2,-3 values for the function f(X) = Y*WT*Xi for some inefficient WT. Summing it up we get 50 -1 -2 -3 = 44 but if only 1 point is classified correctly and for every other WT we get value less than 44.</p><p>Take another case where f(X) for 4 datapoints we get 28,1,2,3. But the sum is 34 which is less susceptible to outliers and the value is lower than previous and hence previous normal plane is found but in this case all four points are classified correctly.</p><p>For this reason we use a Squashing function to penalize the larger numbers(outliers) and restrict the range to [0,1]</p><p>Graph for plot 1/(1+e^-x):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*RvIlz4rPUVRLGIs271sOJw.jpeg" /></figure><p>The reason why a sigma function is choosen for squashing the values is it has two properties:</p><p>1. Probabilistic interpretation</p><p>2. Easy to differentiate</p><p>So the equation we are solving for finding perfect WT after applying squashing function is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*_Gf_xNwm2MCDninUVMfAUA.jpeg" /></figure><p>the argmax is maximising the function f(X).</p><p>Geometrically we can prove that if g(x) is monotonically increasing , then g(f(x)) is also monotonically increasing.</p><p>Examples:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*UjInVxal3PCyNmNFIMsQ5A.jpeg" /></figure><p>F(x) = X² has a minimum value at x = 0</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*DJgzRnirljT0F5KSyQyr3A.jpeg" /></figure><p>G(f(x)) = log(x²) also has a minimum value at 0</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*oawOVZhXkBVbbaneXZHXHw.jpeg" /></figure><p>After simplifying the original equation we get:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*hKMAT4-vU3bsUVLng9vr1Q.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0d5a3949726" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/how-logistic-regression-works-c0d5a3949726">How Logistic Regression works?</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My take on: Why do we need to standardize the data?]]></title>
            <link>https://medium.com/@joelvarmadirisam/my-take-on-why-do-we-need-to-standardize-the-data-1459e6608a63?source=rss-df4bd9c3ddec------2</link>
            <guid isPermaLink="false">https://medium.com/p/1459e6608a63</guid>
            <category><![CDATA[data-standardization]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Joel Dirisam]]></dc:creator>
            <pubDate>Fri, 12 Apr 2019 05:32:56 GMT</pubDate>
            <atom:updated>2021-03-22T20:50:12.823Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DHI4f8V5eC5KXMsXhqdinQ.jpeg" /></figure><p>I have read a lot of articles on why standardization is so important in solving machine learning problems. No offense but, I didn’t really find an appropriate practical explanation.</p><p>Alright, let me take an example of three data points:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2jai1Emachaqfncx_aFfAg.png" /></figure><p>Now say the range of feature 1 and feature 2 are 0–100 and 0–1 respectively. Now if we see the Euclidean distance between DP1 and DP2:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/374/1*aSEKbNCC54Ra_PxiFCxuwQ.png" /></figure><p>Now if the range of feature 1 is 100, a difference of 3 between two data points is 3% overall. But the difference of 0.1 on feature 2 between data points is 10% overall. If we take the Euclidean distance of data points between DP1 and DP3:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/1*ethMGDsAZItvL9By47skAQ.png" /></figure><p>The distance between the points (DP1, DP3) should be more than the distance between (DP1, DP2 ) because there is 70% ( 0.7 ) variation on feature 2 which is very greater than the variation of (DP1, DP2). But Euclidean distance measure fails to capture this logic for the problems involving distance as a metric.</p><p>This is due to the scale difference between the features. Now if we standardize the data, each feature column will have a mean of 0 and the standard deviation of 1 which eliminates the scale difference(discrepancy caused by difference of range). So this is how ( see below image ) we standardize data points, mu( μ ) is the mean and sigma( σ ) is the standard deviation of the values. For starters, Standard deviation basically tells you the average spread of the values from the mean.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*uAF6oph5o9FzFLw4nFW_Nw.png" /><figcaption>Image credits: <a href="https://www.thoughtco.com/z-scores-worksheet-3126534">https://www.thoughtco.com/z-scores-worksheet-3126534</a></figcaption></figure><p>And this is why Machine learning algorithm works well or learns well when we feed in standardized data. So problems which are solved using distance as a metric, standardizing the data comes in handy. So if you guessed it, yes, most of the kNN problems use standardization techniques to improve the model’s accuracy.</p><p><strong>Protip</strong>: If data points nearly follow a Gaussian distribution, Machine learning algorithm might work very well if you apply standardization.</p><h3><em>Cheers!</em></h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1459e6608a63" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>