<?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 ritikkumar on Medium]]></title>
        <description><![CDATA[Stories by ritikkumar on Medium]]></description>
        <link>https://medium.com/@yesiamritik33?source=rss-55809da50e2d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*maA53jv2cmMuQy8aMC3Skw.jpeg</url>
            <title>Stories by ritikkumar on Medium</title>
            <link>https://medium.com/@yesiamritik33?source=rss-55809da50e2d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 08:53:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yesiamritik33/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[Age, Knowledge, and the Myth of Emotional Maturity]]></title>
            <link>https://medium.com/@yesiamritik33/age-knowledge-and-the-myth-of-emotional-maturity-595722fb002e?source=rss-55809da50e2d------2</link>
            <guid isPermaLink="false">https://medium.com/p/595722fb002e</guid>
            <category><![CDATA[mental-health]]></category>
            <category><![CDATA[relationships]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[life]]></category>
            <dc:creator><![CDATA[ritikkumar]]></dc:creator>
            <pubDate>Wed, 02 Sep 2026 15:04:38 GMT</pubDate>
            <atom:updated>2026-09-02T15:04:38.080Z</atom:updated>
            <content:encoded><![CDATA[<p>The People Around You Are Shaping You More Than You Think</p><p>Over the last year, I’ve had an experience that changed the way I look at people, relationships, and even my own decisions.</p><p>I started noticing how much the people around us influence the way we think.</p><p>Not always consciously. In fact, most of the time, we don&#39;t even realize it is happening.</p><p>The way someone talks, reacts to situations, handles pressure, makes decisions, or looks at the world slowly starts influencing the people around them. And if you spend enough time with someone, some of their ways of thinking can become a part of your own without you ever intentionally choosing them.</p><p>That realization made me think about how important it is to be mentally strong.</p><p>You Are Not Completely Yourself Around Everyone</p><p>One of the hardest things I&#39;ve experienced is interacting with people whose way of thinking is very different from mine.</p><p>And I don&#39;t want to label them as &quot;idiots&quot; or &quot;bad people.&quot; I don&#39;t think that&#39;s fair.</p><p>Everyone is a product of their experiences.</p><p>The way someone thinks today has been shaped by their childhood, family, environment, education, failures, successes, relationships, and the people they have spent time with.</p><p>Two people can experience completely different lives and, naturally, develop completely different ways of looking at the same situation.</p><p>That doesn&#39;t necessarily make one person right and the other wrong.</p><p>But sometimes, being around someone with a completely different mindset can be exhausting.</p><p>You find yourself changing the way you communicate. You simplify your thoughts. You hold certain opinions back. You choose different words. Sometimes, you even start thinking in a way that isn&#39;t naturally yours just so you can have a conversation.</p><p>It&#39;s almost like you have to take one step down from your natural way of thinking to meet someone where they are.</p><p>And there&#39;s nothing necessarily wrong with doing that.</p><p>Communication requires adaptation.</p><p>But the dangerous part is when you start doing it so often that you forget where their thinking ends and yours begins.</p><p>The Subconscious Influence Is the Real Problem</p><p>I think the biggest danger isn&#39;t someone intentionally manipulating you.</p><p>It&#39;s being influenced without realizing it.</p><p>When you spend months or years around a particular group of people, their beliefs and behaviors can slowly become normalized.</p><p>You may start accepting things you previously questioned.</p><p>You may become more negative because everyone around you is negative.</p><p>You may become less ambitious because the people around you constantly tell you that something is unrealistic.</p><p>You may start making decisions based on what your surroundings consider normal rather than what you actually want.</p><p>And that&#39;s where self-awareness becomes extremely important.</p><p>You need to occasionally step back and ask yourself:</p><p>&quot;Is this actually what I believe, or is this something I&#39;ve started believing because I&#39;ve been around these people for too long?&quot;</p><p>That question can be uncomfortable.</p><p>But sometimes it&#39;s necessary.</p><p>Age Doesn&#39;t Automatically Mean Emotional Maturity</p><p>Another thing I&#39;ve learned is that age and emotional intelligence are two completely different things.</p><p>Someone can be significantly older than you and still struggle to understand their own emotions.</p><p>Someone can have decades of professional experience and still react impulsively when things don&#39;t go their way.</p><p>Someone can be extremely knowledgeable and highly skilled but have very little emotional awareness.</p><p>And this is something I think we often forget.</p><p>We naturally associate age with wisdom.</p><p>We associate knowledge with maturity.</p><p>We assume that someone who has achieved more than us must also understand people and emotions better than us.</p><p>But that&#39;s not necessarily true.</p><p>Experience can make someone knowledgeable.</p><p>It doesn&#39;t automatically make them emotionally intelligent.</p><p>People Reveal Themselves When They Lose Control</p><p>I have also noticed something interesting about human behavior.</p><p>Most of us have a version of ourselves that we consciously present to the world.</p><p>We know how to behave in professional situations.</p><p>We know how to control our words.</p><p>We know how to appear calm, mature, confident, or understanding.</p><p>But there are moments when that control becomes weaker.</p><p>When someone is extremely happy.</p><p>When they are angry.</p><p>When they are scared.</p><p>When they are under immense pressure.</p><p>When they panic.</p><p>Those moments can reveal parts of someone&#39;s personality that are normally hidden beneath their carefully constructed behavior.</p><p>And I don&#39;t think that necessarily means the person was pretending all along.</p><p>We are complicated.</p><p>We all have different versions of ourselves depending on the situation.</p><p>But these moments can teach you something about a person that normal conversations may never reveal.</p><p>Sometimes, you understand someone better by watching how they behave when they lose control than by listening to everything they say when they have complete control over themselves.</p><p>Sometimes You Will Simply Feel Irritated</p><p>There have also been situations where I couldn&#39;t explain why someone&#39;s presence irritated me.</p><p>They hadn&#39;t necessarily done anything terrible.</p><p>Sometimes, just being around someone made me feel mentally exhausted.</p><p>Earlier, I used to think that feeling meant something was wrong with either me or them.</p><p>Now, I don&#39;t necessarily think that.</p><p>Not every personality is compatible with every other personality.</p><p>You don&#39;t have to hate someone to know that you don&#39;t function well around them.</p><p>You don&#39;t have to think someone is a bad person to realize that being around them negatively affects your mental space.</p><p>And that&#39;s okay.</p><p>Life isn&#39;t about liking everyone.</p><p>It&#39;s about learning how to coexist with people without losing yourself in the process.</p><p>Protecting Your Mind Doesn&#39;t Mean Isolating Yourself</p><p>I don&#39;t think the answer is to distance yourself from everyone who thinks differently.</p><p>If anything, being around people who think differently can teach you a lot.</p><p>The important thing is knowing when you are learning from someone and when you are unconsciously becoming like them.</p><p>There is a difference.</p><p>You should be able to understand someone&#39;s perspective without adopting it.</p><p>You should be able to communicate with someone without becoming a reflection of them.</p><p>You should be able to respect someone&#39;s experiences without allowing those experiences to dictate your own decisions.</p><p>And most importantly, you should be able to adapt your communication without constantly changing your identity.</p><p>What I&#39;ve Taken Away From This</p><p>The people around us are more influential than we realize.</p><p>They don&#39;t just influence what we talk about.</p><p>They influence what we consider normal.</p><p>They influence what we fear.</p><p>They influence what we aspire to.</p><p>They influence the risks we take, the decisions we make, and sometimes even the way we see ourselves.</p><p>That&#39;s why I think being mentally strong doesn&#39;t mean being unaffected by other people.</p><p>It means being aware of how they affect you.</p><p>You can listen without absorbing everything.</p><p>You can understand without agreeing.</p><p>You can adapt without losing yourself.</p><p>You can respect someone&#39;s journey without allowing their worldview to become yours.</p><p>And maybe that&#39;s one of the most important parts of growing up:</p><p>learning to be around people without becoming a product of every person you meet.</p><p>These are just conclusions I&#39;ve arrived at from what I&#39;ve experienced so far.</p><p>I&#39;m sure my understanding of people will change as I meet more of them, experience more situations, and hopefully become more self-aware.</p><p>Because if there&#39;s one thing I&#39;ve learned, it&#39;s that understanding other people is difficult.</p><p>Understanding how other people are changing you is even harder.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=595722fb002e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Didn’t Know His Name, But He Left Me a Piece of Home]]></title>
            <link>https://medium.com/@yesiamritik33/i-didnt-know-his-name-but-he-left-me-a-piece-of-home-0742300beccb?source=rss-55809da50e2d------2</link>
            <guid isPermaLink="false">https://medium.com/p/0742300beccb</guid>
            <dc:creator><![CDATA[ritikkumar]]></dc:creator>
            <pubDate>Wed, 26 Aug 2026 18:19:28 GMT</pubDate>
            <atom:updated>2026-08-26T18:19:28.848Z</atom:updated>
            <content:encoded><![CDATA[<p>I Didn’t Know His Name, But He Left Me a Piece of Home</p><p>Two days ago, someone new came to my PG.</p><p>One of my roommates.</p><p>Initially, we didn’t talk much. I assumed he was probably from somewhere around here, and honestly, he probably thought the same about me. We were both new to each other, so there wasn’t really a reason to start a conversation.</p><p>Yesterday, I finally did.</p><p>I asked him where he was from, what brought him to Bangalore, and what he was looking for.</p><p>He told me he was from Bihar.</p><p>I told him I was from Uttar Pradesh.</p><p>The moment he heard that, his face changed a little. There was this small excitement the kind you get when you unexpectedly find someone from a familiar part of the country in a completely unfamiliar city.</p><p>He had done his B.Tech in Bihar and had come to Bangalore looking for a job.</p><p>Since I had already been working here for around a year, I started telling him whatever I knew what kind of opportunities he could look for, where he could apply, what the Bangalore job market was like, and what he could do to increase his chances of getting hired.</p><p>It wasn&#39;t anything extraordinary.</p><p>Just two people talking.</p><p>Two people who had barely known each other for a day.</p><p>Then came this morning.</p><p>I was having my usual oatmeal when he offered me something.</p><p>Thekua.</p><p>If you&#39;ve spent enough time around Bihar, you probably know what I&#39;m talking about.</p><p>It&#39;s not just food.</p><p>For many people, thekua carries something much more familiar home, festivals, childhood, family, and the taste of a place you’ve grown up in.</p><p>He had brought some with him.</p><p>He offered me one while I was eating my oatmeal.</p><p>I told him,</p><p>&quot;Just keep it on the table. I&#39;ll have it after this.&quot;</p><p>I was getting late for office, so I rushed out.</p><p>And completely forgot about it.</p><p>I went through my day, came back late at night after spending some time with friends, and entered my room around 11 PM.</p><p>That&#39;s when I noticed something.</p><p>He was gone.</p><p>Apparently, he had moved somewhere else.</p><p>He had only stayed in the room for two days.</p><p>We had barely talked.</p><p>I didn&#39;t even know his name.</p><p>But on the table was an entire packet of thekua.</p><p>And a packet of namkeen.</p><p>He had left them for me.</p><p>I just stood there looking at it.</p><p>It sounds like a very small thing.</p><p>And objectively, it is.</p><p>It&#39;s just a packet of food.</p><p>But somehow, at 11 PM, after a long day, it didn&#39;t feel like just food.</p><p>It felt like a gesture.</p><p>A very simple one.</p><p>A person who barely knew me had remembered that I wanted to try something from his home.</p><p>He could have taken the packet with him.</p><p>He could have simply forgotten about it.</p><p>Instead, he left the entire thing behind.</p><p>For me.</p><p>And that&#39;s what got me.</p><p>We spend so much time talking about people through stereotypes.</p><p>People from this place are like this.</p><p>People from that place are like that.</p><p>This community is this way.</p><p>That community is that way.</p><p>But every once in a while, a very ordinary human interaction reminds you how incomplete those assumptions are.</p><p>Because before anything else, we&#39;re just people.</p><p>People who miss home.</p><p>People who get excited when they meet someone from a familiar place.</p><p>People who offer food they love.</p><p>People who, even after knowing someone for barely two days, can leave something behind simply because they thought the other person might enjoy it.</p><p>I don&#39;t know where he is now.</p><p>I don&#39;t know his name.</p><p>I don&#39;t know whether I&#39;ll ever meet him again.</p><p>But I know that somewhere in Bangalore, there was a guy from Bihar who stayed in my room for two days and left me a packet of thekua and namkeen before leaving.</p><p>And somehow, that tiny gesture made a huge city feel a little less unfamiliar.</p><p>Maybe that&#39;s what kindness really is.</p><p>Not always something grand.</p><p>Sometimes, it&#39;s just leaving a little piece of home behind for a stranger.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0742300beccb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I don’t think nostalgia is just about remembering the past.]]></title>
            <link>https://medium.com/@yesiamritik33/i-dont-think-nostalgia-is-just-about-remembering-the-past-ffe32b189e90?source=rss-55809da50e2d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ffe32b189e90</guid>
            <dc:creator><![CDATA[ritikkumar]]></dc:creator>
            <pubDate>Wed, 08 Jul 2026 06:07:49 GMT</pubDate>
            <atom:updated>2026-07-08T06:07:49.518Z</atom:updated>
            <content:encoded><![CDATA[<p>I don’t think nostalgia is just about remembering the past. I think it’s a quiet way of grieving the parts of our lives we can never go back to. Sometimes all it takes is a song, a familiar street, or the smell of rain to make you miss a time that no longer exists.<br>It’s strange how you can miss a place that’s still there, people who are still alive, or even the version of yourself you used to be. The memories never really disappear they just stay silent until something wakes them up.<br>Maybe that’s why we call it nostalgia. It’s easier than admitting we miss who we once were, or that a part of us is still longing for days that are gone. We tell ourselves we’re only remembering, when deep down, we’re quietly mourning what we can never relive.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffe32b189e90" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TensorRT vs vLLM — what I actually learned while building LLM systems]]></title>
            <link>https://medium.com/@yesiamritik33/tensorrt-vs-vllm-what-i-actually-learned-while-building-llm-systems-01b4704fde3b?source=rss-55809da50e2d------2</link>
            <guid isPermaLink="false">https://medium.com/p/01b4704fde3b</guid>
            <dc:creator><![CDATA[ritikkumar]]></dc:creator>
            <pubDate>Sat, 18 Apr 2026 11:05:28 GMT</pubDate>
            <atom:updated>2026-04-18T11:05:28.110Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LZH_xi7uFa8AXvgPm_xqaA.png" /></figure><p>Okay so when I first started going deeper into LLM systems, I kept seeing these two names pop up — TensorRT and vLLM. And for a while, honestly, I had no clue how they were different. Both had something to do with running models faster on GPUs, right? But they’re actually solving completely different problems. Once it clicked, a lot of the other decisions in ML infra started making more sense too. So let me break it down the way I wish someone had explained it to me.</p><p>Before anything else, here’s how I think about where these two sit in the stack. You’ve got your model weights sitting at the bottom. TensorRT lives just above that — its job is to optimize how the model actually runs on GPU. Then vLLM sits above that — its job is to serve that model to many users efficiently. Then your API or agent sits on top. Different layers, different goals. TensorRT is about making one model run as fast as physically possible. vLLM is about serving that model to a lot of people at the same time without your GPU dying.</p><p><strong>TensorRT — the deep optimizer</strong></p><p>TensorRT is NVIDIA’s thing. You hand it your model (usually via ONNX), and it compiles it into an optimized GPU execution engine. The things it does under the hood are pretty wild. It fuses layers together so instead of running Conv → BatchNorm → ReLU as three separate operations, it becomes one single fused kernel. Less memory movement, faster execution. It also does kernel auto-tuning, where it literally benchmarks different GPU kernels and picks the fastest one for your exact hardware. And then there’s quantization dropping from FP32 to FP16 or even INT8, which cuts memory usage and speeds things up significantly.</p><p>NVIDIA also extended TensorRT into something called TensorRT-LLM, which is their answer to the transformer-specific stuff KV cache handling, attention kernel fusion, multi-GPU inference. It’s their way of saying “we know LLMs are different, here’s TensorRT but built for that.” Where TensorRT really shines is in scenarios like self-driving cars, real-time computer vision, or edge inference — anywhere you need one model to respond with the lowest latency possible. The tradeoff is that it’s not super flexible. Dynamic request lengths, like what you’d get in a chat app, don’t play well with it. And the setup is genuinely painful compared to just spinning up a vLLM server.</p><p><strong>vLLM — built for real-world LLM serving</strong></p><p>vLLM is where things get interesting if you’re building something production-facing. It was purpose-built for LLM inference bottlenecks, and its core innovation is something called PagedAttention. Here’s the problem it’s solving: LLMs use a KV cache that grows as tokens are generated. Traditional systems allocate a big contiguous chunk of memory upfront for this. That leads to fragmentation, out-of-memory errors, and a lot of wasted GPU memory sitting around doing nothing. PagedAttention treats the KV cache like virtual memory in an operating system — split into pages, allocated dynamically, reused across requests. The result is 2–4x higher throughput and dramatically better memory efficiency.</p><p>The other big thing vLLM does is continuous batching. Old-school inference servers wait for a full batch to fill up before processing. vLLM adds and removes requests dynamically, even mid-generation. No idle GPU time sitting around waiting for a slow request. This is honestly what makes it actually usable at scale. On top of that, it ships with an OpenAI-compatible API out of the box, LoRA support for fine-tuned models, streaming responses — basically everything you need to stand up a production inference server without reinventing the wheel.</p><p><strong>The core mental model difference</strong></p><p>Here’s the simplest way I can put it. TensorRT is asking: “how do I make this one model run as fast as physically possible on this GPU?” vLLM is asking: “how do I serve hundreds of users efficiently on a single GPU without running out of memory?” One is a compiler and runtime optimizer. The other is a request scheduler and memory manager. They’re not really competing — they’re solving different parts of the same problem.</p><p><strong>Where this is all heading</strong></p><p>The best production setups actually combine both. You get vLLM-style scheduling and memory management sitting on top of a TensorRT-LLM optimized backend throughput from one, raw kernel speed from the other. For most people building LLM products though, start with vLLM. It’ll carry you a long way before you need to go deeper into TensorRT territory.</p><p>And if someone ever asks you this in an interview — TensorRT is a low-level inference optimizer that compiles models into fast GPU execution engines using kernel fusion and quantization. vLLM is a high-level LLM serving engine focused on memory management and request scheduling via PagedAttention and continuous batching. One makes the model fast. The other makes the server scale.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=01b4704fde3b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Making Sense of Complex Data: A Practical Guide to Dimensionality Reduction and Model Evaluation]]></title>
            <link>https://medium.com/@yesiamritik33/making-sense-of-complex-data-a-practical-guide-to-dimensionality-reduction-and-model-evaluation-6de45c206cbe?source=rss-55809da50e2d------2</link>
            <guid isPermaLink="false">https://medium.com/p/6de45c206cbe</guid>
            <dc:creator><![CDATA[ritikkumar]]></dc:creator>
            <pubDate>Sun, 09 Nov 2025 15:55:09 GMT</pubDate>
            <atom:updated>2025-11-09T15:55:09.680Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6MG-Gyfixq_W5p1dpECcZg.png" /></figure><p>I’ve spent enough time staring at datasets with hundreds of features to know that more isn’t always better. Sometimes, you’re drowning in dimensions that don’t really tell you anything new. The challenge isn’t just having too much data it’s figuring out what actually matters.</p><p>This is where dimensionality reduction and proper model evaluation come in. Not as buzzwords, but as practical tools that can make or break a project.</p><h3>The Problem with Too Many Features</h3><p>Picture trying to understand customer behavior when you’re tracking 200 variables. Your model trains slowly, overfits to noise, and you can’t explain what it’s actually learning. High-dimensional data creates real problems:</p><ul><li>Training times that stretch from minutes to hours</li><li>Models that memorize training data instead of learning patterns</li><li>Visualizations that are impossible to make sense of</li><li>Features that are just measuring the same thing in different ways</li></ul><p>The goal isn’t to throw away information it’s to find what’s signal and what’s noise.</p><h3>PCA: Finding What Actually Varies</h3><p>Principal Component Analysis gets brought up constantly in machine learning courses, and there’s a reason for that. It’s remarkably simple in concept: find the directions in your data where things actually change.</p><p>Here’s how it works without the textbook speak:</p><p>Your data sits in some high-dimensional space. PCA rotates this space so that the first axis points in the direction of maximum variation, the second axis captures the next most important variation, and so on. Then you keep the first few axes and drop the rest.</p><p>Mathematically, this involves eigenvalues and eigenvectors of the covariance matrix. But practically, you’re asking: “If I could only keep 10 features instead of 100, which 10 directions capture the most information?”</p><h3>When PCA Actually Helps</h3><p>I’ve used PCA successfully when:</p><ul><li><strong>Preprocessing sensor data</strong> where different sensors measure related things</li><li><strong>Speeding up training</strong> on image datasets by reducing pixel dimensions</li><li><strong>Visualizing high-dimensional embeddings</strong> by projecting down to 2D</li><li><strong>Removing multicollinearity</strong> before running linear models</li></ul><p>The classic example: reducing 100 correlated financial indicators down to 10 principal components that still explain 95% of the variance. You lose some detail, but gain speed and interpretability.</p><h3>Beyond PCA: When Linear Isn’t Enough</h3><p>PCA has a major limitation it only finds linear relationships. Real-world data is messier than that.</p><h3>t-SNE: For When You Need to See Structure</h3><p>t-SNE has become the go-to for visualizing complex datasets, especially in deep learning. It’s incredibly good at preserving local neighborhoods, which makes it perfect for:</p><ul><li>Visualizing word embeddings or image features</li><li>Exploring clusters in high-dimensional data</li><li>Debugging what your neural network learned</li></ul><p>The downside? It’s slow, doesn’t scale well, and you can’t really use it for preprocessing just visualization.</p><h3>UMAP: t-SNE’s Faster Cousin</h3><p>UMAP does what t-SNE does but faster, and it preserves more of the global structure. I’ve seen it handle datasets where t-SNE just choked. It’s become standard in single-cell genomics and anywhere you’re working with hundreds of thousands of data points.</p><h3>Autoencoders: Learning the Compression</h3><p>When your data has truly nonlinear structure, autoencoders can learn the right way to compress it. You train a neural network to squeeze data through a narrow bottleneck and reconstruct it on the other side. That bottleneck becomes your reduced representation.</p><p>This works surprisingly well for:</p><ul><li>Anomaly detection (bad reconstructions = anomalies)</li><li>Feature learning in images or time series</li><li>Initialization for other models</li></ul><h3>The Modern Stack</h3><p>Most production systems now use <strong>transformer embeddings</strong> (from models like BERT or CLIP) to get initial representations, then apply UMAP or PCA for visualization or clustering. This is what powers semantic search, recommendation engines, and modern RAG systems.</p><p>The pipeline usually looks like:</p><pre>Raw Data → Normalization → Dimensionality Reduction → Model/Clustering/Viz</pre><h3>Evaluating What You’ve Built</h3><p>You’ve reduced your dimensions, trained your model now what? How do you know if it’s actually any good?</p><p>This is where people often fumble. Accuracy seems simple but it lies. Especially when your classes are imbalanced (think fraud detection where 99.9% of transactions are legitimate).</p><h3>The ROC Curve: Understanding Trade-offs</h3><p>The ROC curve is one of those things that seems academic until you’re actually tuning a model in production. Then it becomes essential.</p><p>It plots True Positive Rate against False Positive Rate as you vary your classification threshold. What does that mean practically?</p><p>Every classifier outputs some kind of score or probability. You then pick a threshold: “anything above 0.5 is positive.” But why 0.5? The ROC curve shows you what happens at every possible threshold.</p><h3>Reading the Curve</h3><ul><li><strong>Top-left corner = perfect</strong>: catching everything positive without false alarms</li><li><strong>Diagonal line = useless</strong>: no better than flipping a coin</li><li><strong>Area under the curve (AUC)</strong>: single number summarizing performance</li></ul><p>Here’s how to interpret AUC:</p><ul><li><strong>0.9–1.0</strong>: Your model is genuinely good</li><li><strong>0.8–0.9</strong>: Decent, probably useful in production</li><li><strong>0.7–0.8</strong>: Might work, might need more features or data</li><li><strong>0.5</strong>: Broken. Don’t deploy this.</li></ul><h3>When ROC Isn’t Enough</h3><p>ROC curves work great on balanced datasets. But when you’re detecting rare events fraud, disease, equipment failure Precision-Recall curves tell you more. I learned this the hard way on an anomaly detection project where my “great” ROC curve was just predicting “normal” for everything.</p><h3>Real Applications</h3><p><strong>In healthcare</strong>, you might tune your threshold higher to avoid missing diseases (prioritize sensitivity) even if it means more false alarms.</p><p><strong>In spam filtering</strong>, you tune it lower — better to let some spam through than block important emails.</p><p><strong>In fraud detection</strong>, you’re usually looking for the knee in the curve where you maximize detection while keeping false positives manageable for your investigation team.</p><h3>Putting It Together</h3><p>These techniques aren’t separate tools they work together:</p><ol><li>Use dimensionality reduction to make your data manageable and interpretable</li><li>Train your model on the reduced representation</li><li>Use ROC curves to understand performance and pick the right threshold</li><li>Iterate based on what you learn</li></ol><p>The real skill is knowing when to use what. PCA for quick linear reduction. UMAP when you need to see nonlinear structure. Autoencoders when you have the compute budget and complex patterns. ROC curves for binary classification with balanced classes. Precision-Recall when things are imbalanced.</p><h3>What Actually Matters</h3><p>After working on enough projects, I’ve realized the techniques matter less than understanding your data and your problem. Dimensionality reduction isn’t about blindly applying PCA because everyone does. It’s about asking: “What information do I actually need here?”</p><p>Model evaluation isn’t about maximizing AUC. It’s about understanding the trade-offs your business or application can tolerate. A 0.9 AUC model that takes 10 seconds per prediction might be worse than a 0.85 AUC model that runs in milliseconds.</p><p>The math is important, but so is the context. Learn the techniques, but more importantly, learn when to use them and when to walk away and try something else.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6de45c206cbe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kafka Explained Simply: How Zomato & Uber Use It Every Day]]></title>
            <link>https://medium.com/@yesiamritik33/kafka-explained-simply-how-zomato-uber-use-it-every-day-a1b30f545a7b?source=rss-55809da50e2d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a1b30f545a7b</guid>
            <dc:creator><![CDATA[ritikkumar]]></dc:creator>
            <pubDate>Mon, 29 Sep 2025 15:40:06 GMT</pubDate>
            <atom:updated>2025-09-29T15:40:06.157Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AF9ljPE8kkvlZPvc6wFYqA.png" /></figure><p>Over the last few days, I started diving into <strong>Apache Kafka</strong>, and I realized it’s one of those technologies that quietly powers so many apps we use daily — from ordering food on <strong>Zomato</strong> to booking a ride on <strong>Uber</strong>.</p><p>I wanted to write down my learnings in a way that’s simple and beginner-friendly, with some real-world examples of how big companies use Kafka in their day-to-day operations.</p><h3>What is Kafka?</h3><p>At its heart, <strong>Apache Kafka</strong> is an <strong>open-source distributed event streaming platform</strong>.</p><p>That might sound heavy, so let’s break it down:</p><ul><li><strong>Event</strong>: Anything that happens in an app (like placing an order, updating GPS location, or making a payment).</li><li><strong>Streaming</strong>: Events don’t just happen once; they happen <strong>continuously</strong> and need to be processed as they occur.</li><li><strong>Distributed</strong>: Kafka can run across multiple servers and data centers to handle billions of events without breaking.</li></ul><p>In simple words, Kafka is like a <strong>giant real-time data pipeline</strong> that ensures events are delivered, stored, and processed <strong>fast and reliably</strong>.</p><h3>1) Kafka Introduction</h3><p>Kafka started at LinkedIn to solve their huge data movement problem and later became open source. Today, it’s widely used in <strong>finance, e-commerce, food delivery, ride-hailing, and even IoT systems</strong>.</p><p>Think of Kafka as a <strong>messenger system</strong> that’s not only fast but also keeps a record of everything it delivers.</p><h3>2) The Problem Statement</h3><p>Modern businesses don’t just generate data — they generate <strong>mountains of it every second</strong>.</p><p>Examples:</p><ul><li><strong>Zomato</strong>: Thousands of food orders placed, updated, and delivered every minute.</li><li><strong>Uber</strong>: Millions of riders and drivers updating their location every few seconds.</li><li><strong>Banks</strong>: Transactions, fraud checks, and balance updates happening instantly.</li></ul><p>The challenges are:</p><ul><li>How to handle <strong>real-time data</strong> (not just batch processing at the end of the day).</li><li>How to <strong>scale</strong> to millions of users without crashing.</li><li>How to ensure <strong>no data loss</strong> (imagine losing an order or a payment event!).</li></ul><p>Traditional databases and message queues often can’t keep up with this speed and scale. That’s where Kafka shines.</p><h3>3) How Kafka Solves the Problem</h3><p>Kafka works as a <strong>publish–subscribe system</strong>:</p><ul><li><strong>Producers</strong> → send data (events) into Kafka.</li><li><strong>Kafka Brokers</strong> → store and manage the data.</li><li><strong>Consumers</strong> → read and process the data.</li></ul><p>Key benefits:</p><ul><li><strong>Scalable</strong>: Add more servers as data grows.</li><li><strong>Durable</strong>: Data can be replayed anytime (great for error recovery).</li><li><strong>Fast</strong>: Handles millions of events per second.</li><li><strong>Decoupled systems</strong>: Producers don’t need to know who the consumers are.</li></ul><p>💡 Imagine Kafka as a <strong>giant whiteboard in the cloud</strong>. Anyone can write events on it (producers), and multiple teams can read from it at their own pace (consumers).</p><h3>4) Architecture of Kafka</h3><p>The Kafka ecosystem has a few building blocks:</p><ol><li><strong>Producer</strong> — sends messages/events (like an order request from Zomato).</li><li><strong>Topic</strong> — a category or feed where messages are stored (like “orders” or “GPS updates”).</li><li><strong>Broker</strong> — Kafka server that stores topics across a cluster.</li><li><strong>Consumer</strong> — reads messages (like a delivery tracking system).</li><li><strong>Consumer Groups</strong> — multiple consumers working together to split the load.</li><li><strong>ZooKeeper (legacy) / KRaft (new)</strong> — manages the Kafka cluster’s metadata and leader election.</li></ol><p>This design makes Kafka highly fault-tolerant and able to handle <strong>real-time big data at scale</strong>.</p><h3>5) Consumer Groups in Kafka</h3><p>Consumers in Kafka can join a <strong>consumer group</strong>. Each message in a topic is consumed by <strong>only one member of the group</strong>.</p><p>For example:</p><ul><li>Zomato has 10 servers processing food orders.</li><li>All servers are part of the same consumer group.</li><li>Kafka divides the order events among them to balance the load.</li></ul><p>This ensures <strong>high throughput</strong> without duplication.</p><h3>6) Kafka with Node.js</h3><p>Kafka isn’t tied to one language — it works with <strong>Java, Python, Node.js, Go, etc.</strong></p><p>For developers, Kafka with <strong>Node.js</strong> is super handy because Node is widely used in real-time apps (like chat, notifications, order updates).</p><ul><li>Node.js apps can act as <strong>producers</strong> (sending logs, order events).</li><li>Other Node.js apps can act as <strong>consumers</strong> (tracking delivery, pushing notifications).</li></ul><p>This makes building <strong>end-to-end real-time systems</strong> much easier.</p><h3>Real-World Use Cases: Zomato &amp; Uber</h3><h3>Zomato’s Use of Kafka</h3><p>When you place an order on Zomato, multiple things happen at once:</p><ol><li>Your order request goes to Kafka as an event.</li><li>The restaurant receives the order.</li><li>Delivery partners get notified.</li><li>You get live updates on the app.</li></ol><p>Kafka ensures that <strong>all these systems stay in sync in real time</strong>.</p><ul><li>Order data flows to the restaurant app.</li><li>Rider tracking data streams to your app.</li><li>Notifications are pushed instantly.</li></ul><p>Without Kafka, Zomato would struggle to handle thousands of orders happening simultaneously across cities.</p><h3>Uber’s Use of Kafka</h3><p>Uber is essentially a <strong>real-time, event-driven company</strong>. Kafka plays a huge role in:</p><ul><li><strong>Ride Requests</strong>: When you book a ride, Kafka streams your request to nearby drivers.</li><li><strong>GPS Tracking</strong>: Driver and rider location updates are sent every few seconds.</li><li><strong>Surge Pricing</strong>: Kafka streams location + demand data to calculate prices instantly.</li><li><strong>Trip Analytics</strong>: Kafka pipelines push trip data to analytics systems for fraud detection and efficiency.</li></ul><p>Kafka allows Uber to <strong>connect millions of drivers and riders in real time</strong> without lag.</p><h3>Final Thoughts</h3><p>Kafka might sound like a backend-only tool, but it’s actually the <strong>invisible backbone</strong> of the apps we use daily.</p><p>From ordering food on <strong>Zomato</strong> to booking a ride on <strong>Uber</strong>, Kafka ensures data moves reliably, in real time, and at scale.</p><p>Learning Kafka gave me a new perspective: <strong>real-time systems are the future</strong>, and understanding event streaming will open doors to building more powerful applications.</p><p>This is just the beginning of my Kafka journey — I’ll keep exploring and share more learnings soon 🚀</p><p>👉 Have you used Kafka in your projects or company? I’d love to hear your experience!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1b30f545a7b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with DBT: A Beginner’s Guide to Modern Data Transformation]]></title>
            <link>https://medium.com/@yesiamritik33/getting-started-with-dbt-a-beginners-guide-to-modern-data-transformation-2ba59d1c8887?source=rss-55809da50e2d------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ba59d1c8887</guid>
            <dc:creator><![CDATA[ritikkumar]]></dc:creator>
            <pubDate>Fri, 26 Sep 2025 10:32:25 GMT</pubDate>
            <atom:updated>2025-09-26T10:32:25.459Z</atom:updated>
            <content:encoded><![CDATA[<p>Over the last few days, I dove deep into <strong>DBT (Data Build Tool)</strong> — one of the most exciting technologies in the modern data engineering stack. I want to share my learnings in this article, from the fundamentals all the way to deployment with CI/CD.</p><p>Whether you’re just starting with DBT or curious about how it fits into data engineering workflows, this guide will walk you through everything I explored step by step.</p><h3>📌 What is DBT?</h3><p>At its core, <strong>DBT is a transformation tool</strong> that allows data analysts and engineers to write modular SQL and transform raw data into clean, analytics-ready datasets.</p><p>Unlike traditional ETL tools, DBT focuses on the <strong>“T” (Transform)</strong>, leaving the Extract and Load part to other tools like Fivetran, Airbyte, or custom pipelines. This makes it lightweight, powerful, and a great fit in a <strong>modern data stack</strong>.</p><h3>DBT Fundamentals</h3><p>DBT projects are <strong>SQL-first</strong>, meaning all transformations are written in SQL.</p><ul><li>It integrates version control (Git) and promotes <strong>software engineering best practices</strong> for analytics.</li><li>Core concepts:</li><li><strong>Models</strong> → SQL files that define transformations.</li><li><strong>Sources</strong> → Raw tables in your warehouse.</li><li><strong>Seeds</strong> → CSV files versioned with your code.</li><li><strong>Tests</strong> → Assertions to validate data quality.</li></ul><p>Think of DBT as bringing <strong>modularity, testing, and automation</strong> to SQL transformations.</p><h3>Environment Setup</h3><p>To get started with DBT, you need:</p><ul><li><strong>Python + pip</strong> (to install DBT)</li><li>A <strong>warehouse connection</strong> (Snowflake, BigQuery, Redshift, Databricks, etc.)</li><li>Install DBT with:</li></ul><pre>pip install dbt-core<br>pip install dbt-databricks   # Example for Databricks</pre><p>Once installed, you initialize a new DBT project with:</p><pre>dbt init my_project</pre><p>This creates a structured project directory with models, seeds, and configuration files.</p><h3>DBT + Databricks Extension</h3><p>Since I worked with <strong>Databricks</strong>, I used the dbt-databricks adapter. This allows DBT to connect directly to a Databricks SQL warehouse or cluster.</p><p>Configuration in profiles.yml looks like this:</p><pre>my_project:<br>  target: dev<br>  outputs:<br>    dev:<br>      type: databricks<br>      catalog: hive_metastore<br>      schema: analytics<br>      host: &lt;databricks-host&gt;<br>      http_path: &lt;sql-endpoint-path&gt;<br>      token: &lt;databricks-personal-access-token&gt;</pre><p>This integration makes it easy to transform big data directly within Databricks.</p><h3>DBT Project Structure</h3><p>A DBT project has a clean folder structure:</p><pre>my_project/<br> ├── models/        # SQL models<br> ├── seeds/         # CSV files<br> ├── snapshots/     # SCD2 snapshots<br> ├── macros/        # Custom Jinja macros<br> ├── tests/         # Custom tests<br> ├── dbt_project.yml</pre><p>This modular setup ensures that transformations are version-controlled, testable, and reusable.</p><h3>DBT Sources</h3><p>Sources define <strong>raw input tables</strong> from the data warehouse. Example:</p><pre>sources:<br>  - name: raw<br>    tables:<br>      - name: orders<br>      - name: customers</pre><p>This way, DBT knows where your raw data lives and can build models on top of it.</p><h3>DBT Models</h3><p>Models are the <strong>heart of DBT</strong>. Each model is just a .sql file containing a SELECT statement.</p><p>Example:</p><pre>-- models/stg_orders.sql<br>select<br>    order_id,<br>    customer_id,<br>    order_date,<br>    amount<br>from {{ source(&#39;raw&#39;, &#39;orders&#39;) }}</pre><p>Run it with:</p><pre>dbt run</pre><p>DBT materializes it as a table or view in your warehouse.</p><h3>DBT Tests</h3><p>Testing is a game-changer in DBT. You can write simple YAML tests:</p><pre>models:<br>  - name: stg_orders<br>    columns:<br>      - name: order_id<br>        tests:<br>          - not_null<br>          - unique</pre><p>Or create custom tests with SQL. This ensures data quality automatically during pipeline runs.</p><h3>DBT Seeds</h3><p>Seeds are CSV files you want DBT to load into your warehouse. Place them inside the /seeds folder and run:</p><pre>dbt seed</pre><p>Example: A lookup table for country codes or static mappings.</p><h3>DBT Jinja &amp; Macros</h3><p>DBT uses <strong>Jinja templating</strong>, letting you write dynamic SQL.</p><p>Example Macro:</p><pre>{% macro cents_to_dollars(column_name) %}<br>    ({{ column_name }} / 100.0)<br>{% endmacro %}</pre><p>Usage inside a model:</p><pre>select<br>    order_id,<br>    {{ cents_to_dollars(&#39;amount_in_cents&#39;) }} as amount_usd<br>from {{ source(&#39;raw&#39;, &#39;orders&#39;) }}</pre><p>This makes transformations more reusable and less error-prone.</p><h3>DBT Snapshots (SCD Type-2)</h3><p>DBT supports <strong>slowly changing dimensions (SCD Type-2)</strong> with snapshots.</p><p>Example:</p><pre>{% snapshot customer_snapshot %}<br>    {{<br>        config(<br>          target_schema=&#39;snapshots&#39;,<br>          unique_key=&#39;customer_id&#39;,<br>          strategy=&#39;check&#39;,<br>          check_cols=[&#39;email&#39;, &#39;address&#39;]<br>        )<br>    }}<br>    select * from {{ source(&#39;raw&#39;, &#39;customers&#39;) }}<br>{% endsnapshot %}</pre><p>Snapshots track historical changes automatically.</p><h3>DBT Deployment with CI/CD</h3><p>DBT integrates well with GitHub Actions, GitLab CI, or any CI/CD tool.</p><p>Typical CI/CD pipeline:</p><ul><li>Run dbt deps → install dependencies.</li><li>Run dbt seed, dbt run, dbt test.</li><li>Deploy only after tests pass.</li></ul><p>This ensures <strong>production-ready transformations</strong> without manual intervention.</p><h3>🎯 Key Takeaways</h3><ul><li>DBT brings <strong>software engineering practices</strong> (version control, testing, CI/CD) into SQL.</li><li>It simplifies building <strong>modular, testable, and reusable</strong> transformations.</li><li>Adapters like dbt-databricks make it work seamlessly with big data platforms.</li><li>With sources, models, tests, and snapshots, DBT provides an end-to-end framework for modern data transformation.</li></ul><h3>Final Thoughts</h3><p>Studying DBT has been a game-changer for me in understanding <strong>how modern data pipelines are built and maintained</strong>. From writing clean models to setting up CI/CD deployments, DBT provides the missing link between raw data and analytics-ready insights.</p><p>If you’re stepping into data engineering or analytics, I highly recommend exploring DBT. It will not only make your workflows cleaner but also prepare you for <strong>real-world, scalable data projects</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ba59d1c8887" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fine-Tuning Large Language Models in 2025 — LoRA, QLoRA, and the Era of 1-Bit LLMs]]></title>
            <link>https://medium.com/@yesiamritik33/fine-tuning-large-language-models-in-2025-lora-qlora-and-the-era-of-1-bit-llms-47e0f31c737a?source=rss-55809da50e2d------2</link>
            <guid isPermaLink="false">https://medium.com/p/47e0f31c737a</guid>
            <dc:creator><![CDATA[ritikkumar]]></dc:creator>
            <pubDate>Fri, 12 Sep 2025 13:39:55 GMT</pubDate>
            <atom:updated>2025-09-12T13:39:55.724Z</atom:updated>
            <content:encoded><![CDATA[<h3>Fine-Tuning Large Language Models in 2025 — LoRA, QLoRA, and the Era of 1-Bit LLMs</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*164op5z9IYnD9gw-n7_JRA.png" /></figure><p>Fine-tuning has evolved a lot in the last couple of years. Back in 2022, you needed massive compute to retrain models. Today, with techniques like <strong>LoRA, QLoRA, and 1-bit quantization</strong>, even indie developers can adapt large language models (LLMs) to their custom data — often on a single GPU (or even Colab!).</p><p>In this post, I’ll break down what I learned about:</p><ul><li>🧠 <strong>Why fine-tuning is still relevant in the age of huge foundation models</strong></li><li>🔢 <strong>LoRA and QLoRA with mathematical intuition</strong></li><li>🧮 <strong>The “1.58-bit LLM” revolution</strong></li><li>⚙️ <strong>LLMOps made simple</strong></li><li>🛠 <strong>A hands-on example: fine-tuning Gemma with LoRA in Keras</strong></li></ul><h3>1️⃣ Why Fine-Tuning Matters (Even With GPT-4, Llama 3, Gemma…)</h3><p>Many developers assume that prompting is enough. While <strong>prompt engineering</strong> is great for prototyping, fine-tuning shines when:</p><ul><li>You need <strong>domain-specific expertise</strong> (legal, medical, fintech).</li><li>You want <strong>consistent tone/style</strong> across responses.</li><li>You must <strong>reduce inference cost</strong> (a smaller fine-tuned model can replace a bigger general model).</li></ul><blockquote><strong><em>Example:</em></strong><em> A fintech startup trained a small Llama-2–7B with LoRA on their internal risk assessment data. This reduced inference cost by 80% compared to using GPT-4 API calls.</em></blockquote><h3>2️⃣ LoRA: Low-Rank Adaptation (With Intuition)</h3><p>LoRA is like adding a <strong>plug-in brain</strong> to your LLM.</p><p>Instead of retraining the entire model (billions of parameters), LoRA:</p><ul><li><strong>Freezes</strong> the original model weights.</li><li><strong>Injects trainable matrices (A &amp; B)</strong> into attention layers.</li><li><strong>Trains only those matrices</strong>, which are <em>low-rank</em> (small).</li></ul><h3>🧮 Mathematical Intuition</h3><p>If your original weight matrix is W (d×k), LoRA learns:</p><p>ΔW=A×B\Delta W = A \times B</p><p>Where A is (d×r) and B is (r×k), and r ≪ min(d,k) (low rank).<br> So, instead of updating millions of parameters, you update just a fraction.</p><h3>3️⃣ QLoRA: Quantization + LoRA</h3><p>QLoRA combines <strong>4-bit quantization</strong> (so model fits in memory) + LoRA.</p><ul><li>Model weights are quantized to <strong>NF4</strong> (Normal Float 4-bit format).</li><li>LoRA adapters are trained in <strong>full precision</strong> and merged back.</li></ul><h3>Why This Matters</h3><p>This means you can fine-tune a <strong>65B parameter model on a single A100</strong> — something that was unthinkable a year ago.</p><h3>4️⃣ The Era of 1-Bit LLMs (and 1.58 Bits 🤯)</h3><p>Researchers recently pushed quantization to the extreme:</p><ul><li><strong>1-bit models</strong> (binary weights) with clever scaling tricks.</li><li>Achieving near-FP16 accuracy with <strong>~50% memory usage</strong>.</li><li><strong>1.58-bit models</strong> use ternary weights (-1, 0, +1) for slightly better accuracy.</li></ul><blockquote><strong><em>Analogy:</em></strong><em> It’s like compressing an HD movie into a 50MB file but still being able to watch it in almost the same quality.</em></blockquote><p>This unlocks <strong>on-device LLMs</strong> on laptops, edge devices, and even phones.</p><h3>5️⃣ LLMOps Simplified</h3><p>Managing LLM pipelines used to be a pain: data curation, versioning, evaluation, deployment.<br> Now with tools like:</p><ul><li><strong>Weights &amp; Biases + MLflow</strong> → track experiments.</li><li><strong>LangChain + Haystack</strong> → build retrieval pipelines.</li><li><strong>vLLM / Text-Generation-Inference</strong> → serve models at scale.</li></ul><p>You can go from <strong>dataset → fine-tuned model → API endpoint</strong> in under 30 minutes.</p><h3>6️⃣ Hands-on: Fine-Tuning Gemma with LoRA in Keras</h3><p>Here’s a minimal working example using keras-nlp:</p><pre>import keras_nlp<br>import tensorflow as tf</pre><pre># 1. Load Gemma model<br>model = keras_nlp.models.GemmaCausalLM.from_preset(&quot;gemma_2b_en&quot;)</pre><pre># 2. Apply LoRA adapters<br>model = keras_nlp.models.LoraCausalLM.from_model(<br>    model,<br>    rank=8,  # Low-rank dimension<br>    alpha=32,<br>    dropout=0.1<br>)</pre><pre># 3. Prepare dataset<br>train_data = [<br>    {&quot;prompt&quot;: &quot;Translate English to French: Hello!&quot;, &quot;completion&quot;: &quot;Bonjour!&quot;},<br>    {&quot;prompt&quot;: &quot;Translate English to French: How are you?&quot;, &quot;completion&quot;: &quot;Comment ça va?&quot;}<br>]<br>ds = tf.data.Dataset.from_generator(<br>    lambda: ((x[&quot;prompt&quot;], x[&quot;completion&quot;]) for x in train_data),<br>    output_signature=(tf.TensorSpec(shape=(), dtype=tf.string), tf.TensorSpec(shape=(), dtype=tf.string))<br>)</pre><pre># 4. Compile and train<br>model.compile(optimizer=&quot;adam&quot;)<br>model.fit(ds.batch(2), epochs=3)</pre><pre># 5. Generate response<br>print(model.generate(&quot;Translate English to French: Good night!&quot;))</pre><p>This is intentionally simple — just enough to show readers that LoRA fine-tuning isn’t scary.</p><h3>7️⃣ Key Takeaways</h3><ul><li><strong>LoRA/QLoRA democratized fine-tuning</strong> — you don’t need $10k GPUs.</li><li><strong>1-bit &amp; 1.58-bit LLMs</strong> will bring near-state-of-the-art AI to your phone.</li><li><strong>LLMOps is getting easier</strong>, with tools that abstract away complexity.</li></ul><p>The future of LLM customization is <strong>accessible, cheap, and insanely fast</strong>. If you haven’t tried fine-tuning yet, this is the best time to start.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47e0f31c737a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Spreadsheets to Smart Vision: How Pandas Powers OpenCV & YOLO in Machine Learning]]></title>
            <link>https://medium.com/@yesiamritik33/from-spreadsheets-to-smart-vision-how-pandas-powers-opencv-yolo-in-machine-learning-4cfb9a39b1fc?source=rss-55809da50e2d------2</link>
            <guid isPermaLink="false">https://medium.com/p/4cfb9a39b1fc</guid>
            <dc:creator><![CDATA[ritikkumar]]></dc:creator>
            <pubDate>Sat, 16 Aug 2025 07:32:40 GMT</pubDate>
            <atom:updated>2025-08-16T07:32:40.774Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b0zyNWEKvdb1xu2-8KLz1A.png" /></figure><p>When I first opened a Pandas DataFrame, it felt just like working with an Excel sheet rows, columns, and values neatly aligned. But as I dug deeper, I realized Pandas was far more powerful than any spreadsheet.</p><p>Later, when I started exploring <strong>computer vision</strong> with <strong>OpenCV</strong> and <strong>YOLO (You Only Look Once)</strong>, I had a question: <em>what does tabular data have to do with images and object detection?</em></p><p>The answer surprised me <strong>Pandas is the silent backbone that connects raw image data, labels, and model outputs into a structured pipeline.</strong> Without it, building real-world ML products would be chaotic.</p><h3>Why Pandas is Unique</h3><p>Pandas is often called the “Excel of Python,” but that’s selling it short. Here’s what makes it unique:</p><p><strong>Intuitive Data Structures</strong> → DataFrames and Series let you handle data in a way that feels natural.</p><p><strong>Seamless Integration</strong> → Works with NumPy, Matplotlib, TensorFlow, OpenCV, and Scikit-learn.</p><p><strong>Efficient Cleaning &amp; Transformation</strong> → Perfect for handling missing values, merging datasets, and preprocessing before ML models.</p><p><strong>Scalability</strong> → From small CSVs to millions of rows, Pandas keeps your workflow smooth.</p><p>In short, Pandas is the <strong>bridge between raw data and machine learning insights.</strong></p><h3>Pandas in the World of Computer Vision</h3><p>At first glance, images and DataFrames seem unrelated. But here’s where Pandas plays a crucial role in ML pipelines with OpenCV and YOLO:</p><p><strong>Managing Metadata</strong></p><p>Images usually come with labels, bounding box coordinates, or annotations.</p><p>Pandas stores and processes this structured data easily.</p><p>Example: YOLO annotations (class, x_center, y_center, width, height) can be stored as a DataFrame for easier manipulation.</p><p><strong>Preprocessing Datasets</strong></p><p>When OpenCV resizes or augments images, Pandas ensures that labels remain consistent.</p><p>It acts as the “glue” between raw image files and their corresponding annotations.</p><p><strong>Analyzing Model Performance</strong></p><p>After YOLO runs object detection, results (confidence scores, bounding boxes, IoU metrics) can be stored in a Pandas DataFrame.</p><p>This makes it easy to calculate precision, recall, and overall performance.</p><p><strong>Pipeline Orchestration</strong></p><p>Pandas ensures that the right image matches the right annotation and prediction.</p><p>Think of it as the “data traffic controller” of computer vision workflows.</p><h3>Real-World Example: YOLO + Pandas for Sports Analytics</h3><p>Imagine building an <strong>object detection system for tennis ball movement</strong>:</p><p><strong>Step 1</strong>: OpenCV extracts frames from a tennis match video.</p><p><strong>Step 2</strong>: YOLO detects the tennis ball and generates bounding box coordinates for each frame.</p><p><strong>Step 3</strong>: All results (frame number, bounding box, confidence score) are stored in a Pandas DataFrame.</p><p><strong>Step 4</strong>: Using Pandas, we can:</p><p>Track the ball’s trajectory.</p><p>Calculate speed or bounce positions.</p><p>Generate player performance stats.</p><p>This structured insight would be impossible to manage without Pandas.</p><h3>Why Pandas is Crucial for ML Products</h3><p>When we think about ML products, we often focus only on models. But building a successful ML product requires:</p><p>Cleaning and structuring raw data.</p><p>Managing image annotations.</p><p>Tracking experiments and results.</p><p>Analyzing outputs to make business sense.</p><p>Pandas is the tool that quietly enables all these steps. It doesn’t make the headlines like YOLO or OpenCV, but without it, those models would struggle to fit into real-world systems.</p><p>Pandas may not be as glamorous as deep learning models, but it’s the <strong>foundation that transforms raw data into intelligence.</strong></p><p>In my journey, I’ve realized that the smarter the ML system, the more important Pandas becomes in its pipeline. From spreadsheets to smart vision, Pandas is the hidden hero powering data-driven innovation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4cfb9a39b1fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Beginner-Friendly Guide to RAG: Making AI Smarter with Retrieval-Augmented Generation]]></title>
            <link>https://medium.com/@yesiamritik33/a-beginner-friendly-guide-to-rag-making-ai-smarter-with-retrieval-augmented-generation-22975c665477?source=rss-55809da50e2d------2</link>
            <guid isPermaLink="false">https://medium.com/p/22975c665477</guid>
            <dc:creator><![CDATA[ritikkumar]]></dc:creator>
            <pubDate>Tue, 05 Aug 2025 16:44:37 GMT</pubDate>
            <atom:updated>2025-08-05T16:44:37.447Z</atom:updated>
            <content:encoded><![CDATA[<p>Imagine asking an AI a question about the latest news, and it not only understands your question but also pulls the most relevant facts from a huge library of information to give you an accurate, up-to-date answer. That’s the magic of Retrieval-Augmented Generation (RAG)! RAG combines the power of large language models (LLMs) with smart information retrieval to create AI systems that are both clever and reliable. In this article, I’ll walk you through what RAG is, how it works, and why it’s a big deal for building modern AI applications all in simple terms with plenty of examples.</p><h3>What is RAG, and Why Should You Care?</h3><p>RAG is like an AI librarian who’s great at both finding the right books and summarizing them for you. Traditional AI models, like chatbots, rely on what they’ve been trained on, which can get outdated or lead to wrong answers (called “hallucinations”). RAG solves this by splitting the job into two parts:</p><ol><li><strong>Finding Information (Retrieval)</strong>: It searches a database or collection of documents to find relevant facts.</li><li><strong>Creating Answers (Generation)</strong>: It uses a language model to turn those facts into clear, human-like responses.</li></ol><p>For example, if you ask, “What’s the latest on electric cars?” a RAG system might search a database of recent articles, pull out key facts, and then explain them in a way that’s easy to understand.</p><h3>Where is RAG Used?</h3><p>RAG is super useful in many areas:</p><ul><li><strong>Customer Support</strong>: Imagine a chatbot that pulls answers from a company’s FAQ or product manuals to help customers instantly.</li><li><strong>Education</strong>: A tool that finds and summarizes study materials for students.</li><li><strong>Healthcare</strong>: Helping doctors by retrieving relevant medical research for a patient’s condition.</li><li><strong>Content Writing</strong>: Assisting writers by gathering data to create fact-based articles or reports.</li></ul><p>By connecting AI to real-time information, RAG makes sure answers are accurate and relevant, not just guesses.</p><h3>How RAG Works: The Building Blocks</h3><p>RAG has two main parts that work together like a dynamic duo:</p><ol><li><strong>Retriever</strong>: This is the “search engine” that finds the most relevant documents or data based on your question.</li><li><strong>Generator</strong>: This is the language model (like a super-smart chatbot) that takes the retrieved information and turns it into a clear answer.</li></ol><p>Think of it like ordering food at a restaurant. The retriever is like the waiter who goes to the kitchen to find the ingredients (data), and the generator is the chef who prepares a delicious meal (the answer) using those ingredients.</p><h3>A Quick Look at Large Language Models (LLMs)</h3><p>LLMs are the brains behind RAG’s generator. They’re built on something called a <strong>transformer architecture</strong>, which is a fancy way of saying they’re really good at understanding and creating text. Transformers work by paying attention to the relationships between words in a sentence. For example, in “The cat chased the mouse,” the model knows “cat” and “chased” are connected, even if they’re not next to each other.</p><p>LLMs are trained on massive amounts of text, like books or websites, so they can generate human-like responses. In RAG, they take the information the retriever finds and make it sound natural and helpful.</p><h3>Why Python?</h3><p>Python is the go-to programming language for building RAG systems because it’s easy to use and has tons of tools. Libraries like <strong>Hugging Face Transformers</strong> help you work with LLMs, while <strong>Weaviate</strong> makes it simple to store and search data. If you’re new to coding, Python is a great place to start because it’s beginner-friendly and widely used in AI.</p><h3>Digging Deeper: Information Retrieval Made Simple</h3><p>The retriever’s job is to find the right information, like searching Google but smarter. Here’s how it does that:</p><h3>Types of Search</h3><ol><li><strong>Keyword Search</strong>: This looks for exact words in your question. For example, if you ask about “electric cars,” it searches for documents with those words. Tools like <strong>TF-IDF</strong> (which checks how important words are) and <strong>BM25</strong> (a ranking method) help pick the best matches.</li><li><strong>Semantic Search</strong>: This goes beyond keywords to understand meaning. If you ask about “electric vehicles,” it might also find documents about “battery-powered cars” because they’re related.</li><li><strong>Hybrid Search</strong>: Combines keyword and semantic search for the best of both worlds. It’s like searching for a recipe by ingredients (keywords) and cuisine type (meaning).</li></ol><h3>Vector Embeddings: Turning Words into Numbers</h3><p>Semantic search uses <strong>vector embeddings</strong>, which are like numerical fingerprints for words or sentences. Each piece of text is turned into a list of numbers that capture its meaning. For example, “dog” and “puppy” might have similar vectors because they’re related, while “dog” and “car” are far apart.</p><p>These vectors are stored in a <strong>vector database</strong> (like Weaviate), which makes it fast to find similar meanings. If you ask, “What’s a canine?” the system finds documents with vectors close to “canine,” like those about dogs or wolves.</p><h3>Metadata Filtering</h3><p>Sometimes, you want to narrow down the search. <strong>Metadata</strong> is extra info about a document, like its date, author, or topic. For example, if you only want articles about electric cars from 2025, metadata filtering ensures the retriever skips older documents.</p><h3>Measuring Success: Retrieval Metrics</h3><p>To make sure the retriever is doing a good job, we use metrics like:</p><ul><li><strong>Precision</strong>: Are the retrieved documents relevant?</li><li><strong>Recall</strong>: Did we find all the relevant documents?</li><li><strong>Mean Reciprocal Rank (MRR)</strong>: How high up is the best document in the search results?</li></ul><p>These metrics help fine-tune the retriever so it grabs the right stuff every time.</p><h3>Vector Databases: The Heart of Fast Retrieval</h3><p>A <strong>vector database</strong> is like a super-organized library for vector embeddings. It uses <strong>Approximate Nearest Neighbor (ANN)</strong> algorithms to quickly find vectors that are closest to your query. For example, Weaviate can search through millions of documents in seconds to find the most relevant ones.</p><h3>Chunking Documents</h3><p>Big documents, like a 100-page report, are hard to search all at once. So, RAG systems break them into smaller pieces called <strong>chunks</strong> (e.g., paragraphs). Each chunk gets its own vector, making it easier to find the exact part you need.</p><h3>Reranking for Better Results</h3><p>After finding a set of documents, the system might <strong>rerank</strong> them to put the best ones first. Tools like <strong>cross-encoders</strong> or <strong>ColBERT</strong> compare the query and documents more deeply to ensure the top results are spot-on.</p><h3>LLMs and Text Generation: Crafting Great Answers</h3><p>Once the retriever finds the right information, the LLM takes over to create the answer. Here’s what you need to know:</p><h3>How Transformers Work</h3><p>Transformers are the tech behind LLMs. They process text by breaking it into layers, where each layer focuses on different parts of the sentence. This helps the model understand context, like knowing “bank” means a riverbank or a financial institution based on the sentence.</p><h3>Prompt Engineering: Asking the Right Questions</h3><p>To get great answers, you need to ask the LLM the right way. <strong>Prompt engineering</strong> is about crafting clear instructions. For example, instead of asking, “Tell me about cars,” you might say, “Summarize the benefits of electric cars in 100 words.” This helps the LLM stay focused and avoid rambling.</p><h3>Dealing with Hallucinations</h3><p>Sometimes, LLMs make things up (hallucinations). For example, they might claim a car has “1000 horsepower” when it doesn’t. RAG reduces this by grounding answers in retrieved data, but you still need to check the output and tweak prompts to keep things accurate.</p><h3>RAG vs. Fine-Tuning</h3><p>Fine-tuning is like retraining an LLM on specific data (e.g., medical texts) to make it an expert in one area. RAG, on the other hand, pulls fresh data for each question, so it’s better for staying current without retraining. For example, RAG can fetch the latest news, while a fine-tuned model might miss new developments.</p><h3>Agentic RAG</h3><p>This is a fancy term for RAG systems that act like smart assistants. They don’t just answer one question — they can plan, break down complex tasks, and fetch information step-by-step. For example, if you ask, “Plan a trip to Paris,” an agentic RAG might retrieve flight prices, hotel options, and tourist attractions, then organize it all into a plan.</p><h3>Taking RAG to the Real World: Production Challenges</h3><p>Building a RAG system for real-world use (like a website or app) isn’t just about coding — it’s about making it fast, reliable, and secure. Here’s what matters:</p><h3>Speed vs. Quality</h3><p>Users want answers fast, but detailed searches take time. <strong>Quantization</strong> shrinks the LLM to run faster without losing too much accuracy. Optimizing the retriever (e.g., using ANN) also helps keep things speedy.</p><h3>Monitoring and Debugging</h3><p>In production, you need to watch how the system performs. <strong>Logging</strong> tracks what users ask, what the retriever finds, and what the LLM says. <strong>Tracing</strong> helps you debug issues, like why the wrong document was retrieved. This ensures the system stays reliable.</p><h3>Security Matters</h3><p>If your RAG system uses sensitive data (like customer records), you need to protect it. This means securing the database, encrypting data, and making sure the LLM doesn’t leak private information.</p><h3>Multimodal RAG: Beyond Text</h3><p>RAG isn’t just for text — it can handle images, audio, or even videos. For example, a multimodal RAG system could analyze a photo of a car, retrieve its specs from a database, and describe it in words. This opens up exciting possibilities for apps like visual search or virtual assistants.</p><h3>Evaluating RAG Systems</h3><p>To know if your RAG system is good, you need to test it. Metrics like <strong>factual accuracy</strong> (are the answers correct?) and <strong>user satisfaction</strong> (do users like the responses?) help you improve. You can also create custom tests, like checking if the system handles tricky questions well.</p><h3>Why RAG is a Game-Changer</h3><p>RAG is like giving AI a brain <em>and</em> a library. It combines the creativity of LLMs with the precision of information retrieval, making it perfect for building trustworthy AI systems. Whether you’re a coder, a business owner, or just curious about AI, RAG is worth exploring.</p><h3>Get Started with RAG</h3><p>Want to try it yourself? Start with Python and tools like:</p><ul><li><strong>Hugging Face Transformers</strong> for LLMs.</li><li><strong>Weaviate</strong> for vector databases.</li><li><strong>Elasticsearch</strong> for keyword search.</li></ul><p>Play around with small projects, like building a chatbot that answers questions about your favorite topic. The possibilities are endless!</p><p>RAG is shaping the future of AI by making it smarter, more accurate, and more versatile. So, jump in, experiment, and see how RAG can bring your ideas to life!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22975c665477" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>