<?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[Datascience Step-by-Step - Medium]]></title>
        <description><![CDATA[This is a two person blog whose writers are learning machine learning! - Medium]]></description>
        <link>https://medium.com/datascience-step-by-step?source=rss----c3e53ff82a29---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Datascience Step-by-Step - Medium</title>
            <link>https://medium.com/datascience-step-by-step?source=rss----c3e53ff82a29---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 04:52:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/datascience-step-by-step" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Exploratory Data Analysis(EDA)]]></title>
            <link>https://medium.com/datascience-step-by-step/exploratory-data-analysis-eda-c3f4a1b45601?source=rss----c3e53ff82a29---4</link>
            <guid isPermaLink="false">https://medium.com/p/c3f4a1b45601</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[dataset]]></category>
            <category><![CDATA[exploratory-data-analysis]]></category>
            <category><![CDATA[box-plot]]></category>
            <category><![CDATA[seaborn]]></category>
            <dc:creator><![CDATA[Aditya Kumar]]></dc:creator>
            <pubDate>Sat, 28 Sep 2019 15:39:55 GMT</pubDate>
            <atom:updated>2019-09-28T16:09:51.845Z</atom:updated>
            <content:encoded><![CDATA[<p>In statistics, <em>exploratory data analysis(EDA)</em> is an approach to analyse any data set to summerize its key characterstics. This approach involve analysing your data in a visual way with the help of various plots. In data science, EDA is considered as the first step to analyse and characterise the data set.</p><p>If, I will go theoretical, explaining my understanding on EDA, it will be a nerdy apporach! So, lets go visual and lets understand this approach with an example of a data set. I will be using <a href="https://www.kaggle.com/gilsousa/habermans-survival-data-set"><em>Haberman Cancer Survival</em></a> data set from <a href="https://www.kaggle.com/"><em>kaggle</em></a><em>.</em></p><blockquote>Haberman Cancer Survival dataset contains cases from a study that was conducted between 1958 and 1970 at the University of Chicago’s Billings Hospital on the survival of patients who had undergone surgery for breast cancer.</blockquote><p>Now, we have a data set. So, what to do next? Let us start with reading the data set. The column of data set represents the age of patient at which they had undergone their cancer operation. The second column represents the year in which they had undergone their operation. The third column represents number of nodes they had. And the last column represents the patient’s survival, where 1 represents they survived less than 5 years after operation and 2 suggests that patient survived more than 5 years.</p><p>So, now what to do with this data? 🤔 Using this data set, lets predict the survival expectancy of a new patient. Sounds cool! This is where EDA will come in picture.</p><blockquote>I will not go in detail about how to generate these plot as my aim here is to get familiar with EDA</blockquote><p>First, we will plot all colums vs each other. This is called <a href="https://www.quora.com/What-are-pair-plots"><strong><em>pair plot</em></strong></a><strong><em>. </em></strong>This will help us to get an idea of inter-relation of each columns. The image below shows the pair plot.</p><figure><img alt="Pair plot of all columns of the dataset" src="https://cdn-images-1.medium.com/max/915/1*se7Gcnl0A9Bj_rzteK_xQw.png" /><figcaption>Pair plots for the data set</figcaption></figure><p>So, we got our pair plot! We got all combinations of pair of columns i.e. 3C2 graphs, with blue dots representing life expectancy of less than 5 years and orange dots representing life expectancy of more than 5 years. But, we also got age vs age graph and result is not as expected. These graphs with same x and y axes are <strong><em>probability distribution function(PDF). </em></strong>It simply represents the probability or frequnecy of ocuurence of a particular data point.</p><p>By observing all 9 graphs, we can’t get a clear cut life expectancy. The most accurate conclusion we can draw from the above graphs is from the 9th graph where we can say that patient with nodes from 0 to 6 has the highest survival chance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*nsv7hhSchXdviV_hgvTFrQ.png" /><figcaption>The 9th graph</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/1*wQLALn22Yz_oHGsPOtHjig.png" /></figure><p>Now, lets try to get more information from the dataset. Lets analyse the data through <a href="https://en.wikipedia.org/wiki/Cumulative_distribution_function"><strong><em>cummulative distribution function(CDF)</em></strong></a><strong><em>.👈 </em></strong>this graph here have orange line as CDF and blue line as PDF. From this plot, we can say that <em>for about 60% of cases, patient, who got more life expectancy ,was diagnosed with less than 5 nodes.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/1*0PFw4tYiWBig_US-oPnOtw.png" /></figure><p>This plot ☝ represents CDF for age. From this plot, one can clearly say that <em>with increasing age, life expectancy of patients was less.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/1*bMthgmwPf2suaeX4xV5Jqg.png" /></figure><p>Now, lets analyse the data using <a href="https://towardsdatascience.com/understanding-boxplots-5e2df7bcbd51#targetText=A%20boxplot%20is%20a%20standardized,and%20what%20their%20values%20are."><strong><em>box plot</em></strong></a><strong><em>.</em></strong></p><p>From the box plot below, we are not getting any clear cut conclusion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*WbTzltpukCox9MNFpMBSGg.png" /></figure><p>From <a href="https://en.wikipedia.org/wiki/Violin_plot#targetText=A%20violin%20plot%20is%20a,by%20a%20kernel%20density%20estimator."><strong><em>violin plot</em></strong></a><strong><em>, </em></strong>following obervations are made:</p><ul><li><em>Patients with node value less than 3 have the most probability of more survival.</em></li><li><em>Patient with node value greater than 11 are most probable of having less life expectancy.</em></li></ul><p>Now lets go to some statistics and see, if we could get some more characterstics about the dataset. To do so, lets <em>describe</em> the dataset. On describing the dataset for patients with high suvival rate, we get the following table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*Z1GB32GpDvL-VJJNb1GLrg.png" /><figcaption>Statistics values for patients with more life expectancy</figcaption></figure><p>From the above table, one can conclude that <em>node for 75 percentile of patients with more life expectancy hence lesser nodes patients tends to have higher chance of survival.</em></p><p>Now lets visualize the data using contour plot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/1*_tvVJv0xrreJ-WhE1lZcsA.png" /><figcaption>Contour plot</figcaption></figure><p>From the above contour plot for patients with more life expectancy, we can conclude that patients with node less than 10 and age between 45–52 have the most life expectancy.</p><blockquote>Find all my codes and related plots in this <a href="https://drive.google.com/open?id=1VmxhEkBQwtyvcSsrSJmYH7a6pVzQbv94">link</a></blockquote><p>Now lets conclude this blog! EDA is a very excellent way to characterise the data and get some good idea about inter-relation between its various parameters.</p><p>If you liked my blog please do share with your folks and if you find some error do let me know in comment box.</p><blockquote>Special thanks to <a href="https://medium.com/u/8dd0982a035a">Prakhar Agarwal</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3f4a1b45601" width="1" height="1" alt=""><hr><p><a href="https://medium.com/datascience-step-by-step/exploratory-data-analysis-eda-c3f4a1b45601">Exploratory Data Analysis(EDA)</a> was originally published in <a href="https://medium.com/datascience-step-by-step">Datascience Step-by-Step</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Basics of Statistics]]></title>
            <link>https://medium.com/datascience-step-by-step/basics-of-statistics-19cb2c5b7749?source=rss----c3e53ff82a29---4</link>
            <guid isPermaLink="false">https://medium.com/p/19cb2c5b7749</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[statistical-learning]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[basic-statistics]]></category>
            <dc:creator><![CDATA[Prakhar Agarwal]]></dc:creator>
            <pubDate>Tue, 17 Sep 2019 15:38:02 GMT</pubDate>
            <atom:updated>2019-09-17T17:19:03.610Z</atom:updated>
            <content:encoded><![CDATA[<p>Consider an example of rolling a six sided fair dice. Here fair dice means probability of showing up any of the six face is equal,or to say all outcome are equally likely.Now, try listing down all the outcome of rolling the dice. {1,2,3,4,5,6} is the list of all outcome of this expriment.Now immediate question would be what the heck is experiment here??</p><blockquote>“ In probability theory, an <strong>experiment</strong> or <strong>trial</strong> (see below) is any procedure that can be infinitely repeated and has a well-defined <a href="https://en.wikipedia.org/wiki/Set_(mathematics)">set</a> of possible <a href="https://en.wikipedia.org/wiki/Outcome_(probability)">outcomes</a>, known as the <a href="https://en.wikipedia.org/wiki/Sample_space">sample space</a>.”(source:wikipedia)</blockquote><p>Don’t get into terminology of the defination in detail we still have lot of problem before going on exploring the formal defination. To keep it simply Experiment here is simply rolling up the dice.let’s meet one more “mathmatically complex term” random variable. Unlike the defination of experiment its defination is quite straight-forward. “Random variable is variable that can take any outcome of a random experiment”. In our case the list {1,2,3,4,5,6} denotes the set of values which random variable can take. A random variable is always denoted with a capital letter. Consider another experiment of tossing a coin.List of value which random variable of this experiment can take is {‘H’,’T’}.H denotes head , T denotes tail.</p><p>Now let’s understand one mathmatical elegantly written statment and how to interpret in simple english</p><p>P(X=xi):probability that random variable X will take the value xi.</p><p>Consider an equation:</p><p>P(X=xi)=.9:probaility that random variable X will take the value xi is 90%</p><p>For our above experiment we can this probability equation will shows up like this:</p><p>P(X=1)=1/6:for dice example.</p><p>P(X=’H’)=1/2: for coin example.</p><p>Our knowledge of random variable would be incomplete without knowing its classification.</p><p>Random variable are of two types:</p><p><strong>1.Discrete Random Variable:</strong></p><blockquote>“if random variable can take one value from “finite” number of values it’s called discrete random variable.”</blockquote><p>Both the above cases (dice and coin example ) were the example of discrete random variable because in each case it was possible to write the list from which it can take its value.Now, What if we can’t write all the outcome of the values which random variable can take. This is what that leads to bifurcation of random variable.Hence second class of division handles such cases.</p><p><strong>2.Continous Random Variable:</strong></p><p>Suppose our experiment is to measure the height of a randomly picked student in the class where height of student ranges from let’s say 115 cm to 140 cm.For such experiment it is impossible to list each and every value which random variable can take . so instead of representing the outcome as list we use range between two values like [115140].</p><blockquote>“A <strong>continuous random variable</strong> <em>X</em> takes all values in a given interval of numbers.”</blockquote><p><strong>Probability Mass function:</strong></p><p>It’s defined only for discrete random variable.</p><p><em>Example</em>: Let <em>X</em> represent the sum of two dice.</p><p>Then the probability distribution of <em>X</em> is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*7HmLXNjYVifo2yjtnar_Lw.jpeg" /></figure><p>To graph the probability distribution of a discrete random variable, construct a <strong>probability histogram</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*-2LSEU5cZ-RDd_8uDQ5NtA.jpeg" /></figure><p>it is simply listing the values of random variable in one column and probability of getting that random variable in adjacent cell of adjacent column and for graphical representation take ordered pair (value of random variable, probaility of getting that random variable).</p><p><strong>Probability Density Function:</strong></p><p>Unfortunately this is not as straight-forward as previous concept because it defined for continous random variable. For continous random variable we never talk about the probability value associated with single discrete value of random experiment because probability of getting a single discrete value for experiment with continous random variable is always zero. How you could say that??? we’ll answer this question in two ways . First we’ll convince you intutively then will go on to prove it mathmatically.</p><p>Let’s stick to our previous experiment of randomly picking the student and measuring its height .Suppose we pick the person named adam and found that his height was 142 but on measuring it with much more precise instrument it turns out to be 142.45. Now the question is are we really confident about this measurement.No we ain’t because it will never be possible to exactly determine the height. so instead of determining probability of single value we deterimine it for range of values.It means instead of measuring P(X=xi) we will always determine something like P(x1&lt;X&lt;x2).Also this makes sense because probability of finding the height of person with height let’s say 140.2341 will be so rare that it will be almost equal to 0,same happens with 140.0000.</p><p>P(x1&lt;X&lt;x2) :probaility that random value can take up any value between x1 and x2.</p><p>For experiment with continous random variable we always use range of values so instead of determinig P(X=140) in above experiment we should determine find something like P(140&lt;X&lt;145).</p><p>Now comes the mathmatical proof for why the probability Pr(X=a) is zero in a <a href="http://en.wikipedia.org/wiki/Probability_distribution#Continuous_probability_distribution">continuous distribution</a>:</p><p>Imagine that you have a <a href="http://en.wikipedia.org/wiki/Wheel_of_Fortune_(U.S._game_show)">wheel of fortune</a>. Normally, the wheel is partitioned in several <em>discrete sectors,</em> perhaps 20 or so. If all sectors have the same area, you would have a probability of 1/201/20 to hit one specific sector (e.g. the main price). The sum of all probabilities is 1, because 20⋅1/20=120⋅1/20=1. More general: If there are mm sectors evenly distributed on the wheel, every sectors has a probability of 1/m1/m of being hit (uniform probabilities). But what happens if we decided to partition the wheel into a million sectors. Now the probability of hitting one specific sectors (the main prize), is extremely small: 1/1061/106. Further, note that the pointer can theoretically stop at an infinite number of positions of the wheel. If we wanted to make a separate prize for each possible stopping point, we would have to partition the wheel in an infinite number of “sectors” of equal area (but each of those would have an area of 0). But what probability should we assign to each of these “sectors”? It <em>must be zero</em> because if the probabilities for each “sectors” would be positive and equal, the sum of infinitely many equal positive numbers diverges, which creates a contradiction (the total probability must be 1). That’s why we only can assign a probability to an <em>interval</em>, to a real area on the wheel.</p><p>More technical: In a continuous distribution (e.g. <a href="http://en.wikipedia.org/wiki/Uniform_distribution_(continuous)">continuous uniform</a>, <a href="http://en.wikipedia.org/wiki/Normal_distribution">normal</a>, and <a href="http://en.wikipedia.org/wiki/List_of_probability_distributions#Continuous_distributions">others</a>), the probability is calculated by integration, as an <em>area</em> under the probability density function f(x)f(x) (with a≤ba≤b):</p><p>P(a≤X≤b)=∫baf(x)dxP(a≤X≤b)=∫abf(x)dx</p><p>But the area of an interval of length 0 is 0.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19cb2c5b7749" width="1" height="1" alt=""><hr><p><a href="https://medium.com/datascience-step-by-step/basics-of-statistics-19cb2c5b7749">Basics of Statistics</a> was originally published in <a href="https://medium.com/datascience-step-by-step">Datascience Step-by-Step</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>