<?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 LunaVerse on Medium]]></title>
        <description><![CDATA[Stories by LunaVerse on Medium]]></description>
        <link>https://medium.com/@poornimakatgi751?source=rss-175762aa89ef------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*CTeGnH0K25HeQUA4ghNfJw.jpeg</url>
            <title>Stories by LunaVerse on Medium</title>
            <link>https://medium.com/@poornimakatgi751?source=rss-175762aa89ef------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 23 May 2026 16:03:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@poornimakatgi751/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[When Data Scientist meets Robotics]]></title>
            <link>https://medium.com/@poornimakatgi751/when-data-scientist-meets-robotics-1dd0d5cba3ea?source=rss-175762aa89ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/1dd0d5cba3ea</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[perception]]></category>
            <category><![CDATA[robotics]]></category>
            <dc:creator><![CDATA[LunaVerse]]></dc:creator>
            <pubDate>Mon, 28 Jul 2025 14:11:24 GMT</pubDate>
            <atom:updated>2025-07-28T14:11:24.395Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Golden Intersection</h3><p>Mastering these areas will make you a top-tier candidate.</p><h4>1. Computer Vision (CV)</h4><p>This is the #1 most critical skill for you. Robots need to “see.”</p><p><strong>Why it’s important</strong>: For navigation, object detection, manipulation, and scene understanding.</p><p><strong>Skills to Focus On</strong>:</p><ul><li><strong>Fundamentals</strong>: Image processing with <strong>OpenCV</strong> (filtering, transformations, feature detection like SIFT/ORB).</li></ul><p><strong>Deep Learning for CV</strong>:</p><ul><li><strong>Object Detection</strong>: Using models like YOLO, SSD, or Faster R-CNN to find and classify objects in an image/video feed.</li><li><strong>Image Segmentation</strong>: Classifying every pixel in an image (e.g., to distinguish the road from the sidewalk). Models like U-Net are key.</li><li><strong>3D Perception</strong>: Working with data from stereo cameras or RGB-D sensors (like Intel RealSense) to understand depth and geometry.</li><li><strong>Tools</strong>: <strong>PyTorch</strong> (more popular in research/robotics) or TensorFlow, <strong>OpenCV</strong>.</li></ul><h4>2. Reinforcement Learning (RL)</h4><p>This is how you make robots learn complex tasks on their own.</p><p><strong>Why it’s important</strong>: For tasks that are difficult to program explicitly, like learning to walk, grasp novel objects, or navigate complex terrains.</p><p><strong>Skills to Focus On</strong>:</p><ul><li><strong>Core Concepts</strong>: Understand the Markov Decision Process (MDP), Bellman equations, Value functions, and Policy functions.</li></ul><p><strong>Algorithms</strong>:</p><ul><li><strong>Value-based</strong>: Q-Learning, Deep Q-Networks (DQN).</li><li><strong>Policy-based</strong>: REINFORCE, Actor-Critic methods (A2C, A3C), and state-of-the-art like PPO and SAC.</li><li><strong>Tools</strong>: <strong>Gymnasium (formerly OpenAI Gym)</strong> for environments, Stable Baselines3 for implementations, <strong>MuJoCo</strong> or <strong>PyBullet</strong> for physics simulation.</li></ul><h4>3. State Estimation &amp; Sensor Fusion</h4><p>Robots are loaded with sensors (IMUs, GPS, LiDAR, cameras). Data Science techniques are used to make sense of this noisy, multi-modal data.</p><p><strong>Why it’s important</strong>: To get a reliable estimate of the robot’s state (position, orientation, velocity) from imperfect sensor readings.</p><p><strong>Skills to Focus On</strong>:</p><ul><li><strong>Probabilistic Robotics</strong>: This is the core theory.</li><li><strong>Kalman Filters</strong>: Understand the standard Kalman Filter, Extended Kalman Filter (EKF), and Unscented Kalman Filter (UKF). You should be able to implement a simple one from scratch.</li><li><strong>Particle Filters</strong>: Another powerful technique for non-Gaussian systems.</li><li><strong>Time Series Analysis</strong>: Your sensor data is time-series data. Understanding concepts from this field is a huge plus.</li></ul><h4>4. SLAM (Simultaneous Localization and Mapping)</h4><p>This is the problem of putting a robot in an unknown environment and having it build a map while simultaneously figuring out its location within that map.</p><p><strong>Why it’s important</strong>: The fundamental problem for any truly autonomous mobile robot (drones, self-driving cars, warehouse bots).</p><p><strong>Skills to Focus On</strong>:</p><ul><li>Understand the probabilistic nature of SLAM.</li><li>Know the difference between different approaches (e.g., Filter-based SLAM, Graph-based SLAM).</li><li>Familiarity with visual SLAM (like ORB-SLAM) or LiDAR-based SLAM (like Cartographer).</li></ul><h3>Core Technical Toolkit You MUST Have</h3><p>These are the foundational tools to implement the concepts above.</p><h4>1. Python (Expert Level)</h4><ul><li>You need to be fluent. Your code will run on robots, so it needs to be efficient and clean.</li></ul><h4>2. ROS (Robot Operating System)</h4><ul><li><strong>This is non-negotiable for a robotics role.</strong> ROS is the standard framework for writing robot software. It handles communication between different processes (nodes).</li></ul><p>You must be comfortable with:</p><ul><li>Creating nodes, topics, services, and actions.</li><li>Launching files.</li><li>Visualizing data with RViz.</li><li>Integrating your Python/C++ code into the ROS ecosystem.</li></ul><h4>3. Simulators</h4><ul><li>You can’t always test on a real, expensive robot. Simulators are crucial for development, training RL agents, and safe testing.</li><li><strong>Tools</strong>: <strong>Gazebo</strong> (the standard for ROS), <strong>NVIDIA Isaac Sim</strong> (excellent for realistic rendering and physics), <strong>MuJoCo/PyBullet</strong> (popular for RL research).</li></ul><h4>4. C++</h4><ul><li>While Python is great for high-level logic and ML, high-performance robotics code (like controllers, planners, and perception pipelines) is often written in C++ for speed.</li><li>You don’t need to be a C++ wizard, but you should be comfortable reading it and writing basic to intermediate code.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*m_coKZd6uUB18FVO.jpeg" /></figure><h3>Job Roles to Target</h3><p>Use these keywords to search:</p><ul><li><strong>Perception Engineer</strong></li><li><strong>Robotics Software Engineer (AI/ML)</strong></li><li><strong>Motion Planning Engineer</strong></li><li><strong>Autonomous Systems Engineer</strong></li><li><strong>ML Engineer — Robotics</strong></li><li><strong>Computer Vision Engineer</strong></li></ul><p>Good luck — you’ve chosen a fantastic and future-proof field</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1dd0d5cba3ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Correlation Does Not Imply Causation]]></title>
            <link>https://medium.com/@poornimakatgi751/correlation-does-not-imply-causation-330192e2bb17?source=rss-175762aa89ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/330192e2bb17</guid>
            <category><![CDATA[correlation-vs-causation]]></category>
            <category><![CDATA[quasi-experimental-design]]></category>
            <category><![CDATA[randomized-control-trials]]></category>
            <category><![CDATA[a-b-testing]]></category>
            <category><![CDATA[correlation]]></category>
            <dc:creator><![CDATA[LunaVerse]]></dc:creator>
            <pubDate>Mon, 28 Jul 2025 14:04:45 GMT</pubDate>
            <atom:updated>2025-07-28T14:04:45.678Z</atom:updated>
            <content:encoded><![CDATA[<p>Definitions:</p><p><strong>Correlation:</strong> A statistical measure that describes the <strong>size and direction of a linear relationship</strong> between two or more variables. When one variable changes, the other variable tends to change in a specific direction.</p><ul><li><strong>Positive Correlation:</strong> As variable A increases, variable B tends to increase (e.g., height and weight).</li><li><strong>Negative Correlation:</strong> As variable A increases, variable B tends to decrease (e.g., hours of sleep and feelings of tiredness).</li><li><strong>The Key Word:</strong> “Tends.” Correlation describes a pattern of association, not a rule of consequence.</li></ul><p><strong>Causation (or Causality):</strong> A relationship where a change in one variable is <strong>directly responsible for a change in another variable</strong>. This implies a mechanism and a directional link where one event (the cause) brings about the other (the effect).</p><ul><li><strong>Example:</strong> Pressing the power button on your remote control <em>causes</em> the television to turn on. The link is direct, mechanical, and predictable.</li></ul><h4>Why Correlation is Not Causation: The Three Possibilities</h4><p>When you observe a strong correlation between two variables, A and B, there are three main possibilities, only one of which is direct causation.</p><ol><li><strong>Direct Causation (A causes B, or B causes A):</strong></li></ol><ul><li>This is what we often mistakenly assume. For example, increased study time (A) is likely a direct cause of higher exam scores (B).</li></ul><p><strong>2. Confounding Variable (A third variable, C, causes both A and B):</strong></p><ul><li>This is the most common source of confusion and the most important concept for a data scientist to identify. The hidden “confounder” creates an illusion of a direct relationship.</li><li><strong>Classic Example:</strong> There is a strong positive correlation between ice cream sales (A) and the number of shark attacks (B).</li><li><strong>Fallacy:</strong> Eating ice cream causes shark attacks.</li><li><strong>Reality:</strong> A confounding variable, <strong>hot weather ©</strong>, causes people to both buy more ice cream and swim in the ocean more often, which leads to more shark encounters. A and B are correlated only because they are both effects of C.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/539/1*7j_lTL2OGivk_4SGcfRB0g.png" /></figure><p><strong>3. Coincidence (The relationship is purely due to random chance):</strong></p><ul><li>With vast amounts of data, it’s possible to find variables that are mathematically correlated with no logical connection whatsoever. For instance, the number of films Nicolas Cage appeared in per year might correlate with the number of people who drowned by falling into a pool. This is spurious and meaningless.</li></ul><h3>The Data Scientist’s Role: Playing Detective with Data</h3><p>Imagine you are a detective. You arrive at a scene and see two things: a broken window and a baseball on the floor inside.</p><ul><li><strong>Correlation:</strong> You have observed a <strong>correlation</strong>. The broken window and the baseball are associated in the same time and place.</li><li><strong>Causation:</strong> Your immediate hypothesis is <strong>causation</strong>: the baseball <em>caused</em> the window to break.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/338/1*WQo6vtlJf3HmFucu7UPb7A.png" /></figure><p>The job of a data scientist is to be a good detective: to prove that the baseball really did cause the window to break, and it wasn’t something else. This process of trying to prove cause-and-effect is called <strong>Causal Inference</strong>.</p><p>Identifying correlation is the easy first step <strong>(like df.corr() in Python)</strong>.</p><p>It’s like finding the baseball and the broken window. The real work is proving the cause. Here are the methods data scientists use, from the most reliable (“The Gold Standard”) to the more clever “detective work” methods.</p><h4>Method 1: The Gold Standard — The A/B Test (or Randomized Controlled Trial)</h4><p>This is the most reliable and powerful way to prove causation. It’s like re-creating the crime under controlled conditions.</p><p><strong>The Problem:</strong> Maybe a strong wind broke the window and the baseball was already on the floor. The wind is a “confounding variable” — a hidden cause. How can we be sure it was the baseball?</p><ul><li><strong>The A/B Test Solution:</strong> Let’s design an experiment.</li></ul><ol><li>We get 1,000 identical windows.</li><li>We <strong>randomly</strong> divide them into two groups of 500.</li></ol><ul><li><strong>Group A (Control Group):</strong> We do nothing to these windows.</li><li><strong>Group B (Treatment Group):</strong> We throw a baseball at each of these windows.</li></ul><p>We count how many windows break in each group.</p><ul><li><strong>Why it Works:</strong> By randomizing, we have “neutralized” all other possible causes. The chance of a strong wind, a bird strike, or a manufacturing defect is now <strong>equally likely</strong> for both groups. So, the <em>only meaningful difference</em> between Group A and Group B is that we threw a baseball at Group B.</li><li><strong>The Conclusion:</strong> If significantly more windows break in Group B, we can be extremely confident that <strong>throwing the baseball <em>caused</em> the windows to break.</strong> This is the logic behind every A/B test for a new feature on a website.</li></ul><h4>Method 2: When You Can’t Run an A/B Test (Quasi-Experimental Methods)</h4><p>Sometimes, running an A/B test is impossible, unethical, or too expensive. You can’t randomly assign some people to smoke cigarettes and others not to. You can’t force a new law on only half a city.</p><p>In these cases, you only have <strong>observational data</strong> (data you collected by just watching the world). You have to be a cleverer detective.</p><p>Let’s say we want to know if a new tutoring program (the “treatment”) causes higher test scores. We can’t force kids into it. We just have data on kids who chose to join and those who didn’t.</p><p><strong>Clever Detective Trick #1: Regression with Control Variables</strong></p><p><strong>The Problem:</strong> The kids who joined the tutoring program might already be the most motivated or have parents who are more involved. This “motivation” is a confounding variable. We can’t tell if the program worked or if the kids were already on track to do better.</p><ul><li><strong>The Solution:</strong> We can try to <strong>statistically control</strong> for this. When we build a regression model to predict test scores, we don’t just include joined_program (yes/no). We also add other variables (the “controls”) we think might be confounders, like hours_spent_on_homework, parents_education_level, or previous_gpa.</li><li><strong>The Logic:</strong> By including these variables, the model tries to isolate the effect of the tutoring program <em>while holding the other factors constant</em>. It’s like asking, “For two students with the <em>same</em> motivation and homework habits, what was the effect of one of them joining the program?” It’s not as good as an A/B test, but it’s a way to try and account for obvious confounders.</li></ul><p><strong>Clever Detective Trick #2: Difference-in-Differences (DiD)</strong></p><p><strong>The Problem:</strong> How do we know the scores wouldn’t have gone up anyway? Maybe there was a city-wide trend of improving education.</p><ul><li><strong>The Setup:</strong> Imagine a nearby city, City B, that is very similar to our city, City A, but it did <em>not</em> launch a tutoring program.</li></ul><p><strong>The Solution:</strong></p><ol><li>We measure the average test scores in <strong>both cities</strong> <em>before</em> the program starts in City A.</li><li>We measure the average test scores in <strong>both cities</strong> <em>after</em> the program has been running for a year in City A.</li></ol><p><strong>The Logic:</strong></p><ul><li>The change in scores in City B represents the “natural trend” (what would have happened anyway).</li><li>The change in scores in City A represents the natural trend <em>plus</em> the effect of the tutoring program.</li><li>Therefore, the <strong>“difference in the differences”</strong> between the two cities gives us an estimate of the true causal effect of the program.</li></ul><p>These methods are called<strong> “quasi-experimental” </strong>because they try to mimic a real experiment using clever statistical techniques when a true experiment isn’t possible.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=330192e2bb17" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Statistical tests: z-Test, t-Test, Chi-Squared Test, Correlation test]]></title>
            <link>https://medium.com/@poornimakatgi751/statistical-tests-z-test-t-test-chi-squared-test-correlation-test-c71c16acdd22?source=rss-175762aa89ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/c71c16acdd22</guid>
            <category><![CDATA[z-test]]></category>
            <category><![CDATA[correlation]]></category>
            <category><![CDATA[t-test]]></category>
            <category><![CDATA[chi-square-test]]></category>
            <category><![CDATA[paired-t-test]]></category>
            <dc:creator><![CDATA[LunaVerse]]></dc:creator>
            <pubDate>Fri, 25 Jul 2025 18:00:32 GMT</pubDate>
            <atom:updated>2025-07-25T18:00:32.321Z</atom:updated>
            <content:encoded><![CDATA[<p>This is your practical playbook. To choose the right statistical test, you don’t start with the test name; you start with the business question and identify the number and type of variables involved. This framework maps your data directly to the correct statistical tool.</p><h3>Part 1: Analysis of a Single Feature</h3><p>This is for when you want to compare a property of a single group to a known standard, target, or historical benchmark.</p><h4>Case: The feature is NUMERICAL (e.g., “Average Order Value”)</h4><ul><li><strong>Business Question:</strong> “Our historical average order value (AOV) is $50. After a site-wide redesign, we sampled 100 new orders and found the average was $54. Is this increase statistically significant?”</li><li><strong>The Tests:</strong> One-Sample <strong>t-Test</strong> or One-Sample <strong>z-Test</strong>.</li></ul><p><strong>The Critical Choice: z-Test vs. t-Test</strong></p><p>This is a classic statistics question. The choice depends on one thing: <strong>Do you know the true population standard deviation (σ)?</strong></p><ul><li><strong>Use a z-Test if:</strong> You <strong>know</strong> σ. This is rare. It might happen in a controlled manufacturing process or if you have access to the entire population’s data (which is almost never the case).</li><li><strong>Use a t-Test if:</strong> You <strong>do not know</strong> σ and have to estimate it from your sample (using the sample standard deviation, s). <strong>This is the situation 99% of the time in data science.</strong> The t-test accounts for the extra uncertainty of estimating the spread from a sample.</li><li><strong>Conclusion:</strong> For practical purposes, when you hear “test of a mean,” you should think <strong>t-test</strong>.</li></ul><h4>Case: The feature is CATEGORICAL (e.g., “Clicked Ad: Yes/No”)</h4><ul><li><strong>Test:</strong> <strong>One-Proportion z-Test</strong>.</li><li><strong>Business Question:</strong> “Historically, 10% of users who get a support email click the feedback link. We re-wrote the email, and in a sample of 1000 users, 120 clicked. Is this new 12% click-rate a significant improvement?”</li><li><strong>How it Works:</strong> Compares an observed sample proportion to a known or hypothesized population proportion.</li></ul><h3>Part 2: Analysis of Two Features (Relationships &amp; Comparisons)</h3><p>This is for when you want to understand the relationship between two variables.</p><h4>Case: Both features are CATEGORICAL</h4><ul><li><strong>Test:</strong> <strong>Chi-Squared (χ²) Test</strong>.</li></ul><p><strong>Business Question (Independence):</strong> “Is there a relationship between a user’s country (USA, India, UK) and the subscription plan they choose (Basic, Premium)?”</p><ul><li>This is the <strong>Chi-Squared Test for Independence</strong>. It checks if the variables are associated by comparing observed counts in a contingency table to the counts we’d expect if they were independent. This is fundamental for user segmentation.</li></ul><p><strong>Business Question (Goodness of Fit):</strong> “We expect our support tickets to be distributed 50% for ‘Billing’, 30% for ‘Technical’, and 20% for ‘General’. Our observed counts this week were 110, 50, and 40. Do our observations fit our expectations?”</p><ul><li>This is the <strong>Chi-Squared Goodness of Fit Test</strong>. It compares the observed counts of a single categorical variable against a hypothesized distribution.</li></ul><h4>Case: One feature NUMERICAL, one feature CATEGORICAL</h4><p>This is the heart of A/B testing and group comparisons. The categorical variable defines the groups you want to compare.</p><p><strong>Sub-case: The categorical feature has 2 groups (e.g., Control vs. Variant)</strong></p><ul><li><strong>Test:</strong> <strong>Two-Sample Independent t-Test</strong>.</li><li><strong>Business Question:</strong> “Does our new feature (Variant group) lead to a higher average session time (numerical) compared to the old design (Control group)?”</li><li><strong>Key Interview Topic — Assumptions:</strong> Be ready to discuss the assumptions: (1) Independence of groups, (2) Normality of the numerical data within each group (or large sample size), and (3) Equality of variances. If assumptions fail, mention alternatives like <strong>Welch’s t-test</strong> (for unequal variances) or the non-parametric <strong>Mann-Whitney U test</strong> (if data is not normal).</li></ul><p><strong>Special Sub-case: The two groups are related (e.g., Before vs. After)</strong></p><ul><li><strong>Test:</strong> <strong>Paired t-Test</strong>.</li><li><strong>Business Question:</strong> “We measured the performance of 20 employees, gave them a new tool, and then measured the performance of the <em>same 20 employees</em> again. Did the tool have an effect?”</li><li><strong>Why it’s Different:</strong> This test is more powerful because it controls for individual variation. It analyzes the <em>differences</em> for each pair, not the raw values of the groups.</li></ul><p><strong>Sub-case: The categorical feature has 3 or more groups (e.g., Gold vs. Silver vs. Bronze tier)</strong></p><ul><li><strong>Test:</strong> <strong>ANOVA (Analysis of Variance)</strong>.</li><li><strong>Business Question:</strong> “Do users on our Gold, Silver, or Bronze plans have different average monthly spending?”</li><li><strong>Interview Focus:</strong> Running multiple t-tests inflates the risk of a false positive. ANOVA tests all groups at once. If it’s significant, your job isn’t done. You must perform <strong>post-hoc tests</strong> (e.g., Tukey’s test) to find out <em>which specific pairs</em> of groups are different from each other.</li></ul><h4>Case: Both features are NUMERICAL</h4><ul><li><strong>Test:</strong> <strong>Correlation Test (Pearson)</strong>.</li><li><strong>Business Question:</strong> “Is there a linear relationship between a user’s age and their monthly spending?”</li><li><strong>How it Works:</strong> Calculates the correlation coefficient r to measure the strength and direction of a linear relationship. The test provides a p-value to determine if this relationship is statistically significant.</li></ul><p><strong>Question: The “Choose Your Design” Scenario:</strong> We want to test a new training program. Should we measure 20 people before and after (Design 1), or test 20 people with the training against 20 without (Design 2)?</p><p><strong>Answer:</strong> Design 1 calls for a <strong>paired t-test</strong>, while Design 2 uses a <strong>two-sample independent t-test</strong>. Design 1 is often more statistically powerful because by measuring the same individuals, we control for their baseline abilities, reducing the overall noise in the experiment and making it easier to detect a true effect from the training.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c71c16acdd22" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Module 4: Statistical Inference — Making Judgements from Data]]></title>
            <link>https://medium.com/@poornimakatgi751/module-4-statistical-inference-making-judgements-from-data-2b91367733a8?source=rss-175762aa89ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b91367733a8</guid>
            <category><![CDATA[type-2-error]]></category>
            <category><![CDATA[hypothesis-testing]]></category>
            <category><![CDATA[null-hypotheses]]></category>
            <category><![CDATA[type-1-error]]></category>
            <category><![CDATA[confidence-interval]]></category>
            <dc:creator><![CDATA[LunaVerse]]></dc:creator>
            <pubDate>Fri, 25 Jul 2025 17:06:01 GMT</pubDate>
            <atom:updated>2025-07-25T17:06:01.432Z</atom:updated>
            <content:encoded><![CDATA[<h3>Module 4: Statistical Inference — Making Judgements from Data</h3><p><strong>Topic 4.1: The Framework of Inference: Estimation</strong></p><p>Before we test a specific claim (hypothesis testing), we often want to simply <em>estimate</em> an unknown value from the population.</p><p>Imagine you’re a product manager for a streaming service. The CEO asks a simple question: “What’s the average number of hours our users stream per week?” This true average across all millions of users is the <strong>population parameter</strong>, and it’s unknown.</p><ul><li><strong>Point Estimation:</strong> You take a sample of 1,000 users and calculate their average streaming time. The result is 8.2 hours. This single number, 8.2, is your <strong>point estimate</strong>. It’s your single best guess for the true population average.</li><li><strong>Interval Estimation (Confidence Intervals):</strong> This is a much more powerful and honest approach. Instead of giving one number, you provide a <em>range</em> of plausible values. You might come back and say, “I am 95% confident that the true average weekly streaming time for our users is between 7.9 and 8.5 hours.”</li></ul><p><strong>Question (Confidence Interval Calculation):</strong> A data scientist samples 64 users and finds their average daily time on an app is 30 minutes. The population standard deviation (σ) is known to be 8 minutes. Calculate the 95% confidence interval for the true mean daily time on the app. (The Z-value for 95% confidence is 1.96).</p><p><strong>Solution: Identify knowns:</strong> Sample mean x̄ = 30, population std dev σ = 8, sample size n = 64, Z-value = 1.96.</p><ol><li><strong>Calculate Standard Error (SE):</strong> SE = σ / √n = 8 / √64 = 8 / 8 = 1.</li><li><strong>Calculate Margin of Error (ME):</strong> ME = Z * SE = 1.96 * 1 = 1.96.</li><li><strong>Construct the Interval:</strong> Interval = x̄ ± ME = 30 ± 1.96.</li><li>Lower bound = 30–1.96 = 28.04.</li><li>Upper bound = 30 + 1.96 = 31.96.</li></ol><p>The 95% confidence interval is [28.04, 31.96].</p><p><strong>Interviewer (The “Practical Levers” Question):</strong> We’ve just completed a pilot study for a new feature and the 95% confidence interval for the uplift in user engagement is [-0.5%, +7%]. The marketing team is excited about the 7%, but the finance team is worried about the -0.5%. The VP asks you, ‘This range is too wide to make a launch decision. What can we do to get a narrower confidence interval?’</p><p>Answer: A wide confidence interval indicates a high degree of uncertainty.</p><ol><li><strong>Increase the Sample Size:</strong> The width of the confidence interval is inversely proportional to the square root of the sample size. If we want to cut the interval width in half, we need to quadruple our sample size. I would propose running the study on a larger group of users to get a more stable and precise measurement of the feature’s impact.</li><li><strong>Decrease the Confidence Level:</strong> We could calculate a 90% or 80% confidence interval instead of 95%. This would mathematically produce a narrower range. We’d have a narrower range, but a higher risk (e.g., a 1 in 10 chance instead of 1 in 20) that our interval completely misses the true value. It’s a trade-off between precision and confidence, and for most business decisions, we want to maintain high confidence.</li></ol><p><strong>Topic 4.2: The Framework of Inference: Hypothesis Testing</strong></p><p>This is the formal, scientific process for using sample data to test a claim about a population.</p><p>Imagine you’re a data scientist at a gaming company. The company releases a patch to make a difficult level easier. The goal is to reduce the average completion time from its historical average of 60 seconds. You collect data from a sample of 100 players after the patch and find their new average time is 58 seconds.</p><p>Is the level <em>really</em> easier? Or could this 2-second difference just be random chance from the specific 100 players you happened to observe? Hypothesis testing gives us a framework to decide.</p><p><strong>The Core Logic:</strong> We start by assuming the patch did <em>nothing</em>. This is the <strong>Null Hypothesis (H₀)</strong></p><ul><li><strong>H₀:</strong> The true average completion time is still 60 seconds (μ = 60).</li></ul><p>We then state what we are hoping to prove. This is the <strong>Alternative Hypothesis (H₁)</strong>.</p><ul><li><strong>H₁:</strong> The true average completion time is now less than 60 seconds (μ &lt; 60).</li></ul><p>We then calculate the probability of seeing our result (a sample mean of 58s or even less) <em>if the null hypothesis were true</em>. This probability is the famous <strong>p-value</strong>.</p><ul><li><strong>Significance Level (alpha, α):</strong> Before we even start, we set a threshold of “unlikeliness,” typically 5% (α = 0.05). This is our standard for rejecting the status quo(<strong>H₀)</strong></li></ul><p><strong>The Decision:</strong></p><ul><li>If the p-value is very small (e.g., p=0.01), it means our result was very unlikely to happen by random chance alone. Since it <em>did</em> happen, we doubt our initial assumption. We <strong>reject the Null Hypothesis (H₀)</strong> and conclude that the patch likely had an effect.</li><li>If the p-value is large (e.g., p=0.30), it means our result was quite plausible under the null hypothesis. We <strong>fail to reject the Null Hypothesis (H₀)</strong>. This doesn’t <em>prove</em> the patch did nothing, but it means we don’t have enough evidence to claim it did.</li></ul><p><strong>Type I &amp; Type II Errors (Crucial Interview Topic):</strong> This is about the two ways our conclusion can be wrong.</p><ul><li><strong>Type I Error (α):</strong> A <strong>False Positive</strong>. We reject H₀ when it was actually true. (We conclude the patch worked, but the 2-second difference was just a random fluke). The probability of this error is our significance level, α.</li><li><strong>Type II Error (β):</strong> A <strong>False Negative</strong>. We fail to reject H₀ when it was actually false. (The patch really <em>did</em> work, but our sample size was too small or the effect was too subtle for us to detect it, so we missed it).</li></ul><p><strong>Question:</strong> In the context of a criminal trial, the Null Hypothesis (H₀) is “the defendant is innocent.” What would constitute a Type I Error in this scenario?</p><p>(A) An innocent person is set free.</p><p>(B) A guilty person is set free.</p><p>( C) An innocent person is convicted.</p><p>(D) A guilty person is convicted.</p><p><strong>Solution:</strong></p><ol><li>A Type I error is rejecting a true Null Hypothesis.</li><li>The Null Hypothesis is “the defendant is innocent.”</li><li>Rejecting this hypothesis means declaring the defendant “not innocent,” i.e., guilty.</li><li>Therefore, a Type I error is convicting a defendant who was, in fact, innocent.</li></ol><p>Answer c: An innocent person is convicted. (B is a Type II Error).</p><p><strong>Interviewer (The “p-value for a 5-year-old” Question):</strong> Imagine I’m a business manager with no statistical background. Explain what a p-value is to me. Use a simple analogy.</p><p><strong>Answer:</strong> Let’s imagine we’re testing a new ad campaign. The old ad has a known click rate. We run the new ad and see it gets a higher click rate. The p-value answers one simple question:</p><p><strong>‘If our new ad is actually just as good as the old one (and the higher rate we saw was pure luck), what’s the chance of seeing a result this good or even better?’</strong></p><ul><li>If the p-value is <strong>high</strong>, say 40%, it means there’s a 40% chance the new ad’s performance was just a lucky fluke. That’s too high a chance to bet on, so we’d say we don’t have enough evidence it’s better.</li><li>If the p-value is <strong>very low</strong>, say 1%, it means there’s only a 1% chance we’d see such a good result by luck alone. Because that’s so unlikely, we’d bet that it wasn’t luck — the new ad is genuinely better.</li></ul><p>So, a small p-value means ‘probably not luck,’ and a large p-value means ‘could easily be luck.’”</p><p><strong>Interviewer (The “Error Trade-off” Question):</strong> We’re building a machine learning model to detect fraudulent transactions. In this context, what is a Type I error and what is a Type II error? Which one do you think is more costly for the business, and how might that influence the threshold you set for your model?</p><p><strong>Answer:</strong> Let’s set up the hypothesis:</p><ul><li><strong>Null Hypothesis (H₀):</strong> The transaction is <strong>not fraudulent</strong>.</li><li><strong>Alternative Hypothesis (H₁):</strong> The transaction <strong>is fraudulent</strong>.</li></ul><p>Now let’s define the errors:</p><ul><li><strong>Type I Error (False Positive):</strong> We reject the null hypothesis when it’s true. This means we <strong>flag a legitimate transaction as fraudulent</strong>. The consequence is that we block a valid customer’s payment. This is a very bad customer experience and could cause them to abandon their cart or even stop using our service.</li><li><strong>Type II Error (False Negative):</strong> We fail to reject the null hypothesis when it’s false. This means we <strong>let a fraudulent transaction go through as if it were legitimate</strong>. The consequence is a direct financial loss for the company, as we have to cover the cost of the chargeback.</li></ul><p><strong>Which is more costly?</strong> This is the crucial trade-off.</p><ul><li>In many e-commerce scenarios, the <strong>Type I error (blocking a good customer) is considered more costly</strong>. The lifetime value of a lost customer is often far greater than the value of a single fraudulent transaction. Annoying your customers is a major business risk.</li><li>In other scenarios, like very high-value B2B transactions, the <strong>Type II error (letting fraud through) might be more costly</strong> because a single fraudulent event could be worth millions of dollars.</li></ul><p><strong>How does this influence the model?</strong></p><p>If we decide that Type I errors are more costly, we would set our model’s classification <strong>threshold</strong> to be more conservative. We would only flag a transaction as fraud if the model is <em>extremely</em> confident. This would reduce the number of false positives but would inevitably increase the number of false negatives (Type II errors). It’s a strategic business decision, and as data scientists, our job is to present this trade-off clearly to stakeholders using tools like a precision-recall curve, so they can make an informed choice.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b91367733a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Module 3: The Bridge from Probability to Inference]]></title>
            <link>https://medium.com/@poornimakatgi751/module-3-the-bridge-from-probability-to-inference-a34816fa4c5b?source=rss-175762aa89ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/a34816fa4c5b</guid>
            <category><![CDATA[t-distribution]]></category>
            <category><![CDATA[central-limit-theorem]]></category>
            <category><![CDATA[chi-squared]]></category>
            <category><![CDATA[law-of-large-number]]></category>
            <category><![CDATA[chi-squared-distribution]]></category>
            <dc:creator><![CDATA[LunaVerse]]></dc:creator>
            <pubDate>Fri, 25 Jul 2025 16:05:35 GMT</pubDate>
            <atom:updated>2025-07-25T16:05:35.745Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Topic 3.1: Foundational Theorems</strong></p><ul><li><strong>Law of Large Numbers (LLN):</strong> It formally states what we already suspect: as you collect more and more data points from a random process, the <strong>average of your sample</strong> will get closer and closer to the <strong>true, theoretical average (the expected value)</strong> of the entire population.</li><li><strong>Central Limit Theorem</strong>: It states that if you take sufficiently large random samples from a population — <strong>regardless of the population’s original distribution</strong> (it can be skewed, bimodal, uniform, anything!) — the distribution of the <strong>sample means</strong> will be approximately <strong>Normal (a bell curve)</strong>.</li></ul><p>Question: Which of the following statements is a direct consequence of the Central Limit Theorem?</p><p>(A) The more data you collect, the closer your sample mean will be to the population mean.</p><ul><li>describes the Law of Large Numbers.</li></ul><p>(B) The distribution of a sample of size n=1,000,000 from a right-skewed population will be approximately Normal.</p><ul><li>is incorrect. The sample itself will still reflect the skewed shape of the population.</li></ul><p>© The distribution of the <em>means</em> of many samples of size n=100 drawn from a right-skewed population will be approximately Normal.</p><ul><li>is the correct definition of the Central Limit Theorem. It’s about the distribution of the <em>statistic</em> (the sample mean), not the sample itself.</li></ul><p>(D) The variance of the sample mean decreases as the sample size increases.</p><ul><li>is a true statement related to the sampling distribution, but it’s not the core statement of the CLT.</li></ul><p>Question: The individual weights of a species of fish are known to follow a highly skewed distribution with a population mean (μ) of 5 kg and a population standard deviation (σ) of 2 kg. If we take a random sample of 100 fish, what is the approximate probability that the <em>average weight</em> of the sample is less than 4.8 kg?</p><p>Solution: Even though the original distribution is skewed, the CLT tells us the distribution of the sample mean (x̄) will be approximately Normal because the sample size (n=100) is large.</p><ol><li>The mean of this new sampling distribution is the same as the population mean: μ_x̄ = μ = 5 kg.</li><li>The standard deviation of the sampling distribution (called the Standard Error) is σ_x̄ = σ / √n = 2 / √100 = 2 / 10 = 0.2 kg.</li><li>Now we have a standard Normal distribution problem. We need to find P(x̄ &lt; 4.8).</li><li>Convert 4.8 to a Z-score: Z = (x̄ — μ_x̄) / σ_x̄ = (4.8–5) / 0.2 = -0.2 / 0.2 = -1.0.</li><li>We need to find P(Z &lt; -1.0). From a standard normal table, this value is approximately 0.1587.</li></ol><p>The approximate probability is 15.87%.</p><p><strong>Topic 3.2: Sampling Distribution</strong></p><p>Imagine you’re a data scientist at a fintech company, and you want to know the average monthly spending of your entire user base (the population). It’s impossible to ask everyone. So, you take a sample of 1,000 users and find their average spending is $450. But what if you had, by chance, picked a different sample of 1,000 users? Their average might have been $445. A third sample might yield $458.</p><p>A <strong>sampling distribution</strong> is the theoretical probability distribution of a statistic (like the sample mean) that would result from drawing all possible samples of a given size from a population. The histogram of all these possible sample means is the <strong>sampling distribution of the mean</strong>.</p><ul><li>Thanks to the CLT, we know this distribution is approximately Normal.</li></ul><p><strong>Key Sampling Distributions</strong></p><p><strong>t-Distribution:</strong> The realistic cousin of the Normal distribution. We use it when we test hypotheses about a mean but we have a <strong>small sample size</strong> (typically n &lt; 30) AND/OR we <strong>do not know the true population standard deviation (σ)</strong>. The t-distribution looks like a Normal distribution but has “fatter tails.” This accounts for the extra uncertainty we have because we’re estimating the population’s spread from a small sample.</p><ul><li>The ‘fatter tails’ mean that the t-distribution acknowledges a higher probability of extreme values occurring, which is a direct result of the extra uncertainty we have from a small sample.</li></ul><p><strong>Chi-squared (χ²) Distribution:</strong> This distribution is not for testing means. It’s the workhorse for tests involving <strong>categorical data</strong> or <strong>population variance</strong>. It answers questions like: “Is the distribution of new sign-ups across different marketing channels (Google, Facebook, Direct) what we expected?” (Goodness of Fit test) or “Is there a relationship between a user’s country and the product tier they choose?” (Test for Independence).</p><p><strong>Question:</strong> A data analyst takes a sample of 25 students to estimate their average daily screen time. The population standard deviation is unknown. To calculate a confidence interval for the population mean screen time, which distribution should be used as the basis for the critical value?</p><p>(A) Standard Normal (Z) distribution</p><p>(B) t-distribution</p><p>© Chi-squared (χ²) distribution</p><p>(D) Binomial distribution</p><p><strong>Solution:</strong> The two key phrases are “sample of 25” (which is small, n &lt; 30) and “population standard deviation is unknown.” These are the classic conditions that require the use of the <strong>t-distribution</strong> instead of the Z-distribution. Chi-squared is for categorical data/variance, and Binomial is for counts of successes.</p><p><strong>Question:</strong> A company expects its customer support tickets to be distributed evenly across four categories: A, B, C, D. In a given week, they receive 100 tickets, with the following observed counts: A=30, B=25, C=25, D=20. Calculate the Chi-squared (χ²) test statistic for this data.</p><p><strong>Solution:</strong></p><ol><li><strong>Expected Counts:</strong> With 100 tickets and 4 even categories, the expected count for each is E = 100 / 4 = 25.</li></ol><p><strong>Chi-squared Formula: χ² = Σ [(Observed — Expected)² / Expected]</strong></p><ol><li><strong>Calculate for each category:</strong></li></ol><ul><li>A: (30–25)² / 25 = ⁵² / 25 = 25 / 25 = 1.0</li><li>B: (25–25)² / 25 = ⁰² / 25 = 0</li><li>C: (25–25)² / 25 = ⁰² / 25 = 0</li><li>D: (20–25)² / 25 = (-5)² / 25 = 25 / 25 = 1.0</li></ul><p><strong>Sum them up:</strong> χ² = 1.0 + 0 + 0 + 1.0 = 2.0</p><p>The Chi-squared test statistic is 2.0</p><p>Interviewer: We just launched a new app feature and collected two types of data:</p><ol><li>The average session duration for users who engaged with the feature.</li><li>A count of users categorized by their final action: ‘Used feature and churned,’ ‘Used feature and retained,’ ‘Ignored feature and churned,’ ‘Ignored feature and retained.’</li></ol><p>We want to test for statistical significance in both cases. Which sampling distribution — t-distribution or Chi-squared — would you use for each analysis, and why?</p><p><strong>Answer:</strong></p><ul><li>For the <strong>average session duration</strong>, I would use a framework based on the <strong>t-distribution</strong>. My goal is to compare the mean session duration of two groups (e.g., users with the feature vs. users without). Since this involves testing a hypothesis about a mean and I’d be working with sample data where the true population standard deviation is unknown, a two-sample t-test, which relies on the t-distribution, is the appropriate tool.</li><li>For the <strong>count of users by action category</strong>, I would use the <strong>Chi-squared distribution</strong>. Here, the data is categorical, not a mean value. The question I’m trying to answer is whether there is a statistically significant association between using the feature and the outcome of churning. <strong>A Chi-squared test for independence</strong> is designed precisely for this: to compare observed frequencies in a contingency table (like the one described) to the frequencies we would expect if there were no relationship between the two variables. The resulting test statistic follows a Chi-squared distribution.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a34816fa4c5b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Module 2: Random Variables & Their Distributions (Part 2)]]></title>
            <link>https://medium.com/@poornimakatgi751/module-2-random-variables-their-distributions-part-2-e43e5d6d05f9?source=rss-175762aa89ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/e43e5d6d05f9</guid>
            <category><![CDATA[correlation]]></category>
            <category><![CDATA[covariance]]></category>
            <category><![CDATA[normal-distribution]]></category>
            <category><![CDATA[exponential-distribution]]></category>
            <dc:creator><![CDATA[LunaVerse]]></dc:creator>
            <pubDate>Thu, 24 Jul 2025 16:09:40 GMT</pubDate>
            <atom:updated>2025-07-24T16:11:07.303Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Topic 2.3: Continuous Random Variables and Distributions</strong></p><p>If discrete distributions are about counting, continuous distributions are about measuring essential for modeling real-world phenomena like time, money etc.</p><p><strong>Probability Density Function (PDF):</strong> Unlike a PMF, the value of the PDF at a specific point f(x) is not a probability. It represents a density. To get the probability, you must find the area under the curve of the PDF over some interval. This leads to the most important and often confusing rule for continuous RVs: P(X=x) = 0.</p><ul><li>The probability of a user streaming for <em>exactly</em> 2.00000… hours is zero, because there are infinite possible values. We can only talk about the probability of them streaming <em>between</em>, say, 1.9 and 2.1 hours.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/0*RBhEoe73sl90JjeY.png" /></figure><p><strong>Cumulative Distribution Function(CDF):</strong> The CDF is again F(x) = P(X ≤ x). For a continuous variable, it’s the total area under the PDF from the beginning up to the point x. It’s a smooth, non decreasing curve from 0 to 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*1fXenTAQr5G6o06V5sWFDQ.png" /></figure><p>Key Distributions:</p><p><strong>Uniform (Continuous): </strong>The “Complete Uncertainty” model. Any value within a range [a, b] is equally likely.</p><p><strong>Exponential:</strong> The “Time Until-Next-Event” specialist. This is the continuous cousin of the Poison distribution. If events arrive at a constant average rate(Poisson), the waiting time between those events follows an Exponential distribution. It is “memoryless”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/153/1*2eSnOofri4aDBMi4dyYJfA.png" /></figure><ul><li>Continuous and Right-skewed</li><li>Let T be the waiting time. The CDF of an Exponential distribution is F(t) = P(T ≤ t) = 1 — e^(-λt).</li><li>a single parameter (lambda, λ) representing the rate, a mean of 1/λ, and a variance of 1/λ²</li><li>Memoryless property: The probability of an event happening in the future is not influenced by how long it has already been since the last event. For example, if a light bulb is still working after 1000 hours, the probability it will fail in the next hour is the same as the probability of it failing in the first hour.</li><li>The Poisson distribution models the number of events in a fixed interval, while the exponential distribution models the time between those events.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*VtkaNh_ivoCM7VDP.png" /></figure><p><strong>Normal (Gaussian):</strong> symmetrical, bell-shaped curve. mean=mode=median — located at the center of the distribution making it unimodal distribution(only one peak).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/404/1*yKRNGeTQu189RnHl7exMjg.png" /></figure><ul><li>The distribution is also asymptotic, meaning its tails approach the x-axis but never touch it</li><li>The standard deviation (σ) measures the spread of the data around the mean. The empirical rule (also known as the 68–95–99.7 rule)</li><li>A normal distribution has a central tendency; the mean represents the most likely value, and values deviate from it with decreasing probability.</li><li>It models the distribution of sample means due to the Central Limit Theorem.</li><li>This theorem focuses on the distribution of sample means. It says that if you take many samples of the same size from a population, calculate the mean of each sample, and then plot those sample means, the resulting distribution will be approximately normal.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*e9htdmR_Ti30laz-.png" /></figure><p><strong>Standard Normal (Z-distribution):</strong> The “Universal Translator”. It’s a special Normal distribution with μ=0 and σ=1. We use it to standardize any normal variable into a “Z-score”, allowing us to compare different scales.</p><p>Z-score formula: <strong>Z = (X — μ) / σ</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/0*qmZ533OwxaOFEq1S" /></figure><p>Question: (Exponential): Customer support calls arrive at a call center according to a Poisson process with an average rate of 10 calls per hour. What is the probability that the waiting time until the next call is more than 15 minutes.</p><p>Solution: The waiting time between events in a Poisson process follows an Exponential distribution.</p><ol><li>First, align the units. The rate λ is 10 calls/hour. The question is in minutes. λ = 10 calls / 60 minutes = 1/6 calls per minute.</li><li>Let T be the waiting time. The CDF of an Exponential distribution is F(t) = P(T ≤ t) = <strong>1 — e^(-λt).</strong></li><li>The question asks for P(T &gt; 15). This is the complement of P(T ≤ 15).</li><li>P(T &gt; 15) = 1 — P(T ≤ 15) = 1 — [1 — e^(-(1/6) * 15)] = e^(-15/6) = e^(-2.5).</li><li>e⁻²·⁵ ≈ 0.082.</li></ol><p>There is approximately an 8.2% chance that the wait for the next call will be longer than 15 minutes.</p><p>Question: (Normal) The daily data processing time for a job on a server is normally distributed with a mean(μ) of 120 minutes and a standard deviation (σ) of 15 minutes. What is the probability that a job will take between 90 and 135 minutes?</p><p>Solution: We need to convert the values 90 and 135 into standard Z-scores.</p><ol><li>Z-score formula: <strong>Z = (X — μ) / σ</strong></li><li>Z₁ (for X=90): Z₁ = (90–120) / 15 = -30 / 15 = -2.0.</li><li>Z₂ (for X=135): Z₂ = (135–120) / 15 = 15 / 15 = 1.0.</li><li>The question is now P(-2.0 ≤ Z ≤ 1.0).</li><li>This is calculated as P(Z ≤ 1.0) — P(Z ≤ -2.0). Using a standard normal table or calculator:</li></ol><ul><li>P(Z ≤ 1.0) ≈ 0.8413</li><li>P(Z ≤ -2.0) ≈ 0.0228</li></ul><p>P(-2.0 ≤ Z ≤ 1.0) = 0.8413–0.0228 = 0.8185.</p><p>There is an 81.85% probability that the job will complete between 90 and 135 minutes.</p><p>Interviewer: “Why is Normal so Famous?”</p><p>Answer: Reason is <strong>Central Limit Theorem</strong>. The theorem states that if you take sufficiently large random samples from <em>any</em> population, regardless of its original shape, the distribution of the <em>sample means</em> will be approximately normal.</p><p>This is incredibly powerful. It means even if our raw user spending data is skewed, we can still use techniques like t-tests, which rely on normality, to analyze the <em>average</em> spending of different user groups. It’s the distribution of the <em>statistic</em> (like the mean), not necessarily the raw data, that makes the Normal distribution so ubiquitous in inference.</p><p><strong>Topic 2.4: Properties of Random Variables</strong></p><p>let’s use two random variables from an e-commerce context:</p><ul><li>X: The number of items a customer buys in a month (a discrete RV).</li><li>Y: The total amount of time (in minutes) they spend on the website in a month (a continuous RV).</li></ul><p><strong>Expectation (Mean, E[X]):</strong> This is the long-run average value of the random variable if we were to repeat the experiment an infinite number of times. It’s the “center of mass” of the distribution. It answers the question, “What value do we expect on average?”</p><ul><li><em>Example:</em> If E[X] = 3.2, it means that over thousands of customers, the average number of items purchased per customer per month is 3.2. Note that no single customer can buy 3.2 items, but the average can be a non-integer.</li></ul><p><strong>Variance (Var(X) or σ²):</strong> This measures the <em>spread</em> or <em>dispersion</em> of the distribution around its mean. A low variance means most values are clustered tightly around the average. A high variance means the values are very spread out. The standard deviation (σ) is the square root of the variance, bringing the units back to the original scale (e.g., items, not items²).</p><ul><li><em>Example:</em> If two customer segments both have an E[X] = 3.2, but Segment A has a Var(X) = 1 and Segment B has a Var(X) = 20, it tells us Segment A is very predictable (most buy 2–4 items), while Segment B is unpredictable (some buy 0, some buy 20). This is crucial for inventory management.</li></ul><p><strong>Covariance (Cov(X, Y)):</strong> This measures the <em>joint variability</em> of two random variables. It tells us the direction of the linear relationship.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/322/0*taPx8-WyQR32pjYK" /></figure><ul><li>Positive Covariance: When X tends to be above its mean, Y also tends to be above its mean (e.g., as items purchased goes up, time on site goes up).</li><li>Negative Covariance: When X tends to be above its mean, Y tends to be below its mean.</li><li>Zero Covariance: No linear relationship.</li><li>The problem with covariance is that its value (e.g., 250.7) is hard to interpret. Is that a strong or weak relationship? This leads us to…</li></ul><p><strong>Correlation (Corr(X, Y) or ρ):</strong> This is the <strong>normalized</strong> version of covariance. It scales the value to be between -1 and +1, making it universally interpretable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*cN_JwIe69W04ywcd.jpg" /></figure><ul><li>+1: Perfect positive linear relationship.</li><li>1: Perfect negative linear relationship.</li><li>0: No linear relationship.</li><li>By dividing the covariance by the product of the standard deviations, it normalizes the metric.</li><li><em>Example:</em> If Corr(X, Y) = 0.8, it signifies a strong positive linear relationship. This is a very useful feature for a recommendation engine — people who buy more also tend to browse more, so we can target them with more recommendations.</li></ul><p>Question: <strong>(Expectation &amp; Variance):</strong> A discrete random variable X has the following probability distribution: P(X=0) = 0.2, P(X=1) = 0.5, P(X=2) = 0.3. Calculate the Expectation E[X] and the Variance Var(X). Solution:</p><ol><li><strong>Expectation E[X]:</strong> E[X] = Σ [x * P(X=x)]</li></ol><p>E[X] = (0 * 0.2) + (1 * 0.5) + (2 * 0.3) = 0 + 0.5 + 0.6 = 1.1</p><ol><li><strong>Variance Var(X):</strong> Var(X) = E[X²] — (E[X])²</li></ol><p>First find E[X²]: E[X²] = Σ [x² * P(X=x)]</p><p>E[X²] = (⁰² * 0.2) + (¹² * 0.5) + (²² * 0.3) = 0 + (1 * 0.5) + (4 * 0.3) = 0.5 + 1.2 = 1.7</p><p>Var(X) = 1.7 — (1.1)² = 1.7–1.21 = 0.49</p><p>Question: <strong>(Correlation):</strong> Given two random variables X and Y. The variance of X is 16, the variance of Y is 25, and the covariance between X and Y is -10. What is the correlation coefficient ρ(X, Y)?</p><p>Solution: formula for correlation: ρ(X, Y) = Cov(X, Y) / (σ_X * σ_Y)</p><p>The standard deviations are:</p><ul><li>σ_X = √Var(X) = √16 = 4</li><li>σ_Y = √Var(Y) = √25 = 5</li></ul><p>ρ(X, Y) = -10 / (4 * 5) = -10 / 20 = -0.5</p><p>The correlation coefficient is -0.5</p><p>Interviewer: <strong>(“Feature Selection” )</strong> We are building a machine learning model to predict house prices. You find two features, number_of_bathrooms and square_footage, that have a very high correlation, say 0.9. How does this finding impact how you would treat these features before feeding them into a model like Linear Regression?</p><p>Answer: A correlation of 0.9 indicates strong <strong>multicollinearity</strong>. This is a problem for models like Linear Regression because it becomes difficult for the model to disentangle the individual effect of each feature on the house price. The model coefficients can become unstable and have high standard errors, making them hard to interpret.</p><p>I would not include both highly correlated features in the model. I would choose one of them based on a few criteria:</p><ul><li><strong>Correlation with Target:</strong> I’d keep the feature that has a slightly higher correlation with the target variable, price.</li><li><strong>Completeness:</strong> I’d check which feature has fewer missing values.</li><li>Alternatively, I could use a dimensionality reduction technique like <strong>Principal Component Analysis (PCA)</strong> to combine the information from both features into a new, single component. For tree-based models like Random Forest or Gradient Boosting, multicollinearity is less of an issue for predictive accuracy, but removing one feature can still make the model simpler and faster to train.</li><li><strong>Business Sense:</strong> Which feature is more fundamental? Square_footage is likely more a direct driver of price than number_of_bathrooms.</li></ul><p>Interviewer: (<strong>“Correlation vs. Covariance”)</strong> Why do data scientists almost always report correlation but rarely report covariance? If covariance tells you the direction of a relationship, isn’t that useful enough?</p><p><strong>Answer: </strong>While covariance does tell us the direction of the relationship — positive or negative — its magnitude is not standardized, making it almost impossible to interpret or compare. It provides a universal, unitless measure of the <em>strength</em> of the linear relationship, bounded between -1 and +1. This makes it easy to say ‘a correlation of 0.8 is stronger than 0.4’, a comparison you simply can’t make with raw covariance values.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e43e5d6d05f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Module 2: Random Variables & Their Distributions (Part 1)]]></title>
            <link>https://medium.com/@poornimakatgi751/module-2-random-variables-their-distributions-part-1-b68e98066dc4?source=rss-175762aa89ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/b68e98066dc4</guid>
            <category><![CDATA[binomial-distribution]]></category>
            <category><![CDATA[poisson-distribution]]></category>
            <category><![CDATA[bernoulli-distribution]]></category>
            <category><![CDATA[uniform-distribution]]></category>
            <category><![CDATA[random-variable]]></category>
            <dc:creator><![CDATA[LunaVerse]]></dc:creator>
            <pubDate>Thu, 24 Jul 2025 15:47:46 GMT</pubDate>
            <atom:updated>2025-07-24T15:48:06.085Z</atom:updated>
            <content:encoded><![CDATA[<p>We learn to model uncertainty itself using mathematical functions, which is the core of statistical modeling.</p><p><strong>Topic 2.1: Introduction to Random Variables (RVs)</strong></p><p>A Random variable is not a traditional variable like x=5. It’s a process or a function that maps the outcomes of a random event to a numeric value. We use the power of mathematics on phenomena that are inherently uncertain.</p><ul><li><strong>Discrete Random Variable: </strong>The variable can only take on a countable number of distinct values. Example- Count of students in class. X = {0,1,2, ..}.</li><li><strong>Continuous Random Variable: </strong>The variable can take on any value within a given range. Example- Height of Students in class. Y = {150, 150.5, .. 170}</li></ul><p>Question: From the following list, identify which can be modeled by a discrete random variable and which by a continuous random variable:</p><ol><li>The number of detective items in a shipment of 50. — Discrete</li><li>The weight of a grain of rice. — Continuous</li><li>The number of cars that pass through an intersection in an hour — Discrete</li><li>The exact temperature of a data center’s server room. — Continuous</li><li>The stock price of a company. — Continuous</li></ol><p>Question: An experiment consists of flipping a fair coin twice. Let the random variable Z be the number of Heads observed. What are the possible numerical values of Z, and what is the probability P(Z=1)?</p><p>Solution: Sample space S = {HH, HT, TH, TT}</p><p>The Random variable Z maps these outcomes to numbers:</p><p>HH → Z =2, HT→ Z=1, TH → Z=1, TT→ Z=0</p><p>Possible values of Z are {0,1,2}.</p><p>Therefore, P(Z=1) = 2/4 = 0.5</p><p>Interviewer: In our user database, we have a column called did_churn which is either TRUE or FALSE. Why do we need to go through the trouble of defining a ‘random variable’ for this? Why can’t we just work with the TRUE/FALSE labels directly? What practical advantage does defining it as a random variable give us?</p><p>Answer: By defining a random variable, say X, where X=1 if the user churned and X=0 if they didn’t, we translate a categorical outcome into a number. This translation is what unlocks the entire toolkit of statistics and mathematics.</p><p><strong>Topic 2.2: Discrete Random Variables and Distributions</strong></p><p>Let’s take an example, a user is shown 3 different pop-up ads. Let x be the discrete random variable representing the number of ads they click. The possible values for X are {0,1,2,3}.</p><p><strong>Probability Mass Function (PMF): </strong>This function gives you the probability of the RV being equal to a specific value. It’s the height of the bar in a bar chart for that value. We write it as P(X = k).</p><ul><li>PMF tells us that :</li><li>P(X = 0) = 0.5 (50% chance they click no ads)</li><li>P(X = 1) = 0.3 (30% chance they click exactly one)</li><li>P(X = 2) = 0.15 (15% chance they click exactly two)</li><li>P(X = 3) = 0.05 (50% chance they click all three)</li></ul><p>Note — The sum of all PMF values must be 1.</p><p><strong>Cumulative Distribution Function (CDF):</strong> This function gives you the probability of the RV being less than or equal to a specific value. It “accumulates” probability as you go. We write it as F(k) = P(X≤ k).</p><ul><li>Using PMF above :</li><li>F(0) = P(X ≤ 0) = P(X=0) = 0.5</li><li>F(1) = P(X ≤ 1) = P(X=0) + P(X=1) = 0.5 + 0.3 = 0.8</li><li>F(2) = P(X ≤ 2) = P(X=0) + P(X=1) + P(X=2) = 0.8 + 0.15 = 0.95</li><li>F(3) = P(X ≤ 3) = P(X=0) + P(X=1) + P(X=2) + P(X=3) = 0.95 + 0.05 = 1</li></ul><p>The CDF is always non-decreasing and goes from 0 to 1. It looks like a staircase for discrete variables.</p><p><strong>Key Distributions</strong></p><p><strong>Bernoulli: </strong>The “Yes/No” specialist. Models a single trial with two outcomes. It’s the fundamental building block.</p><ul><li>Two outcomes — Probability of success -”p” and failure -”1-p”.</li><li>The mean (expected value) of a Bernoulli distribution is equal to ‘p’. The variance is p(1-p).</li><li>Foundation for binomial distribution</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/369/1*zlmat55xJnj4Wb5M_nuxUQ.png" /></figure><p><strong>Binomial: </strong>The “Success Counter in N trials” . Models the number of successes in a fixed number of “<strong>independent”</strong> Bernoulli trials.</p><ul><li>Each trial results in either success or failure.</li><li><strong>Constant Probability of Success:</strong> The probability of success (p) remains the same for every trial.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/1*9QhGvac9BDMh56cx7dOeEA.png" /></figure><ul><li>p is the probability of success in a single trial</li><li>(1-p) is the probability of failure</li><li>n is the number of trials</li><li>k is the number of successes</li></ul><p><strong>Poisson: </strong>The “Event Rate Modeler”. Models the number of events occurring in a fixed interval of time or space, when you know the average rate. (e.g., number of customers arriving at a store per hour.)</p><ul><li>assumption — mean is equal to variance.</li><li>The Poisson distribution has only one parameter, λ (lambda), which is the mean number of events.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/169/1*aa2pL4XPKHCFk4OAsaYmfA.png" /></figure><ul><li>where</li><li>x = 0,1,2,3….</li><li>λ = mean number of occurrences in the interval</li><li>e = Euler’s constant = 2.71828</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*DPLlZdluyGmtLbYr-dPq8Q.png" /></figure><p><strong>Uniform (Discrete): </strong>The “Fairness” model. Every outcome is equally likely (e.g., rolling a fair die). Also known as rectangular distribution. (PDF is a horizontal line within the range, indicating equal probability for all values).</p><ul><li>Can be either discrete or continuous.</li><li><strong>PDF:</strong> f(x) = 1 / (b — a)</li><li><strong>Cumulative Distribution Function (CDF):</strong> F(x) = (x — a) / (b — a) for a ≤ x ≤ b</li><li>A uniform distribution has no central tendency; every value within the range is equally probable.</li></ul><p>Question: (BInomial) A company runs an A/B test on a new “Buy now” button. Historically, the old button has a click-through rate of 10%. They show the new button to 20 users. Assuming the new button has the same 10% effectiveness, what is the probability that exactly 3 users click it?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*F4wfFlkOq8sQ5O0t4Ad7YQ.png" /></figure><p>Solution: It’s a binomial problem because we have a fixed number of trails (n=20) and we are counting successes (clicks).</p><p>n=20, p=0.10(probability of success), k =3(number of successes we want).</p><ul><li>P(X=k) = nCk * p^k * (1-p)^(n-k)</li><li>P(X=3) = ²⁰C₃ * (0.1)³ * (0.9)¹⁷</li><li>²⁰C₃ = (20 * 19 * 18) / (3 * 2 * 1) = 1140</li><li>P(X=3) = 1140 * 0.001 * 0.16677… ≈ 0.1901</li></ul><p>There is approximately a 19.01% chance that exactly 3 users click the new button.</p><p>Question: (Poisson) A data center’s support desk receives requests at an average rate of 4 requests per hour. What is the probability that they will receive zero requests in the next hour?</p><p>Solution: It’s Poisson problem because we are modeling the number of events in a fixed interval (1 hour) given an average rate.</p><p>λ (lambda) = 4 requests/hour. We want to find the probability of k=0 events.</p><ul><li>Poisson PMF formula: P(X=k) = (λ^k * e^-λ) / k!</li><li>P(X=0) = (⁴⁰ * e⁻⁴) / 0!</li><li>P(X=0) = (1 * e⁻⁴) / 1 = e⁻⁴ ≈ 0.0183</li></ul><p>There is approximately a 1.83% chance of receiving no support requests in the next hour.</p><p>Interviewer: (Choose your model) Which discrete distribution would you choose as a starting point?</p><ol><li>The number of users out of a batch of 500 who will unsubscribe after receiving a promotional email.</li></ol><ul><li>Binomial distribution — because it models the number of successes(unsubscribes) in a fixed number of trials (500 users).</li></ul><p>b. Whether a single, high-value transaction is fraudulent or not.</p><ul><li>Bernoulli distribution because it’s a single event with only two possible outcomes: fraudulent or non-fraudulent.</li></ul><p>c. The number of typos a content writer makes per article</p><ul><li>Poisson distribution because it’s designed to model the count of events(typos) occurring within a fixed interval or space (in this case, one article)</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b68e98066dc4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Module 1: The foundations — Describing Data and Basic probability]]></title>
            <link>https://medium.com/@poornimakatgi751/module-1-the-foundations-describing-data-and-basic-probability-6e5b1e507195?source=rss-175762aa89ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e5b1e507195</guid>
            <category><![CDATA[bayes-theorem]]></category>
            <category><![CDATA[probability]]></category>
            <category><![CDATA[measure-of-dispersion]]></category>
            <category><![CDATA[kurtosis-and-skewness]]></category>
            <dc:creator><![CDATA[LunaVerse]]></dc:creator>
            <pubDate>Thu, 24 Jul 2025 15:36:57 GMT</pubDate>
            <atom:updated>2025-07-24T15:36:57.409Z</atom:updated>
            <content:encoded><![CDATA[<h3>Module 1: The foundations — Describing Data and Basic probability</h3><p><strong>Topic 1.1: Counting (Permutations and Combinations)</strong></p><p>Counting is about figuring out how many different ways you can select or arrange them.</p><p><strong>Permutation</strong>: An <strong>arrangements</strong> of items where order matters.</p><ul><li><em>Example:</em> You have three friends: Alice (A), Bob (B), and Charles ©. How many ways can they finish 1st and 2nd in a race? The pairs could be (A, B), (B, A), (A, C), (C, A), (B, C), (C, B). Notice that (A, B) is different from (B, A) because the order of finishing matters.</li><li><em>Formula:</em> The number of permutations of selecting k items from a set of n is P(n, k) = n! / (n-k)!</li></ul><p><strong>Combination:</strong> A <strong>selection</strong> of items from set where order does NOT matter.</p><ul><li><em>Example:</em> From the same three friends (A, B, C), how many ways can you choose a team of two to go on a trip? The team could be {A, B}, {A, C}, or {B, C}. The team {A, B} is the same as {B, A}. We just care about <em>who</em> is on the team, not the order they were picked in.</li><li><em>Formula:</em> The number of combinations of selecting k items from a set of n is C(n, k) = n! / (k! * (n-k)!)</li></ul><p><strong>Question:</strong> A data science team is being formed from a group of 6 Python programmers and 4 R programmers. The team must consist of 5 members. What is the number of ways the team can be formed if it must have at least 3 Python programmers?</p><p><strong>Solution: </strong>Combination problem — since order of selecting team members doesn’t matter.</p><ul><li><strong>Scenario 1: </strong>3 Python programmers and 2 R programmers</li><li>Ways to choose 3 Python from 6: C(6, 3) = 6! / (3! * 3!) = (6<em>5</em>4)/(3<em>2</em>1) = 20</li><li>Ways to choose 2 R from 4: C(4, 2) = 4! / (2! * 2!) = (4*3)/2 = 6</li><li>Total ways for Scenario 1 = 20 * 6 = 120</li><li><strong>Scenario 2: </strong>4 Python programmers and 1 R programmer</li><li>Ways to choose 4 Python from 6: C(6, 4) = 6! / (4! * 2!) = (6*5)/2 = 15</li><li>Ways to choose 1 R from 4: C(4, 1) = 4! / (1! * 3!) = 4</li><li>Total ways for Scenario 2 = 15 * 4 = 60</li><li><strong>Scenario 3: </strong>5 Python programmers and 0 R programmers</li><li>Ways to choose 5 Python from 6: C(6, 5) = 6! / (5! * 1!) = 6</li><li>Ways to choose 0 R from 4: C(4, 0) = 1</li><li>Total ways for Scenario 3 = 6 * 1 = 6</li></ul><p>Since these are “OR” scenarios (the team can be formed in any of these ways), we add the totals:</p><p>Total ways = 120 + 60 + 6 = <strong>186 ways</strong>.</p><p><strong>Topic 1.2: Descriptive Statistics</strong></p><p>We describe data using two main types of measures:</p><p>A) <strong>Measures of Central Tendency</strong> (Where is the “center” of my data?)</p><ul><li><strong>Mean (Average):</strong> The sum of all values divided by the number of values.</li><li><em>Best for:</em> Symmetrical data (like a normal distribution) with no extreme values.</li><li><em>Vulnerability:</em> Highly sensitive to <strong>outliers.</strong></li><li><strong>Median:</strong> The middle value when the data is sorted. If there’s an even number of values, it’s the average of the two middle ones.</li><li><em>Best for:</em> <strong>Skewed data</strong> or data with significant outliers.</li><li><em>Robustness:</em> It is not affected by outliers.</li><li><strong>Mode:</strong> The value that appears most frequently.</li><li><em>Best for:</em> Categorical data or discrete data. A dataset can have one mode (unimodal), two modes (bimodal), or more (multimodal).</li></ul><p>B) <strong>Measures of Dispersion/Spread</strong> (How spread out is my data?)</p><ul><li><strong>Variance (σ²):</strong> The average of the squared differences from the Mean.</li><li><em>Why squared?</em> To prevent positive and negative differences from canceling each other out.</li><li><strong>Standard Deviation (σ):</strong> The square root of the variance.</li><li><em>Benefit:</em> It brings the measure of spread back to the original units of the data.</li><li><em>Interpretation:</em></li><li>A low standard deviation means the data points are clustered close to the mean.</li><li>A high standard deviation means they are spread out over a wider range.</li></ul><p>C) <strong>Measures of Shape (</strong>What is the “shape” of my data’s distribution?)</p><ul><li><strong>Skewness:</strong> Measures the asymmetry of the distribution.</li></ul><ol><li><strong>Zero Skew:</strong> Perfectly symmetrical (like a Normal Distribution). Mean = Median = Mode.</li><li><strong>Positive Skew (Right-skewed):</strong> The “tail” of the distribution is longer on the right. In this case, <strong>Mean &gt; Median &gt; Mode</strong>. Think of income distribution — most people earn an average amount, but a few billionaires pull the mean way up.</li><li><strong>Negative Skew (Left-skewed):</strong> The “tail” is longer on the left, caused by a few unusually low values. Here, <strong>Mean &lt; Median&lt; Mode</strong>. Think of age at retirement — most people retire around 60–70, but a few retire very early, pulling the mean down.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/0*_pRlp1fOAWeEdDl2" /></figure><ul><li><strong>Kurtosis:</strong> Measures the “tailedness” or “flattenedness” of the distribution. It tells you how much of the data is in the tails versus the center. It’s often compared to a normal distribution.</li></ul><ol><li><strong>Leptokurtic (Positive Kurtosis &gt; 0):</strong> “Thicker” or “heavier” tails and a sharper peak. This means there are more outliers than you’d expect in a normal distribution. Think of stock market returns, which have more extreme up/down days than a normal distribution would predict.</li><li><strong>Mesokurtic (Kurtosis ≈ 0 or 3):</strong> Similar tailedness to a <strong>normal distribution</strong>. (Note: Some software reports “excess kurtosis” which is Kurtosis — 3, so a normal distribution has 0 excess kurtosis).</li><li><strong>Platykurtic (Negative Kurtosis &lt; 0):</strong> “Thinner” tails and a flatter peak. Fewer outliers than a normal distribution.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/0*0DlyLQ2HVrW6ss7l.jpg" /></figure><p>D) Outliers</p><ul><li>An outlier is a data point that differs significantly from other observations. It can be caused by measurement error or it can be a genuine, novel data point.</li><li>Identifying them is crucial because they can skew your mean, inflate your variance, and violate assumptions of many machine learning models.</li><li>A common rule of thumb is to identify outliers as points that fall below Q1–1.5<em>IQR or above Q3 + 1.5</em>IQR (where IQR is the Inter-Quartile Range, Q3 — Q1).</li></ul><p><strong>Question:</strong> Consider the following dataset representing the daily processing time (in minutes) for a batch job: [10, 12, 15, 15, 17, 19, 20, 21, 24, 90]. Calculate the Mean, Median, and describe the skewness of the data based on these values.</p><p>Solution: Data points = 10 • Mean = Sum / n = 243 / 10 = <strong>24.3 minutes</strong> • Median = (5th +6th value)/2 = (17 + 19) / 2 = 36 / 2 = <strong>18 minutes</strong></p><p>Skewness: We see that Mean(24.3) &gt; Median(18) = positively skewed(Right)</p><p><strong>Interviewer:</strong> “You’ve calculated the mean and median for a dataset of customer purchase values. The mean is $150 and the median is $75. What does this tell you about your customers, and which metric would you report to your business stakeholders? Why?”</p><p>Answer: Here Mean(150) is significantly higher than the Median(75) tells that the data is positively skewed.</p><p>I would report <strong>both</strong>, but I would emphasize the <strong>median</strong> as the primary metric for the ‘typical’ customer experience.</p><p><em>Our typical customer spends about $75 per transaction. This median value gives us the most accurate picture of the central customer. However, it’s also important to note that our average purchase is $150. This higher average is driven by a smaller group of high-spending customers. This presents us with two distinct opportunities: first, how do we cater to and grow our core $75-customer base? And second, who are these high-value customers, and how can we find and retain more of them?</em></p><p><strong>Topic 1.3: Core Probability Theory</strong></p><ul><li><strong>Sample Space: </strong>The set of all possible actions</li><li><strong>Event:</strong> A subset of the sample space. A= user adds to cart. B= user makes a purchase.</li><li><strong>Independent vs. Mutually Exclusive:</strong></li><li><strong>Mutually Exclusive:</strong> The two events that cannot happen at the same time. If A happens, B cannot. P(A and B) = 0.</li><li><strong>Independent:</strong> The outcome of one event gives you no information about the outcome of another. P(A and B) = P(A)*P(B).</li><li><strong>Joint Probability P(A and B):</strong> The probability of both events happening. What is the probability a user adds_to_cart AND makes_a_purchase?</li><li><strong>Marginal Probability P(A): </strong>The probability of a single event, irrespective of others. What is the overall a user adds_to_cart?</li><li><strong>Conditional Probability P(A|B):</strong> The probability of event A happening given that event B has already occurred. “Given a user added_to_cart, what is now the probability they will make_a_purchase?” This P(Purchase | Add to Cart) is much higher than the general P(Purchase).</li></ul><p><strong>Question:</strong> An analytics company surveyed 1000 users. It found that 200 of them clicked on a promotional ad. Out of these 200, 80 made a purchase. From the 800 users who did not click the ad, 40 made a purchase. Let C be the event a user clicks the ad, and P be the event a user makes a purchase. Calculate P(P|C).</p><p>Solution: P(P|C) = P(P and C)/P(C)</p><p>P(P and C) = 80/1000 =0.08 = is the (joint) probability a user both clicked AND purchased.</p><p>P(C) = 200/1000=0.2 = is the marginal probability a user clicked the ad.</p><p>P(P|C) = 0.08/0.2 = 0.4</p><p>There is 40% probability that a user will make a purchase, given they have clicked the promotional ad.</p><p><strong>Interviewer:</strong> Explain the difference between independent and mutually exclusive events. Can two events with non-zero probabilities be both?</p><p>Answer: Mutually exclusive events cannot occur at the same time. P(A and B)=0. Independent events are ones where the outcome of one has no bearing on the outcome of the other. P(A and B) = P(A)*P(B).</p><p>Two events with nonzero probabilities cannot be both mutually exclusive and independent. Since, P(A) and P(B) are non-zero, their product would be non-zero, which is a contradiction. Therefore, they cannot be both.</p><p><strong>Topic 1.4: The Cornerstone Theorem: Bayes Theorem</strong></p><p>At its core, Bayes Theorem is about <strong>updating your beliefs in light of new evidence</strong>. Imagine you are working on a medical diagnostic tool.</p><p>Event A: A patient has a specific rare disease.</p><p>Event B: The patient tests positive on a new diagnostic test.</p><p>Bayes theorem helps us answer : If a patient tests positive, what is the probability they actually have the disease? i.e., what is P(Disease | Positive test)?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/282/1*6GeiE1M3ZJj0XfQxuvkH0A.png" /></figure><ol><li><strong>The Prior P(A) or P(Disease): </strong>What is our belief before we see the test result? Since the disease is rare, this probability is low. Let’s say 1 in 10,000 people have it, so P(Disease) = 0.0001. This is our initial, or “prior” belief.</li><li><strong>The Likelihood P(B|A) or P(Positive test | Disease):</strong> How good is our test at detecting the disease when it’s actually there? This is the test’s sensitivity. Let’s say it’s a good test and correctly identifies the disease 99% of the time. So, P(Positive test | Disease) = 0.99.</li><li><strong>The Evidence P(B) or P(Positive test):</strong> What is the overall probability of any person (sick or healthy) testing positive? A person can test positive in two ways: a) they have the disease and test positive(a true positive), OR b) they don’t have the disease but still test positive (a false positive).</li></ol><p>Bayes theorem lets us combine these pieces to find our <strong>Posterior</strong> belief — the updated probability P(Disease | Positive test).</p><p><strong>Question: </strong>A company screens job applicants for a specific skill using a coding test. 60% of applicants who have the skill pass the test. 10% of applicants who do not have the skill also pass the test (they guess correctly). It is known that 20% of the total applicant pool has the skill. What is the probability that an applicant who passed the test actually has the skill?</p><p>Solution:</p><p>S: The applicant has the Skill</p><p>P: The applicant Passed the test</p><p>We need to find P(S | P).</p><p>P(P | S) = 0.6 (Likelihood: probability of passing given they have the skill)</p><p>P(P | S’) = 0.1 (Probability of passing given they do not have the skill)</p><p>P(S) = 0.2 (Prior: probability that any random applicant has the skill)</p><p>P(S’) = 1-P(S) = 0.8</p><p><strong>State Bayes’ Formula:</strong> P(S | P) = [P(P | S) * P(S)] / P(P)</p><p>we use the Law of Total Probability:</p><p>(the total probability of passing) <strong>P(P) = P(P | S)P(S) + P(P | S’)P(S’)</strong></p><p>P(P) = (0.6 * 0.2) + (0.1 * 0.8)</p><p>P(P) = 0.12 + 0.08</p><p>P(P) = 0.2</p><p>Substitute all values into Bayes Formula:</p><p>P(S | P) = (0.6*0.2)/0.2</p><p>P(S | P) = 0.12/0.2</p><p>P(S | P) = 0.6</p><p>The probability that an applicant who passed the test actually has the skill is 60%.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e5b1e507195" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Ultimate Probability & Statistics Study Plan (GATE DA + Interviews)]]></title>
            <link>https://medium.com/@poornimakatgi751/the-ultimate-probability-statistics-study-plan-gate-da-interviews-51b34b798d10?source=rss-175762aa89ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/51b34b798d10</guid>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[probability]]></category>
            <dc:creator><![CDATA[LunaVerse]]></dc:creator>
            <pubDate>Mon, 21 Jul 2025 13:16:02 GMT</pubDate>
            <atom:updated>2025-07-21T13:16:02.015Z</atom:updated>
            <content:encoded><![CDATA[<p>This plan is structured in a bottom-up approach, starting with the fundamentals and moving towards application and inference.</p><h3>Module 1: The Foundations — Describing Data &amp; Basic Probability</h3><p>This module covers the absolute basics. You can’t do anything else without mastering these concepts.</p><ol><li><strong>Counting (Combinatorics):</strong></li></ol><ul><li>Permutations</li><li>Combinations</li><li><strong>Why it’s first:</strong> These are the building blocks for calculating the size of sample spaces in classical probability.</li></ul><p><strong>2. Descriptive Statistics:</strong></p><ul><li>Measures of Central Tendency: <strong>Mean, Median, Mode</strong> (Understand the difference and when to use each, e.g., median for skewed data).</li><li>Measures of Dispersion/Spread: <strong>Variance, Standard Deviation, Range</strong>.</li><li><strong>Why here:</strong> Before we even talk about probability, it’s essential to know how to summarize a set of data. This is the “D” in EDA (Exploratory Data Analysis).</li></ul><p><strong>3. Core Probability Theory:</strong></p><ul><li>Sample Space &amp; Events</li><li>Axioms of Probability</li><li>Independent vs. Mutually Exclusive Events (A classic interview question is to explain the difference).</li><li>Joint, Marginal, and Conditional Probability.</li></ul><p><strong>4. The Cornerstone Theorem: Bayes’ Theorem</strong></p><ul><li>Derivation and formula.</li><li><strong>Interview Focus:</strong> Be prepared to explain it with a real-world example (e.g., medical diagnosis, spam filtering). Understand the terms: Prior, Likelihood, Posterior.</li></ul><h3>Module 2: Random Variables &amp; Their Distributions</h3><p>This is the heart of probability theory, where we model uncertainty using mathematical functions.</p><ol><li><strong>Introduction to Random Variables (RVs):</strong></li></ol><ul><li>What is a Random Variable?</li><li>Discrete RVs vs. Continuous RVs.</li></ul><p><strong>2. Discrete Random Variables &amp; Distributions:</strong></p><ul><li><strong>Probability Mass Function (PMF):</strong> The defining function for discrete RVs.</li><li><strong>Cumulative Distribution Function (CDF):</strong> Introduce it here! It’s a universal concept for all RVs.</li><li><strong>Key Distributions:</strong></li><li><strong>Bernoulli:</strong> The single coin flip.</li><li><strong>Binomial:</strong> The sum of n independent Bernoulli trials.</li><li><strong>Poisson:</strong> Modeling counts of events in a fixed interval (Note: <strong>Poisson is a discrete distribution</strong>, not continuous as sometimes mistakenly grouped).</li><li><strong>Uniform (Discrete):</strong> e.g., a single die roll.</li></ul><p><strong>3. Continuous Random Variables &amp; Distributions:</strong></p><ul><li><strong>Probability Density Function (PDF):</strong> The defining function for continuous RVs. Emphasize that P(X=x) = 0.</li><li><strong>Cumulative Distribution Function (CDF):</strong> Revisit and apply to continuous cases.</li><li><strong>Key Distributions:</strong></li><li><strong>Uniform (Continuous):</strong> Equal probability over a range.</li><li><strong>Exponential:</strong> “Time until next event” in a Poisson process.</li><li><strong>Normal (Gaussian):</strong> The most important distribution in all of statistics.</li><li><strong>Standard Normal:</strong> The Z-distribution (μ=0, σ=1).</li></ul><p><strong>4. Properties of Random Variables:</strong></p><ul><li><strong>Expectation (Mean) and Variance</strong> of RVs.</li><li><strong>Conditional Expectation and Variance.</strong> (This fits more logically here than with basic descriptive stats).</li><li><strong>Covariance and Correlation:</strong> Quantifying the relationship between two random variables. A crucial topic for feature selection in ML.</li></ul><h3>Module 3: The Bridge from Probability to Inference</h3><p>These are the powerful ideas that allow us to use sample data to make claims about an entire population.</p><ol><li><strong>Foundational Theorems:</strong></li></ol><ul><li><strong>Law of Large Numbers (LLN):</strong> (<em>Interview Addition</em>) Why sample means converge to the true population mean.</li><li><strong>Central Limit Theorem (CLT):</strong> The single most important theorem for inference. Understand what it says and, crucially, <strong>what its assumptions are</strong>. It’s why the Normal distribution is so ubiquitous.</li></ul><p><strong>2. Sampling Distributions:</strong></p><ul><li>The concept of a sampling distribution (the distribution of a statistic, like the sample mean).</li><li><strong>t-Distribution:</strong> When to use it (small sample size, unknown population variance).</li><li><strong>Chi-squared Distribution:</strong> Used for tests involving categorical data or variance.</li></ul><h3>Module 4: Statistical Inference — Making Judgements from Data</h3><p>This is where everything comes together for practical application. This is a huge area for interviews.</p><ol><li><strong>The Framework of Inference:</strong></li></ol><ul><li><strong>Estimation:</strong></li><li>Point Estimation (e.g., sample mean).</li><li>Interval Estimation: <strong>Confidence Intervals</strong>. Be able to interpret a CI correctly (e.g., “We are 95% confident that this interval contains the true population mean”).</li><li><strong>Hypothesis Testing:</strong></li><li>The core logic: Null Hypothesis (H₀) vs. Alternative Hypothesis (H₁).</li><li><strong>Type I &amp; Type II Errors:</strong> (<em>Crucial Interview Topic</em>) False positives and false negatives.</li><li><strong>p-value:</strong> The most famous (and misunderstood) concept. Be able to explain it to a non-technical person.</li><li>Significance Level (alpha, α).</li></ul><p><strong>2. Specific Statistical Tests:</strong></p><ul><li><strong>z-Test:</strong> (for means, when population variance is known or sample is large).</li><li><strong>t-Test:</strong> (one-sample, two-sample independent, paired). <strong>Interview Focus:</strong> Know the assumptions for each test!</li><li><strong>Chi-squared Test:</strong> (Goodness of fit, Test for independence).</li></ul><h3>Module 5: Interview-Focused &amp; Advanced Topics</h3><p>These topics solidify your understanding and directly map to common data science job responsibilities.</p><ol><li><strong>Maximum Likelihood Estimation (MLE):</strong> (<em>Crucial Addition</em>)</li></ol><ul><li><strong>What it is:</strong> The principle behind finding the parameters for many ML models (like Logistic Regression). Understand the intuition: “What parameters for my chosen distribution make my observed data most probable?”</li></ul><ol><li><strong>A/B Testing:</strong> (<em>The #1 Applied Stats Interview Topic</em>)</li></ol><ul><li>This is simply a practical application of a two-sample hypothesis test.</li><li>Be ready to discuss the entire process: choosing a metric, setting up the experiment, determining sample size, and interpreting results.</li></ul><p><strong>2. Correlation vs. Causation:</strong></p><ul><li>A fundamental conceptual check. Always be prepared to discuss this.</li></ul><p><strong>3. (Bonus) Resampling Methods:</strong></p><ul><li><strong>Bootstrapping:</strong> A powerful simulation-based method to estimate confidence intervals or the standard error of a statistic, especially when the theoretical distribution is unknown. Very practical.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51b34b798d10" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Artificial Neural Network]]></title>
            <link>https://medium.com/@poornimakatgi751/artificial-neural-network-56e6bf6cc2e5?source=rss-175762aa89ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/56e6bf6cc2e5</guid>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[artificial-neural-network]]></category>
            <category><![CDATA[intro-to-deep-learning]]></category>
            <dc:creator><![CDATA[LunaVerse]]></dc:creator>
            <pubDate>Sun, 24 Oct 2021 09:32:53 GMT</pubDate>
            <atom:updated>2021-10-24T09:32:53.082Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>One of the most influential technologies of the past decade is the artificial neural network. The fundamental piece of deep learning algorithms is the application we see every day, such as virtual assistants, image recognition(face ID for phone lock), amazon’s Alexa ai powered assistant, diagnosing health issues, and fraud detection. There are many things computers can do better than humans but our incredible brains are still a step ahead. That brings us to the simplified definition of artificial neural networks. Artificial neural networks are computational models inspired by the biological neural networks that constitute the brain allowing machines to learn to do tasks by considering examples.</p><h3><strong>Why Artificial Neural Networks?</strong></h3><p>Earlier conventional computers follow an algorithmic approach that is the computational system following a set of instructions in order to solve a particular problem. Unless the algorithm series that the computer needs to follow are known, the computer cannot solve a problem. So basically, first we need a person who knows the answer to the problem to set specific tasks for a computer to follow. This restricts the problem-solving capability of conventional computers to problems that we already understand and know how to solve.</p><p>What if we have no clue how to solve the problem, making the traditional approach a failure.</p><p>It was at that time, under the umbrella of artificial intelligence, artificial neural networks were introduced.</p><h3><strong>What are artificial neural networks(ANNs)?</strong></h3><p>ANNs are computational models that follow operations similar to that of neurons of the human brain to analyze and process the problem.</p><p>In trying to mimic the human brain the computer is able to learn, reason, predict and take decisions just like humans. ANNs gather knowledge by detecting the patterns and relationships between the sets of data and learning from their experience without task-specific programming. The more the data is trained, the more accuracy you get from the model.</p><h3><strong>The architecture of an artificial neural network</strong></h3><p>ANNs are nothing more than a network of artificial neurons. Here is a simple network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/411/1*YLWs8wHnAV5gbyhsWyT3rQ.png" /><figcaption>Structure of Artificial Neural Network model</figcaption></figure><p>A neural network has many layers and the complexity of the model increases, as the number of layers gradually increases.</p><p>The purest form of neural network has three layers -</p><ul><li>Input layer</li><li>Hidden layer</li><li>Output layer</li></ul><p>A single artificial neuron is called a perceptron and when thousands of perceptrons are connected forming a network that has many hidden layers, it is called a multilayer perceptron.</p><p>At first, the input layers receive the input signals and transfer them to the hidden layers to process data, and interconnection between these two layers assign weights to each input randomly at the initial point. Then bias is added to each input neuron and after this, the weighted sum which is a combination of weights and bias is passed through the activation function. The activation function basically provides a threshold value. Neutrons above that value get fired. Thus, the function has the responsibility of which node to fire, and finally, the output is calculated. So the artificial neural network constitutes the composition of so many perceptrons, connected in different ways and operating on different activating functions. This whole process is known as Foreward Propagation.</p><p>In the case of multilayer perceptron, a common deep learning algorithm for supervised training is known as Backward Propagation. After getting the output model when compared with the original output, the error is known. Finally, to reduce the error the weights need to be updated in backward propagation and this process continues for a certain number of epochs. Finally, model weights get updated and prediction is done.</p><h3><strong>Training ANN model</strong></h3><p>To train the ANN model, it needs to flood with a huge amount of data provided as the training set. For example, if you want the system to recognize an image of a dog then we have to provide thousands of images as inputs in order to train it.</p><p>Artificial neural networks assign values to the weights of the connection between neurons. ANN model to get 100% accuracy has to adjust weights to the right numbers. In the example, that mentioned above when provided with more training examples, the neural network propagates back and adjusts its weights to map each input to the correct outputs. In the process, each layer detects specific features in the images. Finally, the adjusted weights of the neurons will be able to determine the image with accuracy. After ANN training, the data may produce output even with incomplete information. Thus making the network work intelligently.</p><h3><strong>Advantages of ANN</strong></h3><ul><li>Storing information: Information is stored on the entire network, not on a database. The disappearance of a few elements of information does not prevent the network from functioning.</li><li>Fault tolerance: The corruption of one or more cells of ANN does not prevent it from generating output. This feature makes the networks fault-tolerant.</li><li>Gradual corruption: A network slows over time and undergoes relative degradation. The network problem does not immediately corrode immediately.</li><li>Parallel processing capability: Artificial neural networks have numerical strength that can perform more than one job at the same time.</li></ul><h3><strong>Limitations of ANN</strong></h3><ul><li>Amount of data: neural networks need thousands and millions of examples.</li><li>Neural networks lack generalizing: a neural network can only do the task it is trained for. Even if there’s a similar problem neural networks will not perform well.</li><li>Neural networks are BlackBox: though neural networks are able to do human-like decisions it’s very hard to find the factors(logics) that determined the decision.</li></ul><h3><strong>Applications of neural networks:</strong></h3><ul><li>Image recognition</li><li>Fraud detection</li><li>Forecasting</li><li>Stock market prediction</li><li>Healthcare</li><li>Handwriting analysis</li><li>Credit rating</li><li>Social media</li><li>Defense</li></ul><h3><strong>Conclusion</strong></h3><p>The article gives a simplified and complete description of artificial neural networks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=56e6bf6cc2e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>