<?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 Vivek Menon on Medium]]></title>
        <description><![CDATA[Stories by Vivek Menon on Medium]]></description>
        <link>https://medium.com/@viveksmenon?source=rss-44c795faea95------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*OzV63pFxRqhmoq4MYLnwuA.jpeg</url>
            <title>Stories by Vivek Menon on Medium</title>
            <link>https://medium.com/@viveksmenon?source=rss-44c795faea95------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 20:11:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@viveksmenon/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[Exploring the Reasoning Capabilities of OpenAI’s o1 Models]]></title>
            <link>https://viveksmenon.medium.com/exploring-the-reasoning-capabilities-of-openais-o1-models-7b8f3487075a?source=rss-44c795faea95------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b8f3487075a</guid>
            <category><![CDATA[o1-model]]></category>
            <category><![CDATA[gpt-4]]></category>
            <category><![CDATA[reasoning]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Vivek Menon]]></dc:creator>
            <pubDate>Thu, 02 Jan 2025 11:16:46 GMT</pubDate>
            <atom:updated>2025-01-02T11:16:46.472Z</atom:updated>
            <content:encoded><![CDATA[<p>To ensure the accuracy and reasoning of GPT models, we often use Chain-of-Thought (COT) prompts. This method helps the model break down problems step-by-step and apply intermediate reasoning steps.</p><figure><img alt="Chain-of-Thought Prompting" src="https://cdn-images-1.medium.com/max/940/1*BIS6QWMX44RgtiWPyXVUpw.png" /><figcaption><a href="https://arxiv.org/abs/2201.11903">https://arxiv.org/abs/2201.11903</a></figcaption></figure><p><strong>o1 Series Models</strong></p><p>Recently, OpenAI launched the o1 and o1-mini models, which are equipped with advanced reasoning capabilities. These models are trained with reinforcement learning to handle complex reasoning tasks.</p><p>o1 models excel in scientific reasoning and below are few achievements which vouch for its performance:</p><p>· Ranking in the 89th percentile on competitive programming questions (Codeforces)</p><p>· Placing among the top 500 students in the US in a qualifier for the USA Math Olympiad (AIME)</p><p>· Exceeding human PhD-level accuracy on a benchmark of physics, biology, and chemistry problems (GPQA).</p><p>There are two models launched and are available through APIs.They are</p><p><strong>o1 :</strong> Designed to reason hard problems using broad general knowledge about the world</p><p><strong>o1-mini:</strong> faster and affordable version of o1</p><p><strong>How It works?</strong></p><p>o1 models use “reasoning tokens.” When given a prompt, the model breaks it down and uses multiple approaches to generate a response. The reasoning tokens help the model “think” through the problem. Once the final response (completion tokens) is generated, the reasoning tokens are discarded. However reasoning tokens are considered in context and affect the size of the context window, and they are billed as completion tokens.</p><p>Here’s an example of a multi-step conversation between a user and an assistant to illustrate this process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*WWR6b8WjmLehJNfKdNEBpQ.png" /><figcaption>How reasoning works</figcaption></figure><p><strong>Usage</strong></p><p>The o1 models can generate up to 100,000 output tokens, while the o1-mini models can generate up to 65,000 tokens. These output tokens include both reasoning and completion tokens. When designing prompts and solutions, it’s important to keep these limits in mind.</p><p>The context window, which is the space where the model processes information, has a limit of 200,000 tokens for o1 models and 128,000 tokens for o1-mini models. It’s crucial to leave enough space for reasoning tokens in the context window for the model to work effectively.</p><p>Reasoning tokens are generated based on the complexity of the problem. You can see the details of these tokens in the ‘completion_tokens_details’ section of the chat completion response object. To control the total number of tokens, you can set the ‘max_completion_tokens’ parameter, which was previously known as ‘max_tokens’ in earlier models.</p><p>With these models , prompting has become simpler and direct and the results of model has become more accurate.</p><p><strong>References:</strong></p><p><a href="https://platform.openai.com/docs/guides/reasoning?reasoning-prompt-examples=coding-planning#how-reasoning-works">https://platform.openai.com/docs/guides/reasoning?reasoning-prompt-examples=coding-planning#how-reasoning-works</a></p><p><a href="https://arxiv.org/abs/2201.11903">https://arxiv.org/abs/2201.11903</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b8f3487075a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Hallucination]]></title>
            <link>https://viveksmenon.medium.com/ai-hallucination-8408ca293d46?source=rss-44c795faea95------2</link>
            <guid isPermaLink="false">https://medium.com/p/8408ca293d46</guid>
            <category><![CDATA[ai-hallucination]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[generative]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Vivek Menon]]></dc:creator>
            <pubDate>Mon, 18 Dec 2023 12:16:37 GMT</pubDate>
            <atom:updated>2023-12-18T12:16:37.697Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PR1NDLiFwqvuU90mJdWskQ.jpeg" /></figure><p>What would you do if the AI model you were working with started talking about topics like trade wars, private plane crashes in mountains, global warming, or northern lights when it was supposed to give you a response for business decision making that is in no way related to any of the points discussed above? You might think that the model is hallucinating. I had a similar experience recently while working with LLMs. You may think that model is hallucinating.</p><p>Yes, you are right, this is called AI hallucination. AI hallucination is a phenomenon wherein a large language model (LLM) perceives patterns or objects that are non-existent or imperceptible to human observers, creating outputs that are nonsensical or altogether inaccurate.</p><p>A little research on AI hallucination helped me understand that AI hallucination is not rare, and there have been notable AI hallucinations such as incorrectly claiming that the James Webb Space Telescope had captured the world’s first images of a planet outside our solar system, or Chat AI, Sydney, admitting to falling in love with users and spying on Bing employees, among many others. It is also another critical area that the AI world is trying to fix, as mentioned by people like Sam Altman and Sundar Pichai.</p><p>AI hallucination is not just restricted to NLP, but also to other fields, including computer vision. The most accurate method to find AI hallucination is manually evaluating the output of the AI model. However, this approach is time-consuming and defeats the purpose of an AI model if it takes too much time to test the AI model output for hallucination. There are a few models developed to find AI hallucination, but these models have a lot of scope for improvement.”</p><p>Most AI hallucinations occur due to bias/overfitting of the training data, poor quality prompts, model complexity, or if you fail to explain what you exactly need in output or if you failed to limit the response size. AI hallucinations can be controlled to an extent if the above points are taken care of.</p><p>So, the next time you work on a critical project, please don’t blindly trust the output of an AI model, but please evaluate it manually!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8408ca293d46" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Probability Distribution]]></title>
            <link>https://medium.com/swlh/understanding-probability-distribution-b5c041f5d564?source=rss-44c795faea95------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5c041f5d564</guid>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[probability-distributions]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Vivek Menon]]></dc:creator>
            <pubDate>Fri, 04 Dec 2020 05:09:05 GMT</pubDate>
            <atom:updated>2021-03-16T10:27:22.466Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*IZa3g5dp33HJbQCXmG2jCw.jpeg" /><figcaption>Image by Brett Jordan available at <a href="https://unsplash.com/photos/4aB1nGtD_Sg">Unsplash</a></figcaption></figure><p>What is Probability Distribution? What are different types of Probability distributions? How will it help in framing Data Science Solutions?.</p><p>Let me try to explain it in very simple words</p><p>Definition:-<em>A </em><strong><em>probability distribution</em></strong><em> is the mathematical function that gives the probabilities of occurrence of different possible </em><strong><em>outcomes</em></strong><em> for an experiment.</em></p><p>Rolling a Dice gives me a set of outcomes distributed in a particular way , where as the marks of a particular subject of a class gives me another distribution and occurrence of car accidents in a particular year follows an entirely different distribution and so on. Different Distributions help us to know more about the data and its characteristics. It helps to understand what could be the possible outcome if it follows a particular distribution.</p><p>Probability Distribution is broadly classified into two<strong> Discrete Probability Distributions</strong> and <strong>Continuous Probability Distributions.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*nOMS0KgevT7YfqtfnhgXUg.png" /><figcaption>Probability Distributions</figcaption></figure><p><strong>Discrete Probability Distributions</strong></p><p>When you toss a coin you will have either Heads or Tails .Your outcome is discrete. You cant have any value in between. Here counts of events are discrete functions. Same is the case with rolling a dice. Likelihood of rolling a specific number is discrete. Your output will be 1,2,3,4,5 or 6.Discrete as name suggests has a boundary unlike a continuous one. It can be either one or two when you throw a dice, it won’t be 1.5 or 1.22345.Every possible outcome in discrete probability distribution has a probability for occurrence. Binomial Distribution, Poisson Distribution, Uniform Distribution etc are the examples of Discrete Probability Distributions</p><p><strong>Continuous Probability Distributions.</strong></p><p>In the case of measurement of Height or weight of a class, the values or outcomes we observe wouldn’t be a discrete number. It could be continuous values .A person’s weight could be 48.050 and another could be 46.063.It can be calculated to as many decimals as you need based on the scale of the machine used for measurement. Continuous probability functions are also known as probability density functions. Sum of probabilities in a continuous probability function remains one .However we cannot confirm that each possible value/outcome will have non-zero likelihood. In Continuous probability function we calculate the probability of occurrence between two values or points. Area under curve for a probability plot of continuous probability distribution is one. Normal distribution , Weibull distribution, Log Normal distribution are examples of Continuous probability Distributions</p><p>Now let’s look at Distributions in details</p><p><strong>Uniform Distribution</strong></p><p>A uniform distribution is a distribution where all the outcomes (between maximum value and minimum value)has an equally likely probability. Uniform distribution can be Continuous uniform distribution and Discrete Uniform distribution.</p><p><em>Continuous uniform distribution.</em></p><p>Continuous uniform distribution also called as rectangular distribution describes an experiment where there is an arbitrary outcome that lies between certain bounds, <em>a</em> and <em>b</em>, which are the minimum and maximum values.</p><p>You have entered your apartment and are about to take an elevator to your floor .You call and elevator takes between 0 and 40seconds to reach you after you press the button. This is a classic example of continuous uniform distribution with Minimum value zero and maximum value 40 seconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/266/1*pYBzRFFTwoiG-m2dXl4qrA.png" /><figcaption>Continuous Uniform Distribution function (source: Wikipedia)</figcaption></figure><p>The probability density function of Continuous Uniform Distribution is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/401/1*4bFljur7uBYw6kkhju6O1g.png" /></figure><p>Expected Value of Continuous Uniform Distribution is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/305/1*Ctprr4YroDDHicxxa4bnmg.png" /></figure><p>Variance of Continuous Uniform Distribution is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/319/1*A3XWlMV-H3nqoyKapGuXRg.png" /></figure><p>In the above problem E(X) =1/2*(40) = 20s and V(X) = 1/12*(40)²=400/3</p><p><em>Discrete Uniform distribution.</em></p><p>Discrete uniform distribution is a symmetric probability distribution wherein a finite number of values are equally likely to be observed; every one of <em>n</em> values has equal probability 1/<em>n</em></p><p>Drawing a heart, a club, a diamond or a spade from a pack of card is an example for Discrete Uniform distribution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*p-w0fNqOLUYT1_UtPaDW9A.png" /><figcaption>Discrete Uniform Distribution function (source: Wikipedia)</figcaption></figure><p>The probability density function of Discrete Uniform Distribution is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/319/1*C985F9bf5-LuFgZSWdthZA.png" /></figure><p>Expected Value of Discrete Uniform Distribution is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*ijzdHVOwtHEnIXe2aVm_ZQ.png" /></figure><p>Variance of Discrete Uniform Distribution is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/298/1*VTqQabT7NkGv4lq-sdEdmQ.png" /></figure><p>In the above problem E(X) =(1+6)/2 = 3.5 and</p><p>V(X) = ((6–1+1)²-1)/12=35/12=2.9</p><p><strong>Bernoulli Distribution</strong></p><p>The Bernoulli distribution is the discrete probability distribution of a random variable which takes a binary output: 1 with probability p, and 0 with probability (1-p). Few examples for Bernoulli distribution is , when you toss a coin, you will either get a Heads or Tails, if you associate getting Heads with winning or success and getting Tail with loosing , then it is a Bernoulli distribution. Same with success or failure , Gender male or female, passing or failing in an exam etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*X67j23Q_W-q5hnVGkVEckg.png" /></figure><p>Imagine getting a head while flipping a fair coin is considered as success, then head is equated to 1 and tail is equated to 0 . Probability of getting head is 1/2.Probability of success is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/413/0*mD8klgwqJtjnf0K-.png" /></figure><p>The expected value of a Bernoulli random variable is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/143/1*t6Q1d2Ql42Qi97kKSD1kbA.png" /></figure><p>The Variance of Bernoulli distributed X is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/305/1*xDKqgWk_wXucyOL99_vxIA.png" /></figure><p>Bernoulli distribution is when we do experiment only once, like flipping a coin once or throwing a die once. So what if the experiments are repeated for multiple times? The distribution for that is Binomial Distribution. Bernoulli distribution is a special case of the binomial distribution where a single trial is conducted (so <em>n</em> would be 1 for such a binomial distribution).</p><p><strong>Binomial Distribution</strong></p><p>The binomial distribution is used when there are exactly two mutually exclusive outcomes of a trial, like Heads or Tails while flipping a coin, raining or not raining tomorrow ,winning or losing a match. These outcomes are appropriately labeled as “success” and “failure”. The binomial distribution is used to obtain the probability of observing <em>x</em> successes in <em>N</em> trials, with the probability of success on a single trial denoted by <em>p</em>. The binomial distribution assumes that <em>p</em> is fixed for all trials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*3LVUXkQ6ajmEAn58q92izA.png" /><figcaption>Binomial Distribution(source: Wikipedia)</figcaption></figure><p>The probability of getting exactly <em>x</em> successes in <em>n</em> independent Bernoulli trials is given by the probability mass function:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-_OcC8CT7IkVTe1a3TMnbg.png" /></figure><p>Suppose we are flipping a coin for 6 times, if probability of getting head is considered as success and getting tail as failure .Each trial has a probability of success 1/2 . What will be the probability of getting heads 4 times.</p><p>Each Trial is a Bernoulli and it’s probability of occurrence is p</p><p>Getting 4 heads in flipping coin 6 times is 6c4. Which is equal to 15 and probability of success is 1/64. P(X=4) = 15/64</p><p>If <em>X</em> ~ <em>B</em>(<em>n</em>, <em>p</em>), that is, <em>X</em> is a binomially distributed random variable, n being the total number of experiments and p the probability of each experiment yielding a successful result, then the expected value of <em>X</em> is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/149/1*70B7jaNpeGpfNjLqbYvi9A.png" /></figure><p>The variance of binomial distribution is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/254/1*_CWTm3qM2TXFc2TbdnKaKg.png" /></figure><p><strong>Poisson Distribution</strong></p><p>We now know how binary distribution works. Imagine a case where the number of events is near to infinity or is very very large number and also the probability of event is very very low or near to zero ,like number of emails you receive in a year, number of accident claims that a insurance company receives etc. In above cases you may not have exact ’n’ and ‘p’ value but you know that n is near to infinity and p is near to zero. In such cases we use Poisson distribution. In Poisson distribution we consider the parameter λ.</p><p>A Poisson Process is a model for a series of discrete event where the <em>average time</em> between events is known, but the exact timing of events is random. The arrival of an event is independent of the event before .</p><p>Poisson distribution is the distribution that expresses the probability of a given number of events occurring in a fixed interval of time or space, if these events occur with a known constant mean rate and independently of the time since the last event.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J_4FmaeyxjL-8lxAHdm-Ew.png" /><figcaption>Poisson Distribution(source: Wikipedia)</figcaption></figure><p>When<strong> λ</strong> becomes bigger, the graph looks more like a normal distribution</p><p>A discrete random variable <em>X</em> is said to have a Poisson distribution with parameter <em>λ</em> &gt; 0, if for <em>k</em> = 0, 1, 2, …, the probability mass function of <em>X</em> is given by</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*TF1pHiizQvL_ms4Nr4Uyhw.png" /></figure><p>The Poisson distribution can be applied to systems with a large number of possible events, each of which is rare.</p><p>The positive real number <em>λ</em> is equal to the expected value of <em>X</em> and also to its variance</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/289/1*TjBV4o6Ci0Jbd_E2Gc5gXQ.png" /></figure><p><strong>Normal Distribution</strong></p><p>Normal distribution is most common distribution which we see in our daily life . There are lot of examples around us for this distribution which is other wise called Bell-curve like distribution of heights of students in the calls, blood pressure, measurement error, and IQ scores.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1hQ-tUKgK5ZRXyAhKx5U4g.png" /><figcaption>Normal Distribution(source: Wikipedia)</figcaption></figure><p>The Probability Density function of Normal distribution is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*MdpJglDyqlP1QnVRBw-ndw.png" /></figure><p>The parameter μ is the mean or expectation of the distribution (and also its median and mode), while the parameter σ is its standard deviation. The variance of the distribution is σ^2</p><p>Empirical rule of Normal distribution is that, the 68.27% values lies within one standard deviation ,the 95.45% values lies within two standard deviation and the 99.73% values lies within two standard deviation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*umpCOeMuK-OF1V3xuvbS1A.jpeg" /></figure><p><strong>Gamma Distribution</strong></p><p>What is Gamma Distribution? Where is it used ?Gamma distribution helps to predict the wait time till the ’n’ th event occurs. Gamma distribution has two parameters, alpha<strong>- </strong>which represents the shape , and beta- which represents the <em>scale</em>. Shape Parameter as name suggests define the shape of distribution and scale parameter defines the statistical dispersion . If <em>s</em> is large, then the distribution will be more spread out; if <em>s</em> is small then it will be more concentrated. Few examples of Gamma distribution are amount of rainfall accumulated in a reservoir , size of loan defaults or aggregate insurance claims, load on web servers etc</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iUlrZvp9UoiNrZQrQE0aBQ.png" /><figcaption>Gamma Distribution(source: Wikipedia)</figcaption></figure><p>The Probability Density function of Gamma distribution is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/988/1*ZkZnbb326nTUntFHZcxPTA.png" /></figure><p>The mean of Gamma distribution is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/39/1*tBq1Bgb9xG8OGwi9uuhx8Q.png" /></figure><p>The Variance of Gamma distribution is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/38/1*8FcLuL2LW0_0UuiNc5zX-w.png" /></figure><p><strong>Summary</strong></p><p>I have covered the main distributions which are useful for Data scientists in their analysis and modelling. Please share your thoughts and questions in the comments section. I will be happy to respond to your questions .</p><p>References:-</p><ul><li><a href="https://statisticsbyjim.com/basics/probability-distributions/">Understanding Probability Distributions - Statistics By Jim</a></li><li><a href="https://www.itl.nist.gov/div898/handbook/eda/section3/eda366i.htm">1.3.6.6.18. Binomial Distribution</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5c041f5d564" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/understanding-probability-distribution-b5c041f5d564">Understanding Probability Distribution</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploratory Data Analysis]]></title>
            <link>https://medium.com/analytics-vidhya/exploratory-data-analysis-d464f3adb777?source=rss-44c795faea95------2</link>
            <guid isPermaLink="false">https://medium.com/p/d464f3adb777</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[eda]]></category>
            <category><![CDATA[exploratory-data-analysis]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Vivek Menon]]></dc:creator>
            <pubDate>Thu, 03 Sep 2020 10:02:59 GMT</pubDate>
            <atom:updated>2020-12-04T06:19:47.676Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tZJWGHdmpBHkwLNAlc-7Vg.jpeg" /></figure><p>When we hear about Data science or Analytics , the first thing that comes to our mind is Modelling , Tuning etc. . But one of the most important and primary steps before all of these is Exploratory Data Analysis or EDA.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/415/1*UXF2lg4T8LIs4IJr-uNiEA.png" /><figcaption>Exploratory data analysis (Machine learning process steps)</figcaption></figure><h3><strong>Why EDA</strong></h3><p>In Data Science one of the Major problem Data Scientists/Analysts are facing today is the Data Quality . Since we rely on multiple sources for data , data quality is often compromised.The quality of Data determines the quality of models which we are building on it .As the adage goes,Garbage in , garbage out . The above statement holds very true in the case of Data science.</p><p>We cannot build Empire State Building or Burj Khalifa on a shaky foundation !</p><p>And that explains why 60–80% of time of Data Scientists are being spent on Data gathering and Data preparation.</p><p>When we are working with Data , EDA or Exploratory Data Analysis is the most important step .It is very important to gather as much information and insights from data as we could before processing it . This could be done by EDA. EDA Also help us to analyse the underlying trends and patterns in data and also help us to formulate our problem statement in a better way .</p><p>“ <strong>Well begun is half done”</strong></p><p>Exploratory Data Analysis helps to understand the data better and also it helps to understand what Data speaks.This could be done both by visual analysis as well as with few other analysis.Also EDA helps to distinguish between what to be pursued further and what is not worth following up.</p><p><strong>Exploratory Data Analysis</strong></p><p>Let’s explore steps of Exploratory data analysis using Bank loan Data set</p><p><em>Import the Libraries:</em></p><p>To perform initial analysis , we would need libraries like Numpy, Pandas,Seaborn and Matplotlib. Numpy is an array processing package.Its a library for numerical computations .Pandas is used for data manipulation and analysis. Matplotlib and Seaborn are statistical libraries used for data visualization</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/289/1*rNAdKeeGJ5Ioed6mNNrCkA.png" /></figure><p><em>Import Dataset:</em></p><p>Data is stored in csv file format, hence we are importing it using pd.read_csv</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*0mduOsWEF0Af_UAoydOobQ.png" /></figure><p>Imported data from the file is stored in bankloan_df dataframe</p><p><em>Information of data set:</em></p><p>.info() will display information about the data frames</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/198/1*QlfYjIJFIo7UHMAYWEWjDQ.png" /></figure><p>It shows the column names,number of rows and columns, data types etc.It gives an idea about what type of data it is .It is very important to understand whether a column represents categorical or numerical variable , if categorical we should understand whether its ordinal or nominal .We need to treat each of these data types differently which I will explain in another post.You can use .astype to change the datatype of a column</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*Y6lgtfhW5_bKZJCgnMwhcQ.png" /></figure><p>If need to know only the number of rows and columns .shape can be used</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*dzI4Fh8TxePsclPQI0ozyQ.png" /></figure><p>To see the data type , bankloan_df.dtypes can be used</p><p>To check the null values bankloan_df.isnull().sum() can be used</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/210/1*kiLGNVu4ZPa-3M6UtQofcQ.png" /></figure><p><em>Descriptive Analysis :</em></p><p>.describe() is used for descriptive analysis , it provides details like count, mean, standard deviation, Inter Quartile Range etc.This analysis helps to understand the skewness of data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*HBD4O3nIiELeLlbC5poTjg.png" /></figure><p>In the case of categorical variables,to check the representation of different groups , we use groupby. This is used to analyze whether any group is over represented than other . If such under representation is there for target variable, we need to treat it with certain techniques like SMOTE.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*j1GHepnTc2WGq-KnAvT8Zg.png" /></figure><p><em>Graphical analysis:</em></p><p>Graphs are very important tool to understand the data distribution .We use different graphs for analyzing data. We use it for Univariate, Bi Variate and Multi Variate Analysis. Seaborn is a very good library to explore different graphs. I will explain few very common graphs in the analysis here and will write a post in detail about graphs later.</p><p>Uni variate Analysis — Analysis where we consider only one variable. Few uni variate graphs are Count Plot, Box Plot etc.</p><p>Countplot:-Countplot shows the counts of observations in each category using bars</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*I9Rf_B9np4uv5E1Pe-3Fcw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*ncnZLGenw9lug1LYnkg_qQ.png" /></figure><p>Boxplot:-A box plot (or box-and-whisker plot) shows the distribution of quantitative data.The box shows the quartiles of the dataset while the whiskers extend to show the rest of the distribution, except for points that are determined to be “outliers” using a method that is a function of the inter-quartile range.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NXCM-SzqQ-9wgluJ.png" /></figure><p>To identify outliers also we use boxplots</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*aZU1hgX9vnTq4JmKkHWgNg.png" /></figure><p>Bi Variate Analysis is where relationship between two variables are plotted in the graph and in Multi variate Analysis , relationship between different variables represented using graphs.</p><p>Pairplot is a Bi Variate graph which is used to analyse the relationship between different variables in a dataset. This is very important step for Model building.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*q7T7ZzPw4Bqq1yrloKLH4w.png" /></figure><p><em>Correlation</em></p><p>Correlation is another important step of EDA. While building a model, its important to understand whether any correlation exists between the independent variables and also with independent variable and dependent variable. This also helps in feature selection/elimination.</p><p>Values closer to +1 and -1 are considered as maximum correlated variables.The values in diagonal is the correlation of variable with itself and it will always be +1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*az6b0-YiGUcBN0p0IW1RRw.png" /></figure><p>Correlation graphs can be designed using the below code snippet</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*rFKhFnpL1Wm2EiffzOTPMg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*BZB-wzqX4jV1yuknYcETgA.png" /></figure><p>These are initial few steps of Exploratory data analysis. Based on the findings of each step, one can take appropriate action to improve data quality, analyse the trend or to treat missing variables/Outliers or anomaly appropriately.</p><p>“Information is the oil of the 21st century, and analytics is the combustion engine.” — Peter Sondergaard, Gartner Research</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d464f3adb777" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/exploratory-data-analysis-d464f3adb777">Exploratory Data Analysis</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>
    </channel>
</rss>