<?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 Mrunaldhar Bathula on Medium]]></title>
        <description><![CDATA[Stories by Mrunaldhar Bathula on Medium]]></description>
        <link>https://medium.com/@mrunaldharbathula?source=rss-b5eadce19822------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*4QmZWkEX-u3PzN-y.</url>
            <title>Stories by Mrunaldhar Bathula on Medium</title>
            <link>https://medium.com/@mrunaldharbathula?source=rss-b5eadce19822------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 07:05:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mrunaldharbathula/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[Logistic regression the Bayesian way (PART 2) (how to achieve the S-shaped function)]]></title>
            <link>https://medium.com/@mrunaldharbathula/logistic-regression-the-bayesian-way-part-2-how-to-achieve-the-s-shaped-function-d2a335395140?source=rss-b5eadce19822------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2a335395140</guid>
            <dc:creator><![CDATA[Mrunaldhar Bathula]]></dc:creator>
            <pubDate>Thu, 26 Mar 2020 07:21:11 GMT</pubDate>
            <atom:updated>2020-03-26T07:21:11.256Z</atom:updated>
            <content:encoded><![CDATA[<p>if you have not read my 1st post on logistic regression the bayesian way please refer to this link <a href="https://medium.com/@mrunaldharbathula/logistic-regression-the-bayesian-way-57ffdfec3821">https://medium.com/@mrunaldharbathula/logistic-regression-the-bayesian-way-57ffdfec3821</a></p><p>now coming to the stats and maths part of approaching logistic regression in previous story we had provided the intuition for logistic regression</p><p>In my previous example i had used an example of making tea for introducing logistic regression here we need to find the probability of occurrence of a good tea(<strong>PROBABILITY OF OCCURRENCE OF AN EVENT</strong>) given that we have parameters required for making tea such as sugar,tea powder etc (<strong>given that the data had occurred</strong>) ,Hence we need to find out probability of occurrence of an event given that we have data</p><p>let “<strong>E</strong>” be the event in our case {<strong>P(making a good tea)</strong>}</p><p>let <strong>“D” </strong>be the event of occurrence of data {<strong>P(occurrence of items such as good sugar and good tea powder and good milk)</strong>}</p><p>Now our aim is to find out P(E/D) now to find out this we will use bayes theorem to find out P(E/D)</p><p>P(E) = (P(E/D) * P(D)) = (P(D/E) * P(E))</p><p>Which implies P(E/D) = (P(D/E) * P(E))/(P(D))</p><p>if we see the above equation we can observe that the first term P(D/E) and can be found out because it is a conditional probability though it is difficult but can be evaluated, P(E) is independent of any variables and hence it has probability of 0.5. But coming to P(D) it depends on so many factors such as sugar, tea environment etc. To wrap it up it accounts for all of the nature and many factors which are difficult to compute so we try to eliminate it by using odds</p><p>we define odds for a random variable X as O(X) = (P(X)/(1-P(X)))</p><p>so on calculating odds for P(E/D) we get the below equation as follows and the rest of the proof is mentioned in the below pictures</p><p>O(E/D) = (P(E/D)/(1-P(E/D)))</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i2ADHzhguf-H1LgHgrE_Cw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9utbyrD4XPZp-bjLrke30A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YpsAFuxnw5652rhMCZZCaA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SfpdEMZOjI439PdMRB0vXg.jpeg" /></figure><p>from the above pictures we can see how do we arrive at the sigmoid function for evaluating the probabilities</p><p>In my next story, I will proove how do we derive cost function for logistic regression .</p><p>Stay Tuned for the next stories………………………!!</p><p>If you like my story give it a clap</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2a335395140" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LOGISTIC REGRESSION THE BAYESIAN WAY]]></title>
            <link>https://medium.com/@mrunaldharbathula/logistic-regression-the-bayesian-way-57ffdfec3821?source=rss-b5eadce19822------2</link>
            <guid isPermaLink="false">https://medium.com/p/57ffdfec3821</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[logistic-regression]]></category>
            <dc:creator><![CDATA[Mrunaldhar Bathula]]></dc:creator>
            <pubDate>Mon, 04 Nov 2019 13:56:22 GMT</pubDate>
            <atom:updated>2019-11-04T13:56:22.815Z</atom:updated>
            <content:encoded><![CDATA[<p>Logistic Regression is an algorithm that is used as a classifier i.e that it determines the probability of occurrence of an event given that data had already occurred …..but wait………. it is a common thing and known by most of the people who work on DATA SCIENCE or MACHINE LEARNING you may question me that what is new in this post ………….answer for your question is that I am going to explain logistic regression in both intuitive and mathematical ways so that you can appreciate the functionality and heart of the algorithm.</p><p>For beginners who don’t know much about logistic regression…………….. logistic regression is an algorithm that outputs the probability of occurrence of our upcoming event given the data of events we have had already occurred, This algorithm performs by fitting an sigmoid function on the data we have and predicts the probability of occurrence of events given that data had already occurred</p><p>Firstly you may ask me what is need of logistic regression ???</p><p>The answer is if you have an event in which you have to predict the probability of occurrence of making a good tea given that data such as amount of sugar used and amount of tea powder used and amount of milk used,The logistic regression is one of the best way out ,On visualizing our data our data will look some thing like this as shown in <strong>FIGURE1 .</strong> In figure 1 Y axis shows us data about weather the tea we prepare is good or not versus a parameter (amount of sugar added in making tea)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/324/1*xYxHmjQy-d_kK3B2nxXvsQ.jpeg" /><figcaption><strong>FIGURE 1</strong></figcaption></figure><p>The main aim of regression is to fit a curve onto the data such that the fitted curve will be able to predict the value or probability of occurrence of an event</p><p>If we try to fit a straight line onto that data i.e linear regression it looks something like this as shown in FIGURE 2</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/409/1*ZTpTz12vXEXgRKAY9DRk2w.png" /></figure><p>from the curve we can see for values of X&gt;some-value the value of Y is greater than 1 and for some values X&lt;(value of X-intercept) the value of Y&lt;1 ,from the above data we can conclude that fitting a linear model for the above classifier data is in inaccurate since probability of an event must lie in the range of [0,1] since we had defined Y as a probability ,so it must lie in range of [0,1] hence we can conclude that fitting this type of a straight line to our data is a bad idea</p><p>So friends our constraint is Y must not exceed 1 or less than 0 hence the function Y must have Y=0 and Y=1 as the asymptodes of our function Y=f(X)</p><p>you may think that graph given in Figure 3 is perfect for our need</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/1*ygDW3AvIGEUyQVYe7tnFyQ.png" /><figcaption>FIGURE 3</figcaption></figure><p>Hurray !! we finally arrived……..but friends its not over since the at turning points the function is continuous but not differentiable so its impossible to find the optimum of the function(while figuring out the parameters that determine the exact shape of the curve) so we have to make corners smooth so that the function is both continuous and differntiable and there is one more concern with the graph as in figure3 the probability of the occurrence of that event is suddenly decreasing to zero but on observation from data probability gradually decreases and rate of change of probability decreases as we move towards left from the center of the graph and for the next half of the graph the probability gradually increases to one but not suddenly it must gradually increasse so we can see that there is a need for an smooth graph for which first derivate increases for the first half and decreases for the second half</p><p>So from the above discussion we can conclude that there is an need for an “S” shaped function which has asymptodes at Y=0 and Y=1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wf8r76Cpjp-D1apNBlA-nA.jpeg" /><figcaption>Figure 4</figcaption></figure><p>you may question me that “You have told us only about an “s” shaped function but why you considered this function shown in figure4 “</p><p>(or)</p><p>you may ask me <strong>why sigmoid!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! </strong>not other functions ???</p><p>The answer for the above question is in my next story ……stay tuned</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57ffdfec3821" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>