<?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 Shubhi Phartiyal on Medium]]></title>
        <description><![CDATA[Stories by Shubhi Phartiyal on Medium]]></description>
        <link>https://medium.com/@shubhiphartiyal?source=rss-2e0fb53d0b2b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*8MIWzygb1QG0Xp9h</url>
            <title>Stories by Shubhi Phartiyal on Medium</title>
            <link>https://medium.com/@shubhiphartiyal?source=rss-2e0fb53d0b2b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 07:40:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shubhiphartiyal/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[What Lead, Crime, and Pasta Sales Taught Me About Being a Better Data Analyst]]></title>
            <link>https://medium.com/@shubhiphartiyal/what-lead-crime-and-pasta-sales-taught-me-about-being-a-better-data-analyst-02a664bb1476?source=rss-2e0fb53d0b2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/02a664bb1476</guid>
            <dc:creator><![CDATA[Shubhi Phartiyal]]></dc:creator>
            <pubDate>Wed, 23 Jul 2025 01:23:18 GMT</pubDate>
            <atom:updated>2025-07-23T01:23:18.287Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gdlZubGnAg5kfPO30Wm_tw.png" /></figure><p>A few nights ago, I watched <a href="https://www.youtube.com/watch?v=vm_1XLKtGpI">a video by Howtown</a> exploring the well-known <strong>lead–crime correlation</strong>: how U.S. violent crime dropped in the ’90s around the same time childhood exposure to lead declined.</p><p>As an analyst, my first thought was classic:<br> <strong>“Correlation ≠ causation.”</strong></p><p>Those charts were satisfying, almost deceiving. They plotted cleanly. The timelines lined up. The narrative felt persuasive. And it reminded me just how easy it is to be drawn in by a story that <em>looks</em> right. But right then, the video referenced <a href="https://www.tylervigen.com/spurious-correlations">Tyler Vigen’s <em>Spurious Correlations</em></a>, a website full of beautifully absurd data pairings like <strong>pasta consumption and divorces in Maine, </strong>that track almost perfectly. It’s obviously nonsense, but that’s what makes it stick.</p><p>Correlations can deceive you even when you know better, and that is because Correlations feel satisfying: they plot cleanly, jump out visually, and seem to promise insights fast. In fast-moving environments like startups or high-impact analyses, they’re tempting to present as fact. But real-world analysis requires deeper interrogation. Relying on visuals alone is decoration. Analytics is about <strong>making the link</strong>, not assuming it.</p><p>But the video didn’t just show the national trend, It walked through <strong>state-by-state comparisons</strong>, examining timing differences that aligned with when each state phased out leaded gasoline. That’s a hint at causal thinking, closer to a <strong>difference-in-differences</strong> (diff‑in‑diff) setup.</p><h3>From Clue to Causal Insight: Enter Diff‑in‑Diff</h3><p>Difference-in-differences is a method that compares trends in a “treatment” group (e.g., early lead-phase-out states) to a control group (later-phase-out states) before and after the policy change.</p><p>Economists have used such approaches to show that reduced lead exposure <em>likely</em> contributed to crime reduction, but the effect size was modest (~10 % drop in homicide) and far from the sole explanation.</p><p>That nuance matters. The lead reduction didn’t <em>cause</em> the crime drop single-handedly. It was one factor among many.</p><h3>What Analysts Should Actually Do</h3><p>Here’s the framework I use when I spot a correlation:</p><ol><li><strong>Identify potential “control” comparisons.</strong><br> Can I compare before vs. after, with similar groups unaffected by the change?</li><li><strong>Check timing and alignment.</strong><br> Did the change precede the effect? Was it consistent across subgroups?</li><li><strong>Watch for confounders.</strong><br> What else changed in that time or place? Economy? Policies? Culture?</li><li><strong>Use stronger methods when available.</strong><br> Diff‑in‑diff, regression adjustments, or even experiments if you can.</li><li><strong>Blend quantitative with qualitative.</strong><br> Interviews or context can reveal what numbers can’t.</li><li><strong>Call it what it is:</strong> correlation, association, hypothesis. Not proof.</li></ol><h3>Why This Matters to Pattern-Hungry People Like Us</h3><p>Human brains love patterns. We’re wired to connect dots, tell stories, and find meaning, especially when the line charts look like they’re trying to whisper a narrative to us.</p><p>And honestly, that instinct is part of what makes data work exciting. You stumble upon something that feels neat, coherent, almost poetic. A metric shifts. A trend emerges. It <em>feels</em> like something important is happening.</p><p>But sometimes, it’s just noise dressed as insight.</p><p>As analysts, our job isn’t to kill the story. It’s to challenge it until it holds up. That means:</p><ul><li>Asking what else could be influencing the trend</li><li>Looking for missing context or timing mismatches</li><li>Checking if the pattern really holds when you slice it differently</li></ul><p>It’s not glamorous, but it’s necessary. Because being directionally wrong with confidence is still wrong.</p><h3>Final Thoughts</h3><p>That video didn’t teach me about causation or difference-in-differences. But it showed me how those concepts applied in the wild to a messy, real-world question and communicated clearly enough to start a conversation, not end it.</p><p>It was a reminder that good analysis isn’t just about knowing the tools. It’s about asking the right questions, layering context, and being honest about what the data can and can’t say.</p><h3>📚 Sources</h3><ol><li><a href="https://www.youtube.com/watch?v=vm_1XLKtGpI">Howtown — <em>Did Lead Cause the Crime Drop?</em></a></li><li><a href="https://en.wikipedia.org/wiki/Lead%E2%80%93crime_hypothesis">Wikipedia — Lead–Crime Hypothesis</a></li><li><a href="https://www.tylervigen.com/spurious-correlations">Tyler Vigen — <em>Spurious Correlations</em></a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=02a664bb1476" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Math Behind Your Netflix Queue: Behavioral Data & Collaborative Filtering]]></title>
            <link>https://medium.com/@shubhiphartiyal/the-math-behind-your-netflix-queue-behavioral-data-collaborative-filtering-b90e865faf90?source=rss-2e0fb53d0b2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/b90e865faf90</guid>
            <dc:creator><![CDATA[Shubhi Phartiyal]]></dc:creator>
            <pubDate>Thu, 10 Jul 2025 05:14:40 GMT</pubDate>
            <atom:updated>2025-07-10T05:14:40.035Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever wonder how Netflix just <em>knows</em> what you want to watch next? It’s not guessing. Every skip, pause, rewind, or binge session tells a story that gets fed into an algorithm quietly learning your preferences. At the heart of it is <strong>behavioral data</strong>, not just what you rate or search for, but how you actually use the platform. And while older systems relied on 5-star ratings or thumbs up/down, most people don’t bother with that. So platforms started paying closer attention to what we already do: finish a show, stop halfway, rewatch something. These became signals. This kind of passive input, called <strong>implicit feedback</strong>, turned out to be far more useful. It builds what’s called a <strong>user-item interaction matrix</strong>: a massive grid of users and content, where each entry reflects some form of engagement. The only problem? Most of that matrix is empty. So how do platforms make recommendations when there’s so little direct overlap?</p><h3>Collaborative Filtering: Finding Patterns in People</h3><p><strong>Collaborative filtering</strong> is one of the most widely used techniques to make sense of all this sparse behavioral data. Its core idea is surprisingly intuitive: <em>If two users behave similarly, say, watching and liking the same shows, they’ll probably enjoy more of the same in the future.</em></p><p>There are two main approaches:</p><ul><li><strong>User-based filtering</strong>, which finds users with similar histories and recommends what they liked but you haven’t seen yet</li><li><strong>Item-based filtering</strong>, which recommends items that were liked by users who also liked what you did</li></ul><p>The system doesn’t need to know anything about the content itself , just the patterns in interactions. For instance, if you watched <em>Mindhunter</em> and <em>Dark</em> back to back, and so did 10,000 other people, it might suggest <em>True Detective</em> next, even if those shows are totally different in genre.</p><p>To find these similarities, algorithms often use <strong>cosine similarity</strong> or <strong>Pearson correlation</strong> to compare rows (users) or columns (items) in the interaction matrix. Even with limited data, this approach can make highly personalized recommendations, just based on collective behavior.</p><p>It’s simple, elegant, and surprisingly powerful, especially when scaled to millions of users and items.</p><h3>When You Don’t Know What You Like (Yet)</h3><p>That giant user-item matrix? It’s still mostly empty. To deal with that, many systems use <strong>matrix factorization, </strong>a technique that reduces the complexity by breaking the matrix down into smaller, more useful parts.</p><p>One common method is <strong>SVD (Singular Value Decomposition)</strong>, which lets the system discover hidden “features” about both users and items. These features might not have labels, but they capture things like genre preference, pacing, tone, basically, the <em>vibe</em> of what you like.</p><p>So even if you never told Netflix “I’m into dark, slow-burn psychological thrillers,” it can probably figure that out based on what you watched, and what other similar users enjoyed.</p><h3>The Cold Start Problem</h3><p>But what happens when someone’s new to the platform? Or when a brand-new movie is added that nobody’s interacted with?</p><p>That’s the <strong>cold start problem</strong>.<br>Since there’s no behavioral data to go on, platforms turn to <strong>content-based filtering, </strong>recommending things based on attributes like genre, director, or description. Many systems use a <strong>hybrid approach</strong>, combining both behavioral patterns and content features to make more balanced recommendations.</p><h3>The Loop We Don’t See</h3><p>Here’s where it gets interesting and maybe a little uncomfortable. These systems don’t just reflect what we like. They also shape what we end up liking.</p><p>You watch a documentary, the system shows you five more. You click one, it strengthens the pattern. The more you follow the recommendations, the more personalized they become and the narrower your content universe can get.</p><p>It’s not always a bad thing. But it’s worth noticing.</p><p>Recommendation systems have this quiet power. They don’t force anything on you. They just make certain things easier to find. But how they decide <em>what</em> to surface first? That’s all based on the data we leave behind.</p><p>And that’s what fascinates me. The way behavior, something so human, can be captured, modeled, and used to guide experience.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b90e865faf90" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From CSV Chaos to Clarity: Lessons from Building an AI-Powered Dashboard]]></title>
            <link>https://medium.com/@shubhiphartiyal/from-csv-chaos-to-clarity-lessons-from-building-an-ai-powered-dashboard-edd9db610674?source=rss-2e0fb53d0b2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/edd9db610674</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[dashboard-design]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Shubhi Phartiyal]]></dc:creator>
            <pubDate>Thu, 03 Jul 2025 02:09:04 GMT</pubDate>
            <atom:updated>2025-07-03T02:09:04.870Z</atom:updated>
            <content:encoded><![CDATA[<p>Retail businesses today are generating more data than ever , yet many of them still rely on raw CSV dumps, emailed reports, and manual spreadsheets for decision-making. In my recent practicum project as a Data Scientist at Standard Insights, our team tackled this problem head-on by building a web-based analytics dashboard powered by automation, real-time insights, and even OpenAI.</p><p>It wasn’t just a project in data engineering. It was a deep dive into the full lifecycle of turning raw data into business value.</p><h3>The Problem: Too Much Data, Too Little Insight</h3><p>Our client, a retail company, had data scattered across CSV files- sales, purchases, customers, and product info. Every reporting cycle was a manual ordeal, prone to errors, inconsistency, and delay. There was no central schema, no data validation, and definitely no easy way to track KPIs like revenue trends or stockouts.</p><p>They didn’t need just another dashboard. They needed a system that could process updates, validate data, and offer insights with minimal human effort.</p><h3>The Solution: A Modular AI-Powered Reporting System</h3><p>We designed and deployed an end-to-end reporting tool with three key components:</p><ol><li><strong>ETL Pipeline (Extract-Transform-Load):</strong></li></ol><ul><li>Cleaned and standardized all uploaded CSV files</li><li>Validated schemas in real time</li><li>Loaded transformed data into a structured MySQL database</li></ul><p><strong>2. Web App Interface (Flask):</strong></p><ul><li>Allowed users to upload files, trigger data processing, and view results</li><li>Included sections for sales, customer, and product performance</li></ul><p><strong>3. Narrative Insights (OpenAI API):</strong></p><ul><li>Automatically generated summaries for key metrics and trends</li><li>Helped make dashboards more human-readable, especially for non-technical users</li></ul><h3>Tools &amp; Stack</h3><ul><li><strong>Python</strong> for data cleaning, logic, and API integration</li><li><strong>MySQL</strong> for relational data modeling</li><li><strong>Flask</strong> for the frontend-backend interface</li><li><strong>Matplotlib &amp; Seaborn</strong> for charts</li><li><strong>OpenAI API</strong> for generating insights alongside visuals</li></ul><h3>What Went Wrong and What We Learned</h3><p>Despite the solid architecture, we hit a few roadblocks:</p><ul><li><strong>Schema mismatches</strong>: Real-world data is messy. Even something as simple as “Customer ID” appearing as “Cust_ID” broke the pipeline early on. We built real-time schema checks to handle this.</li><li><strong>User upload errors</strong>: Users uploaded outdated files, incorrect formats, or duplicate data. Adding tooltips and detailed error messages helped reduce friction.</li><li><strong>Data refresh</strong>: Clients needed periodic updates, not static reports. We added an interface to schedule data refreshes and email reports.</li></ul><p>The biggest lesson? <strong>You’re not just building a dashboard. You’re building trust in data.</strong></p><h3>If I Could Do It Again…</h3><p>I’d prioritize user experience from day one — anticipating edge cases, building cleaner error handling, and creating an onboarding flow. I’d also explore adding Streamlit or Power BI connectors for visual flexibility.</p><p>But more than anything, I’ve learned that <strong>data engineering isn’t about code, it’s about clarity.</strong><br> Turning a CSV dump into a dashboard is easy. Making sure it <em>tells a story</em>, <em>updates cleanly</em>, and <em>empowers action</em> — that’s the real craft.</p><h4>Curious to Learn More?</h4><p>I’d love to hear how others are designing human-first analytics tools, especially with AI in the loop. Drop a comment or connect — let’s build smarter systems, together.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=edd9db610674" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>