{"id":4889,"date":"2026-09-22T01:27:28","date_gmt":"2026-09-21T19:57:28","guid":{"rendered":"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/"},"modified":"2026-09-22T01:27:28","modified_gmt":"2026-09-21T19:57:28","slug":"what-is-machine-learning-a-complete-beginners-guide-4","status":"publish","type":"post","link":"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/","title":{"rendered":"What is Machine Learning? A Complete Beginner&#8217;s Guide"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_80 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6ab1ac737e970\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6ab1ac737e970\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/#CODE_REVIEW_overhyped_model_v1py\" >CODE REVIEW: overhyped_model_v1.py<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/#EXECUTIVE_SUMMARY_A_Monument_to_Inefficiency\" >EXECUTIVE SUMMARY: A Monument to Inefficiency<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/#H2_The_Dependency_Bloat_The_%E2%80%9CHello_World%E2%80%9D_of_Resource_Waste\" >H2: The Dependency Bloat (The &#8220;Hello World&#8221; of Resource Waste)<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/#Senior_Reviewer_Comments\" >Senior Reviewer Comments:<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/#H2_Data_Ingestion_or_How_to_Choke_a_CPU_with_CSVs\" >H2: Data Ingestion or: How to Choke a CPU with CSVs<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/#Senior_Reviewer_Comments-2\" >Senior Reviewer Comments:<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/#H2_The_Architecture_of_Ignorance_What_is_Machine_Learning\" >H2: The Architecture of Ignorance (What is Machine Learning?)<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/#Senior_Reviewer_Comments-3\" >Senior Reviewer Comments:<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/#H2_The_Training_Loop_A_Non-Convex_Nightmare\" >H2: The Training Loop: A Non-Convex Nightmare<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/#Senior_Reviewer_Comments-4\" >Senior Reviewer Comments:<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/#H2_Overfitting_The_Result_of_Algorithmic_Laziness\" >H2: Overfitting: The Result of Algorithmic Laziness<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/#Senior_Reviewer_Comments-5\" >Senior Reviewer Comments:<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/#H2_Inference_and_the_Death_of_Real-Time_Performance\" >H2: Inference and the Death of Real-Time Performance<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/#Senior_Reviewer_Comments-6\" >Senior Reviewer Comments:<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/#FINAL_VERDICT_Back_to_Basics\" >FINAL VERDICT: Back to Basics<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/#Appendix_Raw_Pip_Error_Log_from_Juniors_Environment\" >Appendix: Raw Pip Error Log from Junior&#8217;s Environment<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/#Related_Articles\" >Related Articles<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h1><span class=\"ez-toc-section\" id=\"CODE_REVIEW_overhyped_model_v1py\"><\/span>CODE REVIEW: overhyped_model_v1.py<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p><strong>Reviewer:<\/strong> Senior Embedded Systems Engineer (Staff Level, 32 Years Experience)<br \/>\n<strong>Date:<\/strong> October 24, 2023<br \/>\n<strong>Subject:<\/strong> Stop wasting my cycles on this statistical alchemy.<\/p>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"EXECUTIVE_SUMMARY_A_Monument_to_Inefficiency\"><\/span>EXECUTIVE SUMMARY: A Monument to Inefficiency<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>I was asked to review this repository, and frankly, I\u2019d rather be debugging a race condition in a 1992 interrupt handler written in hand-optimized assembly. What I found in <code>overhyped_model_v1.py<\/code> is not &#8220;Artificial Intelligence.&#8221; It is a bloated, fragile, and mathematically illiterate attempt to perform high-dimensional curve fitting using the most inefficient tools ever devised by man.<\/p>\n<p>You are using <strong>Python 3.11.4<\/strong>, a language that treats memory management like a suggestion rather than a law of physics. You have pulled in <strong>NumPy 1.26.0<\/strong>, <strong>pandas 2.1.1<\/strong>, and <strong>scikit-learn 1.3.2<\/strong> to solve a problem that could be handled by a simple lookup table or a few lines of C. Your script consumes 1.2GB of RAM before it even performs a single calculation. In my world, we launch satellites with 128KB.<\/p>\n<p>This code is a &#8220;black box&#8221; because you don&#8217;t understand the math, not because the math is complex. You\u2019ve replaced logic with &#8220;training,&#8221; and you\u2019ve replaced efficiency with &#8220;layers.&#8221; This review will be painful, but perhaps it will prevent you from committing another crime against the CPU.<\/p>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"H2_The_Dependency_Bloat_The_%E2%80%9CHello_World%E2%80%9D_of_Resource_Waste\"><\/span>H2: The Dependency Bloat (The &#8220;Hello World&#8221; of Resource Waste)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Let\u2019s start with your imports. You\u2019ve managed to create a dependency graph that looks like a bowl of spaghetti.<\/p>\n<pre class=\"codehilite\"><code class=\"language-python\"># The Junior's Code\nimport pandas as pd\nimport numpy as np\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.neural_network import MLPClassifier\nimport pickle\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Senior_Reviewer_Comments\"><\/span>Senior Reviewer Comments:<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Look at this. To perform what is essentially a series of matrix multiplications, you\u2019ve imported half of the PyData ecosystem. Do you have any idea what happens when you run <code>import pandas as pd<\/code>? <\/p>\n<p>On my machine, running <strong>Python 3.11.4<\/strong>, here is the terminal output of your &#8220;simple&#8221; script just trying to load its dependencies:<\/p>\n<pre class=\"codehilite\"><code class=\"language-bash\">$ \/usr\/bin\/time -v python3 overhyped_model_v1.py\n    Command being timed: &quot;python3 overhyped_model_v1.py&quot;\n    User time (seconds): 2.45\n    System time (seconds): 0.82\n    Percent of CPU this job got: 98%\n    Maximum resident set size (kbytes): 452032\n    Minor (reclaiming a frame) page faults: 112043\n    Voluntary context switches: 452\n    Involuntary context switches: 120\n<\/code><\/pre>\n<p>452MB of RAM just to <em>start<\/em> the script. You haven&#8217;t even touched a data point yet. You are using <code>pandas<\/code> (version 2.1.1) to load a CSV file. A CSV file is a text file with commas. I can write a parser for that in 20 lines of C that uses 4KB of stack space. Instead, you load a library that brings in its own memory manager and a thousand helper functions you will never use. <\/p>\n<p>And <code>scikit-learn 1.3.2<\/code>? You\u2019re using an <code>MLPClassifier<\/code>. You\u2019ve pulled in an entire library for a Multi-Layer Perceptron when all you\u2019re doing is an iterative optimization of a non-convex loss function. You don&#8217;t even know what that means, do you? You think it&#8217;s &#8220;learning.&#8221; It&#8217;s not learning. It&#8217;s math.<\/p>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"H2_Data_Ingestion_or_How_to_Choke_a_CPU_with_CSVs\"><\/span>H2: Data Ingestion or: How to Choke a CPU with CSVs<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre class=\"codehilite\"><code class=\"language-python\"># The Junior's Code\ndef load_and_preprocess(file_path):\n    data = pd.read_csv(file_path)\n    X = data.drop('target', axis=1)\n    y = data['target']\n\n    scaler = StandardScaler()\n    X_scaled = scaler.fit_transform(X)\n\n    return train_test_split(X_scaled, y, test_size=0.2)\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Senior_Reviewer_Comments-2\"><\/span>Senior Reviewer Comments:<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>This function is a disaster. You are loading the entire dataset into memory at once. What happens when the dataset is 50GB? Your script will trigger the OOM (Out of Memory) killer faster than you can say &#8220;Big Data.&#8221;<\/p>\n<pre class=\"codehilite\"><code class=\"language-bash\">$ python3 overhyped_model_v1.py\n[1]    84201 killed     python3 overhyped_model_v1.py\n# Kernel log:\n# [92834.12] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=\/,mems_allowed=0,task=python3,pid=84201,uid=1000\n# [92834.12] Out of memory: Killed process 84201 (python3) total-vm:16777216kB, anon-rss:14520320kB, file-rss:0kB, shmem-rss:0kB\n<\/code><\/pre>\n<p>You are using <code>StandardScaler<\/code>. Let&#8217;s talk about <strong>what is<\/strong> actually happening here. You are calculating the mean and standard deviation of your input vectors in a high-dimensional manifold. You are then subtracting the mean and dividing by the standard deviation for every single element. <\/p>\n<p>In C, I would do this in a single pass using Welford\u2019s online algorithm to keep memory usage constant. You, however, are creating multiple copies of the data in RAM. <code>X<\/code> is a copy, <code>X_scaled<\/code> is another copy, and <code>train_test_split<\/code> creates even <em>more<\/em> copies. You are treating RAM like it\u2019s an infinite resource. It isn\u2019t. Every byte you waste is a byte that can&#8217;t be used for actual computation.<\/p>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"H2_The_Architecture_of_Ignorance_What_is_Machine_Learning\"><\/span>H2: The Architecture of Ignorance (What is Machine Learning?)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Now we get to the &#8220;AI&#8221; part. You\u2019ve defined your model like this:<\/p>\n<pre class=\"codehilite\"><code class=\"language-python\"># The Junior's Code\nmodel = MLPClassifier(hidden_layer_sizes=(100, 50), \n                      activation='relu', \n                      solver='adam', \n                      max_iter=500)\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Senior_Reviewer_Comments-3\"><\/span>Senior Reviewer Comments:<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>You call this a &#8220;Neural Network.&#8221; I call it a series of nested loops and dot products that you don&#8217;t understand. <\/p>\n<p>To answer the question you clearly haven&#8217;t asked: <strong>what is machine learning?<\/strong> <\/p>\n<p>Machine learning is not &#8220;intelligence.&#8221; It is the process of using a computer to perform a numerical optimization of a parameterized function until the output matches a set of labels within an acceptable margin of error. In your case, you are trying to find a set of weights ($W$) and biases ($b$) such that $f(X, W, b) \\approx y$. <\/p>\n<p>Your <code>MLPClassifier<\/code> is just a collection of linear transformations followed by non-linear &#8220;activation functions&#8221; (like ReLU, which is just <code>max(0, x)<\/code>\u2014an <code>if<\/code> statement for people who like to waste GPU cycles). <\/p>\n<p>By choosing <code>hidden_layer_sizes=(100, 50)<\/code>, you have created a system with thousands of parameters. For a classification problem with 10 input features, this is like using a sledgehammer to crack a nut. You are trying to fit a curve to data points. If you had any sense, you\u2019d start with a linear regression or a simple decision tree. But no, you want &#8220;Deep Learning&#8221; because it sounds better in a LinkedIn bio.<\/p>\n<p>You are using the <code>adam<\/code> solver. That\u2019s an adaptive moment estimation\u2014a fancy way of saying you\u2019re doing gradient descent but you\u2019re too lazy to tune the learning rate yourself. You\u2019re letting the computer guess how to move down the gradient of a non-convex loss function. If you hit a local minimum, your model is useless, and you won&#8217;t even know why.<\/p>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"H2_The_Training_Loop_A_Non-Convex_Nightmare\"><\/span>H2: The Training Loop: A Non-Convex Nightmare<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre class=\"codehilite\"><code class=\"language-python\"># The Junior's Code\nprint(&quot;Training model...&quot;)\nmodel.fit(X_train, y_train)\nprint(f&quot;Training complete. Iterations: {model.n_iter_}&quot;)\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Senior_Reviewer_Comments-4\"><\/span>Senior Reviewer Comments:<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>&#8220;Training.&#8221; You make it sound so organic. Let\u2019s look at the raw reality of what your CPU is doing during <code>model.fit()<\/code>. <\/p>\n<p>It is performing backpropagation. This involves calculating the partial derivative of the loss function with respect to every single weight in your 100&#215;50 network. Because you are using Python 3.11.4, every one of those calculations is wrapped in an object. Every float is a <code>PyObject<\/code>. <\/p>\n<p>While a C program would be piping these numbers directly into the AVX-512 registers of the CPU, your Python script is bouncing around the heap, checking the Global Interpreter Lock (GIL), and praying that the garbage collector doesn&#8217;t decide to wake up.<\/p>\n<p>Here is what your &#8220;Training&#8221; looks like on a system monitor:<\/p>\n<pre class=\"codehilite\"><code class=\"language-bash\">PID    USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND\n84201  junior    20   0 18.4G  1.2G  45200 R  99.9   7.2   5:12.43 python3\n<\/code><\/pre>\n<p>99% CPU usage for five minutes to solve a problem that a closed-form solution (like Ordinary Least Squares) could solve in 10 milliseconds. You are burning electricity to avoid thinking. <\/p>\n<p>And let&#8217;s talk about the &#8220;non-convex loss function.&#8221; Because your &#8220;network&#8221; is deep (two layers is &#8220;deep&#8221; for someone with your attention span), the error surface is full of pits and valleys. You aren&#8217;t finding the &#8220;truth&#8221;; you&#8217;re finding a spot where the math stops changing. That\u2019s not intelligence; that\u2019s exhaustion.<\/p>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"H2_Overfitting_The_Result_of_Algorithmic_Laziness\"><\/span>H2: Overfitting: The Result of Algorithmic Laziness<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre class=\"codehilite\"><code class=\"language-python\"># The Junior's Code\ntrain_acc = model.score(X_train, y_train)\ntest_acc = model.score(X_test, y_test)\n\nprint(f&quot;Training Accuracy: {train_acc:.4f}&quot;)\nprint(f&quot;Test Accuracy: {test_acc:.4f}&quot;)\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Senior_Reviewer_Comments-5\"><\/span>Senior Reviewer Comments:<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>I ran your code. Here is the output:<br \/>\n<code>Training Accuracy: 0.9998<\/code><br \/>\n<code>Test Accuracy: 0.7241<\/code><\/p>\n<p>Congratulations. You haven&#8217;t built a model; you&#8217;ve built a very expensive, very slow lookup table. This is what we call <strong>overfitting<\/strong>. <\/p>\n<p>Overfitting is a symptom of developer laziness. You gave the model so many parameters (the 100&#215;50 hidden layers) that it simply memorized the training data. It didn&#8217;t find the underlying pattern in the high-dimensional manifold; it just drew a circle around every point in the training set.<\/p>\n<p>In the embedded world, if my sensor logic only works in the lab and fails in the field, people die. In your world, you just call it &#8220;a need for more data.&#8221; No. You need fewer parameters. You need regularization. You need to understand that <strong>what is<\/strong> happening is that your model has &#8220;high variance.&#8221; It\u2019s sensitive to the noise in your data, not the signal.<\/p>\n<p>You\u2019re using <strong>scikit-learn 1.3.2<\/strong>, which has <code>L2<\/code> regularization (weight decay) turned on by default with <code>alpha=0.0001<\/code>. Clearly, that\u2019s not enough to save you from your own architectural hubris. You\u2019ve created a digital version of a student who memorizes the answers to the practice test but fails the actual exam because they don&#8217;t understand the subject.<\/p>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"H2_Inference_and_the_Death_of_Real-Time_Performance\"><\/span>H2: Inference and the Death of Real-Time Performance<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre class=\"codehilite\"><code class=\"language-python\"># The Junior's Code\ndef predict_realtime(sample):\n    # sample is a list of features\n    sample_scaled = scaler.transform([sample])\n    prediction = model.predict(sample_scaled)\n    return prediction[0]\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Senior_Reviewer_Comments-6\"><\/span>Senior Reviewer Comments:<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>&#8220;Real-time.&#8221; You keep using that word. I do not think it means what you think it means.<\/p>\n<p>In my world, &#8220;real-time&#8221; means a deterministic response within a fixed number of clock cycles. In your world, &#8220;real-time&#8221; means &#8220;whenever Python feels like it.&#8221;<\/p>\n<p>Let\u2019s look at the latency of your <code>predict_realtime<\/code> function. To predict a single label, you have to:<br \/>\n1. Convert a Python list to a NumPy array (allocation!).<br \/>\n2. Pass it through the <code>StandardScaler<\/code> (more math, more allocations).<br \/>\n3. Perform multiple matrix multiplications in the MLP.<br \/>\n4. Apply the activation functions.<br \/>\n5. Return a NumPy array and extract the first element.<\/p>\n<p>I profiled this. The latency is approximately 15ms per prediction. 15 milliseconds! In 15ms, a modern CPU can execute 45 million instructions. You are using 45 million instructions to do a few hundred multiplications. <\/p>\n<p>If I put this code in an anti-lock braking system, the car would be in the next county before the brakes applied. This is the fundamental problem with modern &#8220;AI&#8221; development: you\u2019ve become so accustomed to fast hardware that you\u2019ve forgotten how to write fast software. You treat the CPU as a magic box that turns your slow Python into &#8220;intelligence.&#8221;<\/p>\n<p>And what happens if the input is slightly outside the range of your training data? Your model will confidently give a wrong answer. It has no bounds checking. It has no safety. It\u2019s a black box that spits out a float and you treat it like the gospel truth.<\/p>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"FINAL_VERDICT_Back_to_Basics\"><\/span>FINAL VERDICT: Back to Basics<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Your <code>overhyped_model_v1.py<\/code> is a case study in everything wrong with modern software engineering. You have:<br \/>\n1. Ignored memory constraints.<br \/>\n2. Used massive dependencies for trivial tasks.<br \/>\n3. Substituted mathematical understanding with &#8220;training.&#8221;<br \/>\n4. Produced a model that is too slow for real-world use and too bloated for embedded systems.<\/p>\n<p><strong>What is<\/strong> the solution? <\/p>\n<p>First, delete your <code>venv<\/code> folder. It\u2019s 2GB of garbage you don&#8217;t need.<br \/>\nSecond, open a textbook on linear algebra. Learn what a dot product actually is. Learn what a Jacobian matrix is.<br \/>\nThird, rewrite this entire thing in C. Use fixed-point arithmetic if you want to impress me. <\/p>\n<p>If you can&#8217;t explain the math behind your model using only a pencil and paper, you have no business writing code that implements it. You are not an engineer; you are a script kiddie playing with statistical fire.<\/p>\n<p>Go back to school. Learn how pointers work. Learn how the stack and the heap differ. Learn why a <code>PyObject<\/code> is the most expensive way to store a 4-byte integer. Until then, stay away from my production servers. You\u2019re a liability to the uptime.<\/p>\n<p><strong>Grade: F-<\/strong><br \/>\n<em>Note: The CPU fan on my laptop is still spinning from running your script. I\u2019m sending you the bill for the electricity.<\/em><\/p>\n<hr \/>\n<h3><span class=\"ez-toc-section\" id=\"Appendix_Raw_Pip_Error_Log_from_Juniors_Environment\"><\/span>Appendix: Raw Pip Error Log from Junior&#8217;s Environment<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>(Just to show how fragile this &#8220;modern&#8221; stack is)<\/p>\n<pre class=\"codehilite\"><code class=\"language-text\">$ pip install -r requirements.txt\nCollecting pandas==2.1.1 (from -r requirements.txt (line 1))\n  Using cached pandas-2.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.3 MB)\nCollecting numpy==1.26.0 (from -r requirements.txt (line 2))\n  Using cached numpy-1.26.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB)\nCollecting scikit-learn==1.3.2 (from -r requirements.txt (line 3))\n  Using cached scikit_learn-1.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.8 MB)\nInstalling collected packages: numpy, pandas, scikit-learn\nERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\nsome-other-useless-package 0.1.2 requires numpy&lt;1.24.0,&gt;=1.21.0, but you have numpy 1.26.0 which is incompatible.\nSuccessfully installed numpy-1.26.0 pandas-2.1.1 scikit-learn-1.3.2\n<\/code><\/pre>\n<p>Even your package manager hates your choices. Fix it.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Related_Articles\"><\/span>Related Articles<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Explore more insights and best practices:<\/p>\n<ul>\n<li><a href=\"https:\/\/itsupportwale.com\/blog\/kali-linux-2020-1-released-new-features-and-download\/\">Kali Linux 2020 1 Released New Features And Download<\/a><\/li>\n<li><a href=\"https:\/\/itsupportwale.com\/blog\/10-essential-javascript-best-practices-for-clean-code-2\/\">10 Essential Javascript Best Practices For Clean Code 2<\/a><\/li>\n<li><a href=\"https:\/\/itsupportwale.com\/blog\/machine-learning-best-practices-10-tips-for-success-2\/\">Machine Learning Best Practices 10 Tips For Success 2<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>CODE REVIEW: overhyped_model_v1.py Reviewer: Senior Embedded Systems Engineer (Staff Level, 32 Years Experience) Date: October 24, 2023 Subject: Stop wasting my cycles on this statistical alchemy. EXECUTIVE SUMMARY: A Monument to Inefficiency I was asked to review this repository, and frankly, I\u2019d rather be debugging a race condition in a 1992 interrupt handler written in &#8230; <a title=\"What is Machine Learning? A Complete Beginner&#8217;s Guide\" class=\"read-more\" href=\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/\" aria-label=\"Read more  on What is Machine Learning? A Complete Beginner&#8217;s Guide\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4889","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What is Machine Learning? A Complete Beginner&#039;s Guide - ITSupportWale<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is Machine Learning? A Complete Beginner&#039;s Guide - ITSupportWale\" \/>\n<meta property=\"og:description\" content=\"CODE REVIEW: overhyped_model_v1.py Reviewer: Senior Embedded Systems Engineer (Staff Level, 32 Years Experience) Date: October 24, 2023 Subject: Stop wasting my cycles on this statistical alchemy. EXECUTIVE SUMMARY: A Monument to Inefficiency I was asked to review this repository, and frankly, I\u2019d rather be debugging a race condition in a 1992 interrupt handler written in ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/\" \/>\n<meta property=\"og:site_name\" content=\"ITSupportWale\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Itsupportwale-298547177495978\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-21T19:57:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/itsupportwale.com\/blog\/wp-content\/uploads\/2021\/05\/android-chrome-512x512-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"512\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Techie\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Techie\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/\"},\"author\":{\"name\":\"Techie\",\"@id\":\"https:\/\/itsupportwale.com\/blog\/#\/schema\/person\/8c5a2b3d36396e0a8fd91ec8242fd46d\"},\"headline\":\"What is Machine Learning? A Complete Beginner&#8217;s Guide\",\"datePublished\":\"2026-09-21T19:57:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/\"},\"wordCount\":1816,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/itsupportwale.com\/blog\/#organization\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/\",\"url\":\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/\",\"name\":\"What is Machine Learning? A Complete Beginner's Guide - ITSupportWale\",\"isPartOf\":{\"@id\":\"https:\/\/itsupportwale.com\/blog\/#website\"},\"datePublished\":\"2026-09-21T19:57:28+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/itsupportwale.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What is Machine Learning? A Complete Beginner&#8217;s Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/itsupportwale.com\/blog\/#website\",\"url\":\"https:\/\/itsupportwale.com\/blog\/\",\"name\":\"ITSupportWale\",\"description\":\"Tips, Tricks, Fixed-Errors, Tutorials &amp; Guides\",\"publisher\":{\"@id\":\"https:\/\/itsupportwale.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/itsupportwale.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/itsupportwale.com\/blog\/#organization\",\"name\":\"itsupportwale\",\"url\":\"https:\/\/itsupportwale.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/itsupportwale.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/itsupportwale.com\/blog\/wp-content\/uploads\/2023\/09\/cropped-Logo-trans-without-slogan.png\",\"contentUrl\":\"https:\/\/itsupportwale.com\/blog\/wp-content\/uploads\/2023\/09\/cropped-Logo-trans-without-slogan.png\",\"width\":1119,\"height\":144,\"caption\":\"itsupportwale\"},\"image\":{\"@id\":\"https:\/\/itsupportwale.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/Itsupportwale-298547177495978\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/itsupportwale.com\/blog\/#\/schema\/person\/8c5a2b3d36396e0a8fd91ec8242fd46d\",\"name\":\"Techie\",\"sameAs\":[\"https:\/\/itsupportwale.com\",\"iswblogadmin\"],\"url\":\"https:\/\/itsupportwale.com\/blog\/author\/iswblogadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is Machine Learning? A Complete Beginner's Guide - ITSupportWale","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/","og_locale":"en_US","og_type":"article","og_title":"What is Machine Learning? A Complete Beginner's Guide - ITSupportWale","og_description":"CODE REVIEW: overhyped_model_v1.py Reviewer: Senior Embedded Systems Engineer (Staff Level, 32 Years Experience) Date: October 24, 2023 Subject: Stop wasting my cycles on this statistical alchemy. EXECUTIVE SUMMARY: A Monument to Inefficiency I was asked to review this repository, and frankly, I\u2019d rather be debugging a race condition in a 1992 interrupt handler written in ... Read more","og_url":"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/","og_site_name":"ITSupportWale","article_publisher":"https:\/\/www.facebook.com\/Itsupportwale-298547177495978","article_published_time":"2026-09-21T19:57:28+00:00","og_image":[{"width":512,"height":512,"url":"https:\/\/itsupportwale.com\/blog\/wp-content\/uploads\/2021\/05\/android-chrome-512x512-1.png","type":"image\/png"}],"author":"Techie","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Techie","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/#article","isPartOf":{"@id":"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/"},"author":{"name":"Techie","@id":"https:\/\/itsupportwale.com\/blog\/#\/schema\/person\/8c5a2b3d36396e0a8fd91ec8242fd46d"},"headline":"What is Machine Learning? A Complete Beginner&#8217;s Guide","datePublished":"2026-09-21T19:57:28+00:00","mainEntityOfPage":{"@id":"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/"},"wordCount":1816,"commentCount":0,"publisher":{"@id":"https:\/\/itsupportwale.com\/blog\/#organization"},"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/","url":"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/","name":"What is Machine Learning? A Complete Beginner's Guide - ITSupportWale","isPartOf":{"@id":"https:\/\/itsupportwale.com\/blog\/#website"},"datePublished":"2026-09-21T19:57:28+00:00","breadcrumb":{"@id":"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/itsupportwale.com\/blog\/what-is-machine-learning-a-complete-beginners-guide-4\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/itsupportwale.com\/blog\/"},{"@type":"ListItem","position":2,"name":"What is Machine Learning? A Complete Beginner&#8217;s Guide"}]},{"@type":"WebSite","@id":"https:\/\/itsupportwale.com\/blog\/#website","url":"https:\/\/itsupportwale.com\/blog\/","name":"ITSupportWale","description":"Tips, Tricks, Fixed-Errors, Tutorials &amp; Guides","publisher":{"@id":"https:\/\/itsupportwale.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/itsupportwale.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/itsupportwale.com\/blog\/#organization","name":"itsupportwale","url":"https:\/\/itsupportwale.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/itsupportwale.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/itsupportwale.com\/blog\/wp-content\/uploads\/2023\/09\/cropped-Logo-trans-without-slogan.png","contentUrl":"https:\/\/itsupportwale.com\/blog\/wp-content\/uploads\/2023\/09\/cropped-Logo-trans-without-slogan.png","width":1119,"height":144,"caption":"itsupportwale"},"image":{"@id":"https:\/\/itsupportwale.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Itsupportwale-298547177495978"]},{"@type":"Person","@id":"https:\/\/itsupportwale.com\/blog\/#\/schema\/person\/8c5a2b3d36396e0a8fd91ec8242fd46d","name":"Techie","sameAs":["https:\/\/itsupportwale.com","iswblogadmin"],"url":"https:\/\/itsupportwale.com\/blog\/author\/iswblogadmin\/"}]}},"_links":{"self":[{"href":"https:\/\/itsupportwale.com\/blog\/wp-json\/wp\/v2\/posts\/4889","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itsupportwale.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itsupportwale.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itsupportwale.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/itsupportwale.com\/blog\/wp-json\/wp\/v2\/comments?post=4889"}],"version-history":[{"count":0,"href":"https:\/\/itsupportwale.com\/blog\/wp-json\/wp\/v2\/posts\/4889\/revisions"}],"wp:attachment":[{"href":"https:\/\/itsupportwale.com\/blog\/wp-json\/wp\/v2\/media?parent=4889"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itsupportwale.com\/blog\/wp-json\/wp\/v2\/categories?post=4889"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itsupportwale.com\/blog\/wp-json\/wp\/v2\/tags?post=4889"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}