{
  "source_file": "0930",
  "source_platform": "Hashnode",
  "author": "Tharun",
  "title_listed": "Matrix Inverse, Determinant & Linear Transformation — What Actually Happens Inside a Machine Learning Model When It \"Learns\"",
  "keywords": "",
  "domain": "机器学习",
  "content_type": "深度技术解析",
  "is_paid_flag": "否",
  "url": "https://tharunpandya.hashnode.dev/matrix-inverse-determinant-linear-transformation-machine-learning",
  "publish_date": "2026-07-22",
  "corpus_stage": "",
  "notes": "",
  "id": "32ea7849fd04",
  "collected_at": "2026-10-02T14:10:45",
  "title": "Linear Transformations in Machine Learning Explained",
  "body_markdown": "Matrix Inverse, Determinant & Linear Transformation — What Actually Happens Inside a Machine Learning Model When It \"Learns\"\nUpdated\nJuly 22, 2026\n•\n25\nmin read\n•\nView as Markdown\nT\nTharun\nA few months ago, I locked myself out of my own apartment.\nI stood outside, called a locksmith, and watched him work. He looked at the lock, cut a fresh key, turned it, and — click — the door opened. One clean, precise action, completely undone.\nHere's a question worth actually sitting with:\nwhy did that work?\nWhy could he undo the lock, but if that same lock had been crushed, melted, or welded shut, no locksmith on the planet could bring it back to \"unlocked\" again?\nThe answer is simple once you say it out loud: a normal turning lock is a\nreversible\naction. Twist one way, it locks. Twist the exact opposite way, it unlocks. But crushing a lock isn't reversible — no matter how skilled the locksmith is, there's no \"opposite\" action that un-crushes metal back into a working lock. Some actions can be undone. Some actions destroy information so completely that undoing them is simply impossible, no matter how clever you are.\nThis single idea — some actions can be undone, some can't, and you can actually tell in advance which is which — is the entire subject of this blog. And it turns out, this exact idea sits at the very heart of how Machine Learning models \"learn,\" how camera apps fix a distorted photo, and even hints at something surprisingly true about your own memory.\nIn the earlier blogs of this series, we learned to add, subtract, mask, and multiply matrices. Today, we go one level deeper and ask:\nwhen you multiply your data by a matrix, what is actually happening to it?\nIs it just numbers shuffling around, or is something bigger going on — something geometric, something you could almost picture with your eyes closed?\nBy the end of this blog, you will understand:\nWhat a\nlinear transformation\ngenuinely is — what multiplying by a matrix actually\ndoes\nto your data, in a way you can picture\nWhat the\ndeterminant\ntells you, before you even attempt anything else, about whether a transformation is reversible\nWhat the\nmatrix inverse\nis, how to build it from scratch, and why it's the mathematical version of the locksmith's key\nReal, low-level examples from camera lens correction, face recognition, and how your own memory works\nWhy this trio, quietly, is the mathematical backbone of linear regression, PCA, and how neural networks reshape raw data into decisions\nLet's take this slowly, one idea at a time.\nPart 1: Linear Transformation — What Multiplying by a Matrix Actually Does\nPicture a flat rubber sheet with a perfectly even grid drawn on it — neat little squares, all the same size, evenly spaced, like graph paper.\nNow imagine grabbing that sheet with both hands and doing something to it — stretching it wider, spinning it slightly, or squashing it thinner. Watch what happens to the grid lines. They might get longer or shorter. The squares might turn into rectangles, or lean into diamonds. But — and this is the important part —\nthe lines stay perfectly straight, and they stay evenly spaced relative to each other.\nNo line bends into a curve. No two originally-parallel lines suddenly cross each other.\nThat specific kind of movement — stretching, rotating, or squashing, while keeping straight lines straight and spacing even — is called a\nlinear transformation\n. And here's the sentence that ties this entire blog series together, so read it twice:\nEvery time you multiply a vector (or a whole matrix of data) by another matrix, using real matrix multiplication, you are applying a linear transformation to it.\nThe matrix itself is nothing but a stored\ninstruction\n— \"stretch this way, rotate that much, squash this direction\" — waiting to be applied to whatever numbers you feed it.\nSeeing It With Real Numbers\nLet's use a small, concrete matrix as our \"instruction,\" and a single vector as the thing being transformed.\nimport numpy as np\n\nA = np.array([[12, 3, 13, 6],\n              [1, 15, 7, 5],\n              [4, 11, 4, 8],\n              [18, 2, 6, 8]])\n\nx = np.array([[1], [2], [3], [4]])\n\ndef transformation(a, x):\n    result = np.zeros((a.shape[0], x.shape[1]))\n    for i in range(x.shape[0]):\n        for j in range(a.shape[0]):\n            result[i] += a[i, j] * x[j]\n    return result\n\nprint(transformation(A, x))\n[[81.]\n [72.]\n [70.]\n [72.]]\nLook closely at what this code is actually doing — it's the exact matrix multiplication you learned in the last blog, just applied to a single column of numbers (a vector) instead of a full grid. Our starting vector was\n[1, 2, 3, 4]\n. After being multiplied by matrix A, it \"moved\" to a brand new position:\n[81, 72, 70, 72]\n.\nNothing about this feels dramatic when you just look at the numbers. But picture it the rubber-sheet way instead: imagine\n[1, 2, 3, 4]\nas a single point sitting somewhere on that grid. Multiplying it by A is exactly like grabbing the whole sheet and stretching, rotating, or squashing it according to the \"instructions\" written inside A — and that point on the sheet gets carried along to a brand new location,\n[81, 72, 70, 72]\n, purely because the sheet itself moved underneath it.\nWhere This Actually Shows Up (Real, Concrete Examples)\n1. Rotating and resizing a photo (Computer Vision)\nWhen you rotate a photo 15 degrees in an editing app, or resize it to fit an Instagram story, the app isn't magically \"redrawing\" the image. It takes the (x, y) coordinate of every single pixel — imagine each pixel's position as a tiny 2-number vector — and multiplies it by a small rotation-and-scaling matrix. Every pixel gets carried to a new position, exactly like the point on our rubber sheet, and the collection of all these moved pixels is your rotated, resized photo. Do this for a few million pixels, and it happens instantly, every time you pinch-zoom or rotate a photo on your phone.\n2. Face filters stretching your face into a cartoon (Computer Vision)\nThose \"big eyes, small chin\" cartoon-style filters on Snapchat and Instagram work by taking the coordinates of your detected face mesh (remember the triangle mesh from the last blog) and applying a carefully designed linear transformation matrix that stretches certain regions (the eyes) and shrinks others (the chin), while keeping the overall structure of the face recognizably intact. It's the exact same rubber-sheet stretching idea, just applied specifically and cleverly to different regions of your face.\n3. Every single layer of a neural network reshaping data (Deep Learning, Translation Apps)\nHere's the big one, worth sitting with. When a translation app processes your sentence, or a face recognition system processes your photo, the raw input data (word numbers, or pixel numbers) doesn't stay in its original form the whole way through. It passes through many layers, one after another, and\neach layer applies its own linear transformation\n— its own \"stretch, rotate, squash\" instruction, learned automatically during training (a topic for a future blog, don't worry about the word \"training\" itself right now) — gradually reshaping the raw data into a new form where the final answer (which word comes next, whose face this is) becomes far easier to read off directly.\nThis is genuinely one of the most useful mental pictures you can carry forward from this entire series:\nA neural network is really just a long chain of linear transformations, each one reshaping the data a little more, until the final shape makes the answer obvious.\nIt's rubber sheets, stacked on top of rubber sheets, each one stretched slightly differently, until what started as a meaningless grid of pixel brightness numbers ends up perfectly shaped to reveal \"this is a photo of a cat\" or \"this sentence is happy, not sad.\"\nBut here's a question this immediately raises, and it's the reason the rest of this blog exists:\nif a transformation reshapes your data, can you always get the original data back?\nSometimes yes. Sometimes, shockingly, no. Let's find out how to tell the difference, before we ever attempt to undo anything.\nPart 2: Determinant — Does This Transformation Destroy Information Forever?\nGo back to the rubber sheet. If you stretch it gently — say, pulling it a little wider — every original square grows a bit bigger, but you can still clearly make out every original square's shape. Crucially, if you knew exactly how much you stretched it, you could pull it back the opposite way and get the\nexact\noriginal grid back, perfectly.\nBut now imagine squashing the sheet so hard, from one direction, that it completely flattens into a single straight line — or worse, into a single point. Now, many, many different original squares have all been crushed down onto that same flat line, or that same single point. If someone showed you only that flattened result and asked, \"which original square was this?\" — you genuinely could not answer. Multiple different starting points have been merged into one, indistinguishable, final position. There's no way back. The information about which square it originally was is gone, permanently.\nThe\ndeterminant\nis a single number, calculated directly from a matrix, that tells you — before you ever attempt anything — which of these two situations you're facing.\nIf a matrix's determinant is exactly zero, the transformation it represents crushes information down so completely that undoing it is mathematically impossible. If the determinant is any number other than zero, the transformation is fully reversible.\nA Real, Relatable Example of a Zero Determinant\nHere's a genuinely useful, low-level example. Imagine a self-driving car with two nearly-identical distance sensors, both facing forward, mounted just a few centimeters apart. If both sensors, for some reason, always report\nexactly\nthe same distance reading in every situation (say, due to a wiring mistake accidentally connecting them to the same signal), then the \"matrix\" describing these two sensor readings together has effectively collapsed into just one piece of real information, duplicated twice. Mathematically, this shows up as a determinant of zero — a strong, precise, mathematical warning sign that says, \"you think you have two independent pieces of information here, but you actually only have one, and part of what you thought you knew is unrecoverable, because it was never really separate to begin with.\"\nThis exact warning sign — a zero, or very close to zero, determinant — is one of the very first things engineers check for when building systems that rely on combining multiple sensors or multiple features, precisely because it flags hidden, wasted redundancy before it causes a bigger, more confusing failure downstream.\nThe Rule (Explained Slowly, With a Fully Worked Example)\nFor a small, 2-by-2 matrix, the determinant has a direct, simple formula:\nFor a 2x2 matrix   [a  b]\n                    [c  d]\n\ndeterminant = (a × d) − (b × c)\nLet's fully work through a real example by hand.\nMatrix =   [2   1]\n           [1   3]\ndeterminant = (2 × 3) − (1 × 1)\n            = 6 − 1\n            = 5\nSince\n5\nis not zero, this transformation is fully reversible — nothing gets permanently crushed. Good news; we'll actually undo this exact matrix ourselves in Part 3.\nNow let's see what a zero determinant genuinely looks like, using an example built from real, whole numbers, so you can verify it yourself:\nMatrix =    [1   2   3]\n            [4   5   6]\n            [7   8   9]\nIf you look closely at this matrix, you'll notice something quietly suspicious: each row is simply the row above it, plus 3, added to every number (\n1,2,3\nthen\n4,5,6\nthen\n7,8,9\n). The third row isn't really \"new\" information — it's secretly just a combination of the first two rows. This hidden redundancy is\nexactly\nthe kind of thing a zero determinant is built to catch. And indeed, if you calculate it (we'll show the code shortly), this matrix's determinant comes out to exactly zero.\nFor matrices bigger than 2-by-2, the determinant is calculated by breaking the matrix down into smaller and smaller pieces — a process called\ncofactor expansion\n— repeatedly, until you're only left with tiny 2x2 or 1x1 pieces you already know how to solve directly. You genuinely never need to memorize this process by hand for anything beyond a small textbook example — but let's still build it from scratch in code, so you can see, honestly, that there's no hidden magic inside\nnp.linalg.det()\n.\nPython Code — Built Entirely From Scratch\nimport numpy as np\n\ndef det(a):\n    if len(a) == 1:\n        return a[0][0]\n    if len(a) == 2:\n        return a[0][0] * a[1][1] - a[0][1] * a[1][0]\n\n    result = 0\n    for col in range(len(a)):\n        minor = [\n            [a[row][c] for c in range(len(a)) if c != col]\n            for row in range(1, len(a))\n        ]\n        result += ((-1) ** col) * a[0][col] * det(np.array(minor))\n\n    return result\nLet's unpack this slowly, piece by piece, because at first glance this looks intimidating and it really isn't.\nif len(a) == 1\nand\nif len(a) == 2\n— these are our two simple \"base cases,\" the ones we can solve directly using the small formula above, without needing to break the matrix down any further.\nFor anything bigger than 2x2, the function looks at the first row, one number at a time (\na[0][col]\n), and for each of those numbers, it builds a smaller matrix called\nminor\n— this is simply the original matrix with that number's entire row and column removed.\nIt then calls\ndet()\non that smaller\nminor\nmatrix — this is the function calling\nitself\n, on a smaller piece of the problem, a technique called\nrecursion\n. Think of it like those Russian nesting dolls — each doll opens to reveal a smaller doll of the exact same shape, until you reach the smallest one that can't be opened any further (our 1x1 and 2x2 base cases).\nThe\n((-1) ** col)\npart just means the sign flips back and forth (positive, negative, positive, negative...) as we move across the row — this is a specific mathematical detail of how cofactor expansion is defined, and while it's worth knowing it exists, you don't need to memorize exactly why it alternates to use this code correctly.\nLet's test it against NumPy's own built-in version, to make sure it genuinely works:\nA = np.array([[12, 3, 13, 6],\n              [1, 15, 7, 5],\n              [4, 11, 4, 8],\n              [18, 2, 6, 8]])\n\nprint(\"hand-built:\", det(A), \"\\t numpy:\", np.linalg.det(A))\n# hand-built: 6706    numpy: 6705.999999999999\nThat tiny difference (\n6706\nversus\n6705.999...\n) is nothing to worry about — it's just a normal, expected side-effect of how computers store decimal numbers with a small amount of built-in imprecision, called\nfloating-point rounding\n. Both answers genuinely mean the same thing.\nNow let's test our earlier redundant matrix, the one with rows that secretly repeat information:\nB = np.array([[1, 2, 3],\n              [4, 5, 6],\n              [7, 8, 9]])\n\nprint(\"hand-built:\", det(B), \"\\t numpy:\", np.linalg.det(B))\n# hand-built: 0    numpy: -9.5e-16  (essentially zero)\nExactly as we predicted just by eyeballing the pattern in the rows — the determinant comes out to zero (NumPy's tiny\n-9.5e-16\nis so close to zero it's effectively zero, again just floating-point rounding noise). This matrix genuinely, mathematically destroys information the moment you use it in a transformation, and there is no possible \"undo\" matrix that could bring back what's lost.\nWhere Determinant Actually Shows Up (Real, Concrete Examples)\n1. Checking if a face recognition model's \"faceprints\" are actually useful (Computer Vision)\nRemember the 128-number face embeddings from the last blog? Imagine, hypothetically, a badly designed face recognition system where several of those 128 numbers always ended up being near-identical copies of each other, no matter whose face it was looking at — essentially wasted, redundant information, contributing nothing new. Engineers can use determinant-based checks (on the relationships between these numbers, across many faces) to catch this kind of hidden redundancy early, before it quietly causes the system to struggle telling two different people apart.\n2. Detecting redundant, near-duplicate sensor data (Self-driving cars, Robotics)\nExactly as in our earlier example — if two sensors are secretly reporting the same information in different disguises, the mathematics built on top of their combined readings develops a near-zero determinant, acting as an early, automatic warning sign of wasted, duplicated data.\n3. Deciding if a distorted photo can even theoretically be corrected (Computer Vision, camera apps)\nIf a photo has been so severely distorted or compressed that entire regions of visually different content have been crushed down into identical, indistinguishable blocks of pixels, no \"undo\" algorithm, however clever, can perfectly restore the original detail. This is directly connected to the idea of a zero determinant — once information is truly, completely crushed together, no mathematical trick can separate it back out. This is precisely why, when you excessively zoom into a low-quality photo, you get blurry, blocky mush instead of your original sharp detail returning — the information genuinely, permanently, isn't there to recover anymore.\nPart 3: Matrix Inverse — The Locksmith's Key\nOnce you know, using the determinant, that a transformation\ncan\nbe undone, the\nmatrix inverse\nis the actual, precise key that undoes it — exactly like the locksmith's freshly cut key from the very start of this blog.\nMultiplying a matrix by its own inverse gives you the identity matrix\n— a special matrix (all\n1\ns along the diagonal,\n0\ns everywhere else) that represents \"doing absolutely nothing\" — the exact mathematical equivalent of multiplying an ordinary number by 1.\nThis matters enormously in practice because a huge number of real problems boil down to exactly this shape:\n\"I know the result of a transformation. I know what transformation was applied. Now, what was the original data before the transformation happened?\"\nWhenever a problem takes this shape — written as\nA @ x = b\n, meaning \"some matrix A, multiplied by an unknown x, gives a known result b\" — the inverse gives you a direct, precise way to solve for that unknown\nx\n:\nx = A⁻¹ @ b\nBuilding It From Scratch\nThe inverse is built from two ingredients you've already met: the determinant, and something called the\nadjugate\n— a slightly more elaborate cousin of the determinant, built using the exact same \"cofactor\" idea, just organized a little differently.\nimport numpy as np\n\ndef det(A):\n    rows, cols = A.shape\n    if rows == 1:\n        return A[0][0]\n    if rows == 2:\n        return A[0][0]*A[1][1] - A[0][1]*A[1][0]\n    result = 0\n    for i in range(rows):\n        mat = np.zeros((rows-1, cols-1))\n        n = 0\n        for j in range(1, rows):\n            m = 0\n            for k in range(cols):\n                if k == i:\n                    continue\n                mat[n][m] = A[j][k]\n                m += 1\n            n += 1\n        result += ((-1)**i) * A[0][i] * det(mat)\n    return result\n\ndef adjugate(matrix):\n    if len(matrix) == 2:\n        res = np.zeros((2, 2))\n        res[0, 0] = matrix[1, 1]\n        res[0, 1] = -matrix[0, 1]\n        res[1, 0] = -matrix[1, 0]\n        res[1, 1] = matrix[0, 0]\n        return res\n    # for matrices larger than 2x2, the same cofactor idea extends further —\n    # we're keeping this example to a 2x2 case to stay clear and readable\n\ndef inverse(A):\n    det_A = det(A)\n    return (1 / det_A) * adjugate(A)\nLook closely at that final function,\ninverse(A)\n. It's genuinely doing something you could describe in one plain-English sentence:\n\"take the adjugate, and shrink or grow it according to 1 divided by the determinant.\"\nThis single detail is also exactly why a zero determinant makes an inverse completely impossible to compute — dividing by zero is undefined, mathematically forbidden, and Python (like any calculator) will refuse to do it, giving you an error instead of a nonsensical answer. This is the deep, precise reason a zero-determinant matrix truly cannot be undone — not just \"practically difficult,\" but genuinely, mathematically impossible.\nTesting It on Our Earlier Example\nRemember our simple, fully-reversible matrix from Part 2?\nMatrix =   [2   1]\n           [1   3]      (determinant was 5, safely non-zero)\na = np.array([[2, 1], [1, 3]])\n\na_inverse = inverse(a)\nprint(a_inverse)\n[[ 0.6 -0.2]\n [-0.2  0.4]]\nNow, the real test — does multiplying the original matrix by this inverse genuinely give us back the \"do nothing\" identity matrix?\nprint(np.dot(a, a_inverse).astype(int))\n[[1 0]\n [0 1]]\nExactly the identity matrix, precisely as we hoped. The original transformation, and its inverse, cancel each other out perfectly — genuinely no different, mathematically, from turning a key one way to lock a door, and turning it the exact opposite way to unlock it again.\nIn real, professional Machine Learning work, you'll essentially never hand-build an inverse this way for anything beyond a small teaching example — NumPy's\nnp.linalg.inv(A)\nhandles it far more efficiently and reliably for large, real-world matrices. But now, genuinely, you know exactly what's happening the moment you type that one line of code.\nWhere Matrix Inverse Actually Shows Up (Real, Concrete Examples)\n1. Predicting house prices — solving for the \"best formula\" directly (Machine Learning, tying back to blog 3)\nRemember our house price example from earlier in this series — bedrooms, bathrooms, and square footage predicting price? Finding the single \"best\" formula that fits a whole dataset of past house sales (this exact process is called\nlinear regression\n, and don't worry, we'll dedicate an entire future blog to properly unpacking how a model \"learns\" this formula) has a direct, one-step mathematical solution, and matrix inverse sits right at its center:\nbest_formula_weights = inverse(Xᵀ @ X) @ Xᵀ @ actual_prices\nYou don't need to memorize this formula right now — just notice that the word \"inverse\" appears directly inside it. Solving for the single best price-prediction formula, across potentially thousands of past house sales at once, genuinely depends on being able to compute a matrix inverse.\n2. Correcting fisheye and lens distortion in phone cameras (Computer Vision)\nWide-angle and \"fisheye\" camera lenses (common in phone ultra-wide cameras, action cameras, and security cameras) bend straight lines into curves, purely because of how the physical lens glass is shaped. Camera software knows, in advance, exactly what distortion transformation that specific lens applies — this is measured carefully during the camera's design and calibration. To give you a normal-looking, straight-lined photo, the software applies the\ninverse\nof that known distortion transformation, mathematically \"unbending\" the image back to how it would have looked through an ordinary, undistorted lens. Every time your phone gives you a straight-edged, undistorted ultra-wide photo, an inverse transformation almost certainly just ran, silently, correcting for the lens's natural bending.\n3. Figuring out a robot's exact position from multiple distance readings (Robotics)\nWhen a robot (or a self-driving car) needs to figure out its exact position using several distance measurements from known landmarks (a process related to GPS and a technique sometimes called triangulation), the underlying math frequently reduces to solving exactly the\nA @ x = b\nshape mentioned earlier — where\nx\nis the robot's unknown position, and matrix inverse (or a more numerically careful equivalent used in real systems) is precisely the tool used to solve for it directly.\nOne honest, important caution worth carrying forward: computing a matrix inverse directly can become slow and less numerically reliable for very large matrices. Real-world ML libraries very often use smarter, more efficient techniques that achieve the same\ngoal\n— solving for the unknown — without literally computing a full inverse matrix by hand. But the core idea, \"the inverse is the precise mathematical key that undoes a transformation,\" remains exactly the right mental model for understanding what those more efficient techniques are actually approximating underneath.\nPart 4: Bringing the Whole Series Together\nTake a moment here, because you've genuinely covered a lot of ground across these six blogs. Let's see it all laid out in one place.\nYou learned\nwhy\nMachine Learning needs linear algebra at all — because computers only understand numbers, and linear algebra is the language for organizing and manipulating large groups of numbers efficiently.\nYou learned what a\nvector\nis — one single example, described entirely as a list of numbers.\nYou learned what a\nmatrix\nis — many vectors, stacked together into one organized table.\nYou learned\naddition, subtraction, and element-wise multiplication\n— the simple, \"position matches position\" operations that combine, compare, and mask data.\nYou learned\nmatrix multiplication, transpose, and cross product\n— the operations that genuinely weigh, combine, and reorient data into something new.\nAnd now, you understand\nlinear transformation, determinant, and matrix inverse\n— what a matrix truly\ndoes\nto your data geometrically, whether that action can be undone, and exactly how to undo it if it can.\nConcept\nWhat it tells you, in one line\nLinear transformation\nWhat multiplying by a matrix actually does to your data — stretch, rotate, or squash it\nDeterminant\nWhether that action can be undone at all, or whether information has been destroyed forever\nMatrix inverse\nThe exact, precise action that undoes it, whenever undoing is genuinely possible\nPut together, honestly, this is real, working mathematical understanding of what's happening inside linear regression, inside PCA, and inside the forward pass of a neural network — not \"trust the library, it just works,\" but a genuine, ground-level understanding of the actual arithmetic quietly running underneath.\nPart 5: One Last Thought That Should Genuinely Stay With You\nHere's something worth closing on, because I think it's the most quietly profound idea in this entire blog.\nThink about your own memory for a moment. When you remember a childhood birthday party, you don't actually replay a perfect, complete recording of that day. Your brain stores a compressed, simplified version — a handful of key details (a cake, a certain song, a particular feeling) — and every other tiny detail (the exact angle of the sunlight, the precise words your cousin said, what you were wearing on your left foot) is, quite simply, gone. Permanently. Crushed away, the same way our redundant, zero-determinant matrix crushed different starting squares down into one indistinguishable, unrecoverable position.\nYour brain, in other words, applies something remarkably like a non-reversible transformation to your own experiences, every single day, without asking your permission — keeping what it judges important, and letting the rest collapse away forever, with no \"inverse\" available to bring back what's lost. This isn't a flaw in your memory. It's almost certainly a deliberate, efficient design, honed by millions of years of evolution — full, perfect recall of every waking second would be an unimaginable, overwhelming amount of information to carry around.\nMachine Learning models, in a strange and genuinely fascinating way, do something remarkably similar on purpose. A face recognition system doesn't need to remember every single pixel of your face perfectly — it deliberately compresses your face down into just 128 carefully-chosen numbers, discarding almost everything else, because those 128 numbers happen to be exactly enough to tell you apart from millions of other people. That deliberate act of throwing away the unimportant and keeping only what matters — the same core idea as a determinant collapsing information, done\non purpose\n, carefully, usefully — is arguably the single biggest reason modern Machine Learning models work at all. Understanding this math, genuinely, isn't just a technical skill. It's a small window into how information itself — in a phone, in an algorithm, and quite possibly inside your own head — decides, silently, every single day, what's worth keeping and what's allowed to disappear.\nWhat's Coming Next\nWe started this entire series by asking one simple question: why does Machine Learning even need linear algebra? Six blogs later, you now have a genuine, working answer — because every Machine Learning model, from the simplest house-price predictor to the largest translation and chat AI systems in the world, is fundamentally built from exactly the operations covered across this series, applied over and over, at a truly enormous scale, reshaping raw numbers into useful, real-world answers.\nThe natural next stop from here is\neigenvalues and eigenvectors\n— a genuinely fascinating idea that says: every transformation has certain special directions it never rotates or bends, only stretches or shrinks along. This single idea is precisely what powers\nPCA\n(a technique for simplifying huge, complicated datasets down to their most important patterns), what makes certain kinds of image compression possible, and — genuinely fascinating — what powered an early, famous version of one of the most successful face recognition techniques ever built, sometimes nicknamed \"Eigenfaces,\" where a person's face is described not by 128 abstract numbers, but by exactly these special stretching directions.\nIf matrices, throughout this series, have been the \"actions\" — the stretching, squashing, and combining — eigenvectors are about to show you the one direction each of those actions can never bend, only stretch. That's a strange, beautiful enough idea to deserve its very own blog.\nSee you there.\n#\nai\n#\nmachine-learning\n#\nlinear-algebra\n#\nmathematics\n#\nmatrix\n#\npython\n#\nnumpy\n#\ndata-science\n#\ndeeplearning\n#\ncomputer-vision\n#\nnlp\n#\nbeginners\n9\nviews",
  "metadata": {
    "title": "Linear Transformations in Machine Learning Explained",
    "description": "Discover how matrices transform data, why determinants matter, and how matrix inverse helps Machine Learning models learn with real Python examples.",
    "keywords": null,
    "author": null,
    "og:title": "Linear Transformations in Machine Learning Explained",
    "og:description": "Discover how matrices transform data, why determinants matter, and how matrix inverse helps Machine Learning models learn with real Python examples.",
    "og:url": "https://tharunpandya.hashnode.dev/matrix-inverse-determinant-linear-transformation-machine-learning",
    "og:site_name": "Machine Learing From scratch",
    "og:image": "https://cdn.hashnode.com/uploads/og-images/6a3f9a25a837e83b51cc8712/b6f6e7fd-002d-43b9-b287-70a041cb6705.png",
    "og:image:width": "1200",
    "og:image:height": "630",
    "og:type": "article",
    "twitter:card": "summary_large_image",
    "twitter:title": "Linear Transformations in Machine Learning Explained",
    "twitter:description": "Discover how matrices transform data, why determinants matter, and how matrix inverse helps Machine Learning models learn with real Python examples.",
    "twitter:image": "https://cdn.hashnode.com/uploads/og-images/6a3f9a25a837e83b51cc8712/b6f6e7fd-002d-43b9-b287-70a041cb6705.png",
    "article:published_time": "2026-07-22T14:41:49.197Z",
    "article:modified_time": "2026-07-22T14:41:49.197Z",
    "article:author": "https://tharunpandya.hashnode.dev/@tharun-pandya"
  },
  "paywall": {
    "listed_paid": false,
    "detected": false,
    "marker": "",
    "public_only": false,
    "policy": "付费/会员内容只保留页面公开可见部分，不绕过付费墙"
  },
  "crawl": {
    "success": true,
    "status_code": 200,
    "error": ""
  },
  "code_blocks": [
    {
      "file": "attachments/32ea7849fd04/code/body-000.txt",
      "chars": 404,
      "language": "text"
    },
    {
      "file": "attachments/32ea7849fd04/code/body-001.txt",
      "chars": 29,
      "language": "text"
    },
    {
      "file": "attachments/32ea7849fd04/code/body-002.txt",
      "chars": 86,
      "language": "text"
    },
    {
      "file": "attachments/32ea7849fd04/code/body-003.txt",
      "chars": 38,
      "language": "text"
    },
    {
      "file": "attachments/32ea7849fd04/code/body-004.txt",
      "chars": 68,
      "language": "text"
    },
    {
      "file": "attachments/32ea7849fd04/code/body-005.txt",
      "chars": 72,
      "language": "text"
    },
    {
      "file": "attachments/32ea7849fd04/code/body-006.txt",
      "chars": 407,
      "language": "text"
    },
    {
      "file": "attachments/32ea7849fd04/code/body-007.txt",
      "chars": 226,
      "language": "text"
    },
    {
      "file": "attachments/32ea7849fd04/code/body-008.txt",
      "chars": 192,
      "language": "text"
    },
    {
      "file": "attachments/32ea7849fd04/code/body-009.txt",
      "chars": 12,
      "language": "text"
    },
    {
      "file": "attachments/32ea7849fd04/code/body-010.txt",
      "chars": 1003,
      "language": "text"
    },
    {
      "file": "attachments/32ea7849fd04/code/body-011.txt",
      "chars": 80,
      "language": "text"
    },
    {
      "file": "attachments/32ea7849fd04/code/body-012.txt",
      "chars": 72,
      "language": "text"
    },
    {
      "file": "attachments/32ea7849fd04/code/body-013.txt",
      "chars": 27,
      "language": "text"
    },
    {
      "file": "attachments/32ea7849fd04/code/body-014.txt",
      "chars": 40,
      "language": "text"
    },
    {
      "file": "attachments/32ea7849fd04/code/body-015.txt",
      "chars": 15,
      "language": "text"
    },
    {
      "file": "attachments/32ea7849fd04/code/body-016.txt",
      "chars": 60,
      "language": "text"
    }
  ],
  "images": [
    {
      "status": "ok",
      "url": "https://cdn.hashnode.com/uploads/covers/6a3f9a25a837e83b51cc8712/30c35f17-2a80-4a35-a9be-4c93de821dcb.png",
      "bytes": 1584778,
      "reused": true,
      "local_path": "attachments/32ea7849fd04/images/002.png",
      "src": "https://cdn.hashnode.com/uploads/covers/6a3f9a25a837e83b51cc8712/30c35f17-2a80-4a35-a9be-4c93de821dcb.png",
      "alt": "Matrix Inverse, Determinant & Linear Transformation — What Actually Happens Inside a Machine Learning Model When It \"Learns\"",
      "downloaded": true
    }
  ],
  "audio": [],
  "videos": [],
  "links": [
    {
      "href": "https://tharunpandya.hashnode.dev/matrix-inverse-determinant-linear-transformation-machine-learning.md",
      "label": "View as Markdown",
      "type": "a"
    },
    {
      "href": "https://hashnode.com/@tharun-pandya",
      "label": "T",
      "type": "a"
    },
    {
      "href": "https://linkedin.com/in/tharun-pandya-kodi",
      "label": "",
      "type": "a"
    },
    {
      "href": "https://tharunpandya.hashnode.dev/tag/ai",
      "label": "# ai",
      "type": "a"
    },
    {
      "href": "https://tharunpandya.hashnode.dev/tag/machine-learning",
      "label": "# machine-learning",
      "type": "a"
    },
    {
      "href": "https://tharunpandya.hashnode.dev/tag/linear-algebra",
      "label": "# linear-algebra",
      "type": "a"
    },
    {
      "href": "https://tharunpandya.hashnode.dev/tag/mathematics",
      "label": "# mathematics",
      "type": "a"
    },
    {
      "href": "https://tharunpandya.hashnode.dev/tag/matrix",
      "label": "# matrix",
      "type": "a"
    },
    {
      "href": "https://tharunpandya.hashnode.dev/tag/python",
      "label": "# python",
      "type": "a"
    },
    {
      "href": "https://tharunpandya.hashnode.dev/tag/numpy",
      "label": "# numpy",
      "type": "a"
    },
    {
      "href": "https://tharunpandya.hashnode.dev/tag/data-science",
      "label": "# data-science",
      "type": "a"
    },
    {
      "href": "https://tharunpandya.hashnode.dev/tag/deeplearning",
      "label": "# deeplearning",
      "type": "a"
    },
    {
      "href": "https://tharunpandya.hashnode.dev/tag/computer-vision",
      "label": "# computer-vision",
      "type": "a"
    },
    {
      "href": "https://tharunpandya.hashnode.dev/tag/nlp",
      "label": "# nlp",
      "type": "a"
    },
    {
      "href": "https://tharunpandya.hashnode.dev/tag/beginners",
      "label": "# beginners",
      "type": "a"
    }
  ],
  "retry_at": "2026-10-03T08:05:04",
  "repair_version": 2,
  "repaired_at": "2026-10-14T10:50:30Z",
  "source_url": "https://tharunpandya.hashnode.dev/matrix-inverse-determinant-linear-transformation-machine-learning",
  "papers": [],
  "actual_video_files": [],
  "body_chars": 30004,
  "expected_body_images": 1,
  "discovery_status": "ok",
  "delivery_status": "ok",
  "missing_reason": "",
  "raw_html": "attachments/32ea7849fd04/pages/source.html",
  "local_html": "attachments/32ea7849fd04/pages/article.html",
  "body_base_path": "attachments/32ea7849fd04/pages/",
  "body_markdown_path": "attachments/32ea7849fd04/pages/article.md"
}