<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[payal's Substack]]></title><description><![CDATA[Agentic AI x maths x System design x Research]]></description><link>https://payalkanyan.substack.com</link><image><url>https://substackcdn.com/image/fetch/$s_!fJa9!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53401c2a-101d-4c28-907a-8881d4a908ef_640x640.png</url><title>payal&apos;s Substack</title><link>https://payalkanyan.substack.com</link></image><generator>Substack</generator><lastBuildDate>Sun, 24 May 2026 09:28:26 GMT</lastBuildDate><atom:link href="https://payalkanyan.substack.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[payal]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[payalkanyan@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[payalkanyan@substack.com]]></itunes:email><itunes:name><![CDATA[payal]]></itunes:name></itunes:owner><itunes:author><![CDATA[payal]]></itunes:author><googleplay:owner><![CDATA[payalkanyan@substack.com]]></googleplay:owner><googleplay:email><![CDATA[payalkanyan@substack.com]]></googleplay:email><googleplay:author><![CDATA[payal]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[I Built a Second Brain That Actually Thinks ]]></title><description><![CDATA[Five databases, a Chrome extension, and an AI agent makes a personal knowledge operating system.]]></description><link>https://payalkanyan.substack.com/p/i-built-a-second-brain-that-actually</link><guid isPermaLink="false">https://payalkanyan.substack.com/p/i-built-a-second-brain-that-actually</guid><dc:creator><![CDATA[payal]]></dc:creator><pubDate>Sun, 17 May 2026 11:46:37 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!1eYN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F571d57f1-ddd9-4e47-ae38-4bc9fb8eea76_666x431.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Okay so this started from a genuinely embarrassing place.</p><p>I was in the middle of writing a technical post, I <em>knew</em> I had read a great explanation of  the topic somewhere. I could picture the page. I spent 40 minutes re-Googling variations of the same query, opening tabs, closing them, opening them again. Never found it.</p><p>That&#8217;s when I realized: I don&#8217;t have a knowledge problem. I have a retrieval problem. I read constantly and I retain almost none of it in a way that&#8217;s actually useful.</p><p>I had 147 bookmarks across three browsers. A Notion database with 100 articles I&#8217;d tagged &#8220;read later&#8221; and never opened. An Obsidian vault that felt productive to set up and then immediately became a burden to maintain.</p><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://payalkanyan.substack.com/p/i-built-a-second-brain-that-actually?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption">Thanks for reading payal's Substack! This post is public so feel free to share it.</p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://payalkanyan.substack.com/p/i-built-a-second-brain-that-actually?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://payalkanyan.substack.com/p/i-built-a-second-brain-that-actually?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><p>The thing is, all of these tools have the same problem underneath: <strong>filing cabinets.</strong> You put something in, it stays exactly where you put it, and you need to remember where you put it to get it back. They don&#8217;t understand what you read. They don&#8217;t connect ideas across sources. They don&#8217;t know that the paper you read in January is related to the blog post you saved last week.</p><p>So I built something that does and I&#8217;m calling it <strong>Personal KnowOS.</strong></p><p>The solution is simple: everything you actually read(not bookmark) becomes queryable knowledge without you doing anything. You browse normally. The system captures what you spend real time on, processes it, builds a graph of entities and relationships across your entire reading history, and gives you a conversational agent you can ask questions to. With citations. From your actual reading.</p><p>This post is about how I built it and why I made every decision I made. Including the ones I got wrong.</p><p></p><h2>The whole system, fast</h2><p>Chrome extension notices you&#8217;ve been reading something for real (not just landed on it) &#8594; POSTs cleaned content to a local FastAPI server &#8594; server immediately hands it off to a Celery worker and returns a job ID &#8594; worker chunks the text, embeds it into Qdrant, runs entity extraction into Neo4j, writes metadata to Postgres &#8594; Redis handles dedup and job tracking throughout.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wrV4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe60a62b2-dff9-4f22-b7c8-1fb90ca7d0b3_801x606.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wrV4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe60a62b2-dff9-4f22-b7c8-1fb90ca7d0b3_801x606.png 424w, https://substackcdn.com/image/fetch/$s_!wrV4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe60a62b2-dff9-4f22-b7c8-1fb90ca7d0b3_801x606.png 848w, https://substackcdn.com/image/fetch/$s_!wrV4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe60a62b2-dff9-4f22-b7c8-1fb90ca7d0b3_801x606.png 1272w, https://substackcdn.com/image/fetch/$s_!wrV4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe60a62b2-dff9-4f22-b7c8-1fb90ca7d0b3_801x606.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wrV4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe60a62b2-dff9-4f22-b7c8-1fb90ca7d0b3_801x606.png" width="646" height="488.73408239700376" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e60a62b2-dff9-4f22-b7c8-1fb90ca7d0b3_801x606.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:606,&quot;width&quot;:801,&quot;resizeWidth&quot;:646,&quot;bytes&quot;:51037,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/198098889?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe60a62b2-dff9-4f22-b7c8-1fb90ca7d0b3_801x606.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!wrV4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe60a62b2-dff9-4f22-b7c8-1fb90ca7d0b3_801x606.png 424w, https://substackcdn.com/image/fetch/$s_!wrV4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe60a62b2-dff9-4f22-b7c8-1fb90ca7d0b3_801x606.png 848w, https://substackcdn.com/image/fetch/$s_!wrV4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe60a62b2-dff9-4f22-b7c8-1fb90ca7d0b3_801x606.png 1272w, https://substackcdn.com/image/fetch/$s_!wrV4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe60a62b2-dff9-4f22-b7c8-1fb90ca7d0b3_801x606.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>When you ask a question, a LangGraph agent figures out what kind of question it is, decides whether to search your personal knowledge base or the live web (or both), runs hybrid retrieval across vectors + keyword + graph, re-ranks the results, pulls full context, and sends it to Gemini for synthesis with source citations.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PXwN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e04350e-1d40-429a-854b-be8dc09df8e1_801x685.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PXwN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e04350e-1d40-429a-854b-be8dc09df8e1_801x685.png 424w, https://substackcdn.com/image/fetch/$s_!PXwN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e04350e-1d40-429a-854b-be8dc09df8e1_801x685.png 848w, https://substackcdn.com/image/fetch/$s_!PXwN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e04350e-1d40-429a-854b-be8dc09df8e1_801x685.png 1272w, https://substackcdn.com/image/fetch/$s_!PXwN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e04350e-1d40-429a-854b-be8dc09df8e1_801x685.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PXwN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e04350e-1d40-429a-854b-be8dc09df8e1_801x685.png" width="566" height="484.03245942571783" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4e04350e-1d40-429a-854b-be8dc09df8e1_801x685.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:685,&quot;width&quot;:801,&quot;resizeWidth&quot;:566,&quot;bytes&quot;:47147,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/198098889?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e04350e-1d40-429a-854b-be8dc09df8e1_801x685.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!PXwN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e04350e-1d40-429a-854b-be8dc09df8e1_801x685.png 424w, https://substackcdn.com/image/fetch/$s_!PXwN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e04350e-1d40-429a-854b-be8dc09df8e1_801x685.png 848w, https://substackcdn.com/image/fetch/$s_!PXwN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e04350e-1d40-429a-854b-be8dc09df8e1_801x685.png 1272w, https://substackcdn.com/image/fetch/$s_!PXwN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e04350e-1d40-429a-854b-be8dc09df8e1_801x685.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>That&#8217;s the shape of it.</p><p></p><h2>Part 1: The Capture Layer</h2><p>The first real question comes: how does content get in?</p><p>I went through the options a lot of options like browser history parser, chrome extension, desktop/mobile app. </p><p>A <strong>Chrome extension</strong> was the only path that made sense. It runs inside the browser. It sees the fully rendered DOM. It knows how long I&#8217;ve been on the page, how far I&#8217;ve scrolled, when the tab was in focus. It can run Readability.js right there in the browser to strip navigation, ads, and boilerplate before the content ever touches my server.</p><p>The extension has two parts: 1. a content script that lives in the page and handles DOM access and text extraction, and 2. a background service worker that manages tab events and makes the actual POST request to FastAPI. They talk to each other via <code>chrome.runtime.sendMessage</code>.</p><p>The hard part wasn&#8217;t the building. It was figuring out what <em>not</em> to capture.</p><h3>On noise</h3><p>The first version of this captured everything. Everything. And my retrieval results were immediately garbage: LinkedIn profile pages, my shopping cart, Google search results I&#8217;d glanced at for three seconds, cookie consent dialogs that had somehow scraped together 200 words.</p><p>The insight, which sounds obvious in retrospect: a personal knowledge system is only as good as the signal you feed it. Noise doesn&#8217;t just fail to help. It actively makes things worse. Every irrelevant document that makes it in is something that could surface in your results instead of the thing you actually want.</p><p>So I added three layers of filtering.</p><p><strong>Behavioral gates: </strong>the extension only fires if you&#8217;ve spent at least 30 seconds on the page, scrolled at least 40% of the content, and the word count is over 250. These are proxies for &#8220;did I actually read this?&#8221; They&#8217;re not perfect but they&#8217;re pretty good.</p><p><strong>Domain blocklists: </strong>social media feeds, email inboxes, shopping pages, banking sites. The extension doesn&#8217;t even look at these.</p><p><strong>Content deduplication:</strong> SHA-256 hash of the cleaned text gets checked against Redis. If I&#8217;ve seen this content in the last 7 days, skip it. For near-duplicates (same article on the original site and three syndication farms), content similarity scoring at a 0.92 threshold.</p><p>Honestly, building the blocklist was more work than building the capture logic and more important.</p><div><hr></div><h2>Part 2: The Processing Pipeline</h2><p>When content arrives at FastAPI, the server does exactly one thing: it hands the work to a Celery task and returns a job ID. The whole endpoint takes under 200ms.</p><p>I&#8217;m proud of this decision because the temptation is to just process everything synchronously in the route handler. It&#8217;s simpler to write. And it would be completely unusable: chunking, embedding, NER, and three database writes takes 10-30 seconds. The extension would time out. The browser would feel broken.</p><p>Celery running against a Redis broker separates the HTTP response from the actual work. The extension stays snappy. Failed tasks retry automatically. Workers scale horizontally. And I stream status back to the extension via Server-Sent Events, so there&#8217;s a little progress indicator rather than a black hole.</p><h3>Chunking &#8212; the decision I got most wrong, most times</h3><p>I went through three versions of chunking before landing on something that actually worked.</p><p><strong>Version one: </strong>fixed-size chunks at 512 tokens. Dead simple to implement. Terrible in practice. Chunks that split mid-sentence, mid-argument, sometimes mid-concept. The embeddings for these chunks don&#8217;t represent coherent ideas, they represent arbitrary fragments. Retrieval was noisy in a way that felt random.</p><p><strong>Version two:</strong> sentence-level chunks. Better, at least each chunk is grammatically complete. But individual sentences are often meaningless in isolation. &#8220;This has three important advantages&#8221; retrieved without the advantages is useless. And sentence-level chunks are often too short to embed a real idea.</p><p><strong>Version three:</strong> which is what I run now: <strong>parent-child chunking</strong>. Small child chunks (256 tokens) get embedded and searched. Each child is linked to a large parent chunk (1024 tokens). When retrieval finds a relevant child, you fetch its parent for the LLM to actually read.</p><p>The insight:<strong> optimize search and read separately</strong>. Small chunks give precise retrieval because they capture narrow, specific semantics. Large chunks give the LLM enough context to actually understand and use what it found. Doing both in one chunk size means you&#8217;re compromising on both.</p><p>This single change improved answer quality.</p><p>For very long documents I also use semantic chunking, which splits on topic boundaries rather than token counts. The way you detect a boundary: measure cosine similarity between adjacent sentence embeddings. When it drops sharply, that&#8217;s a topic transition. Split there.</p><h3>The knowledge graph</h3><p>This is the piece that makes the system feel like memory rather than search.</p><p>After chunking, a spaCy NER pipeline runs over each document and pulls out named entities like people, organizations, places, concepts, products. These become nodes in Neo4j. Relationships extracted from sentence co-occurrence and dependency parsing become edges.</p><p>What this buys you: a retrieval path that pure vector search fundamentally cannot provide. Vector search is great at &#8220;what&#8217;s semantically related to this query.&#8221; Graph traversal is great at &#8220;what do I know about this specific entity.&#8221; They answer different questions.</p><p>If you search &#8220;Sam Altman&#8221; in a pure vector system, you&#8217;ll find documents where he&#8217;s prominently featured, where his name appears often enough to dominate the embedding. You might miss the document that mentions him once in passing, relevantly. Graph traversal finds every document with a node edge to him, regardless of prominence.</p><p>I added the graph last.</p><div><hr></div><h2>Part 3: Memory &#8212; Why You Need More Than One Database</h2><p>The most common mistake I see in projects like this is treating storage as one thing. Pick a database, put everything in it. This doesn&#8217;t work because different data has wildly different access patterns and latency requirements.</p><p>I made three tiers.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gDSl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5c32185-f3a8-4a35-9724-12e76a8acf87_666x326.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gDSl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5c32185-f3a8-4a35-9724-12e76a8acf87_666x326.png 424w, https://substackcdn.com/image/fetch/$s_!gDSl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5c32185-f3a8-4a35-9724-12e76a8acf87_666x326.png 848w, https://substackcdn.com/image/fetch/$s_!gDSl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5c32185-f3a8-4a35-9724-12e76a8acf87_666x326.png 1272w, https://substackcdn.com/image/fetch/$s_!gDSl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5c32185-f3a8-4a35-9724-12e76a8acf87_666x326.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gDSl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5c32185-f3a8-4a35-9724-12e76a8acf87_666x326.png" width="724" height="354.3903903903904" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f5c32185-f3a8-4a35-9724-12e76a8acf87_666x326.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:326,&quot;width&quot;:666,&quot;resizeWidth&quot;:724,&quot;bytes&quot;:39563,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/198098889?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5c32185-f3a8-4a35-9724-12e76a8acf87_666x326.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!gDSl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5c32185-f3a8-4a35-9724-12e76a8acf87_666x326.png 424w, https://substackcdn.com/image/fetch/$s_!gDSl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5c32185-f3a8-4a35-9724-12e76a8acf87_666x326.png 848w, https://substackcdn.com/image/fetch/$s_!gDSl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5c32185-f3a8-4a35-9724-12e76a8acf87_666x326.png 1272w, https://substackcdn.com/image/fetch/$s_!gDSl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5c32185-f3a8-4a35-9724-12e76a8acf87_666x326.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Tier 1</strong> is an <strong>in-process Python dictionary</strong>. Current session context and the agent&#8217;s conversation history live here. Latency is sub-millisecond. It dies on restart, which is fine, a session state doesn&#8217;t need to survive a restart. Running a Redis call for every agent state update during a conversation would be gratuitous overhead.</p><p><strong>Tier 2</strong> is <strong>Redis</strong>. Dedup fingerprints, job status, search result cache (24-hour TTL), the Celery task queue. Latency is around 1ms. Fast enough for the dedup check that runs on every ingested document, persistent enough to survive a server restart.</p><p><strong>Tier 3</strong> is the actual knowledge stores:<strong> Qdrant for vectors, Neo4j for the graph, Postgres for structured metadata</strong>. Latency is 5-50ms depending on query complexity. Durable, indexed, queryable. Each one handles the thing it&#8217;s genuinely designed for.</p><p>The rule I kept coming back to: match the storage to the access pattern. Don&#8217;t run a Qdrant vector search to check if you&#8217;ve seen a URL. Don&#8217;t store conversation history in Postgres. Don&#8217;t put embeddings in Redis.</p><div><hr></div><h2>Part 4: Retrieval &#8212; Why Hybrid Beats Simple</h2><p>The question at the heart of the retrieval system: when someone asks &#8220;what do I know about transformer architectures?&#8221;, how do you find the right content across thousands of documents?</p><p>The obvious answer is vector search. Embed the query, find similar embeddings. It works. But it misses things.</p><p>Vector search fails on exact terms. If you&#8217;re looking for &#8220;Attention is All You Need&#8221;, the vector might surface conceptually related documents that never mention the paper by name. Acronyms, proper nouns, and technical jargon compress poorly into embedding space.</p><p>Pure keyword search (BM25) fails on semantics. &#8220;How do attention mechanisms work&#8221; might miss a document that explains the concept perfectly using different vocabulary, because none of the words match.</p><p>So I run three retrievers in parallel and merge the results.</p><p><strong>First</strong>: vector search over Qdrant child chunks, but with HyDE(Hypothetical Document Embeddings). Instead of embedding the raw query, I prompt Gemini to generate three hypothetical answers to the question, then embed those. The hypothetical answers use domain vocabulary that matches how real documents are written, not how casual questions are phrased. For vague exploratory queries this dramatically improves recall.</p><p><strong>Second</strong>: BM25 over full document text in Postgres. Catches exact terminology, model names, paper titles, acronyms.</p><p><strong>Third</strong>: graph traversal over Neo4j for entity-centric queries. Start at the entity node, walk edges to related documents.</p><p>The three ranked result lists get merged with Reciprocal Rank Fusion. The formula: for each document, sum 1/(k + rank) across all lists where it appears, where k is typically 60. A document ranked highly in multiple lists scores much higher than one that appears in only one. No normalization needed.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1eYN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F571d57f1-ddd9-4e47-ae38-4bc9fb8eea76_666x431.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1eYN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F571d57f1-ddd9-4e47-ae38-4bc9fb8eea76_666x431.png 424w, https://substackcdn.com/image/fetch/$s_!1eYN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F571d57f1-ddd9-4e47-ae38-4bc9fb8eea76_666x431.png 848w, https://substackcdn.com/image/fetch/$s_!1eYN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F571d57f1-ddd9-4e47-ae38-4bc9fb8eea76_666x431.png 1272w, https://substackcdn.com/image/fetch/$s_!1eYN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F571d57f1-ddd9-4e47-ae38-4bc9fb8eea76_666x431.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1eYN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F571d57f1-ddd9-4e47-ae38-4bc9fb8eea76_666x431.png" width="728" height="471.12312312312315" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/571d57f1-ddd9-4e47-ae38-4bc9fb8eea76_666x431.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:431,&quot;width&quot;:666,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:49607,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/198098889?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F571d57f1-ddd9-4e47-ae38-4bc9fb8eea76_666x431.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!1eYN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F571d57f1-ddd9-4e47-ae38-4bc9fb8eea76_666x431.png 424w, https://substackcdn.com/image/fetch/$s_!1eYN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F571d57f1-ddd9-4e47-ae38-4bc9fb8eea76_666x431.png 848w, https://substackcdn.com/image/fetch/$s_!1eYN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F571d57f1-ddd9-4e47-ae38-4bc9fb8eea76_666x431.png 1272w, https://substackcdn.com/image/fetch/$s_!1eYN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F571d57f1-ddd9-4e47-ae38-4bc9fb8eea76_666x431.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>After RRF, the top 20 candidates go to a cross-encoder re-ranker.</p><p>This is the step I resisted adding the longest, and it had the biggest quality impact.</p><p>Vector search uses bi-encoders: query and document are embedded separately, then compared. It&#8217;s fast but the comparison is shallow, you&#8217;re comparing two independent summaries rather than reading both together. A cross-encoder takes the (query, document) pair as one input and runs full attention over both simultaneously. Much more accurate. Also O(n) expensive, which is why you only use it on top-20 candidates, not the full corpus.</p><p>Top 5 after re-ranking get their parent chunks fetched. Those go to the LLM.</p><div><hr></div><h2>Part 5: The Agent</h2><p>Without this layer, everything I&#8217;ve described is a sophisticated single-shot search system. One query, one retrieval pass, one answer. No iteration, no tool selection, no ability to say &#8220;I don&#8217;t have this in my personal KB, let me check the web.&#8221;</p><p><strong>LangGraph</strong> lets you build a <strong>stateful graph of agent nodes</strong> where edges can be conditional. Each node is a function that reads from and writes to a shared state dictionary. The graph loops until a termination condition is met.</p><p>My agent&#8217;s state carries the original query, retrieved chunks, tool call history, intermediate reasoning, and conversation history. Nodes can inspect previous tool calls and decide differently based on what they found.</p><p>The routing logic works like this. The classification node reads the query and decides: is this temporal (&#8221;what did I read last week about X?&#8221;) &#8594; Postgres-filtered vector search. Entity-centric (&#8221;everything I&#8217;ve read about Anthropic&#8221;) &#8594; graph traversal first. Current events (&#8221;what happened with OpenAI yesterday?&#8221;) &#8594; DuckDuckGo directly. Exploratory (&#8221;what do I know about diffusion models?&#8221;) &#8594; HyDE + vector.</p><p>The synthesis node is the most constrained part of the system. Gemini gets the retrieved context and a prompt that says: cite every factual claim to a source ID. Do not introduce information that isn&#8217;t in the provided context. If context is insufficient, say so explicitly and ask if I want to search the web.</p><p>This matters more than it sounds. An unconstrained synthesis step will confidently blend retrieved knowledge with model priors, and you&#8217;ll get answers that feel right but contain information that wasn&#8217;t in anything you actually read. The citation constraint forces grounding.</p><div><hr></div><h2>Part 6: Making It All Run</h2><p>Six Docker services in one compose file: FastAPI, Celery worker, Redis, Qdrant, Neo4j, Postgres. They share a Docker network and resolve each other by service name. Volumes for persistent data. Environment variables for secrets. Health checks so Celery doesn&#8217;t start before Redis is ready.</p><p>The embedding API call is the bottleneck at scale. It&#8217;s synchronous and has rate limits. The fix is batching: instead of embedding one chunk per API call, batch them. An async HTTP client (httpx) instead of requests helps too. At scale you&#8217;d also look at self-hosting an embedding model rather than paying per token.</p><div><hr></div><h2>What I Got Wrong</h2><p><strong>The chunking thing.</strong> I stayed with fixed-size chunks longer than I should have because they were simple and &#8220;good enough&#8221; felt like it was right around the corner. It wasn&#8217;t.</p><p><strong>Underestimating noise.</strong> I genuinely did not expect cookie dialogs and Google search result pages to make it through. The behavioral triggers felt conservative when I wrote them. In practice they barely held back the flood. The blocklist was the most tedious thing I built and probably had the highest return.</p><p><strong>Adding the graph last.</strong> I treated Neo4j as an enhancement rather than a core component. That means my entity extraction schema was designed around what was easy to bolt on, not what would be most useful for traversal. The Cypher queries feel improvised rather than planned. If I rebuilt this from scratch, the graph schema would be the first design artifact I produced.</p><p><strong>Not adding the cross-encoder at the start.</strong> I assumed bi-encoder vector search would be close enough and I could always add re-ranking later. There are very few retrieval systems where you don&#8217;t want a cross-encoder re-ranker.</p><div><hr></div><h2>What I Want to Build Next</h2><p>Running a cloud LLM over all my personal reading is a <strong>privacy tradeoff</strong> that bothers me more the longer I think about it. Local synthesis with <strong>Ollama</strong> and a quantized model is the most important thing on the roadmap. The quality hit is real but the privacy gain is worth it for something this personal.</p><p><strong>Spaced repetition</strong>, the system knows what I&#8217;ve read and when. It should be able to surface &#8220;you read this 4 months ago, do you still remember this?&#8221; and give me a one-paragraph refresher. Forgetting curve modeling over ingested content.</p><p><strong>Multi-modal capture</strong>. YouTube transcripts work partially. Podcasts, lectures, voice notes nothing. Whisper integration with timestamp-aligned chunking would bring audio into the knowledge base, which is where a huge chunk of my actual learning comes from.</p><p>The thing I want most and keep deprioritizing: <strong>graph visualization</strong>. I want to see my knowledge as a map. I want to see clusters forming around topics, connections appearing between ideas I didn&#8217;t know were related, blank spots in areas I think I understand. It would turn this from a search engine into something that actually feels like a second brain.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://payalkanyan.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://payalkanyan.substack.com/subscribe?"><span>Subscribe now</span></a></p><p>If this article helped clarify things, consider <strong>subscribing</strong> so you don&#8217;t miss future deep-dives, and feel free to <strong>like or leave a comment</strong>&#8212;I&#8217;d love to hear your thoughts and what you&#8217;d like to see next.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://payalkanyan.substack.com/p/i-built-a-second-brain-that-actually/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://payalkanyan.substack.com/p/i-built-a-second-brain-that-actually/comments"><span>Leave a comment</span></a></p><div class="directMessage button" data-attrs="{&quot;userId&quot;:236050308,&quot;userName&quot;:&quot;payal&quot;,&quot;canDm&quot;:null,&quot;dmUpgradeOptions&quot;:null,&quot;isEditorNode&quot;:true}" data-component-name="DirectMessageToDOM"></div><p></p>]]></content:encoded></item><item><title><![CDATA[MCP is the New HTTP — and Nobody's Explaining It Properly]]></title><description><![CDATA[The open protocol quietly becoming the connective tissue of the agentic AI era]]></description><link>https://payalkanyan.substack.com/p/mcp-is-the-new-http-and-nobodys-explaining</link><guid isPermaLink="false">https://payalkanyan.substack.com/p/mcp-is-the-new-http-and-nobodys-explaining</guid><dc:creator><![CDATA[payal]]></dc:creator><pubDate>Wed, 11 Mar 2026 15:54:54 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!GKxW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97798fb7-6127-4159-b493-1b5a6650719d_449x418.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="pullquote"><p>One of the confusing things when you first encounter MCP is &#8212; if AI agents can already call APIs and use tools, why do we need yet another protocol? Why didn't the community just stick with function calling and move on?</p></div><p>This confusion usually shows up right when you are starting to feel comfortable with how AI agents work. Then MCP appears, claiming to be a &#8220;universal standard for connecting AI to everything,&#8221; and suddenly the picture gets murky again.</p><p>The trick is to not start with the architecture. Start with the <em>problem it actually solves.</em></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://payalkanyan.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading payal's Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2><strong>The Problem: AI Agents Are Brilliant but Isolated</strong></h2><p>Today&#8217;s AI models can reason, write, plan, and summarize. But they are fundamentally disconnected from the systems where work actually happens.</p><p>Claude cannot see your Slack messages. It cannot push a commit to GitHub. It cannot query your company&#8217;s database. Not without someone writing custom glue code &#8212; every single time, for every single system.</p><p>Before MCP, connecting an AI to an external tool looked like this:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!F3tS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f3e0d15-5675-4dc2-9f51-5709328aca46_647x298.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!F3tS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f3e0d15-5675-4dc2-9f51-5709328aca46_647x298.png 424w, https://substackcdn.com/image/fetch/$s_!F3tS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f3e0d15-5675-4dc2-9f51-5709328aca46_647x298.png 848w, https://substackcdn.com/image/fetch/$s_!F3tS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f3e0d15-5675-4dc2-9f51-5709328aca46_647x298.png 1272w, https://substackcdn.com/image/fetch/$s_!F3tS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f3e0d15-5675-4dc2-9f51-5709328aca46_647x298.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!F3tS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f3e0d15-5675-4dc2-9f51-5709328aca46_647x298.png" width="727" height="334.84698608964453" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3f3e0d15-5675-4dc2-9f51-5709328aca46_647x298.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:298,&quot;width&quot;:647,&quot;resizeWidth&quot;:727,&quot;bytes&quot;:44089,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/190630124?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f3e0d15-5675-4dc2-9f51-5709328aca46_647x298.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!F3tS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f3e0d15-5675-4dc2-9f51-5709328aca46_647x298.png 424w, https://substackcdn.com/image/fetch/$s_!F3tS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f3e0d15-5675-4dc2-9f51-5709328aca46_647x298.png 848w, https://substackcdn.com/image/fetch/$s_!F3tS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f3e0d15-5675-4dc2-9f51-5709328aca46_647x298.png 1272w, https://substackcdn.com/image/fetch/$s_!F3tS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f3e0d15-5675-4dc2-9f51-5709328aca46_647x298.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>That second column is what the <strong>Model Context Protocol</strong> makes possible. And the USB analogy is not just poetic &#8212; it is precise.</p><p></p><blockquote><p>Before USB, every device had its own proprietary connector. USB gave the world one standard plug. MCP does the same thing for AI agents and external systems.</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qrXG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa802511-1173-4aa6-8f71-d21011aeda3d_639x159.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qrXG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa802511-1173-4aa6-8f71-d21011aeda3d_639x159.png 424w, https://substackcdn.com/image/fetch/$s_!qrXG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa802511-1173-4aa6-8f71-d21011aeda3d_639x159.png 848w, https://substackcdn.com/image/fetch/$s_!qrXG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa802511-1173-4aa6-8f71-d21011aeda3d_639x159.png 1272w, https://substackcdn.com/image/fetch/$s_!qrXG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa802511-1173-4aa6-8f71-d21011aeda3d_639x159.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qrXG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa802511-1173-4aa6-8f71-d21011aeda3d_639x159.png" width="727" height="180.8967136150235" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fa802511-1173-4aa6-8f71-d21011aeda3d_639x159.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:159,&quot;width&quot;:639,&quot;resizeWidth&quot;:727,&quot;bytes&quot;:15534,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/190630124?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa802511-1173-4aa6-8f71-d21011aeda3d_639x159.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!qrXG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa802511-1173-4aa6-8f71-d21011aeda3d_639x159.png 424w, https://substackcdn.com/image/fetch/$s_!qrXG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa802511-1173-4aa6-8f71-d21011aeda3d_639x159.png 848w, https://substackcdn.com/image/fetch/$s_!qrXG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa802511-1173-4aa6-8f71-d21011aeda3d_639x159.png 1272w, https://substackcdn.com/image/fetch/$s_!qrXG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa802511-1173-4aa6-8f71-d21011aeda3d_639x159.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h2><strong><br>What MCP Actually Is</strong></h2><p>MCP stands for <strong>Model Context Protocol</strong>. It is an open-source standard, originally developed by Anthropic, that defines how AI applications communicate with external systems &#8212; databases, file systems, search engines, Slack, Google Drive, GitHub, maps, and more.</p><p>One detail that is rarely explained clearly: MCP is a <strong>s</strong><em><strong>tateful protocol</strong></em><strong>.</strong> Unlike a REST API call that fires and forgets, MCP maintains a persistent connection with a full lifecycle &#8212; it must be initialized, kept alive, and properly shut down. This makes it far better suited to the back-and-forth, multi-step nature of real agentic workflows.<br></p><blockquote><p><strong>&#128161; Why Stateful Matters</strong></p><p>Imagine asking an agent to &#8220;review all open PRs and comment on anything touching the auth module.&#8221; That requires multiple tool calls, context carried across them, and real-time updates as results come back. A stateless REST call can&#8217;t do this well. A stateful MCP connection can.</p></blockquote><p><br>The MCP ecosystem has three layers:</p><p><strong>MCP Specification</strong> &#8212; the formal standard that defines exactly what clients and servers must implement. Language-agnostic and versioned.</p><p><strong>SDKs</strong> &#8212; available in Python, TypeScript, and more, so developers can build MCP servers without implementing the protocol from scratch.</p><p><strong>Dev Tools &amp; Reference Implementations</strong> &#8212; ready-made MCP servers for common systems (filesystem, GitHub, web search, databases) that you can plug in immediately without writing any server code.</p><h2><strong><br>The Architecture: Three Actors, One Clear Job Each</strong></h2><p>MCP uses a client-server architecture &#8212; but with one extra piece that makes everything click. There are three actors, and each has a clean, non-overlapping role.</p><p><strong>The Host</strong> is the AI application &#8212; Claude Desktop, VS Code with an AI extension, Cursor, or any custom agent framework. It is what the user interacts with. The host owns the conversation and orchestrates everything.</p><p><strong>The Client</strong> lives inside the host. Each client maintains a dedicated, one-to-one connection with a single MCP server. If the host needs to talk to both GitHub and the filesystem, it spins up two separate clients &#8212; one for each. Clients are the translation layer between the host&#8217;s needs and the server&#8217;s capabilities.</p><p><strong>The Server</strong> is the external system. A GitHub MCP server exposes repository operations. A filesystem MCP server exposes file reads and writes. Each runs as its own independent process.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GKxW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97798fb7-6127-4159-b493-1b5a6650719d_449x418.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GKxW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97798fb7-6127-4159-b493-1b5a6650719d_449x418.png 424w, https://substackcdn.com/image/fetch/$s_!GKxW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97798fb7-6127-4159-b493-1b5a6650719d_449x418.png 848w, https://substackcdn.com/image/fetch/$s_!GKxW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97798fb7-6127-4159-b493-1b5a6650719d_449x418.png 1272w, https://substackcdn.com/image/fetch/$s_!GKxW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97798fb7-6127-4159-b493-1b5a6650719d_449x418.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GKxW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97798fb7-6127-4159-b493-1b5a6650719d_449x418.png" width="563" height="524.1291759465479" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/97798fb7-6127-4159-b493-1b5a6650719d_449x418.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:418,&quot;width&quot;:449,&quot;resizeWidth&quot;:563,&quot;bytes&quot;:22850,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/190630124?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97798fb7-6127-4159-b493-1b5a6650719d_449x418.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!GKxW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97798fb7-6127-4159-b493-1b5a6650719d_449x418.png 424w, https://substackcdn.com/image/fetch/$s_!GKxW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97798fb7-6127-4159-b493-1b5a6650719d_449x418.png 848w, https://substackcdn.com/image/fetch/$s_!GKxW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97798fb7-6127-4159-b493-1b5a6650719d_449x418.png 1272w, https://substackcdn.com/image/fetch/$s_!GKxW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97798fb7-6127-4159-b493-1b5a6650719d_449x418.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><blockquote><p><strong>&#128273; Key Rule</strong></p><p>The host <em>never</em> talks directly to a server. It always goes through a dedicated client. This separation keeps concerns clean, security manageable, and failures isolated &#8212; if one server crashes, only its client is affected.</p></blockquote><h2><strong><br>The Two Layers Inside Every MCP Connection</strong></h2><p>Every MCP connection has two layers working together &#8212; an inner data layer and an outer transport layer. Think of it like a letter: the transport layer is the envelope and postal system, the data layer is the language the letter is written in.</p><h3><strong>The Data Layer (Inner)</strong></h3><p>All communication between a client and server uses <strong>JSON-RPC 2.0</strong> &#8212; a lightweight remote procedure call protocol. Every message is a clean JSON object: a method name, a set of parameters, and an ID so responses can be matched back to their requests.</p><p>The most important job of the data layer is <strong>schema definition</strong> &#8212; formally describing what a server can do, what inputs it expects, and what shape the output takes. This is how an AI discovers available tools without any hardcoded knowledge. It just asks: &#8220;what can you do?&#8221; and the server tells it.</p><h3><strong>The Transport Layer (Outer)</strong></h3><p>This is how messages physically travel. MCP supports two mechanisms, chosen based on where the server lives.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ECbw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31e84208-1b57-49ea-b3a6-eb5bf040aaef_639x346.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ECbw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31e84208-1b57-49ea-b3a6-eb5bf040aaef_639x346.png 424w, https://substackcdn.com/image/fetch/$s_!ECbw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31e84208-1b57-49ea-b3a6-eb5bf040aaef_639x346.png 848w, https://substackcdn.com/image/fetch/$s_!ECbw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31e84208-1b57-49ea-b3a6-eb5bf040aaef_639x346.png 1272w, https://substackcdn.com/image/fetch/$s_!ECbw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31e84208-1b57-49ea-b3a6-eb5bf040aaef_639x346.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ECbw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31e84208-1b57-49ea-b3a6-eb5bf040aaef_639x346.png" width="726" height="393.1079812206573" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/31e84208-1b57-49ea-b3a6-eb5bf040aaef_639x346.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:346,&quot;width&quot;:639,&quot;resizeWidth&quot;:726,&quot;bytes&quot;:45438,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/190630124?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31e84208-1b57-49ea-b3a6-eb5bf040aaef_639x346.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ECbw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31e84208-1b57-49ea-b3a6-eb5bf040aaef_639x346.png 424w, https://substackcdn.com/image/fetch/$s_!ECbw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31e84208-1b57-49ea-b3a6-eb5bf040aaef_639x346.png 848w, https://substackcdn.com/image/fetch/$s_!ECbw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31e84208-1b57-49ea-b3a6-eb5bf040aaef_639x346.png 1272w, https://substackcdn.com/image/fetch/$s_!ECbw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31e84208-1b57-49ea-b3a6-eb5bf040aaef_639x346.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The SSE (Server-Sent Events) part of the HTTP transport is worth pausing on. It means the server can <em>push</em> updates to the client as things happen &#8212; not just respond to requests. This is what enables real-time notifications in MCP: a long-running task can stream progress back to the agent as it works.</p><h2><strong>The Lifecycle: MCP Is Not Fire-and-Forget</strong></h2><p>Because MCP is stateful, connections have a proper lifecycle that needs to be managed. This is one of the most underexplained parts of the protocol.</p><p><strong>MCP Connection Lifecycle</strong></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!He7B!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba0ad09b-e88f-4b37-afe6-c6de900fc204_639x216.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!He7B!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba0ad09b-e88f-4b37-afe6-c6de900fc204_639x216.png 424w, https://substackcdn.com/image/fetch/$s_!He7B!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba0ad09b-e88f-4b37-afe6-c6de900fc204_639x216.png 848w, https://substackcdn.com/image/fetch/$s_!He7B!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba0ad09b-e88f-4b37-afe6-c6de900fc204_639x216.png 1272w, https://substackcdn.com/image/fetch/$s_!He7B!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba0ad09b-e88f-4b37-afe6-c6de900fc204_639x216.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!He7B!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba0ad09b-e88f-4b37-afe6-c6de900fc204_639x216.png" width="727" height="245.74647887323943" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ba0ad09b-e88f-4b37-afe6-c6de900fc204_639x216.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:216,&quot;width&quot;:639,&quot;resizeWidth&quot;:727,&quot;bytes&quot;:23706,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/190630124?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba0ad09b-e88f-4b37-afe6-c6de900fc204_639x216.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!He7B!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba0ad09b-e88f-4b37-afe6-c6de900fc204_639x216.png 424w, https://substackcdn.com/image/fetch/$s_!He7B!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba0ad09b-e88f-4b37-afe6-c6de900fc204_639x216.png 848w, https://substackcdn.com/image/fetch/$s_!He7B!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba0ad09b-e88f-4b37-afe6-c6de900fc204_639x216.png 1272w, https://substackcdn.com/image/fetch/$s_!He7B!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba0ad09b-e88f-4b37-afe6-c6de900fc204_639x216.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The initialization handshake is particularly important &#8212; it is where the client and server negotiate which features each supports, so they never assume capabilities the other side doesn&#8217;t have. This is what makes MCP robust across very different server implementations.<br></p><h2><strong>MCP Primitives: The Vocabulary of Agentic Action</strong></h2><p>This is where MCP gets genuinely interesting. The protocol defines a vocabulary of <strong>primitives</strong> &#8212; the building blocks that describe every possible action and piece of context that can flow between client and server. And it goes <em>both ways.</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3apj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5edb3cd5-0d4b-4e64-9366-59d1414bd3f6_639x414.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3apj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5edb3cd5-0d4b-4e64-9366-59d1414bd3f6_639x414.png 424w, https://substackcdn.com/image/fetch/$s_!3apj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5edb3cd5-0d4b-4e64-9366-59d1414bd3f6_639x414.png 848w, https://substackcdn.com/image/fetch/$s_!3apj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5edb3cd5-0d4b-4e64-9366-59d1414bd3f6_639x414.png 1272w, https://substackcdn.com/image/fetch/$s_!3apj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5edb3cd5-0d4b-4e64-9366-59d1414bd3f6_639x414.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3apj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5edb3cd5-0d4b-4e64-9366-59d1414bd3f6_639x414.png" width="726" height="470.36619718309856" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5edb3cd5-0d4b-4e64-9366-59d1414bd3f6_639x414.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:414,&quot;width&quot;:639,&quot;resizeWidth&quot;:726,&quot;bytes&quot;:75397,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/190630124?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5edb3cd5-0d4b-4e64-9366-59d1414bd3f6_639x414.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!3apj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5edb3cd5-0d4b-4e64-9366-59d1414bd3f6_639x414.png 424w, https://substackcdn.com/image/fetch/$s_!3apj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5edb3cd5-0d4b-4e64-9366-59d1414bd3f6_639x414.png 848w, https://substackcdn.com/image/fetch/$s_!3apj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5edb3cd5-0d4b-4e64-9366-59d1414bd3f6_639x414.png 1272w, https://substackcdn.com/image/fetch/$s_!3apj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5edb3cd5-0d4b-4e64-9366-59d1414bd3f6_639x414.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The <strong>Sampling</strong> primitive deserves special attention. It means a server can ask the host&#8217;s AI to do reasoning <em>mid-execution</em> &#8212; without needing its own model access or API key. A GitHub MCP server could, during a PR review, ask Claude: &#8220;based on these diffs, does this look like a security issue?&#8221; and incorporate that judgment into its next action. Servers become genuinely intelligent, not just mechanical.</p><p>The <strong>Elicitation</strong> primitive is equally powerful. It means agentic workflows do not have to be fully autonomous or fully manual. A server can pause mid-task and surface a clarifying question to the user through the host&#8217;s interface &#8212; &#8220;which branch should I push to?&#8221; &#8212; before continuing. This is the missing piece for human-in-the-loop agentic systems.<br></p><h2><strong>Why MCP Feels Like HTTP for the Agentic Era</strong></h2><p>When the web was being built, HTTP solved a critical coordination problem: any browser could talk to any server without custom integration. You did not need to know whether a server ran Apache or Nginx. HTTP abstracted that away &#8212; and the web exploded.</p><p>MCP is doing the same thing for AI agents.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!M_ru!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb369034-b063-443e-bb40-cf57346d58e6_639x376.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!M_ru!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb369034-b063-443e-bb40-cf57346d58e6_639x376.png 424w, https://substackcdn.com/image/fetch/$s_!M_ru!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb369034-b063-443e-bb40-cf57346d58e6_639x376.png 848w, https://substackcdn.com/image/fetch/$s_!M_ru!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb369034-b063-443e-bb40-cf57346d58e6_639x376.png 1272w, https://substackcdn.com/image/fetch/$s_!M_ru!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb369034-b063-443e-bb40-cf57346d58e6_639x376.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!M_ru!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb369034-b063-443e-bb40-cf57346d58e6_639x376.png" width="725" height="426.60406885759" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/eb369034-b063-443e-bb40-cf57346d58e6_639x376.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:376,&quot;width&quot;:639,&quot;resizeWidth&quot;:725,&quot;bytes&quot;:43316,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/190630124?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb369034-b063-443e-bb40-cf57346d58e6_639x376.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!M_ru!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb369034-b063-443e-bb40-cf57346d58e6_639x376.png 424w, https://substackcdn.com/image/fetch/$s_!M_ru!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb369034-b063-443e-bb40-cf57346d58e6_639x376.png 848w, https://substackcdn.com/image/fetch/$s_!M_ru!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb369034-b063-443e-bb40-cf57346d58e6_639x376.png 1272w, https://substackcdn.com/image/fetch/$s_!M_ru!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb369034-b063-443e-bb40-cf57346d58e6_639x376.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The web succeeded because it standardized communication. Any developer could build a website knowing any browser could render it. The agentic AI ecosystem will succeed for exactly the same reason &#8212; because any developer can build an MCP server knowing any AI host can use it.<br></p><h2><strong>The Real Takeaway</strong></h2><p>MCP is not just a developer tool. It is infrastructure &#8212; the quiet foundation being laid right now that will determine whether AI agents remain impressive demos or become genuinely useful participants in complex real-world workflows.</p><p>Once the mental model clicks, it becomes simple:</p><p>The <strong>host</strong> is the AI application. The <strong>client</strong> is the dedicated bridge to each external system. The <strong>server</strong> is the external system. The host never talks to servers directly &#8212; always through clients. The <strong>data layer</strong> defines what is said; the <strong>transport layer</strong> defines how it travels. <strong>Tools</strong> are what the AI does. <strong>Resources</strong> are what it reads. <strong>Prompts</strong> are how it is guided. And the whole thing is <strong>stateful</strong> &#8212; which is what makes long-running, multi-step agentic tasks possible.</p><p>The same way you do not think about TCP/IP every time you open a browser, you will eventually not think about MCP every time your AI agent reads a file, queries a database, or drafts a Slack message. It will just work.</p><p>And the reason it will just work is because someone built the standard properly.</p><p><strong>Next up:</strong> Building your own MCP server from scratch &#8212; in under 50 lines of Python.</p><p>Till then, keep building &#8212; and stay curious.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://payalkanyan.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://payalkanyan.substack.com/subscribe?"><span>Subscribe now</span></a></p><p>If this article helped clarify things, consider <strong>subscribing</strong> so you don&#8217;t miss future deep-dives, and feel free to <strong>like or leave a comment</strong>&#8212;I&#8217;d love to hear your thoughts and what you&#8217;d like to see next.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://payalkanyan.substack.com/p/mcp-is-the-new-http-and-nobodys-explaining/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://payalkanyan.substack.com/p/mcp-is-the-new-http-and-nobodys-explaining/comments"><span>Leave a comment</span></a></p><div class="directMessage button" data-attrs="{&quot;userId&quot;:236050308,&quot;userName&quot;:&quot;payal&quot;,&quot;canDm&quot;:null,&quot;dmUpgradeOptions&quot;:null,&quot;isEditorNode&quot;:true}" data-component-name="DirectMessageToDOM"></div><p></p>]]></content:encoded></item><item><title><![CDATA[Linear Algebra for Machine Learning]]></title><description><![CDATA[The Quiet Foundation Behind Intelligent Systems - Part 3]]></description><link>https://payalkanyan.substack.com/p/linear-algebra-for-machine-learning-9f3</link><guid isPermaLink="false">https://payalkanyan.substack.com/p/linear-algebra-for-machine-learning-9f3</guid><dc:creator><![CDATA[payal]]></dc:creator><pubDate>Wed, 28 Jan 2026 10:56:08 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!nfwU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe7c9261-1459-4b84-ac7d-a5894d06b824_1472x1137.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Before diving into this final part, it helps to have the earlier pieces fresh in mind.</p><p>In <strong><a href="https://payalkanyan.substack.com/p/linear-algebra-for-machine-learning">Part 1: </a></strong><em><strong><a href="https://payalkanyan.substack.com/p/linear-algebra-for-machine-learning">The Quiet Foundation Behind Intelligent Systems</a></strong></em>, we built the ground floor &#8212; understanding what scalars, vectors, matrices, and linear equations actually are, and why machine learning quietly depends on them everywhere.</p><p>In <strong><a href="https://payalkanyan.substack.com/p/linear-algebra-for-machine-learning-bc3">Part 2</a></strong><a href="https://payalkanyan.substack.com/p/linear-algebra-for-machine-learning-bc3">,</a> we shifted from <em>what these objects are</em> to <em>what they do</em>, looking at how matrices act as transformations, how data moves through space, and why these transformations matter more than the numbers themselves.</p><p>This article continues naturally from both.</p><p>If any idea here feels slightly unfamiliar, it&#8217;s not a dead end &#8212; it&#8217;s usually a sign that revisiting <a href="https://payalkanyan.substack.com/p/linear-algebra-for-machine-learning">Part 1</a> or <a href="https://payalkanyan.substack.com/p/linear-algebra-for-machine-learning-bc3">Part 2</a> for a few minutes will make everything click again.</p><p>So far, we&#8217;ve asked <strong>what vectors and matrices are</strong>, and <strong>why machine learning needs them</strong>.</p><p>Now we go one level deeper and ask a more practical question:</p><p><em>How do vectors interact, stretch, align, collapse, and quietly decide which directions matter &#8212; and why do those interactions show up everywhere from regularisation to PCA?<br></em></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://payalkanyan.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading payal's Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2>Vectors: Rows, Columns, and Direction</h2><p>A <strong>vector</strong> is simply an ordered list of numbers, but the way we write it matters.</p><ul><li><p>A <strong>row vector</strong> is written horizontally</p></li><li><p>A <strong>column vector</strong> is written vertically</p></li></ul><p>In ML, column vectors are more common because they fit naturally into matrix multiplication.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!d3NH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3df77c9d-cd7c-4ea0-ad2e-dd501f5375d6_1928x794.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!d3NH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3df77c9d-cd7c-4ea0-ad2e-dd501f5375d6_1928x794.jpeg 424w, https://substackcdn.com/image/fetch/$s_!d3NH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3df77c9d-cd7c-4ea0-ad2e-dd501f5375d6_1928x794.jpeg 848w, https://substackcdn.com/image/fetch/$s_!d3NH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3df77c9d-cd7c-4ea0-ad2e-dd501f5375d6_1928x794.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!d3NH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3df77c9d-cd7c-4ea0-ad2e-dd501f5375d6_1928x794.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!d3NH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3df77c9d-cd7c-4ea0-ad2e-dd501f5375d6_1928x794.jpeg" width="654" height="269.5054945054945" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3df77c9d-cd7c-4ea0-ad2e-dd501f5375d6_1928x794.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1456,&quot;resizeWidth&quot;:654,&quot;bytes&quot;:54588,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/186057524?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3df77c9d-cd7c-4ea0-ad2e-dd501f5375d6_1928x794.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!d3NH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3df77c9d-cd7c-4ea0-ad2e-dd501f5375d6_1928x794.jpeg 424w, https://substackcdn.com/image/fetch/$s_!d3NH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3df77c9d-cd7c-4ea0-ad2e-dd501f5375d6_1928x794.jpeg 848w, https://substackcdn.com/image/fetch/$s_!d3NH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3df77c9d-cd7c-4ea0-ad2e-dd501f5375d6_1928x794.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!d3NH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3df77c9d-cd7c-4ea0-ad2e-dd501f5375d6_1928x794.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><br>Measuring Vector &#8220;Size&#8221;: Norms</h2><p>When we talk about a vector&#8217;s <em>length</em>, we use something called a <strong>norm</strong>.</p><h3>L1 Norm (Manhattan Distance)</h3><p>The <strong>L1 norm</strong> adds up the absolute values of the components:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nNkp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2adf3553-2bcb-4875-a025-1ae6c2dc1c72_260x55.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nNkp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2adf3553-2bcb-4875-a025-1ae6c2dc1c72_260x55.png 424w, https://substackcdn.com/image/fetch/$s_!nNkp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2adf3553-2bcb-4875-a025-1ae6c2dc1c72_260x55.png 848w, https://substackcdn.com/image/fetch/$s_!nNkp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2adf3553-2bcb-4875-a025-1ae6c2dc1c72_260x55.png 1272w, https://substackcdn.com/image/fetch/$s_!nNkp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2adf3553-2bcb-4875-a025-1ae6c2dc1c72_260x55.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nNkp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2adf3553-2bcb-4875-a025-1ae6c2dc1c72_260x55.png" width="426" height="90.11538461538461" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2adf3553-2bcb-4875-a025-1ae6c2dc1c72_260x55.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:55,&quot;width&quot;:260,&quot;resizeWidth&quot;:426,&quot;bytes&quot;:2488,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/186057524?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2adf3553-2bcb-4875-a025-1ae6c2dc1c72_260x55.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!nNkp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2adf3553-2bcb-4875-a025-1ae6c2dc1c72_260x55.png 424w, https://substackcdn.com/image/fetch/$s_!nNkp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2adf3553-2bcb-4875-a025-1ae6c2dc1c72_260x55.png 848w, https://substackcdn.com/image/fetch/$s_!nNkp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2adf3553-2bcb-4875-a025-1ae6c2dc1c72_260x55.png 1272w, https://substackcdn.com/image/fetch/$s_!nNkp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2adf3553-2bcb-4875-a025-1ae6c2dc1c72_260x55.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Intuition:</p><p>Imagine walking in a city laid out in blocks &#8212; you can only move left/right and up/down. L1 norm measures distance the way you&#8217;d walk, not fly.</p><h3>L2 Norm (Euclidean Distance)</h3><p>The <strong>L2 norm</strong> is the straight-line distance:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!weUO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18423f4-3d71-48cb-914e-d83267ceb6a1_260x55.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!weUO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18423f4-3d71-48cb-914e-d83267ceb6a1_260x55.png 424w, https://substackcdn.com/image/fetch/$s_!weUO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18423f4-3d71-48cb-914e-d83267ceb6a1_260x55.png 848w, https://substackcdn.com/image/fetch/$s_!weUO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18423f4-3d71-48cb-914e-d83267ceb6a1_260x55.png 1272w, https://substackcdn.com/image/fetch/$s_!weUO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18423f4-3d71-48cb-914e-d83267ceb6a1_260x55.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!weUO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18423f4-3d71-48cb-914e-d83267ceb6a1_260x55.png" width="426" height="90.11538461538461" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a18423f4-3d71-48cb-914e-d83267ceb6a1_260x55.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:55,&quot;width&quot;:260,&quot;resizeWidth&quot;:426,&quot;bytes&quot;:3042,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/186057524?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18423f4-3d71-48cb-914e-d83267ceb6a1_260x55.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!weUO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18423f4-3d71-48cb-914e-d83267ceb6a1_260x55.png 424w, https://substackcdn.com/image/fetch/$s_!weUO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18423f4-3d71-48cb-914e-d83267ceb6a1_260x55.png 848w, https://substackcdn.com/image/fetch/$s_!weUO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18423f4-3d71-48cb-914e-d83267ceb6a1_260x55.png 1272w, https://substackcdn.com/image/fetch/$s_!weUO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18423f4-3d71-48cb-914e-d83267ceb6a1_260x55.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>This is the distance your intuition already knows &#8212; shortest path through space.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nfwU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe7c9261-1459-4b84-ac7d-a5894d06b824_1472x1137.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nfwU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe7c9261-1459-4b84-ac7d-a5894d06b824_1472x1137.jpeg 424w, https://substackcdn.com/image/fetch/$s_!nfwU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe7c9261-1459-4b84-ac7d-a5894d06b824_1472x1137.jpeg 848w, https://substackcdn.com/image/fetch/$s_!nfwU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe7c9261-1459-4b84-ac7d-a5894d06b824_1472x1137.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!nfwU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe7c9261-1459-4b84-ac7d-a5894d06b824_1472x1137.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nfwU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe7c9261-1459-4b84-ac7d-a5894d06b824_1472x1137.jpeg" width="1456" height="1125" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fe7c9261-1459-4b84-ac7d-a5894d06b824_1472x1137.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1125,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:64285,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/186057524?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe7c9261-1459-4b84-ac7d-a5894d06b824_1472x1137.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!nfwU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe7c9261-1459-4b84-ac7d-a5894d06b824_1472x1137.jpeg 424w, https://substackcdn.com/image/fetch/$s_!nfwU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe7c9261-1459-4b84-ac7d-a5894d06b824_1472x1137.jpeg 848w, https://substackcdn.com/image/fetch/$s_!nfwU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe7c9261-1459-4b84-ac7d-a5894d06b824_1472x1137.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!nfwU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe7c9261-1459-4b84-ac7d-a5894d06b824_1472x1137.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h2>Basic Vector Operations (Nothing Fancy)</h2><p>Vector arithmetic is refreshingly simple:</p><ul><li><p><strong>Addition / subtraction</strong> happens component-by-component</p></li><li><p><strong>Scalar multiplication</strong> stretches or shrinks every component equally</p></li></ul><p>Orthogonal vectors &#8212; vectors at right angles &#8212; have a special property:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ZEwh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab2c8c40-425c-492b-a426-352845f68ed3_260x55.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZEwh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab2c8c40-425c-492b-a426-352845f68ed3_260x55.png 424w, https://substackcdn.com/image/fetch/$s_!ZEwh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab2c8c40-425c-492b-a426-352845f68ed3_260x55.png 848w, https://substackcdn.com/image/fetch/$s_!ZEwh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab2c8c40-425c-492b-a426-352845f68ed3_260x55.png 1272w, https://substackcdn.com/image/fetch/$s_!ZEwh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab2c8c40-425c-492b-a426-352845f68ed3_260x55.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZEwh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab2c8c40-425c-492b-a426-352845f68ed3_260x55.png" width="372" height="78.6923076923077" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ab2c8c40-425c-492b-a426-352845f68ed3_260x55.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:55,&quot;width&quot;:260,&quot;resizeWidth&quot;:372,&quot;bytes&quot;:1463,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/186057524?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab2c8c40-425c-492b-a426-352845f68ed3_260x55.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ZEwh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab2c8c40-425c-492b-a426-352845f68ed3_260x55.png 424w, https://substackcdn.com/image/fetch/$s_!ZEwh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab2c8c40-425c-492b-a426-352845f68ed3_260x55.png 848w, https://substackcdn.com/image/fetch/$s_!ZEwh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab2c8c40-425c-492b-a426-352845f68ed3_260x55.png 1272w, https://substackcdn.com/image/fetch/$s_!ZEwh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab2c8c40-425c-492b-a426-352845f68ed3_260x55.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>This means they share <strong>no direction in common</strong>.</p><h2>Dot Product: More Than Just Multiplication</h2><p>The <strong>dot product</strong> is defined as:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!z2M8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c6f4b92-8d19-43e6-a88c-4fd9db6800a0_260x55.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!z2M8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c6f4b92-8d19-43e6-a88c-4fd9db6800a0_260x55.png 424w, https://substackcdn.com/image/fetch/$s_!z2M8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c6f4b92-8d19-43e6-a88c-4fd9db6800a0_260x55.png 848w, https://substackcdn.com/image/fetch/$s_!z2M8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c6f4b92-8d19-43e6-a88c-4fd9db6800a0_260x55.png 1272w, https://substackcdn.com/image/fetch/$s_!z2M8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c6f4b92-8d19-43e6-a88c-4fd9db6800a0_260x55.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!z2M8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c6f4b92-8d19-43e6-a88c-4fd9db6800a0_260x55.png" width="376" height="79.53846153846153" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7c6f4b92-8d19-43e6-a88c-4fd9db6800a0_260x55.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:55,&quot;width&quot;:260,&quot;resizeWidth&quot;:376,&quot;bytes&quot;:3621,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/186057524?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c6f4b92-8d19-43e6-a88c-4fd9db6800a0_260x55.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!z2M8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c6f4b92-8d19-43e6-a88c-4fd9db6800a0_260x55.png 424w, https://substackcdn.com/image/fetch/$s_!z2M8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c6f4b92-8d19-43e6-a88c-4fd9db6800a0_260x55.png 848w, https://substackcdn.com/image/fetch/$s_!z2M8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c6f4b92-8d19-43e6-a88c-4fd9db6800a0_260x55.png 1272w, https://substackcdn.com/image/fetch/$s_!z2M8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c6f4b92-8d19-43e6-a88c-4fd9db6800a0_260x55.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>But the intuition matters more than the formula.</p><p>The dot product answers:</p><blockquote><p>How much of one vector lies in the direction of the other?</p></blockquote><p>If vectors point in the same direction &#8594; large dot product</p><p>If they&#8217;re perpendicular &#8594; zero</p><p>If they oppose each other &#8594; negative<br></p><h2>Matrix Inverse: Undoing a Transformation</h2><p>A matrix inverse is the idea of <strong>reversing</strong> a transformation.</p><p>If:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jJnS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F928e1334-05bd-418e-b8ad-9352d2bb292b_260x55.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jJnS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F928e1334-05bd-418e-b8ad-9352d2bb292b_260x55.png 424w, https://substackcdn.com/image/fetch/$s_!jJnS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F928e1334-05bd-418e-b8ad-9352d2bb292b_260x55.png 848w, https://substackcdn.com/image/fetch/$s_!jJnS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F928e1334-05bd-418e-b8ad-9352d2bb292b_260x55.png 1272w, https://substackcdn.com/image/fetch/$s_!jJnS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F928e1334-05bd-418e-b8ad-9352d2bb292b_260x55.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jJnS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F928e1334-05bd-418e-b8ad-9352d2bb292b_260x55.png" width="338" height="71.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/928e1334-05bd-418e-b8ad-9352d2bb292b_260x55.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:55,&quot;width&quot;:260,&quot;resizeWidth&quot;:338,&quot;bytes&quot;:1517,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/186057524?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F928e1334-05bd-418e-b8ad-9352d2bb292b_260x55.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!jJnS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F928e1334-05bd-418e-b8ad-9352d2bb292b_260x55.png 424w, https://substackcdn.com/image/fetch/$s_!jJnS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F928e1334-05bd-418e-b8ad-9352d2bb292b_260x55.png 848w, https://substackcdn.com/image/fetch/$s_!jJnS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F928e1334-05bd-418e-b8ad-9352d2bb292b_260x55.png 1272w, https://substackcdn.com/image/fetch/$s_!jJnS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F928e1334-05bd-418e-b8ad-9352d2bb292b_260x55.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>then applying A and then A-1 brings you back to where you started.</p><p>But not all matrices are reversible.</p><p>If:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!d54_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2563764-811a-4e99-b035-f9668a9538e0_260x55.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!d54_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2563764-811a-4e99-b035-f9668a9538e0_260x55.png 424w, https://substackcdn.com/image/fetch/$s_!d54_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2563764-811a-4e99-b035-f9668a9538e0_260x55.png 848w, https://substackcdn.com/image/fetch/$s_!d54_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2563764-811a-4e99-b035-f9668a9538e0_260x55.png 1272w, https://substackcdn.com/image/fetch/$s_!d54_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2563764-811a-4e99-b035-f9668a9538e0_260x55.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!d54_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2563764-811a-4e99-b035-f9668a9538e0_260x55.png" width="354" height="74.88461538461539" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f2563764-811a-4e99-b035-f9668a9538e0_260x55.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:55,&quot;width&quot;:260,&quot;resizeWidth&quot;:354,&quot;bytes&quot;:2371,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/186057524?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2563764-811a-4e99-b035-f9668a9538e0_260x55.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!d54_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2563764-811a-4e99-b035-f9668a9538e0_260x55.png 424w, https://substackcdn.com/image/fetch/$s_!d54_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2563764-811a-4e99-b035-f9668a9538e0_260x55.png 848w, https://substackcdn.com/image/fetch/$s_!d54_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2563764-811a-4e99-b035-f9668a9538e0_260x55.png 1272w, https://substackcdn.com/image/fetch/$s_!d54_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2563764-811a-4e99-b035-f9668a9538e0_260x55.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>then no inverse exists.</p><p>Why?</p><p>Because the transformation <strong>collapsed space</strong> &#8212; some information was lost forever.</p><h2><br>Determinant: Area, Volume, and Orientation</h2><p>The determinant tells us <strong>how a matrix scales space</strong>.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!b6ps!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7965c2c-435d-4e45-94f4-7743b031ffaa_435x89.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!b6ps!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7965c2c-435d-4e45-94f4-7743b031ffaa_435x89.png 424w, https://substackcdn.com/image/fetch/$s_!b6ps!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7965c2c-435d-4e45-94f4-7743b031ffaa_435x89.png 848w, https://substackcdn.com/image/fetch/$s_!b6ps!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7965c2c-435d-4e45-94f4-7743b031ffaa_435x89.png 1272w, https://substackcdn.com/image/fetch/$s_!b6ps!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7965c2c-435d-4e45-94f4-7743b031ffaa_435x89.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!b6ps!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7965c2c-435d-4e45-94f4-7743b031ffaa_435x89.png" width="707" height="144.65057471264367" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e7965c2c-435d-4e45-94f4-7743b031ffaa_435x89.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:89,&quot;width&quot;:435,&quot;resizeWidth&quot;:707,&quot;bytes&quot;:14671,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/186057524?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7965c2c-435d-4e45-94f4-7743b031ffaa_435x89.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!b6ps!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7965c2c-435d-4e45-94f4-7743b031ffaa_435x89.png 424w, https://substackcdn.com/image/fetch/$s_!b6ps!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7965c2c-435d-4e45-94f4-7743b031ffaa_435x89.png 848w, https://substackcdn.com/image/fetch/$s_!b6ps!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7965c2c-435d-4e45-94f4-7743b031ffaa_435x89.png 1272w, https://substackcdn.com/image/fetch/$s_!b6ps!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7965c2c-435d-4e45-94f4-7743b031ffaa_435x89.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>A <strong>negative determinant</strong> means the orientation flipped &#8212; like a mirror reflection.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gjtW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4c5e6df-30e8-4f55-bbc0-79363711ff9f_256x57.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gjtW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4c5e6df-30e8-4f55-bbc0-79363711ff9f_256x57.png 424w, https://substackcdn.com/image/fetch/$s_!gjtW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4c5e6df-30e8-4f55-bbc0-79363711ff9f_256x57.png 848w, https://substackcdn.com/image/fetch/$s_!gjtW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4c5e6df-30e8-4f55-bbc0-79363711ff9f_256x57.png 1272w, https://substackcdn.com/image/fetch/$s_!gjtW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4c5e6df-30e8-4f55-bbc0-79363711ff9f_256x57.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gjtW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4c5e6df-30e8-4f55-bbc0-79363711ff9f_256x57.png" width="384" height="85.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c4c5e6df-30e8-4f55-bbc0-79363711ff9f_256x57.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:57,&quot;width&quot;:256,&quot;resizeWidth&quot;:384,&quot;bytes&quot;:4048,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/186057524?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4c5e6df-30e8-4f55-bbc0-79363711ff9f_256x57.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!gjtW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4c5e6df-30e8-4f55-bbc0-79363711ff9f_256x57.png 424w, https://substackcdn.com/image/fetch/$s_!gjtW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4c5e6df-30e8-4f55-bbc0-79363711ff9f_256x57.png 848w, https://substackcdn.com/image/fetch/$s_!gjtW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4c5e6df-30e8-4f55-bbc0-79363711ff9f_256x57.png 1272w, https://substackcdn.com/image/fetch/$s_!gjtW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4c5e6df-30e8-4f55-bbc0-79363711ff9f_256x57.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Transformations compound exactly the way you&#8217;d expect.</p><h2><br>Basis: Coordinates Without Coordinates</h2><p>A <strong>basis</strong> is a set of vectors that lets you reach every point in a space.</p><p>Think of them as <em>directions you agree to use</em>.</p><ul><li><p>In 2D: usually two vectors</p></li><li><p>In 3D: three vectors</p></li></ul><p>They don&#8217;t have to be perpendicular &#8212; just independent.<br></p><h2>Span: Everything You Can Reach</h2><p>The <strong>span</strong> of a set of vectors is all points you can reach by combining them.</p><p>If you can walk forward, backward, and scale your steps &#8212; span is your reachable world.</p><p>A <strong>basis</strong> is simply a <em>minimal</em> spanning set.</p><p>No redundancy.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!smVL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff361dfd6-6e33-4464-ba63-836ad72753e7_2120x693.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!smVL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff361dfd6-6e33-4464-ba63-836ad72753e7_2120x693.jpeg 424w, https://substackcdn.com/image/fetch/$s_!smVL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff361dfd6-6e33-4464-ba63-836ad72753e7_2120x693.jpeg 848w, https://substackcdn.com/image/fetch/$s_!smVL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff361dfd6-6e33-4464-ba63-836ad72753e7_2120x693.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!smVL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff361dfd6-6e33-4464-ba63-836ad72753e7_2120x693.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!smVL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff361dfd6-6e33-4464-ba63-836ad72753e7_2120x693.jpeg" width="724" height="236.69230769230768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f361dfd6-6e33-4464-ba63-836ad72753e7_2120x693.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:476,&quot;width&quot;:1456,&quot;resizeWidth&quot;:724,&quot;bytes&quot;:111311,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/186057524?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff361dfd6-6e33-4464-ba63-836ad72753e7_2120x693.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!smVL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff361dfd6-6e33-4464-ba63-836ad72753e7_2120x693.jpeg 424w, https://substackcdn.com/image/fetch/$s_!smVL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff361dfd6-6e33-4464-ba63-836ad72753e7_2120x693.jpeg 848w, https://substackcdn.com/image/fetch/$s_!smVL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff361dfd6-6e33-4464-ba63-836ad72753e7_2120x693.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!smVL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff361dfd6-6e33-4464-ba63-836ad72753e7_2120x693.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h2>Dimension: How Many Directions Matter</h2><p>The <strong>dimension</strong> of a space equals the number of vectors in its basis.</p><ul><li><p>Line &#8594; 1D</p></li><li><p>Plane &#8594; 2D</p></li><li><p>Volume &#8594; 3D</p></li></ul><p>In ML, high-dimensional spaces are common &#8212; but often misleading.</p><h2>Linear Dependence: Redundant Directions</h2><p>If one vector can be written as a combination of others:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!C01d!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F186a7b8c-4aa8-431d-b321-29161660ca64_256x57.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!C01d!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F186a7b8c-4aa8-431d-b321-29161660ca64_256x57.png 424w, https://substackcdn.com/image/fetch/$s_!C01d!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F186a7b8c-4aa8-431d-b321-29161660ca64_256x57.png 848w, https://substackcdn.com/image/fetch/$s_!C01d!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F186a7b8c-4aa8-431d-b321-29161660ca64_256x57.png 1272w, https://substackcdn.com/image/fetch/$s_!C01d!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F186a7b8c-4aa8-431d-b321-29161660ca64_256x57.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!C01d!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F186a7b8c-4aa8-431d-b321-29161660ca64_256x57.png" width="398" height="88.6171875" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/186a7b8c-4aa8-431d-b321-29161660ca64_256x57.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:57,&quot;width&quot;:256,&quot;resizeWidth&quot;:398,&quot;bytes&quot;:3097,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/186057524?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F186a7b8c-4aa8-431d-b321-29161660ca64_256x57.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!C01d!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F186a7b8c-4aa8-431d-b321-29161660ca64_256x57.png 424w, https://substackcdn.com/image/fetch/$s_!C01d!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F186a7b8c-4aa8-431d-b321-29161660ca64_256x57.png 848w, https://substackcdn.com/image/fetch/$s_!C01d!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F186a7b8c-4aa8-431d-b321-29161660ca64_256x57.png 1272w, https://substackcdn.com/image/fetch/$s_!C01d!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F186a7b8c-4aa8-431d-b321-29161660ca64_256x57.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>then the vectors are <strong>linearly dependent</strong>.</p><p>Intuition:</p><p>One direction wasn&#8217;t actually adding anything new.</p><p>A proper basis must be:</p><ul><li><p>spanning</p></li><li><p>linearly <strong>independent</strong></p></li></ul><h2><br>Eigenvalues and Eigenvectors: The Quiet Axes</h2><p>Eigenvectors are special directions that <strong>don&#8217;t rotate</strong> under a transformation.</p><p>They only stretch or shrink.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HX0S!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb924263-1c95-4429-b0c3-cbb7deb9ffba_232x51.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HX0S!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb924263-1c95-4429-b0c3-cbb7deb9ffba_232x51.png 424w, https://substackcdn.com/image/fetch/$s_!HX0S!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb924263-1c95-4429-b0c3-cbb7deb9ffba_232x51.png 848w, https://substackcdn.com/image/fetch/$s_!HX0S!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb924263-1c95-4429-b0c3-cbb7deb9ffba_232x51.png 1272w, https://substackcdn.com/image/fetch/$s_!HX0S!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb924263-1c95-4429-b0c3-cbb7deb9ffba_232x51.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HX0S!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb924263-1c95-4429-b0c3-cbb7deb9ffba_232x51.png" width="376" height="82.65517241379311" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/eb924263-1c95-4429-b0c3-cbb7deb9ffba_232x51.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:51,&quot;width&quot;:232,&quot;resizeWidth&quot;:376,&quot;bytes&quot;:1436,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/186057524?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb924263-1c95-4429-b0c3-cbb7deb9ffba_232x51.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!HX0S!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb924263-1c95-4429-b0c3-cbb7deb9ffba_232x51.png 424w, https://substackcdn.com/image/fetch/$s_!HX0S!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb924263-1c95-4429-b0c3-cbb7deb9ffba_232x51.png 848w, https://substackcdn.com/image/fetch/$s_!HX0S!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb924263-1c95-4429-b0c3-cbb7deb9ffba_232x51.png 1272w, https://substackcdn.com/image/fetch/$s_!HX0S!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb924263-1c95-4429-b0c3-cbb7deb9ffba_232x51.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><ul><li><p>The <strong>eigenvector</strong> tells the direction</p></li><li><p>The <strong>eigenvalue</strong> tells how much stretch happens</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Jrp5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7847ef65-6d3e-445a-a715-0b77d1b1419a_2277x845.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Jrp5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7847ef65-6d3e-445a-a715-0b77d1b1419a_2277x845.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Jrp5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7847ef65-6d3e-445a-a715-0b77d1b1419a_2277x845.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Jrp5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7847ef65-6d3e-445a-a715-0b77d1b1419a_2277x845.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Jrp5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7847ef65-6d3e-445a-a715-0b77d1b1419a_2277x845.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Jrp5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7847ef65-6d3e-445a-a715-0b77d1b1419a_2277x845.jpeg" width="1456" height="540" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7847ef65-6d3e-445a-a715-0b77d1b1419a_2277x845.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:540,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:141570,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/186057524?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7847ef65-6d3e-445a-a715-0b77d1b1419a_2277x845.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Jrp5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7847ef65-6d3e-445a-a715-0b77d1b1419a_2277x845.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Jrp5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7847ef65-6d3e-445a-a715-0b77d1b1419a_2277x845.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Jrp5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7847ef65-6d3e-445a-a715-0b77d1b1419a_2277x845.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Jrp5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7847ef65-6d3e-445a-a715-0b77d1b1419a_2277x845.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><br>Eigenbasis</h2><p>If you stack all eigenvectors as columns, you get an <strong>eigenbasis</strong>.</p><p>This basis describes the transformation in its most natural coordinate system.</p><p>To find eigenvalues:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!b_5Y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1ad039c-ad26-4920-8767-db9b9d136ac2_232x51.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!b_5Y!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1ad039c-ad26-4920-8767-db9b9d136ac2_232x51.png 424w, https://substackcdn.com/image/fetch/$s_!b_5Y!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1ad039c-ad26-4920-8767-db9b9d136ac2_232x51.png 848w, https://substackcdn.com/image/fetch/$s_!b_5Y!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1ad039c-ad26-4920-8767-db9b9d136ac2_232x51.png 1272w, https://substackcdn.com/image/fetch/$s_!b_5Y!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1ad039c-ad26-4920-8767-db9b9d136ac2_232x51.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!b_5Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1ad039c-ad26-4920-8767-db9b9d136ac2_232x51.png" width="356" height="78.25862068965517" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c1ad039c-ad26-4920-8767-db9b9d136ac2_232x51.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:51,&quot;width&quot;:232,&quot;resizeWidth&quot;:356,&quot;bytes&quot;:2861,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/186057524?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1ad039c-ad26-4920-8767-db9b9d136ac2_232x51.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!b_5Y!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1ad039c-ad26-4920-8767-db9b9d136ac2_232x51.png 424w, https://substackcdn.com/image/fetch/$s_!b_5Y!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1ad039c-ad26-4920-8767-db9b9d136ac2_232x51.png 848w, https://substackcdn.com/image/fetch/$s_!b_5Y!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1ad039c-ad26-4920-8767-db9b9d136ac2_232x51.png 1272w, https://substackcdn.com/image/fetch/$s_!b_5Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1ad039c-ad26-4920-8767-db9b9d136ac2_232x51.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>This is the <strong>characteristic equation</strong>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!16jF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F634ce549-918a-4552-9688-e9de0586f129_981x486.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!16jF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F634ce549-918a-4552-9688-e9de0586f129_981x486.jpeg 424w, https://substackcdn.com/image/fetch/$s_!16jF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F634ce549-918a-4552-9688-e9de0586f129_981x486.jpeg 848w, https://substackcdn.com/image/fetch/$s_!16jF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F634ce549-918a-4552-9688-e9de0586f129_981x486.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!16jF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F634ce549-918a-4552-9688-e9de0586f129_981x486.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!16jF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F634ce549-918a-4552-9688-e9de0586f129_981x486.jpeg" width="981" height="486" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/634ce549-918a-4552-9688-e9de0586f129_981x486.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:486,&quot;width&quot;:981,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:42039,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/186057524?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F634ce549-918a-4552-9688-e9de0586f129_981x486.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!16jF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F634ce549-918a-4552-9688-e9de0586f129_981x486.jpeg 424w, https://substackcdn.com/image/fetch/$s_!16jF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F634ce549-918a-4552-9688-e9de0586f129_981x486.jpeg 848w, https://substackcdn.com/image/fetch/$s_!16jF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F634ce549-918a-4552-9688-e9de0586f129_981x486.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!16jF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F634ce549-918a-4552-9688-e9de0586f129_981x486.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><br>Dimensionality Reduction and PCA (High-Level)</h2><p>Real datasets often live in high dimensions &#8212; but the <strong>information doesn&#8217;t</strong>.</p><h4>Mean</h4><p>The center of the data.</p><h4>Variance</h4><p>How spread out the data is.</p><h4>Covariance</h4><p>Whether two directions vary <em>together</em>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6Fpk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d199058-52af-4ea1-98db-b39c45657d13_1525x669.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6Fpk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d199058-52af-4ea1-98db-b39c45657d13_1525x669.png 424w, https://substackcdn.com/image/fetch/$s_!6Fpk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d199058-52af-4ea1-98db-b39c45657d13_1525x669.png 848w, https://substackcdn.com/image/fetch/$s_!6Fpk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d199058-52af-4ea1-98db-b39c45657d13_1525x669.png 1272w, https://substackcdn.com/image/fetch/$s_!6Fpk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d199058-52af-4ea1-98db-b39c45657d13_1525x669.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6Fpk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d199058-52af-4ea1-98db-b39c45657d13_1525x669.png" width="1456" height="639" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3d199058-52af-4ea1-98db-b39c45657d13_1525x669.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:639,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:225189,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/186057524?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d199058-52af-4ea1-98db-b39c45657d13_1525x669.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!6Fpk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d199058-52af-4ea1-98db-b39c45657d13_1525x669.png 424w, https://substackcdn.com/image/fetch/$s_!6Fpk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d199058-52af-4ea1-98db-b39c45657d13_1525x669.png 848w, https://substackcdn.com/image/fetch/$s_!6Fpk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d199058-52af-4ea1-98db-b39c45657d13_1525x669.png 1272w, https://substackcdn.com/image/fetch/$s_!6Fpk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d199058-52af-4ea1-98db-b39c45657d13_1525x669.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Covariance checks:</p><blockquote><p>Do these dimensions grow and shrink together?</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!E1OD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa734a1a8-219b-4847-b232-1f5c6fabc7f0_1525x669.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!E1OD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa734a1a8-219b-4847-b232-1f5c6fabc7f0_1525x669.png 424w, https://substackcdn.com/image/fetch/$s_!E1OD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa734a1a8-219b-4847-b232-1f5c6fabc7f0_1525x669.png 848w, https://substackcdn.com/image/fetch/$s_!E1OD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa734a1a8-219b-4847-b232-1f5c6fabc7f0_1525x669.png 1272w, https://substackcdn.com/image/fetch/$s_!E1OD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa734a1a8-219b-4847-b232-1f5c6fabc7f0_1525x669.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!E1OD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa734a1a8-219b-4847-b232-1f5c6fabc7f0_1525x669.png" width="1456" height="639" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a734a1a8-219b-4847-b232-1f5c6fabc7f0_1525x669.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:639,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:225189,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/186057524?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa734a1a8-219b-4847-b232-1f5c6fabc7f0_1525x669.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!E1OD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa734a1a8-219b-4847-b232-1f5c6fabc7f0_1525x669.png 424w, https://substackcdn.com/image/fetch/$s_!E1OD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa734a1a8-219b-4847-b232-1f5c6fabc7f0_1525x669.png 848w, https://substackcdn.com/image/fetch/$s_!E1OD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa734a1a8-219b-4847-b232-1f5c6fabc7f0_1525x669.png 1272w, https://substackcdn.com/image/fetch/$s_!E1OD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa734a1a8-219b-4847-b232-1f5c6fabc7f0_1525x669.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><br>Why PCA Works</h2><p>PCA finds directions with <strong>maximum variance</strong>.</p><p>The eigenvector with the <strong>largest eigenvalue</strong> points along the direction where the data spreads the most.</p><p>Projecting onto that direction preserves maximum information.</p><p>That&#8217;s dimensionality reduction without throwing away meaning.</p><h2><br>Closing Thoughts</h2><p>Some topics &#8212; Gaussian elimination, PCA derivations, advanced matrix factorisations &#8212; deserve their own deep dives.</p><p>This series wasn&#8217;t about covering everything.</p><p>It was about <strong>building intuition strong enough that formulas stop feeling scary</strong>.</p><p>And once that intuition clicks, ML concepts start feeling&#8230; lighter</p><p><br>You can visit the notes for all the 3 parts with <a href="https://github.com/payalkanyan/MATHS_NOTES/blob/main/Linear%20algebra.pdf">this link</a>.</p><p>And for detailed video lectures - <a href="https://www.deeplearning.ai/">DeepLearning.AI</a>(I myself studied from there) from their course <a href="https://www.deeplearning.ai/courses/mathematics-for-machine-learning-and-data-science-specialization/">Maths for ML and DS</a></p><p>Stopping here with Linear algebra. In the next articles, we&#8217;ll move into calculus, probability, and statistics, where the math becomes a little more explicit and a few new terms will show up. Until then, take it slow, revisit what felt fuzzy, and most importantly &#8212; keep learning and stay curious!</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://payalkanyan.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://payalkanyan.substack.com/subscribe?"><span>Subscribe now</span></a></p><p>If this article helped clarify things, consider <strong>subscribing</strong> so you don&#8217;t miss future deep-dives, and feel free to <strong>like or leave a comment</strong>&#8212;I&#8217;d love to hear your thoughts and what you&#8217;d like to see next.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://payalkanyan.substack.com/p/linear-algebra-for-machine-learning-9f3/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://payalkanyan.substack.com/p/linear-algebra-for-machine-learning-9f3/comments"><span>Leave a comment</span></a></p><div class="directMessage button" data-attrs="{&quot;userId&quot;:236050308,&quot;userName&quot;:&quot;payal&quot;,&quot;canDm&quot;:null,&quot;dmUpgradeOptions&quot;:null,&quot;isEditorNode&quot;:true}" data-component-name="DirectMessageToDOM"></div><p></p>]]></content:encoded></item><item><title><![CDATA[Entropy vs Gini]]></title><description><![CDATA[Two Ways of Asking the Same Question]]></description><link>https://payalkanyan.substack.com/p/entropy-vs-gini</link><guid isPermaLink="false">https://payalkanyan.substack.com/p/entropy-vs-gini</guid><dc:creator><![CDATA[payal]]></dc:creator><pubDate>Wed, 14 Jan 2026 06:54:28 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!QDM_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b09619-51b0-4607-adae-4e5186679a77_1282x918.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>One of the confusing questions when I started learning Decision Trees was&#8230;</p><p>If Entropy and Gini almost always choose the same split in a decision tree, a very reasonable question arises &#8212; <strong>why do we even have two different metrics?</strong></p><p>Why didn&#8217;t the community just settle on one and move on?</p><p>This confusion usually appears right when someone starts feeling comfortable with decision trees, and suddenly two unfamiliar formulas enter the picture, both claiming to measure something called <em>impurity</em>. The trick to understanding this comparison is to not start with formulas at all, but with <strong>what kind of question each metric is trying to answer</strong>.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://payalkanyan.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading payal's Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2>Why Do We Measure Impurity in the First Place?</h2><p>A decision tree grows by repeatedly asking simple questions like:</p><blockquote><p>&#8220;Should I split the data based on feature X at value Y?&#8221;</p></blockquote><p>To answer this, the tree needs a way to decide whether a split makes the data <strong>cleaner</strong>. Cleaner here simply means that the labels become more predictable after the split.</p><p>So impurity is not a complicated concept. It is just a measure of <strong>how mixed the classes are</strong> at a node.</p><ul><li><p>A node with only one class &#8594; perfectly pure</p></li><li><p>A node with many classes mixed evenly &#8594; highly impure</p></li></ul><p>Both Entropy and Gini exist to quantify this &#8220;mixed-ness&#8221;, but they look at it through slightly different mental lenses.</p><h2><br>Entropy: Measuring Uncertainty</h2><p>Entropy comes from information theory, but we do not need that background to understand its intuition.</p><p>Entropy is asking a very human question:</p><blockquote><p>&#8220;How uncertain am I about the class label at this node?&#8221;</p></blockquote><p>Imagine reaching a node in a tree and blindly picking a data point from it. If you have no idea what class it belongs to, entropy is high. If you can predict the class almost immediately, entropy is low.</p><p>Mathematically, entropy is written as:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dR1X!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadd23652-4f1f-4e42-a794-cfacf769fe9a_228x69.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dR1X!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadd23652-4f1f-4e42-a794-cfacf769fe9a_228x69.png 424w, https://substackcdn.com/image/fetch/$s_!dR1X!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadd23652-4f1f-4e42-a794-cfacf769fe9a_228x69.png 848w, https://substackcdn.com/image/fetch/$s_!dR1X!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadd23652-4f1f-4e42-a794-cfacf769fe9a_228x69.png 1272w, https://substackcdn.com/image/fetch/$s_!dR1X!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadd23652-4f1f-4e42-a794-cfacf769fe9a_228x69.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dR1X!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadd23652-4f1f-4e42-a794-cfacf769fe9a_228x69.png" width="320" height="96.84210526315789" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/add23652-4f1f-4e42-a794-cfacf769fe9a_228x69.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:69,&quot;width&quot;:228,&quot;resizeWidth&quot;:320,&quot;bytes&quot;:3741,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/184518796?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadd23652-4f1f-4e42-a794-cfacf769fe9a_228x69.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!dR1X!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadd23652-4f1f-4e42-a794-cfacf769fe9a_228x69.png 424w, https://substackcdn.com/image/fetch/$s_!dR1X!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadd23652-4f1f-4e42-a794-cfacf769fe9a_228x69.png 848w, https://substackcdn.com/image/fetch/$s_!dR1X!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadd23652-4f1f-4e42-a794-cfacf769fe9a_228x69.png 1272w, https://substackcdn.com/image/fetch/$s_!dR1X!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadd23652-4f1f-4e42-a794-cfacf769fe9a_228x69.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p></p><p>But instead of focusing on the formula, focus on the behaviour:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ng2s!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44f0b668-4730-4b5f-9713-cf55408e31b3_1446x889.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ng2s!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44f0b668-4730-4b5f-9713-cf55408e31b3_1446x889.png 424w, https://substackcdn.com/image/fetch/$s_!ng2s!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44f0b668-4730-4b5f-9713-cf55408e31b3_1446x889.png 848w, https://substackcdn.com/image/fetch/$s_!ng2s!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44f0b668-4730-4b5f-9713-cf55408e31b3_1446x889.png 1272w, https://substackcdn.com/image/fetch/$s_!ng2s!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44f0b668-4730-4b5f-9713-cf55408e31b3_1446x889.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ng2s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44f0b668-4730-4b5f-9713-cf55408e31b3_1446x889.png" width="1446" height="889" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/44f0b668-4730-4b5f-9713-cf55408e31b3_1446x889.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:889,&quot;width&quot;:1446,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:427962,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/184518796?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77328d3e-6ba9-44c6-b49f-87fa89c0c065_1536x1024.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ng2s!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44f0b668-4730-4b5f-9713-cf55408e31b3_1446x889.png 424w, https://substackcdn.com/image/fetch/$s_!ng2s!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44f0b668-4730-4b5f-9713-cf55408e31b3_1446x889.png 848w, https://substackcdn.com/image/fetch/$s_!ng2s!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44f0b668-4730-4b5f-9713-cf55408e31b3_1446x889.png 1272w, https://substackcdn.com/image/fetch/$s_!ng2s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44f0b668-4730-4b5f-9713-cf55408e31b3_1446x889.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p>When all classes are equally likely &#8594; entropy is high</p></li><li><p>When one class dominates &#8594; entropy drops</p></li><li><p>When a node is perfectly pure &#8594; entropy becomes zero</p></li></ul><h2><br>Gini: Measuring Mistakes</h2><p>Gini looks at the same situation, but asks a different question:</p><blockquote><p>&#8220;If I randomly guess a class label according to the class distribution, how often would I be wrong?&#8221;</p></blockquote><p>This framing is surprisingly powerful.</p><p>Instead of thinking about uncertainty, Gini thinks in terms of <strong>expected misclassification</strong>. It imagines a very lazy classifier that guesses labels based on proportions and asks how bad that strategy would be.</p><p>The Gini impurity is written as:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Y5lq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e72e71e-e299-423c-bdd8-4e2b19b6b630_228x69.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Y5lq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e72e71e-e299-423c-bdd8-4e2b19b6b630_228x69.png 424w, https://substackcdn.com/image/fetch/$s_!Y5lq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e72e71e-e299-423c-bdd8-4e2b19b6b630_228x69.png 848w, https://substackcdn.com/image/fetch/$s_!Y5lq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e72e71e-e299-423c-bdd8-4e2b19b6b630_228x69.png 1272w, https://substackcdn.com/image/fetch/$s_!Y5lq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e72e71e-e299-423c-bdd8-4e2b19b6b630_228x69.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Y5lq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e72e71e-e299-423c-bdd8-4e2b19b6b630_228x69.png" width="356" height="107.73684210526316" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4e72e71e-e299-423c-bdd8-4e2b19b6b630_228x69.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:69,&quot;width&quot;:228,&quot;resizeWidth&quot;:356,&quot;bytes&quot;:2694,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/184518796?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e72e71e-e299-423c-bdd8-4e2b19b6b630_228x69.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Y5lq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e72e71e-e299-423c-bdd8-4e2b19b6b630_228x69.png 424w, https://substackcdn.com/image/fetch/$s_!Y5lq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e72e71e-e299-423c-bdd8-4e2b19b6b630_228x69.png 848w, https://substackcdn.com/image/fetch/$s_!Y5lq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e72e71e-e299-423c-bdd8-4e2b19b6b630_228x69.png 1272w, https://substackcdn.com/image/fetch/$s_!Y5lq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e72e71e-e299-423c-bdd8-4e2b19b6b630_228x69.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p></p><p>Again, intuition matters more than algebra:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!EtkV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9f3df37-4b52-448d-a6e3-cb55c4c2dc88_1024x656.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!EtkV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9f3df37-4b52-448d-a6e3-cb55c4c2dc88_1024x656.png 424w, https://substackcdn.com/image/fetch/$s_!EtkV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9f3df37-4b52-448d-a6e3-cb55c4c2dc88_1024x656.png 848w, https://substackcdn.com/image/fetch/$s_!EtkV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9f3df37-4b52-448d-a6e3-cb55c4c2dc88_1024x656.png 1272w, https://substackcdn.com/image/fetch/$s_!EtkV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9f3df37-4b52-448d-a6e3-cb55c4c2dc88_1024x656.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!EtkV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9f3df37-4b52-448d-a6e3-cb55c4c2dc88_1024x656.png" width="1024" height="656" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d9f3df37-4b52-448d-a6e3-cb55c4c2dc88_1024x656.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:656,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:869323,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/184518796?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8a5d5f3-0576-411b-aa69-90f6157f543b_1024x1024.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!EtkV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9f3df37-4b52-448d-a6e3-cb55c4c2dc88_1024x656.png 424w, https://substackcdn.com/image/fetch/$s_!EtkV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9f3df37-4b52-448d-a6e3-cb55c4c2dc88_1024x656.png 848w, https://substackcdn.com/image/fetch/$s_!EtkV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9f3df37-4b52-448d-a6e3-cb55c4c2dc88_1024x656.png 1272w, https://substackcdn.com/image/fetch/$s_!EtkV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9f3df37-4b52-448d-a6e3-cb55c4c2dc88_1024x656.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p>If one class dominates &#8594; squared probability is large &#8594; Gini is low</p></li><li><p>If classes are evenly mixed &#8594; squared probabilities are small &#8594; Gini is high</p></li><li><p>Pure node &#8594; Gini equals zero</p></li></ul><h2><br>A Single Running Example: The Bag of Balls</h2><p>Let&#8217;s carry one example through the rest of the article.</p><p>Imagine a bag with balls of two colours.</p><h3>Bag A</h3><ul><li><p>50 red</p></li><li><p>50 blue</p></li></ul><h3>Bag B</h3><ul><li><p>90 red</p></li><li><p>10 blue</p></li></ul><p>From an <strong>entropy</strong> point of view:</p><ul><li><p>Bag A is maximally confusing</p></li><li><p>Bag B is far less surprising</p></li></ul><p>From a <strong>Gini</strong> point of view:</p><ul><li><p>In Bag A, you will be wrong very often if you guess</p></li><li><p>In Bag B, guessing &#8220;red&#8221; almost always works</p></li></ul><p>Same situation. Same conclusion.</p><p>Different thinking.</p><p>This is why most of the time both metrics rank splits in the same order.</p><h2><br>Why Do Entropy and Gini Often Pick the Same Split?</h2><p>This is one of the most important insights that is rarely stated clearly.</p><p>Decision trees do not care about the <em>absolute</em> value of impurity.</p><p>They only care about <strong>how much impurity is reduced</strong> by a split.</p><p>Both Entropy and Gini:</p><ul><li><p>Reward purer child nodes</p></li><li><p>Penalize mixed distributions</p></li><li><p>Prefer balanced and meaningful splits</p></li></ul><p>Since both functions are <strong>monotonic</strong> with respect to class purity, the relative improvement after a split is often ranked the same.</p><p>In simple terms:</p><blockquote><p>The tree does not care how you measure impurity, as long as impurity goes down.</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QDM_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b09619-51b0-4607-adae-4e5186679a77_1282x918.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QDM_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b09619-51b0-4607-adae-4e5186679a77_1282x918.png 424w, https://substackcdn.com/image/fetch/$s_!QDM_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b09619-51b0-4607-adae-4e5186679a77_1282x918.png 848w, https://substackcdn.com/image/fetch/$s_!QDM_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b09619-51b0-4607-adae-4e5186679a77_1282x918.png 1272w, https://substackcdn.com/image/fetch/$s_!QDM_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b09619-51b0-4607-adae-4e5186679a77_1282x918.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QDM_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b09619-51b0-4607-adae-4e5186679a77_1282x918.png" width="1282" height="918" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/39b09619-51b0-4607-adae-4e5186679a77_1282x918.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:918,&quot;width&quot;:1282,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:270170,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/184518796?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F560e9a3c-b0ee-40b6-b9dc-38603e058347_1536x1024.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!QDM_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b09619-51b0-4607-adae-4e5186679a77_1282x918.png 424w, https://substackcdn.com/image/fetch/$s_!QDM_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b09619-51b0-4607-adae-4e5186679a77_1282x918.png 848w, https://substackcdn.com/image/fetch/$s_!QDM_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b09619-51b0-4607-adae-4e5186679a77_1282x918.png 1272w, https://substackcdn.com/image/fetch/$s_!QDM_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b09619-51b0-4607-adae-4e5186679a77_1282x918.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>When Do They Actually Differ?</h2><p>Although rare, there <em>are</em> situations where Entropy and Gini disagree.</p><p>This usually happens when:</p><ul><li><p>Class distributions are <strong>highly skewed</strong></p></li><li><p>There are <strong>many classes</strong></p></li><li><p>The dataset is <strong>very small</strong></p></li></ul><p>Entropy is more sensitive to changes near probability extremes, meaning it reacts more strongly when rare classes appear or disappear. Gini, on the other hand, responds more smoothly.</p><p>So entropy may prefer splits that isolate rare classes slightly earlier, while Gini may stay conservative.</p><p>These differences are subtle, but they exist.</p><h2><br>Why Most Libraries Default to Gini</h2><p>If Entropy and Gini behave similarly, why does <code>sklearn</code> default to Gini?</p><p>The reason is refreshingly practical.</p><ul><li><p>Gini is computationally cheaper (no logarithms)</p></li><li><p>Faster when building large trees</p></li><li><p>Empirically shows similar performance</p></li></ul><p>In large-scale systems, these small efficiency gains add up, and since accuracy differences are negligible, Gini becomes the sensible default.</p><h2><br>Visual Intuition Without Graphs</h2><p>You can imagine the two metrics like this:</p><ul><li><p>Entropy drops <strong>sharply</strong> as nodes become pure</p></li><li><p>Gini decreases in a <strong>smoother curve</strong></p></li><li><p>Both reach zero at perfect purity</p></li></ul><p>Entropy feels more &#8220;strict&#8221;, Gini feels more &#8220;forgiving&#8221;, but both guide the tree toward the same destination.</p><h2><br>The Real Takeaway</h2><p>Entropy and Gini are not rivals.</p><p>They are two languages describing the same idea.</p><ul><li><p>Entropy talks about <strong>uncertainty</strong></p></li><li><p>Gini talks about <strong>mistakes</strong></p></li><li><p>Decision trees only care about <strong>improvement</strong></p></li></ul><blockquote><p>Entropy measures how confused the model feels; Gini measures how often it would be wrong.</p></blockquote><p>As long as impurity decreases, the tree is happy.</p><p>And once this intuition clicks, the formulas stop feeling intimidating &#8212; they just become tools expressing a very human idea: <strong>make decisions that reduce confusion</strong></p><p></p><p>Hope this article gave you some insights into Entropy and Gini impurity and now-onwards, you guys won&#8217;t feel scared of these terms. See you in next article.</p><p>Till then, keep learning&#8212;and stay curious! and let the math settle naturally.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://payalkanyan.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://payalkanyan.substack.com/subscribe?"><span>Subscribe now</span></a></p><p>If this article helped clarify things, consider <strong>subscribing</strong> so you don&#8217;t miss future deep-dives, and feel free to <strong>like or leave a comment</strong>&#8212;I&#8217;d love to hear your thoughts and what you&#8217;d like to see next.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://payalkanyan.substack.com/p/entropy-vs-gini/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://payalkanyan.substack.com/p/entropy-vs-gini/comments"><span>Leave a comment</span></a></p><div class="directMessage button" data-attrs="{&quot;userId&quot;:236050308,&quot;userName&quot;:&quot;payal&quot;,&quot;canDm&quot;:null,&quot;dmUpgradeOptions&quot;:null,&quot;isEditorNode&quot;:true}" data-component-name="DirectMessageToDOM"></div><p></p>]]></content:encoded></item><item><title><![CDATA[Linear Algebra for Machine Learning]]></title><description><![CDATA[The Quiet Foundation Behind Intelligent Systems - Part 2]]></description><link>https://payalkanyan.substack.com/p/linear-algebra-for-machine-learning-bc3</link><guid isPermaLink="false">https://payalkanyan.substack.com/p/linear-algebra-for-machine-learning-bc3</guid><dc:creator><![CDATA[payal]]></dc:creator><pubDate>Sun, 11 Jan 2026 07:02:06 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!vhG1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb078de7-c0d7-4d6d-a3d5-5cc456c879b1_1249x378.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Before starting, it is recommended to read <strong><a href="https://payalkanyan.substack.com/p/linear-algebra-for-machine-learning">Part 1: </a></strong><em><strong><a href="https://payalkanyan.substack.com/p/linear-algebra-for-machine-learning">The Quiet Foundation Behind Intelligent Systems</a></strong></em>, where we introduced scalars, vectors, matrices, linear equations, and basic systems of equations. This article continues naturally from there, so if some ideas feel unfamiliar, pausing and revisiting <a href="https://payalkanyan.substack.com/p/linear-algebra-for-machine-learning">Part 1</a> will help a lot.</p><p>In the previous article, we focused on <em>what</em> vectors and matrices are, and <em>why</em> machine learning needs them. Now we move one level deeper and ask a more practical question:</p><p><strong>How do we actually solve systems of equations using matrices?</strong></p><h2>Systems of Equations as Matrices</h2><p>Consider a very simple system of equations:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7_Wo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F218d6da9-2194-4ffd-b9d9-a7c08b7f21ee_1410x386.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7_Wo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F218d6da9-2194-4ffd-b9d9-a7c08b7f21ee_1410x386.jpeg 424w, https://substackcdn.com/image/fetch/$s_!7_Wo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F218d6da9-2194-4ffd-b9d9-a7c08b7f21ee_1410x386.jpeg 848w, https://substackcdn.com/image/fetch/$s_!7_Wo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F218d6da9-2194-4ffd-b9d9-a7c08b7f21ee_1410x386.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!7_Wo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F218d6da9-2194-4ffd-b9d9-a7c08b7f21ee_1410x386.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7_Wo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F218d6da9-2194-4ffd-b9d9-a7c08b7f21ee_1410x386.jpeg" width="1410" height="386" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/218d6da9-2194-4ffd-b9d9-a7c08b7f21ee_1410x386.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:386,&quot;width&quot;:1410,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:21203,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/184186709?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9ad8304-922c-476b-9038-03c153c75154_1410x441.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!7_Wo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F218d6da9-2194-4ffd-b9d9-a7c08b7f21ee_1410x386.jpeg 424w, https://substackcdn.com/image/fetch/$s_!7_Wo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F218d6da9-2194-4ffd-b9d9-a7c08b7f21ee_1410x386.jpeg 848w, https://substackcdn.com/image/fetch/$s_!7_Wo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F218d6da9-2194-4ffd-b9d9-a7c08b7f21ee_1410x386.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!7_Wo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F218d6da9-2194-4ffd-b9d9-a7c08b7f21ee_1410x386.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>These are two equations with two unknowns. Instead of handling them separately, linear algebra allows us to <strong>bundle them together</strong> into a compact matrix form.</p><p>This system can be written as shown in the above figure.</p><p>This way of writing equations is extremely powerful. It allows computers&#8212;and us&#8212;to operate on entire systems at once instead of dealing with equations line by line.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://payalkanyan.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading payal's Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2>Singular and Non-Singular Systems</h2><p>Earlier, we introduced the idea that not all systems of equations behave the same way. Some give a <strong>unique solution</strong>, while others do not.</p><p>To formalise this idea, we introduce an important quantity called the <strong>determinant</strong>.</p><ul><li><p>If the determinant of a matrix is <strong>zero</strong>, the system is <strong>singular</strong></p><p>(the equations are linearly dependent or contradictory)</p></li><li><p>If the determinant is <strong>non-zero</strong>, the system is <strong>non-singular</strong></p><p>(there is exactly one solution)</p></li></ul><p>This single number tells us whether the system carries enough independent information to solve for the unknowns.</p><p>For a 2X2 matrix, the determinant is computed as:</p><p>|determinant| = (ad - bc)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vhG1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb078de7-c0d7-4d6d-a3d5-5cc456c879b1_1249x378.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vhG1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb078de7-c0d7-4d6d-a3d5-5cc456c879b1_1249x378.jpeg 424w, https://substackcdn.com/image/fetch/$s_!vhG1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb078de7-c0d7-4d6d-a3d5-5cc456c879b1_1249x378.jpeg 848w, https://substackcdn.com/image/fetch/$s_!vhG1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb078de7-c0d7-4d6d-a3d5-5cc456c879b1_1249x378.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!vhG1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb078de7-c0d7-4d6d-a3d5-5cc456c879b1_1249x378.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vhG1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb078de7-c0d7-4d6d-a3d5-5cc456c879b1_1249x378.jpeg" width="1249" height="378" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/eb078de7-c0d7-4d6d-a3d5-5cc456c879b1_1249x378.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:378,&quot;width&quot;:1249,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:53949,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/184186709?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb078de7-c0d7-4d6d-a3d5-5cc456c879b1_1249x378.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!vhG1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb078de7-c0d7-4d6d-a3d5-5cc456c879b1_1249x378.jpeg 424w, https://substackcdn.com/image/fetch/$s_!vhG1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb078de7-c0d7-4d6d-a3d5-5cc456c879b1_1249x378.jpeg 848w, https://substackcdn.com/image/fetch/$s_!vhG1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb078de7-c0d7-4d6d-a3d5-5cc456c879b1_1249x378.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!vhG1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb078de7-c0d7-4d6d-a3d5-5cc456c879b1_1249x378.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>You can remember this intuitively as:</p><blockquote><p>multiply the diagonal elements, subtract the product of the off-diagonal elements.</p></blockquote><p>For 3X3 matrix,</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!UK2G!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91652e5a-9333-4933-87eb-e3b908d9fa5f_1640x724.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!UK2G!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91652e5a-9333-4933-87eb-e3b908d9fa5f_1640x724.jpeg 424w, https://substackcdn.com/image/fetch/$s_!UK2G!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91652e5a-9333-4933-87eb-e3b908d9fa5f_1640x724.jpeg 848w, https://substackcdn.com/image/fetch/$s_!UK2G!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91652e5a-9333-4933-87eb-e3b908d9fa5f_1640x724.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!UK2G!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91652e5a-9333-4933-87eb-e3b908d9fa5f_1640x724.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!UK2G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91652e5a-9333-4933-87eb-e3b908d9fa5f_1640x724.jpeg" width="1456" height="643" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/91652e5a-9333-4933-87eb-e3b908d9fa5f_1640x724.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:643,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:124642,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/184186709?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91652e5a-9333-4933-87eb-e3b908d9fa5f_1640x724.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!UK2G!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91652e5a-9333-4933-87eb-e3b908d9fa5f_1640x724.jpeg 424w, https://substackcdn.com/image/fetch/$s_!UK2G!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91652e5a-9333-4933-87eb-e3b908d9fa5f_1640x724.jpeg 848w, https://substackcdn.com/image/fetch/$s_!UK2G!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91652e5a-9333-4933-87eb-e3b908d9fa5f_1640x724.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!UK2G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91652e5a-9333-4933-87eb-e3b908d9fa5f_1640x724.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>If this value becomes zero, the two rows are not giving independent information.</p><p>You can easily search on various methods of calculating the determinant on you-tube, the goal is not memorisation, but understanding <strong>why determinants matter</strong>: they tell us whether solving the system is even possible.</p><p></p><h2>When Does a System Have a Solution?</h2><p>Let us revisit a concrete example:</p><p>a + b = 10 </p><p>a + 2b = 12</p><p>Here, we have:</p><ul><li><p>two variables</p></li><li><p>two independent equations</p></li></ul><p>This leads to a <strong>unique solution</strong>:</p><p>b = 2, and a = 8</p><p>This highlights a key idea:</p><blockquote><p>To get a definite solution, the number of independent equations must match the number of unknowns.</p></blockquote><p>If there are fewer equations, the solution space becomes larger.</p><p>If equations repeat or contradict each other, the system becomes singular.<br></p><h2>Why Matrices Help Computers</h2><p>Solving systems by substitution works for small examples, but machine learning deals with <strong>thousands of variables and equations</strong>.</p><p>Matrices allow us to:</p><ul><li><p>represent systems compactly</p></li><li><p>apply systematic operations</p></li><li><p>reduce equations step by step</p></li></ul><p>This brings us to <strong>row reduction</strong>.<br></p><h2>Matrix Row Reduction</h2><p>The idea of row reduction is simple:</p><p>we perform operations that <strong>do not change the solution</strong>, but make the matrix easier to solve.</p><p>The goal is to reduce complex systems into simpler ones.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!BnpU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b25d944-8d4d-4fa0-83ee-5d39deae1911_1640x912.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BnpU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b25d944-8d4d-4fa0-83ee-5d39deae1911_1640x912.jpeg 424w, https://substackcdn.com/image/fetch/$s_!BnpU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b25d944-8d4d-4fa0-83ee-5d39deae1911_1640x912.jpeg 848w, https://substackcdn.com/image/fetch/$s_!BnpU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b25d944-8d4d-4fa0-83ee-5d39deae1911_1640x912.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!BnpU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b25d944-8d4d-4fa0-83ee-5d39deae1911_1640x912.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BnpU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b25d944-8d4d-4fa0-83ee-5d39deae1911_1640x912.jpeg" width="1456" height="810" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2b25d944-8d4d-4fa0-83ee-5d39deae1911_1640x912.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:810,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:278967,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/184186709?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b25d944-8d4d-4fa0-83ee-5d39deae1911_1640x912.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!BnpU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b25d944-8d4d-4fa0-83ee-5d39deae1911_1640x912.jpeg 424w, https://substackcdn.com/image/fetch/$s_!BnpU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b25d944-8d4d-4fa0-83ee-5d39deae1911_1640x912.jpeg 848w, https://substackcdn.com/image/fetch/$s_!BnpU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b25d944-8d4d-4fa0-83ee-5d39deae1911_1640x912.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!BnpU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b25d944-8d4d-4fa0-83ee-5d39deae1911_1640x912.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>We aim to introduce zeros strategically so that back-substitution becomes easy.</p><h3><br>Elementary Row Operations</h3><p>Before learning different forms, here are the allowed operations:</p><ol><li><p><strong>Row swapping</strong></p><p>Swapping two rows changes the sign of the determinant.</p></li><li><p><strong>Row scaling</strong></p><p>Multiplying a row by a scalar multiplies the determinant by that scalar.</p></li><li><p><strong>Row addition</strong></p><p>Adding a multiple of one row to another does <strong>not</strong> change the determinant.</p></li></ol><p>These operations preserve the solution while simplifying the system.</p><h2>Rank: Measuring Information</h2><p>The <strong>rank</strong> of a matrix tells us how much independent information the system contains.</p><p>Informally:</p><ul><li><p>Rank = number of independent equations</p></li><li><p>Rank = number of pivots after row reduction</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Y4J8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b501b12-66a4-4cde-98df-4bc30ca95042_1481x1357.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Y4J8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b501b12-66a4-4cde-98df-4bc30ca95042_1481x1357.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Y4J8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b501b12-66a4-4cde-98df-4bc30ca95042_1481x1357.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Y4J8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b501b12-66a4-4cde-98df-4bc30ca95042_1481x1357.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Y4J8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b501b12-66a4-4cde-98df-4bc30ca95042_1481x1357.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Y4J8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b501b12-66a4-4cde-98df-4bc30ca95042_1481x1357.jpeg" width="1456" height="1334" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7b501b12-66a4-4cde-98df-4bc30ca95042_1481x1357.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1334,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:479456,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/184186709?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b501b12-66a4-4cde-98df-4bc30ca95042_1481x1357.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Y4J8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b501b12-66a4-4cde-98df-4bc30ca95042_1481x1357.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Y4J8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b501b12-66a4-4cde-98df-4bc30ca95042_1481x1357.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Y4J8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b501b12-66a4-4cde-98df-4bc30ca95042_1481x1357.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Y4J8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b501b12-66a4-4cde-98df-4bc30ca95042_1481x1357.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A useful relationship is:</p><p>Rank = Number of variables - Dimension of solution space</p><p>If the rank is less than the number of variables, the system is <strong>singular</strong> and does not have a unique solution.</p><h2>Row Echelon Form (REF)</h2><p>Row echelon form is a simplified version of a matrix where:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!CJyD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb180b0d-a58b-4765-839b-1316948c7034_1640x688.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CJyD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb180b0d-a58b-4765-839b-1316948c7034_1640x688.jpeg 424w, https://substackcdn.com/image/fetch/$s_!CJyD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb180b0d-a58b-4765-839b-1316948c7034_1640x688.jpeg 848w, https://substackcdn.com/image/fetch/$s_!CJyD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb180b0d-a58b-4765-839b-1316948c7034_1640x688.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!CJyD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb180b0d-a58b-4765-839b-1316948c7034_1640x688.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CJyD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb180b0d-a58b-4765-839b-1316948c7034_1640x688.jpeg" width="1456" height="611" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cb180b0d-a58b-4765-839b-1316948c7034_1640x688.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:611,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:271550,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/184186709?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb180b0d-a58b-4765-839b-1316948c7034_1640x688.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!CJyD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb180b0d-a58b-4765-839b-1316948c7034_1640x688.jpeg 424w, https://substackcdn.com/image/fetch/$s_!CJyD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb180b0d-a58b-4765-839b-1316948c7034_1640x688.jpeg 848w, https://substackcdn.com/image/fetch/$s_!CJyD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb180b0d-a58b-4765-839b-1316948c7034_1640x688.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!CJyD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb180b0d-a58b-4765-839b-1316948c7034_1640x688.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ol><li><p>All zero rows are at the bottom</p></li><li><p>Each leading non-zero entry (pivot) is to the right of the one above it</p></li><li><p>All entries below each pivot are zero</p></li></ol><p>In essence, the matrix becomes <strong>upper triangular</strong>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Tci-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab62b38f-c9f3-4ce3-bce1-7daf29e702a1_1640x1018.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Tci-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab62b38f-c9f3-4ce3-bce1-7daf29e702a1_1640x1018.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Tci-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab62b38f-c9f3-4ce3-bce1-7daf29e702a1_1640x1018.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Tci-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab62b38f-c9f3-4ce3-bce1-7daf29e702a1_1640x1018.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Tci-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab62b38f-c9f3-4ce3-bce1-7daf29e702a1_1640x1018.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Tci-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab62b38f-c9f3-4ce3-bce1-7daf29e702a1_1640x1018.jpeg" width="1456" height="904" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ab62b38f-c9f3-4ce3-bce1-7daf29e702a1_1640x1018.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:904,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:287739,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/184186709?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab62b38f-c9f3-4ce3-bce1-7daf29e702a1_1640x1018.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Tci-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab62b38f-c9f3-4ce3-bce1-7daf29e702a1_1640x1018.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Tci-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab62b38f-c9f3-4ce3-bce1-7daf29e702a1_1640x1018.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Tci-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab62b38f-c9f3-4ce3-bce1-7daf29e702a1_1640x1018.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Tci-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab62b38f-c9f3-4ce3-bce1-7daf29e702a1_1640x1018.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The number of pivots in REF directly gives the <strong>rank</strong> of the matrix.</p><h2>Reduced Row Echelon Form (RREF)</h2><p>Reduced Row Echelon Form goes one step further:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pV06!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf0bae21-bc4c-4ce5-96f5-1604205884ad_1288x694.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pV06!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf0bae21-bc4c-4ce5-96f5-1604205884ad_1288x694.jpeg 424w, https://substackcdn.com/image/fetch/$s_!pV06!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf0bae21-bc4c-4ce5-96f5-1604205884ad_1288x694.jpeg 848w, https://substackcdn.com/image/fetch/$s_!pV06!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf0bae21-bc4c-4ce5-96f5-1604205884ad_1288x694.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!pV06!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf0bae21-bc4c-4ce5-96f5-1604205884ad_1288x694.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pV06!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf0bae21-bc4c-4ce5-96f5-1604205884ad_1288x694.jpeg" width="1288" height="694" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cf0bae21-bc4c-4ce5-96f5-1604205884ad_1288x694.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:694,&quot;width&quot;:1288,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:208379,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/184186709?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf0bae21-bc4c-4ce5-96f5-1604205884ad_1288x694.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!pV06!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf0bae21-bc4c-4ce5-96f5-1604205884ad_1288x694.jpeg 424w, https://substackcdn.com/image/fetch/$s_!pV06!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf0bae21-bc4c-4ce5-96f5-1604205884ad_1288x694.jpeg 848w, https://substackcdn.com/image/fetch/$s_!pV06!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf0bae21-bc4c-4ce5-96f5-1604205884ad_1288x694.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!pV06!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf0bae21-bc4c-4ce5-96f5-1604205884ad_1288x694.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p>Each pivot is <strong>1</strong></p></li><li><p>Each pivot column has zeros <strong>above and below</strong></p></li><li><p>Zero rows stay at the bottom</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HW1M!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F587f90f9-bd70-4b1f-9be6-6e868866706e_1327x842.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HW1M!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F587f90f9-bd70-4b1f-9be6-6e868866706e_1327x842.jpeg 424w, https://substackcdn.com/image/fetch/$s_!HW1M!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F587f90f9-bd70-4b1f-9be6-6e868866706e_1327x842.jpeg 848w, https://substackcdn.com/image/fetch/$s_!HW1M!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F587f90f9-bd70-4b1f-9be6-6e868866706e_1327x842.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!HW1M!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F587f90f9-bd70-4b1f-9be6-6e868866706e_1327x842.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HW1M!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F587f90f9-bd70-4b1f-9be6-6e868866706e_1327x842.jpeg" width="1327" height="842" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/587f90f9-bd70-4b1f-9be6-6e868866706e_1327x842.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:842,&quot;width&quot;:1327,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:190837,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/184186709?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F587f90f9-bd70-4b1f-9be6-6e868866706e_1327x842.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!HW1M!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F587f90f9-bd70-4b1f-9be6-6e868866706e_1327x842.jpeg 424w, https://substackcdn.com/image/fetch/$s_!HW1M!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F587f90f9-bd70-4b1f-9be6-6e868866706e_1327x842.jpeg 848w, https://substackcdn.com/image/fetch/$s_!HW1M!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F587f90f9-bd70-4b1f-9be6-6e868866706e_1327x842.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!HW1M!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F587f90f9-bd70-4b1f-9be6-6e868866706e_1327x842.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>While REF is enough to solve systems, RREF makes the solution immediately visible.</p><div><hr></div><h3>REF vs RREF</h3><ul><li><p>REF simplifies the matrix</p></li><li><p>RREF completely solves it</p></li><li><p>RREF is stricter and more structured</p></li></ul><p>Both are achieved using the same row operations.</p><div><hr></div><h2>Gaussian Elimination</h2><p>Gaussian elimination is the algorithmic process behind all of this.</p><p>Steps:</p><ol><li><p>Convert equations into an augmented matrix</p></li><li><p>Apply row operations to reach REF</p></li><li><p>Use back-substitution to find variables</p></li></ol><p>This procedure is the backbone of many numerical methods used in machine learning systems.</p><p>Don&#8217;t worry, if you didn&#8217;t get everything at first, reread the article.<br>This may feel heavy at first&#8212;and that is normal. These ideas form the mathematical backbone of optimisation, regression, and neural networks.</p><p>We will stop here for now. In the next post, we are gonna give a closure to this topic and get some more important concepts.</p><p>Till then, keep learning&#8212;and stay curious! and let the math settle naturally.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://payalkanyan.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://payalkanyan.substack.com/subscribe?"><span>Subscribe now</span></a></p><p>If this article helped clarify things, consider <strong>subscribing</strong> so you don&#8217;t miss future deep-dives, and feel free to <strong>like or leave a comment</strong>&#8212;I&#8217;d love to hear your thoughts and what you&#8217;d like to see next.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://payalkanyan.substack.com/p/linear-algebra-for-machine-learning-bc3/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://payalkanyan.substack.com/p/linear-algebra-for-machine-learning-bc3/comments"><span>Leave a comment</span></a></p><div class="directMessage button" data-attrs="{&quot;userId&quot;:236050308,&quot;userName&quot;:&quot;payal&quot;,&quot;canDm&quot;:null,&quot;dmUpgradeOptions&quot;:null,&quot;isEditorNode&quot;:true}" data-component-name="DirectMessageToDOM"></div>]]></content:encoded></item><item><title><![CDATA[Teaching Models to Behave Like Humans]]></title><description><![CDATA[Regularisation in ML and DL]]></description><link>https://payalkanyan.substack.com/p/teaching-models-to-behave-like-humans</link><guid isPermaLink="false">https://payalkanyan.substack.com/p/teaching-models-to-behave-like-humans</guid><dc:creator><![CDATA[payal]]></dc:creator><pubDate>Wed, 07 Jan 2026 09:38:07 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!-ErO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F603a9fe5-05fe-4e53-a9ee-4c318d35615d_1001x600.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I have always felt that machine learning models resemble &#8220;beginners&#8221; &#8212; who are handed a notebook the night before the exam and are told that marks will be awarded purely for repeating lines from the book, and in such a situation most students choose the easy road of memorisation, stuffing every corner of their brain with fragile facts that disappear the moment the question paper looks slightly different.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-ErO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F603a9fe5-05fe-4e53-a9ee-4c318d35615d_1001x600.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-ErO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F603a9fe5-05fe-4e53-a9ee-4c318d35615d_1001x600.png 424w, https://substackcdn.com/image/fetch/$s_!-ErO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F603a9fe5-05fe-4e53-a9ee-4c318d35615d_1001x600.png 848w, https://substackcdn.com/image/fetch/$s_!-ErO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F603a9fe5-05fe-4e53-a9ee-4c318d35615d_1001x600.png 1272w, https://substackcdn.com/image/fetch/$s_!-ErO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F603a9fe5-05fe-4e53-a9ee-4c318d35615d_1001x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-ErO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F603a9fe5-05fe-4e53-a9ee-4c318d35615d_1001x600.png" width="530" height="317.68231768231766" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/603a9fe5-05fe-4e53-a9ee-4c318d35615d_1001x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1001,&quot;resizeWidth&quot;:530,&quot;bytes&quot;:821239,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/183769534?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bacd33f-fba8-4e55-84ef-ec41fe9ec9be_1024x1024.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!-ErO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F603a9fe5-05fe-4e53-a9ee-4c318d35615d_1001x600.png 424w, https://substackcdn.com/image/fetch/$s_!-ErO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F603a9fe5-05fe-4e53-a9ee-4c318d35615d_1001x600.png 848w, https://substackcdn.com/image/fetch/$s_!-ErO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F603a9fe5-05fe-4e53-a9ee-4c318d35615d_1001x600.png 1272w, https://substackcdn.com/image/fetch/$s_!-ErO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F603a9fe5-05fe-4e53-a9ee-4c318d35615d_1001x600.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p> Our algorithms do something very similar when the dataset is small or noisy, because the optimisation process rewards any pattern that reduces training error, even if that pattern is a meaningless coincidence, and this is the exact moment when we need a concept called <strong>regularisation</strong>, which acts like a friendly mentor sitting beside the model and whispering that understanding matters more than memorising.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://payalkanyan.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading payal's Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p><p>To keep things gentle and intuition driven, let us carry one simple example through the entire article. Imagine we want to predict <strong>house prices</strong> using only 120 records from a single neighbourhood, and the features include size, age, distance from metro, number of balconies, and a few quirky columns like &#8220;paint color style&#8221; that probably have little to do with actual value. A powerful model trained on this tiny table can easily find strange rules such as <em>green-painted houses built in 2003 with two balconies are extremely expensive</em>, and while that statement may be true for three rows in our data, it collapses brutally when a new family uploads their property next month.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!WgLg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c94e427-685a-4575-b979-2fe3a6d721cd_1640x849.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WgLg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c94e427-685a-4575-b979-2fe3a6d721cd_1640x849.jpeg 424w, https://substackcdn.com/image/fetch/$s_!WgLg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c94e427-685a-4575-b979-2fe3a6d721cd_1640x849.jpeg 848w, https://substackcdn.com/image/fetch/$s_!WgLg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c94e427-685a-4575-b979-2fe3a6d721cd_1640x849.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!WgLg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c94e427-685a-4575-b979-2fe3a6d721cd_1640x849.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WgLg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c94e427-685a-4575-b979-2fe3a6d721cd_1640x849.jpeg" width="1456" height="754" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2c94e427-685a-4575-b979-2fe3a6d721cd_1640x849.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:754,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:105014,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/183769534?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c94e427-685a-4575-b979-2fe3a6d721cd_1640x849.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!WgLg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c94e427-685a-4575-b979-2fe3a6d721cd_1640x849.jpeg 424w, https://substackcdn.com/image/fetch/$s_!WgLg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c94e427-685a-4575-b979-2fe3a6d721cd_1640x849.jpeg 848w, https://substackcdn.com/image/fetch/$s_!WgLg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c94e427-685a-4575-b979-2fe3a6d721cd_1640x849.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!WgLg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c94e427-685a-4575-b979-2fe3a6d721cd_1640x849.jpeg 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>A small picture of the problem</h3><p>The gap between these two arrows is what regularisation tries to close, not by magic, but by reducing the model&#8217;s temptation to use extreme weights and complicated decision surfaces.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!YOqf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93b98680-8bd5-4285-aaf6-d67ac9bb703f_1000x843.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YOqf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93b98680-8bd5-4285-aaf6-d67ac9bb703f_1000x843.webp 424w, https://substackcdn.com/image/fetch/$s_!YOqf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93b98680-8bd5-4285-aaf6-d67ac9bb703f_1000x843.webp 848w, https://substackcdn.com/image/fetch/$s_!YOqf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93b98680-8bd5-4285-aaf6-d67ac9bb703f_1000x843.webp 1272w, https://substackcdn.com/image/fetch/$s_!YOqf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93b98680-8bd5-4285-aaf6-d67ac9bb703f_1000x843.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YOqf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93b98680-8bd5-4285-aaf6-d67ac9bb703f_1000x843.webp" width="1000" height="843" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/93b98680-8bd5-4285-aaf6-d67ac9bb703f_1000x843.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:843,&quot;width&quot;:1000,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:21510,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/webp&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/183769534?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93b98680-8bd5-4285-aaf6-d67ac9bb703f_1000x843.webp&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!YOqf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93b98680-8bd5-4285-aaf6-d67ac9bb703f_1000x843.webp 424w, https://substackcdn.com/image/fetch/$s_!YOqf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93b98680-8bd5-4285-aaf6-d67ac9bb703f_1000x843.webp 848w, https://substackcdn.com/image/fetch/$s_!YOqf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93b98680-8bd5-4285-aaf6-d67ac9bb703f_1000x843.webp 1272w, https://substackcdn.com/image/fetch/$s_!YOqf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93b98680-8bd5-4285-aaf6-d67ac9bb703f_1000x843.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>The Core Intuition</h2><p>Complexity in a model is freedom, and freedom without constraints often becomes chaos. In linear models chaos shows up as huge coefficients jumping in opposite directions, and in deep networks it appears as neurons firing only for very specific training examples, like secret switches that recognise individual houses instead of general principles. Regularisation adds <strong>discipline</strong> so the model prefers simpler explanations.</p><p>In ordinary regression we minimise a loss that looks like</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sI8f!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff39c4741-1c14-4872-9a89-827abff9d257_557x159.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sI8f!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff39c4741-1c14-4872-9a89-827abff9d257_557x159.jpeg 424w, https://substackcdn.com/image/fetch/$s_!sI8f!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff39c4741-1c14-4872-9a89-827abff9d257_557x159.jpeg 848w, https://substackcdn.com/image/fetch/$s_!sI8f!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff39c4741-1c14-4872-9a89-827abff9d257_557x159.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!sI8f!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff39c4741-1c14-4872-9a89-827abff9d257_557x159.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sI8f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff39c4741-1c14-4872-9a89-827abff9d257_557x159.jpeg" width="557" height="159" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f39c4741-1c14-4872-9a89-827abff9d257_557x159.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:159,&quot;width&quot;:557,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:10034,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/183769534?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff39c4741-1c14-4872-9a89-827abff9d257_557x159.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!sI8f!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff39c4741-1c14-4872-9a89-827abff9d257_557x159.jpeg 424w, https://substackcdn.com/image/fetch/$s_!sI8f!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff39c4741-1c14-4872-9a89-827abff9d257_557x159.jpeg 848w, https://substackcdn.com/image/fetch/$s_!sI8f!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff39c4741-1c14-4872-9a89-827abff9d257_557x159.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!sI8f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff39c4741-1c14-4872-9a89-827abff9d257_557x159.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>and the algorithm searches for any set of parameters that makes this expression small. Regularisation tells us to modify the goal and say with a long breath that error should be small <strong>and</strong> weights should not be unnecessarily large, leading to</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JPD7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F630c0136-f211-4832-8317-9c6612c674e7_767x173.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JPD7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F630c0136-f211-4832-8317-9c6612c674e7_767x173.jpeg 424w, https://substackcdn.com/image/fetch/$s_!JPD7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F630c0136-f211-4832-8317-9c6612c674e7_767x173.jpeg 848w, https://substackcdn.com/image/fetch/$s_!JPD7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F630c0136-f211-4832-8317-9c6612c674e7_767x173.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!JPD7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F630c0136-f211-4832-8317-9c6612c674e7_767x173.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JPD7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F630c0136-f211-4832-8317-9c6612c674e7_767x173.jpeg" width="767" height="173" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/630c0136-f211-4832-8317-9c6612c674e7_767x173.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:173,&quot;width&quot;:767,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:14876,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/183769534?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F630c0136-f211-4832-8317-9c6612c674e7_767x173.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!JPD7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F630c0136-f211-4832-8317-9c6612c674e7_767x173.jpeg 424w, https://substackcdn.com/image/fetch/$s_!JPD7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F630c0136-f211-4832-8317-9c6612c674e7_767x173.jpeg 848w, https://substackcdn.com/image/fetch/$s_!JPD7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F630c0136-f211-4832-8317-9c6612c674e7_767x173.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!JPD7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F630c0136-f211-4832-8317-9c6612c674e7_767x173.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>where &#955; is the voice of the mentor and the term &#8721;wj^2 measures how wild the coefficients have become. For our house example this means that if the feature &#8220;paint color style&#8221; receives a giant weight just to fit a few points, the penalty will pull it back like an elastic band.</p><h3>Bullets for the feeling</h3><ul><li><p>Overfitting = memorising individual houses</p></li><li><p>Regularisation = encouraging general taste</p></li><li><p>Lambda = how strict we want to be</p></li><li><p>Smaller dataset &#8594; stronger discipline</p></li></ul><p>Bias and variance can also be narrated through the same streets. When we trained a very deep tree on those 120 houses, variance became high because predictions changed violently with minor data edits, and regularisation increases bias a little but reduces variance a lot, producing calmer prices that follow size and location rather than paint fantasies.</p><p></p><h2>Regularisation in Classical ML</h2><h3>L2 &#8211; The Art of Shrinking (Ridge)</h3><p>L2 regularisation assumes that many features contribute gently, and it prefers spreading responsibility across them instead of allowing one bully column to dominate. In coefficient space it literally creates a circular fence:</p><p>The maths square wj^2 grows fast, so extreme weights hurt badly. For houses this often highlights size, age, and metro distance while reducing balconies and paint color.</p><h3>L1 &#8211; Learning to Ignore (Lasso)</h3><p>L1 regularisation assumes that in a small and noisy dataset only a few features carry real meaning, and it prefers allowing the model to concentrate on those honest drivers instead of distributing attention across every quirky column. The loss becomes</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vx1r!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa81ce800-affa-4eb8-b5f4-c39473a00f70_824x174.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vx1r!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa81ce800-affa-4eb8-b5f4-c39473a00f70_824x174.jpeg 424w, https://substackcdn.com/image/fetch/$s_!vx1r!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa81ce800-affa-4eb8-b5f4-c39473a00f70_824x174.jpeg 848w, https://substackcdn.com/image/fetch/$s_!vx1r!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa81ce800-affa-4eb8-b5f4-c39473a00f70_824x174.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!vx1r!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa81ce800-affa-4eb8-b5f4-c39473a00f70_824x174.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vx1r!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa81ce800-affa-4eb8-b5f4-c39473a00f70_824x174.jpeg" width="824" height="174" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a81ce800-affa-4eb8-b5f4-c39473a00f70_824x174.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:174,&quot;width&quot;:824,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:14611,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/183769534?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa81ce800-affa-4eb8-b5f4-c39473a00f70_824x174.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!vx1r!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa81ce800-affa-4eb8-b5f4-c39473a00f70_824x174.jpeg 424w, https://substackcdn.com/image/fetch/$s_!vx1r!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa81ce800-affa-4eb8-b5f4-c39473a00f70_824x174.jpeg 848w, https://substackcdn.com/image/fetch/$s_!vx1r!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa81ce800-affa-4eb8-b5f4-c39473a00f70_824x174.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!vx1r!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa81ce800-affa-4eb8-b5f4-c39473a00f70_824x174.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>and the absolute value has a firm habit of pushing some weights exactly to zero, which feels like feature selection happening naturally rather than being forced by us. In our neighbourhood example it might slowly realise during training that &#8220;paint color score&#8217;&#8217; is helping only to fit three dramatic houses, and the penalty will keep reducing its coefficient until it finally becomes 0, leaving size, age, and metro distance as the main voices deciding the price. Beginners can watch this behaviour across epochs and notice with long curiosity that predictions turn simpler and more believable, as if the model has learnt to ignore gossip columns and listen only to sensible facts.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!CiBa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe46d2cb6-11fd-40e6-8f92-27607fe45a7a_972x745.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CiBa!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe46d2cb6-11fd-40e6-8f92-27607fe45a7a_972x745.png 424w, https://substackcdn.com/image/fetch/$s_!CiBa!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe46d2cb6-11fd-40e6-8f92-27607fe45a7a_972x745.png 848w, https://substackcdn.com/image/fetch/$s_!CiBa!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe46d2cb6-11fd-40e6-8f92-27607fe45a7a_972x745.png 1272w, https://substackcdn.com/image/fetch/$s_!CiBa!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe46d2cb6-11fd-40e6-8f92-27607fe45a7a_972x745.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CiBa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe46d2cb6-11fd-40e6-8f92-27607fe45a7a_972x745.png" width="536" height="410.8230452674897" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e46d2cb6-11fd-40e6-8f92-27607fe45a7a_972x745.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:745,&quot;width&quot;:972,&quot;resizeWidth&quot;:536,&quot;bytes&quot;:827728,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/183769534?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F449bc4b7-7f0c-426a-8352-b5cdb0db47a8_1024x1024.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!CiBa!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe46d2cb6-11fd-40e6-8f92-27607fe45a7a_972x745.png 424w, https://substackcdn.com/image/fetch/$s_!CiBa!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe46d2cb6-11fd-40e6-8f92-27607fe45a7a_972x745.png 848w, https://substackcdn.com/image/fetch/$s_!CiBa!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe46d2cb6-11fd-40e6-8f92-27607fe45a7a_972x745.png 1272w, https://substackcdn.com/image/fetch/$s_!CiBa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe46d2cb6-11fd-40e6-8f92-27607fe45a7a_972x745.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>When to use which</h3><ul><li><p>If we believe every house feature matters &#8594; L2</p></li><li><p>If we suspect only a few real drivers &#8594; L1</p></li><li><p>Unsure beginners &#8594; try both and watch curves</p></li></ul><p>Training curves for the example tell long stories rather than short tweets, and beginners should read them like novels.</p><h2>Moving to Deep Learning</h2><p>Neural networks are more imaginative than linear models, because a tiny two-layer network for house prices may already contain 50,000 parameters, each capable of inventing secret codes for individual training homes. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pF2G!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf82be8d-b2b1-4c4d-a454-d9848152d552_1024x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pF2G!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf82be8d-b2b1-4c4d-a454-d9848152d552_1024x1024.png 424w, https://substackcdn.com/image/fetch/$s_!pF2G!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf82be8d-b2b1-4c4d-a454-d9848152d552_1024x1024.png 848w, https://substackcdn.com/image/fetch/$s_!pF2G!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf82be8d-b2b1-4c4d-a454-d9848152d552_1024x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!pF2G!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf82be8d-b2b1-4c4d-a454-d9848152d552_1024x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pF2G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf82be8d-b2b1-4c4d-a454-d9848152d552_1024x1024.png" width="1024" height="1024" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cf82be8d-b2b1-4c4d-a454-d9848152d552_1024x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1024,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1092461,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/183769534?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf82be8d-b2b1-4c4d-a454-d9848152d552_1024x1024.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!pF2G!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf82be8d-b2b1-4c4d-a454-d9848152d552_1024x1024.png 424w, https://substackcdn.com/image/fetch/$s_!pF2G!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf82be8d-b2b1-4c4d-a454-d9848152d552_1024x1024.png 848w, https://substackcdn.com/image/fetch/$s_!pF2G!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf82be8d-b2b1-4c4d-a454-d9848152d552_1024x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!pF2G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf82be8d-b2b1-4c4d-a454-d9848152d552_1024x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The neural version of L2 is called <strong>weight decay</strong>, and the formula echoes the same philosophy:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!KqVr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff49a0862-55f2-42dd-a0f3-4248adbeff19_756x120.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!KqVr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff49a0862-55f2-42dd-a0f3-4248adbeff19_756x120.jpeg 424w, https://substackcdn.com/image/fetch/$s_!KqVr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff49a0862-55f2-42dd-a0f3-4248adbeff19_756x120.jpeg 848w, https://substackcdn.com/image/fetch/$s_!KqVr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff49a0862-55f2-42dd-a0f3-4248adbeff19_756x120.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!KqVr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff49a0862-55f2-42dd-a0f3-4248adbeff19_756x120.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!KqVr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff49a0862-55f2-42dd-a0f3-4248adbeff19_756x120.jpeg" width="756" height="120" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f49a0862-55f2-42dd-a0f3-4248adbeff19_756x120.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:120,&quot;width&quot;:756,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:11257,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/183769534?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff49a0862-55f2-42dd-a0f3-4248adbeff19_756x120.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!KqVr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff49a0862-55f2-42dd-a0f3-4248adbeff19_756x120.jpeg 424w, https://substackcdn.com/image/fetch/$s_!KqVr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff49a0862-55f2-42dd-a0f3-4248adbeff19_756x120.jpeg 848w, https://substackcdn.com/image/fetch/$s_!KqVr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff49a0862-55f2-42dd-a0f3-4248adbeff19_756x120.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!KqVr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff49a0862-55f2-42dd-a0f3-4248adbeff19_756x120.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>but deep learning has additional human-friendly tricks.</p><h3>Dropout &#8211; Forcing Team Work</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JVUv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14841213-ce7b-47d8-94ad-3d634ae6b36c_1021x769.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JVUv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14841213-ce7b-47d8-94ad-3d634ae6b36c_1021x769.png 424w, https://substackcdn.com/image/fetch/$s_!JVUv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14841213-ce7b-47d8-94ad-3d634ae6b36c_1021x769.png 848w, https://substackcdn.com/image/fetch/$s_!JVUv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14841213-ce7b-47d8-94ad-3d634ae6b36c_1021x769.png 1272w, https://substackcdn.com/image/fetch/$s_!JVUv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14841213-ce7b-47d8-94ad-3d634ae6b36c_1021x769.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JVUv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14841213-ce7b-47d8-94ad-3d634ae6b36c_1021x769.png" width="534" height="402.1998041136141" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/14841213-ce7b-47d8-94ad-3d634ae6b36c_1021x769.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:769,&quot;width&quot;:1021,&quot;resizeWidth&quot;:534,&quot;bytes&quot;:900489,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/183769534?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65270785-c1da-49f3-9c41-994c6966d1f1_1024x1024.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!JVUv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14841213-ce7b-47d8-94ad-3d634ae6b36c_1021x769.png 424w, https://substackcdn.com/image/fetch/$s_!JVUv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14841213-ce7b-47d8-94ad-3d634ae6b36c_1021x769.png 848w, https://substackcdn.com/image/fetch/$s_!JVUv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14841213-ce7b-47d8-94ad-3d634ae6b36c_1021x769.png 1272w, https://substackcdn.com/image/fetch/$s_!JVUv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14841213-ce7b-47d8-94ad-3d634ae6b36c_1021x769.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>During training we randomly switch off neurons:</p><p>where &#9675; means a sleeping neuron. This prevents the network from relying on one special path that recognises only three houses with green paint, and instead it learns distributed reasoning, like multiple students solving the assignment together.</p><h3>Early Stopping &#8211; Leaving the Exam Hall on Time</h3><p>If we keep training forever, the model eventually memorises the dataset completely, so we stop when validation error begins to rise, which in our example happened around epoch 18 even though training loss was still falling with temptation.</p><h2>The Mathematics Without Fear</h2><p>Regularisation modifies gradients. For L2, derivative of the penalty is</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4Aql!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09aa0604-6719-4311-a914-731ebdccbaf7_458x153.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4Aql!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09aa0604-6719-4311-a914-731ebdccbaf7_458x153.jpeg 424w, https://substackcdn.com/image/fetch/$s_!4Aql!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09aa0604-6719-4311-a914-731ebdccbaf7_458x153.jpeg 848w, https://substackcdn.com/image/fetch/$s_!4Aql!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09aa0604-6719-4311-a914-731ebdccbaf7_458x153.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!4Aql!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09aa0604-6719-4311-a914-731ebdccbaf7_458x153.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4Aql!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09aa0604-6719-4311-a914-731ebdccbaf7_458x153.jpeg" width="458" height="153" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/09aa0604-6719-4311-a914-731ebdccbaf7_458x153.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:153,&quot;width&quot;:458,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:9006,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/183769534?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09aa0604-6719-4311-a914-731ebdccbaf7_458x153.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!4Aql!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09aa0604-6719-4311-a914-731ebdccbaf7_458x153.jpeg 424w, https://substackcdn.com/image/fetch/$s_!4Aql!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09aa0604-6719-4311-a914-731ebdccbaf7_458x153.jpeg 848w, https://substackcdn.com/image/fetch/$s_!4Aql!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09aa0604-6719-4311-a914-731ebdccbaf7_458x153.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!4Aql!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09aa0604-6719-4311-a914-731ebdccbaf7_458x153.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>so each update becomes</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2SOm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9cf60de-8422-40aa-8712-98bc93a0b14e_600x151.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2SOm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9cf60de-8422-40aa-8712-98bc93a0b14e_600x151.jpeg 424w, https://substackcdn.com/image/fetch/$s_!2SOm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9cf60de-8422-40aa-8712-98bc93a0b14e_600x151.jpeg 848w, https://substackcdn.com/image/fetch/$s_!2SOm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9cf60de-8422-40aa-8712-98bc93a0b14e_600x151.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!2SOm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9cf60de-8422-40aa-8712-98bc93a0b14e_600x151.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2SOm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9cf60de-8422-40aa-8712-98bc93a0b14e_600x151.jpeg" width="600" height="151" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c9cf60de-8422-40aa-8712-98bc93a0b14e_600x151.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:151,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:11174,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/183769534?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9cf60de-8422-40aa-8712-98bc93a0b14e_600x151.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2SOm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9cf60de-8422-40aa-8712-98bc93a0b14e_600x151.jpeg 424w, https://substackcdn.com/image/fetch/$s_!2SOm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9cf60de-8422-40aa-8712-98bc93a0b14e_600x151.jpeg 848w, https://substackcdn.com/image/fetch/$s_!2SOm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9cf60de-8422-40aa-8712-98bc93a0b14e_600x151.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!2SOm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9cf60de-8422-40aa-8712-98bc93a0b14e_600x151.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>which clearly shows an additional pull toward zero every iteration, like a constant reminder. Probabilistic people say this equals assuming a Gaussian prior on weights, but as beginners we can simply imagine that simpler explanations are more likely than bizarre ones.</p><div><hr></div><h2>Practical Tips for Beginners</h2><ul><li><p>Choose lambda by watching <strong>validation curves</strong></p></li><li><p>Strong penalty for tiny datasets</p></li><li><p>Do not regularise the bias term usually</p></li><li><p>Remember that regularisation helps behaviour, not broken data</p></li></ul><p>Common misunderstandings appear when beginners expect regularisation to rescue completely irrelevant features or believe that dropout is only for large networks, and our story demonstrates patiently that philosophy matters more than rigid rules.</p><div><hr></div><h2>Conclusion</h2><p>Regularisation is less a formula and more a way of thinking that tells us with long compassionate sentences that models should learn like humans who generalise from experience instead of memorising accidental paint colors from a single lane. The house-price example we carried from start to end shows how gentle discipline turns a fragile predictor into a trustworthy appraiser, and I hope beginners feel encouraged to treat lambda as a friendly mentor rather than a scary Greek symbol.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://payalkanyan.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://payalkanyan.substack.com/subscribe?"><span>Subscribe now</span></a></p><p>If this article helped clarify things, consider <strong>subscribing</strong> so you don&#8217;t miss future deep-dives, and feel free to <strong>like or leave a comment</strong>&#8212;I&#8217;d love to hear your thoughts and what you&#8217;d like to see next.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://payalkanyan.substack.com/p/teaching-models-to-behave-like-humans/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://payalkanyan.substack.com/p/teaching-models-to-behave-like-humans/comments"><span>Leave a comment</span></a></p><div class="directMessage button" data-attrs="{&quot;userId&quot;:236050308,&quot;userName&quot;:&quot;payal&quot;,&quot;canDm&quot;:null,&quot;dmUpgradeOptions&quot;:null,&quot;isEditorNode&quot;:true}" data-component-name="DirectMessageToDOM"></div>]]></content:encoded></item><item><title><![CDATA[Linear Algebra for Machine Learning]]></title><description><![CDATA[The Quiet Foundation Behind Intelligent Systems - Part 1]]></description><link>https://payalkanyan.substack.com/p/linear-algebra-for-machine-learning</link><guid isPermaLink="false">https://payalkanyan.substack.com/p/linear-algebra-for-machine-learning</guid><dc:creator><![CDATA[payal]]></dc:creator><pubDate>Sun, 04 Jan 2026 09:17:17 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!bfPe!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbbfe3e4-2bc1-4533-a70c-eb146cb66f6c_1585x1158.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Linear algebra sits quietly beneath almost everything we call <em>machine learning</em>. From linear regression to deep neural networks, the core ideas are built on linear equations, vectors, matrices, and systems of equations. While modern libraries allow us to write models in just a few lines of code, the mathematics underneath determines <em>why</em> those models work&#8212;or fail.</p><p>Many learners begin their ML journey directly with code. At first, this feels productive. But over time, concepts like gradient descent, back propagation, feature spaces, and optimisation start to feel opaque. Almost always, the root cause is the same: shaky foundations in linear algebra.</p><p>So in this series, we slow things down. We start from the very basics and build upward&#8212;carefully, intuitively, and with machine learning in mind.</p><p><em>Machine learning systems do not &#8220;think&#8221; in words or concepts. They operate on numbers. More precisely, they operate on structured collections of numbers, and they learn by transforming those structures in consistent ways.</em></p><p>If this statement feels abstract right now, don&#8217;t worry. By the end of this series, it will feel obvious.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://payalkanyan.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading payal's Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p><h2>From numbers to structure</h2><p>For this article, let&#8217;s consider a dataset of people&#8217;s characteristics - like height, weight, age, income.</p><p>Consider a dataset describing people:</p><ul><li><p>Height</p></li><li><p>Weight</p></li><li><p>Age</p></li><li><p>Income</p></li></ul><p>Each of these values is a <strong>single number</strong>. In mathematics, such a single number is called a <strong>scalar</strong>. Scalars are meaningful&#8212;temperature, age, price, probability&#8212;but on their own, they cannot represent complex data.</p><p>Machine learning rarely works with isolated numbers. Instead, it works with <em>organised collections</em> of numbers.</p><h2>Vectors: Representing Data Points</h2><p>Suppose we want to represent the heights of many individuals in a single, structured form. This naturally leads us to the concept of a <strong>vector</strong>.</p><p>A vector is simply an ordered list of numbers. In ML terms, you can think of it as <strong>one data point</strong> or <strong>one feature across many samples</strong>, depending on the context</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RmlI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a1aeca8-3754-475c-9b4c-a14fb789c108_964x726.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RmlI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a1aeca8-3754-475c-9b4c-a14fb789c108_964x726.jpeg 424w, https://substackcdn.com/image/fetch/$s_!RmlI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a1aeca8-3754-475c-9b4c-a14fb789c108_964x726.jpeg 848w, https://substackcdn.com/image/fetch/$s_!RmlI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a1aeca8-3754-475c-9b4c-a14fb789c108_964x726.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!RmlI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a1aeca8-3754-475c-9b4c-a14fb789c108_964x726.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RmlI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a1aeca8-3754-475c-9b4c-a14fb789c108_964x726.jpeg" width="516" height="388.6058091286307" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2a1aeca8-3754-475c-9b4c-a14fb789c108_964x726.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:726,&quot;width&quot;:964,&quot;resizeWidth&quot;:516,&quot;bytes&quot;:90408,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/183423213?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a1aeca8-3754-475c-9b4c-a14fb789c108_964x726.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!RmlI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a1aeca8-3754-475c-9b4c-a14fb789c108_964x726.jpeg 424w, https://substackcdn.com/image/fetch/$s_!RmlI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a1aeca8-3754-475c-9b4c-a14fb789c108_964x726.jpeg 848w, https://substackcdn.com/image/fetch/$s_!RmlI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a1aeca8-3754-475c-9b4c-a14fb789c108_964x726.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!RmlI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a1aeca8-3754-475c-9b4c-a14fb789c108_964x726.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Vectors allow us to perform mathematical operations such as addition, scaling, distance measurement, and projections&#8212;operations that are fundamental to learning algorithms.</p><h2>From Vectors to Datasets</h2><p>In practice, we don&#8217;t operate on one vector at a time. Algorithms like <strong>gradient descent</strong> (covered in a later post) work on <em>entire datasets</em> simultaneously.</p><p>Imagine a small dataset where each person is described by height, weight, and age.</p><p>But we want to operate on whole dataset for Gradient Descent like functions.(Soon post on GD).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!J8bX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1843d6c7-364d-4280-9f8c-05a2eaaa0140_1463x847.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!J8bX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1843d6c7-364d-4280-9f8c-05a2eaaa0140_1463x847.jpeg 424w, https://substackcdn.com/image/fetch/$s_!J8bX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1843d6c7-364d-4280-9f8c-05a2eaaa0140_1463x847.jpeg 848w, https://substackcdn.com/image/fetch/$s_!J8bX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1843d6c7-364d-4280-9f8c-05a2eaaa0140_1463x847.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!J8bX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1843d6c7-364d-4280-9f8c-05a2eaaa0140_1463x847.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!J8bX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1843d6c7-364d-4280-9f8c-05a2eaaa0140_1463x847.jpeg" width="600" height="347.3901098901099" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1843d6c7-364d-4280-9f8c-05a2eaaa0140_1463x847.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:843,&quot;width&quot;:1456,&quot;resizeWidth&quot;:600,&quot;bytes&quot;:230634,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/183423213?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1843d6c7-364d-4280-9f8c-05a2eaaa0140_1463x847.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!J8bX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1843d6c7-364d-4280-9f8c-05a2eaaa0140_1463x847.jpeg 424w, https://substackcdn.com/image/fetch/$s_!J8bX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1843d6c7-364d-4280-9f8c-05a2eaaa0140_1463x847.jpeg 848w, https://substackcdn.com/image/fetch/$s_!J8bX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1843d6c7-364d-4280-9f8c-05a2eaaa0140_1463x847.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!J8bX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1843d6c7-364d-4280-9f8c-05a2eaaa0140_1463x847.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Now the question becomes:</p><p><strong>How do we represent this dataset so that a computer can efficiently work with it?</strong></p><p>So, to represent this dataset we need something like this</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bfPe!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbbfe3e4-2bc1-4533-a70c-eb146cb66f6c_1585x1158.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bfPe!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbbfe3e4-2bc1-4533-a70c-eb146cb66f6c_1585x1158.jpeg 424w, https://substackcdn.com/image/fetch/$s_!bfPe!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbbfe3e4-2bc1-4533-a70c-eb146cb66f6c_1585x1158.jpeg 848w, https://substackcdn.com/image/fetch/$s_!bfPe!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbbfe3e4-2bc1-4533-a70c-eb146cb66f6c_1585x1158.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!bfPe!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbbfe3e4-2bc1-4533-a70c-eb146cb66f6c_1585x1158.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bfPe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbbfe3e4-2bc1-4533-a70c-eb146cb66f6c_1585x1158.jpeg" width="1456" height="1064" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dbbfe3e4-2bc1-4533-a70c-eb146cb66f6c_1585x1158.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1064,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:104081,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/183423213?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbbfe3e4-2bc1-4533-a70c-eb146cb66f6c_1585x1158.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!bfPe!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbbfe3e4-2bc1-4533-a70c-eb146cb66f6c_1585x1158.jpeg 424w, https://substackcdn.com/image/fetch/$s_!bfPe!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbbfe3e4-2bc1-4533-a70c-eb146cb66f6c_1585x1158.jpeg 848w, https://substackcdn.com/image/fetch/$s_!bfPe!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbbfe3e4-2bc1-4533-a70c-eb146cb66f6c_1585x1158.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!bfPe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbbfe3e4-2bc1-4533-a70c-eb146cb66f6c_1585x1158.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Matrices: Structured Data at Scale</h2><p>To represent an entire dataset compactly, we use a <strong>matrix</strong>.</p><p>A matrix is a rectangular array of numbers arranged in rows and columns:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!htOO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaccef13-2078-4cad-a1ce-3a8ee1db0b64_1054x454.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!htOO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaccef13-2078-4cad-a1ce-3a8ee1db0b64_1054x454.jpeg 424w, https://substackcdn.com/image/fetch/$s_!htOO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaccef13-2078-4cad-a1ce-3a8ee1db0b64_1054x454.jpeg 848w, https://substackcdn.com/image/fetch/$s_!htOO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaccef13-2078-4cad-a1ce-3a8ee1db0b64_1054x454.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!htOO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaccef13-2078-4cad-a1ce-3a8ee1db0b64_1054x454.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!htOO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaccef13-2078-4cad-a1ce-3a8ee1db0b64_1054x454.jpeg" width="1054" height="454" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aaccef13-2078-4cad-a1ce-3a8ee1db0b64_1054x454.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:454,&quot;width&quot;:1054,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:56344,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/183423213?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaccef13-2078-4cad-a1ce-3a8ee1db0b64_1054x454.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!htOO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaccef13-2078-4cad-a1ce-3a8ee1db0b64_1054x454.jpeg 424w, https://substackcdn.com/image/fetch/$s_!htOO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaccef13-2078-4cad-a1ce-3a8ee1db0b64_1054x454.jpeg 848w, https://substackcdn.com/image/fetch/$s_!htOO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaccef13-2078-4cad-a1ce-3a8ee1db0b64_1054x454.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!htOO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaccef13-2078-4cad-a1ce-3a8ee1db0b64_1054x454.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p>Each <strong>row</strong> typically represents one data sample</p></li><li><p>Each <strong>column</strong> represents a feature</p></li></ul><p>This structure is not arbitrary. Matrices allow us to express large collections of equations and transformations using concise mathematical notation&#8212;exactly what machine learning relies on.</p><h2>Linear Equations: The Simplest Models</h2><p>A <strong>linear equation</strong> describes a straight-line relationship. The most familiar form is:</p><p>y=mx+by = mx + by=mx+b</p><p>Here:</p><ul><li><p>x is the <strong>independent variable</strong> (input or feature)</p></li><li><p>y is the <strong>dependent variable</strong> (output or target)</p></li><li><p>m controls the slope</p></li><li><p>b is the intercept</p></li></ul><p>In machine learning, y is usually what we want to <strong>predict</strong>, while x represents known features such as age or height.</p><p>Even simple numbers can be expressed through equations. For example:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vwsr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9719d8f5-6802-47c1-8125-d71265be1262_689x307.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vwsr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9719d8f5-6802-47c1-8125-d71265be1262_689x307.jpeg 424w, https://substackcdn.com/image/fetch/$s_!vwsr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9719d8f5-6802-47c1-8125-d71265be1262_689x307.jpeg 848w, https://substackcdn.com/image/fetch/$s_!vwsr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9719d8f5-6802-47c1-8125-d71265be1262_689x307.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!vwsr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9719d8f5-6802-47c1-8125-d71265be1262_689x307.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vwsr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9719d8f5-6802-47c1-8125-d71265be1262_689x307.jpeg" width="689" height="307" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9719d8f5-6802-47c1-8125-d71265be1262_689x307.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:307,&quot;width&quot;:689,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:26895,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/183423213?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9719d8f5-6802-47c1-8125-d71265be1262_689x307.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!vwsr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9719d8f5-6802-47c1-8125-d71265be1262_689x307.jpeg 424w, https://substackcdn.com/image/fetch/$s_!vwsr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9719d8f5-6802-47c1-8125-d71265be1262_689x307.jpeg 848w, https://substackcdn.com/image/fetch/$s_!vwsr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9719d8f5-6802-47c1-8125-d71265be1262_689x307.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!vwsr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9719d8f5-6802-47c1-8125-d71265be1262_689x307.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This may look trivial, but the idea is powerful: unknown values can be represented and solved using known quantities.</p><h2>From One Equation to Many</h2><p>Real-world datasets involve multiple features, leading to <strong>multiple equations</strong> that must be solved together.</p><p>Using matrix notation, this is commonly written as:</p><p>W*X+b=y^</p><p>This is known as a <strong>system of linear equations</strong>, where:</p><ul><li><p>W contains weights</p></li><li><p>X is the input matrix</p></li><li><p>b is the bias</p></li><li><p>y^ is the predicted output</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!BDnR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fca8ebe-b754-40d6-90b8-a11909b3c986_1242x321.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BDnR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fca8ebe-b754-40d6-90b8-a11909b3c986_1242x321.jpeg 424w, https://substackcdn.com/image/fetch/$s_!BDnR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fca8ebe-b754-40d6-90b8-a11909b3c986_1242x321.jpeg 848w, https://substackcdn.com/image/fetch/$s_!BDnR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fca8ebe-b754-40d6-90b8-a11909b3c986_1242x321.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!BDnR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fca8ebe-b754-40d6-90b8-a11909b3c986_1242x321.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BDnR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fca8ebe-b754-40d6-90b8-a11909b3c986_1242x321.jpeg" width="724" height="187.12077294685992" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1fca8ebe-b754-40d6-90b8-a11909b3c986_1242x321.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:321,&quot;width&quot;:1242,&quot;resizeWidth&quot;:724,&quot;bytes&quot;:63793,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/183423213?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fca8ebe-b754-40d6-90b8-a11909b3c986_1242x321.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!BDnR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fca8ebe-b754-40d6-90b8-a11909b3c986_1242x321.jpeg 424w, https://substackcdn.com/image/fetch/$s_!BDnR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fca8ebe-b754-40d6-90b8-a11909b3c986_1242x321.jpeg 848w, https://substackcdn.com/image/fetch/$s_!BDnR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fca8ebe-b754-40d6-90b8-a11909b3c986_1242x321.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!BDnR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fca8ebe-b754-40d6-90b8-a11909b3c986_1242x321.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h2>Systems of Equations: An Intuitive View</h2><p>Think of a system of equations like a set of sentences describing reality.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!XOPC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F903b71c6-f40f-4ca5-a287-a34b862f8dc0_1302x660.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!XOPC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F903b71c6-f40f-4ca5-a287-a34b862f8dc0_1302x660.jpeg 424w, https://substackcdn.com/image/fetch/$s_!XOPC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F903b71c6-f40f-4ca5-a287-a34b862f8dc0_1302x660.jpeg 848w, https://substackcdn.com/image/fetch/$s_!XOPC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F903b71c6-f40f-4ca5-a287-a34b862f8dc0_1302x660.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!XOPC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F903b71c6-f40f-4ca5-a287-a34b862f8dc0_1302x660.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!XOPC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F903b71c6-f40f-4ca5-a287-a34b862f8dc0_1302x660.jpeg" width="1302" height="660" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/903b71c6-f40f-4ca5-a287-a34b862f8dc0_1302x660.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:660,&quot;width&quot;:1302,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:239550,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/183423213?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F903b71c6-f40f-4ca5-a287-a34b862f8dc0_1302x660.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!XOPC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F903b71c6-f40f-4ca5-a287-a34b862f8dc0_1302x660.jpeg 424w, https://substackcdn.com/image/fetch/$s_!XOPC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F903b71c6-f40f-4ca5-a287-a34b862f8dc0_1302x660.jpeg 848w, https://substackcdn.com/image/fetch/$s_!XOPC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F903b71c6-f40f-4ca5-a287-a34b862f8dc0_1302x660.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!XOPC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F903b71c6-f40f-4ca5-a287-a34b862f8dc0_1302x660.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>example courtesy - DeepLearning.AI</p><ul><li><p>for the first system - this makes the definite colour to each one thus is considered complete and called Non-singular. </p></li><li><p>for second system - it is giving same equations twice about the colour of same creature- thus redundant system of equations and are called Singular</p></li><li><p>for the last system - the two sentences are contradictory and are called Singular</p></li></ul><h2>Systems of Equations in Numbers</h2><ol><li><p><strong>Unique solution (non-singular)</strong></p><p>a+b=10</p><p>a+2b=12</p><p>&#8594; a=8,b=2</p></li><li><p><strong>Infinite solutions (singular, redundant)</strong></p><p>2a+2b=20</p><p>a+b=10</p></li><li><p><strong>No solution (singular, contradictory)</strong></p><p>a+b=10</p><p>2a+2b=24</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!e8Xx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe87d162e-47a8-4b21-924c-782b53ca2319_1153x801.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!e8Xx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe87d162e-47a8-4b21-924c-782b53ca2319_1153x801.jpeg 424w, https://substackcdn.com/image/fetch/$s_!e8Xx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe87d162e-47a8-4b21-924c-782b53ca2319_1153x801.jpeg 848w, https://substackcdn.com/image/fetch/$s_!e8Xx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe87d162e-47a8-4b21-924c-782b53ca2319_1153x801.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!e8Xx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe87d162e-47a8-4b21-924c-782b53ca2319_1153x801.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!e8Xx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe87d162e-47a8-4b21-924c-782b53ca2319_1153x801.jpeg" width="1153" height="801" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e87d162e-47a8-4b21-924c-782b53ca2319_1153x801.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:801,&quot;width&quot;:1153,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:142755,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/183423213?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe87d162e-47a8-4b21-924c-782b53ca2319_1153x801.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!e8Xx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe87d162e-47a8-4b21-924c-782b53ca2319_1153x801.jpeg 424w, https://substackcdn.com/image/fetch/$s_!e8Xx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe87d162e-47a8-4b21-924c-782b53ca2319_1153x801.jpeg 848w, https://substackcdn.com/image/fetch/$s_!e8Xx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe87d162e-47a8-4b21-924c-782b53ca2319_1153x801.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!e8Xx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe87d162e-47a8-4b21-924c-782b53ca2319_1153x801.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In linear algebra terms:</p><ul><li><p>Singular systems are <strong>linearly dependent</strong></p></li><li><p>Non-singular systems are <strong>linearly independent</strong></p></li></ul><p>Not all equations are linear. and here are some example of non-linear equations:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!n7VC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cb902f8-a936-4ee9-be86-cfea7b5bb52d_1388x645.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!n7VC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cb902f8-a936-4ee9-be86-cfea7b5bb52d_1388x645.jpeg 424w, https://substackcdn.com/image/fetch/$s_!n7VC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cb902f8-a936-4ee9-be86-cfea7b5bb52d_1388x645.jpeg 848w, https://substackcdn.com/image/fetch/$s_!n7VC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cb902f8-a936-4ee9-be86-cfea7b5bb52d_1388x645.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!n7VC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cb902f8-a936-4ee9-be86-cfea7b5bb52d_1388x645.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!n7VC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cb902f8-a936-4ee9-be86-cfea7b5bb52d_1388x645.jpeg" width="1388" height="645" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7cb902f8-a936-4ee9-be86-cfea7b5bb52d_1388x645.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:645,&quot;width&quot;:1388,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:96687,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://payalkanyan.substack.com/i/183423213?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cb902f8-a936-4ee9-be86-cfea7b5bb52d_1388x645.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!n7VC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cb902f8-a936-4ee9-be86-cfea7b5bb52d_1388x645.jpeg 424w, https://substackcdn.com/image/fetch/$s_!n7VC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cb902f8-a936-4ee9-be86-cfea7b5bb52d_1388x645.jpeg 848w, https://substackcdn.com/image/fetch/$s_!n7VC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cb902f8-a936-4ee9-be86-cfea7b5bb52d_1388x645.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!n7VC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cb902f8-a936-4ee9-be86-cfea7b5bb52d_1388x645.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Machine learning often starts with linear models because they are easier to analyze and optimize. Non-linearity is later introduced deliberately, usually through activation functions.</p><h2>Geometry Behind the Math</h2><ul><li><p>2 variables &#8594; <strong>line</strong></p></li><li><p>3 variables &#8594; <strong>plane</strong></p></li><li><p>More than 3 variables &#8594; <strong>hyperplane</strong> (cannot be visualized directly)</p></li></ul><p>Despite the abstraction, these geometric interpretations guide how algorithms learn and generalise.</p><p>Stopping it here today, hopefully this much didn&#8217;t overwhelmed you. this was just the introduction, gear up for the next posts which will have a bit of mathematical representations and new terms introduced. Till then, keep learning&#8212;and stay curious!</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://payalkanyan.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://payalkanyan.substack.com/subscribe?"><span>Subscribe now</span></a></p><p>If this article helped clarify things, consider <strong>subscribing</strong> so you don&#8217;t miss future deep-dives, and feel free to <strong>like or leave a comment</strong>&#8212;I&#8217;d love to hear your thoughts and what you&#8217;d like to see next.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://payalkanyan.substack.com/p/linear-algebra-for-machine-learning/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://payalkanyan.substack.com/p/linear-algebra-for-machine-learning/comments"><span>Leave a comment</span></a></p><div class="directMessage button" data-attrs="{&quot;userId&quot;:236050308,&quot;userName&quot;:&quot;payal&quot;,&quot;canDm&quot;:null,&quot;dmUpgradeOptions&quot;:null,&quot;isEditorNode&quot;:true}" data-component-name="DirectMessageToDOM"></div><p></p>]]></content:encoded></item><item><title><![CDATA[AI/ML Fundamentals, Explained Clearly]]></title><description><![CDATA[Structured notes and insights for building strong ML foundations]]></description><link>https://payalkanyan.substack.com/p/aiml-fundamentals-explained-clearly</link><guid isPermaLink="false">https://payalkanyan.substack.com/p/aiml-fundamentals-explained-clearly</guid><dc:creator><![CDATA[payal]]></dc:creator><pubDate>Sat, 27 Dec 2025 07:56:15 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!fJa9!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53401c2a-101d-4c28-907a-8881d4a908ef_640x640.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hi everyone.<br>Welcome to my substack.<br>I&#8217;m Payal, a final-year student at IIT Roorkee, building strong foundations in AI and Machine Learning.<br>Machine Learning can feel overwhelming&#8212;too many resources, too much hype, and very little clarity about what actually matters.</p><p>This publication is my attempt to slow things down and focus on the fundamentals. Here, I write about <strong>AI and Machine Learning concepts the way I wish I had learned them</strong>&#8212;clearly, step by step, and with emphasis on understanding rather than memorization.</p><p>You&#8217;ll find concise explanations of <strong>Maths for ML</strong>, core ML concepts, PyTorch insights, and curated notes from courses and papers&#8212;written for clarity, not noise.</p><blockquote><p>Over time, this will grow into a well-organized knowledge base I can return to&#8212;and that others can use as well.</p></blockquote><p>The goal is simple: to make these ideas easier to learn, revisit, and truly understand.</p><p>If you&#8217;re building strong ML foundations or preparing for AI/ML roles, I hope this helps you learn with more confidence and less confusion.</p><p><strong>Subscribe to get practical, high-signal ML content directly in your inbox.</strong></p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://payalkanyan.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading PayalKanyan's Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item></channel></rss>