<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vineet Chauhan</title>
    <description>The latest articles on DEV Community by Vineet Chauhan (@vineet_chauhan_a828338181).</description>
    <link>https://dev.to/vineet_chauhan_a828338181</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3935167%2F28e42c33-ffce-49c7-bd1b-b0c2c436d670.png</url>
      <title>DEV Community: Vineet Chauhan</title>
      <link>https://dev.to/vineet_chauhan_a828338181</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vineet_chauhan_a828338181"/>
    <language>en</language>
    <item>
      <title>The Invisible Complexity Behind Simple Human Actions: Why Teaching Machines What We Do Naturally Is So Hard</title>
      <dc:creator>Vineet Chauhan</dc:creator>
      <pubDate>Tue, 04 Aug 2026 18:41:52 +0000</pubDate>
      <link>https://dev.to/vineet_chauhan_a828338181/the-invisible-complexity-behind-simple-human-actions-why-teaching-machines-what-we-do-naturally-is-3d40</link>
      <guid>https://dev.to/vineet_chauhan_a828338181/the-invisible-complexity-behind-simple-human-actions-why-teaching-machines-what-we-do-naturally-is-3d40</guid>
      <description>&lt;h1&gt;
  
  
  The Biggest Thing I Realized After Spending One Year Learning AI
&lt;/h1&gt;

&lt;p&gt;For the last one year, I've spent most of my time studying Machine Learning, Deep Learning, Generative AI, Agentic AI, and Data Science. Along with that came hours of struggling with Probability, Statistics, Linear Algebra, Calculus, and all the mathematics behind these models.&lt;/p&gt;

&lt;p&gt;When I started, my questions were pretty simple: &lt;em&gt;How does Linear Regression actually work? Why does Gradient Descent find the minimum? What's the intuition behind Neural Networks?&lt;/em&gt; I was focused on understanding individual algorithms.&lt;/p&gt;

&lt;p&gt;But over the last couple of months, I realized something much bigger.&lt;/p&gt;

&lt;p&gt;We're not just building software—we're trying to recreate one of the most extraordinary abilities in nature: &lt;strong&gt;intelligence&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Think about something as simple as recognizing a friend. We look at a face for a fraction of a second and instantly know who it is, what emotion they're showing, and even the situation they're might be in. Our brain does this so naturally that we never think about how difficult it actually is.&lt;/p&gt;

&lt;p&gt;Now ask a machine to do the same.&lt;/p&gt;

&lt;p&gt;For us, it's effortless. For a machine, it's millions or even billions of mathematical operations, huge datasets, complex neural networks, optimization algorithms, and massive computational power—all just to perform a task that a child can do without thinking.&lt;/p&gt;

&lt;p&gt;That's the moment AI truly blew my mind.&lt;/p&gt;

&lt;p&gt;Every time I learn something new, I appreciate even more the incredible engineering and research happening behind companies like OpenAI and Anthropic. What looks like a simple chatbot response or image generation is actually the result of years of research, mathematics, and thousands of brilliant minds working together.&lt;/p&gt;

&lt;p&gt;The more I learn about AI, the more I realize we're not just teaching machines to solve problems—we're trying to teach them to understand the world the way humans do. And honestly, that's one of the greatest engineering challenges humanity has ever taken on.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>deeplearning</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>From Learning Machine Learning to Competing on Kaggle: My First End-to-End Playground Competition Journey</title>
      <dc:creator>Vineet Chauhan</dc:creator>
      <pubDate>Thu, 30 Jul 2026 09:16:23 +0000</pubDate>
      <link>https://dev.to/vineet_chauhan_a828338181/from-learning-machine-learning-to-competing-on-kaggle-my-first-end-to-end-playground-competition-22bd</link>
      <guid>https://dev.to/vineet_chauhan_a828338181/from-learning-machine-learning-to-competing-on-kaggle-my-first-end-to-end-playground-competition-22bd</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;How I applied Exploratory Data Analysis, Feature Engineering, Pipelines, and Ensemble Models to solve a real-world machine learning problem—and the lessons I learned along the way.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;There comes a point in every machine learning learner's journey when watching tutorials and completing small practice exercises are no longer enough.&lt;/p&gt;

&lt;p&gt;After spending weeks understanding statistics, exploratory data analysis (EDA), feature engineering, preprocessing techniques, and classical machine learning algorithms, I wanted to answer one question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Can I apply everything I've learned to a real machine learning competition?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's when I decided to participate in a Kaggle Playground competition.&lt;/p&gt;

&lt;p&gt;Unlike classroom datasets, Kaggle competitions force you to think like a machine learning engineer. You're responsible for understanding messy data, building preprocessing pipelines, selecting models, evaluating performance, debugging errors, and finally creating a submission that competes with thousands of participants.&lt;/p&gt;

&lt;p&gt;This article documents my complete journey—from loading the dataset to building production-style preprocessing pipelines and training multiple ensemble models. Along the way, I'll also share the challenges I faced, what worked well, and the lessons I'll carry into future competitions.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why Kaggle?
&lt;/h1&gt;

&lt;p&gt;Learning machine learning isn't just about knowing algorithms.&lt;/p&gt;

&lt;p&gt;Real-world ML requires answering questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which features are useful?&lt;/li&gt;
&lt;li&gt;How should missing values be handled?&lt;/li&gt;
&lt;li&gt;Should categorical variables be one-hot encoded or ordinal encoded?&lt;/li&gt;
&lt;li&gt;Which preprocessing steps belong inside a pipeline?&lt;/li&gt;
&lt;li&gt;How do different ensemble models compare?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Kaggle provides an environment where all of these questions matter.&lt;/p&gt;

&lt;p&gt;Instead of building a model that works only inside a notebook, you're solving a problem under realistic constraints and evaluating your solution on unseen data.&lt;/p&gt;




&lt;h1&gt;
  
  
  Competition Goal
&lt;/h1&gt;

&lt;p&gt;The objective of this Playground competition was to predict the target class based on a combination of numerical and categorical features related to health and lifestyle.&lt;/p&gt;

&lt;p&gt;The workflow followed the same structure used in many real-world machine learning projects.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Raw Dataset
      │
      ▼
Exploratory Data Analysis
      │
      ▼
Missing Value Analysis
      │
      ▼
Feature Engineering
      │
      ▼
Preprocessing Pipeline
      │
      ▼
Model Training
      │
      ▼
Evaluation
      │
      ▼
Prediction
      │
      ▼
Kaggle Submission
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Although the workflow appears simple, every stage requires careful decision-making.&lt;/p&gt;




&lt;h1&gt;
  
  
  Understanding the Dataset
&lt;/h1&gt;

&lt;p&gt;The first step was loading both the training and testing datasets using Pandas.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;train&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read_csv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;train.csv&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;test&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read_csv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;test.csv&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before writing a single machine learning model, I spent time understanding the structure of the data.&lt;/p&gt;

&lt;p&gt;Some of the questions I explored were:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How many rows and columns are present?&lt;/li&gt;
&lt;li&gt;Which features are numerical?&lt;/li&gt;
&lt;li&gt;Which features are categorical?&lt;/li&gt;
&lt;li&gt;Are there missing values?&lt;/li&gt;
&lt;li&gt;What is the distribution of each feature?&lt;/li&gt;
&lt;li&gt;Are there any obvious outliers?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Skipping this stage often leads to poor model performance because preprocessing decisions depend entirely on the characteristics of the data.&lt;/p&gt;




&lt;h1&gt;
  
  
  Exploratory Data Analysis (EDA)
&lt;/h1&gt;

&lt;p&gt;EDA turned out to be one of the most valuable parts of the project.&lt;/p&gt;

&lt;p&gt;Instead of immediately training a model, I wanted to understand how the dataset behaved.&lt;/p&gt;

&lt;p&gt;I separated the features into two broad categories:&lt;/p&gt;

&lt;h3&gt;
  
  
  Numerical Features
&lt;/h3&gt;

&lt;p&gt;Examples included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sleep Duration&lt;/li&gt;
&lt;li&gt;Heart Rate&lt;/li&gt;
&lt;li&gt;BMI&lt;/li&gt;
&lt;li&gt;Calorie Expenditure&lt;/li&gt;
&lt;li&gt;Step Count&lt;/li&gt;
&lt;li&gt;Exercise Duration&lt;/li&gt;
&lt;li&gt;Water Intake&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Categorical Features
&lt;/h3&gt;

&lt;p&gt;Examples included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Diet Type&lt;/li&gt;
&lt;li&gt;Gender&lt;/li&gt;
&lt;li&gt;Smoking/Alcohol&lt;/li&gt;
&lt;li&gt;Physical Activity Level&lt;/li&gt;
&lt;li&gt;Sleep Quality&lt;/li&gt;
&lt;li&gt;Stress Level&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This separation made it much easier to apply different visualization techniques.&lt;/p&gt;




&lt;h1&gt;
  
  
  Visualizing Numerical Features
&lt;/h1&gt;

&lt;p&gt;For numerical columns, I explored the data using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Histograms&lt;/li&gt;
&lt;li&gt;KDE Plots&lt;/li&gt;
&lt;li&gt;Boxplots&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These visualizations helped answer important questions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Are the features normally distributed?
&lt;/h3&gt;

&lt;p&gt;Some variables showed distributions close to normal, while others exhibited noticeable skewness.&lt;/p&gt;

&lt;h3&gt;
  
  
  Are there extreme values?
&lt;/h3&gt;

&lt;p&gt;Boxplots revealed the presence of outliers in several numerical features.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is the data symmetric?
&lt;/h3&gt;

&lt;p&gt;Using skewness calculations together with KDE plots made it easier to understand whether transformations might be useful.&lt;/p&gt;

&lt;p&gt;Instead of blindly preprocessing the data, these visualizations allowed me to make decisions based on evidence.&lt;/p&gt;




&lt;h1&gt;
  
  
  Understanding Missing Values
&lt;/h1&gt;

&lt;p&gt;One of the first analyses I performed was checking the percentage of missing values across the dataset.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;train&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isnull&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Missing values are one of the most common problems in real-world datasets.&lt;/p&gt;

&lt;p&gt;Ignoring them isn't an option because most machine learning algorithms cannot train with incomplete data.&lt;/p&gt;

&lt;p&gt;Rather than replacing every missing value with a single constant, I decided to use appropriate preprocessing techniques later in the pipeline.&lt;/p&gt;




&lt;h1&gt;
  
  
  Exploring Categorical Features
&lt;/h1&gt;

&lt;p&gt;For categorical variables, I created count plots to understand the frequency distribution of each category.&lt;/p&gt;

&lt;p&gt;These plots answered questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which diet type appears most frequently?&lt;/li&gt;
&lt;li&gt;How are physical activity levels distributed?&lt;/li&gt;
&lt;li&gt;Does gender influence certain lifestyle variables?&lt;/li&gt;
&lt;li&gt;Are some categories extremely rare?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I also explored relationships between different categorical variables using grouped visualizations.&lt;/p&gt;

&lt;p&gt;This helped me develop an intuition about the dataset before training any model.&lt;/p&gt;




&lt;h1&gt;
  
  
  Building Intuition Before Building Models
&lt;/h1&gt;

&lt;p&gt;One lesson became very clear during EDA:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Better understanding often leads to better preprocessing.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Machine learning isn't just about choosing a powerful algorithm.&lt;/p&gt;

&lt;p&gt;The quality of the input data has an enormous impact on the quality of the final predictions.&lt;/p&gt;

&lt;p&gt;That's why I spent significant time exploring the data before moving on to feature engineering.&lt;/p&gt;




&lt;h1&gt;
  
  
  Feature Engineering
&lt;/h1&gt;

&lt;p&gt;After understanding the dataset, the next step was preparing it for machine learning.&lt;/p&gt;

&lt;p&gt;The first task was separating features and the target variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;X&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;train&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;drop&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;columns&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;health_condition&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;train&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;health_condition&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This created a clear distinction between:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Input features (&lt;code&gt;X&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Target labels (&lt;code&gt;y&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I then split the training data into training and validation sets.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;sklearn.model_selection&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;train_test_split&lt;/span&gt;

&lt;span class="n"&gt;X_train&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;X_test&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y_train&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y_test&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;train_test_split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;X&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;test_size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;random_state&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;42&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creating a validation set allowed me to evaluate model performance before making a Kaggle submission.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why Preprocessing Matters
&lt;/h1&gt;

&lt;p&gt;Different feature types require different preprocessing strategies.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature Type&lt;/th&gt;
&lt;th&gt;Preprocessing&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Numerical&lt;/td&gt;
&lt;td&gt;Imputation + Scaling&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ordinal Categorical&lt;/td&gt;
&lt;td&gt;Ordinal Encoding&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nominal Categorical&lt;/td&gt;
&lt;td&gt;One-Hot Encoding&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Target Variable&lt;/td&gt;
&lt;td&gt;Label Encoding&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Applying the wrong preprocessing technique can significantly reduce model performance.&lt;/p&gt;

&lt;p&gt;Instead of manually transforming every column, I wanted a cleaner and more reusable solution.&lt;/p&gt;

&lt;p&gt;That's where Scikit-learn Pipelines became extremely useful.&lt;/p&gt;




&lt;h1&gt;
  
  
  Organizing Features
&lt;/h1&gt;

&lt;p&gt;I divided the features into logical groups.&lt;/p&gt;

&lt;h3&gt;
  
  
  Numerical Columns
&lt;/h3&gt;

&lt;p&gt;Continuous numerical variables requiring scaling and missing value handling.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ordinal Categories
&lt;/h3&gt;

&lt;p&gt;Features with a natural ordering, such as activity or stress levels.&lt;/p&gt;

&lt;p&gt;These can be safely converted into ordered numerical values.&lt;/p&gt;

&lt;h3&gt;
  
  
  Nominal Categories
&lt;/h3&gt;

&lt;p&gt;Features such as gender or diet type have no natural ordering.&lt;/p&gt;

&lt;p&gt;Assigning arbitrary numbers could introduce unintended relationships, so One-Hot Encoding is a better choice.&lt;/p&gt;

&lt;p&gt;This separation made the preprocessing pipeline much easier to maintain.&lt;/p&gt;




&lt;h1&gt;
  
  
  Building a Production-Style Preprocessing Pipeline
&lt;/h1&gt;

&lt;p&gt;Rather than writing preprocessing code repeatedly for every model, I used Scikit-learn's &lt;code&gt;Pipeline&lt;/code&gt; and &lt;code&gt;ColumnTransformer&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This approach provides several advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cleaner code&lt;/li&gt;
&lt;li&gt;Reduced risk of data leakage&lt;/li&gt;
&lt;li&gt;Consistent preprocessing&lt;/li&gt;
&lt;li&gt;Easier experimentation with multiple models&lt;/li&gt;
&lt;li&gt;Production-ready workflow&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of manually applying transformations one by one, the pipeline automatically performs every preprocessing step before model training.&lt;/p&gt;

&lt;p&gt;This is one of the biggest improvements I made compared to my earlier machine learning projects.&lt;/p&gt;




&lt;h1&gt;
  
  
  Building a Production-Ready Machine Learning Pipeline
&lt;/h1&gt;

&lt;p&gt;One of the biggest improvements I made in this project compared to my earlier machine learning exercises was moving away from manual preprocessing.&lt;/p&gt;

&lt;p&gt;Instead of writing separate preprocessing code for every model, I built a reusable pipeline using Scikit-learn.&lt;/p&gt;

&lt;p&gt;This approach follows the same philosophy used in production machine learning systems.&lt;/p&gt;

&lt;p&gt;Rather than remembering dozens of preprocessing steps, everything is automated inside a single workflow.&lt;/p&gt;




&lt;h1&gt;
  
  
  Designing the Preprocessing Pipeline
&lt;/h1&gt;

&lt;p&gt;Different feature types require different transformations.&lt;/p&gt;

&lt;p&gt;My preprocessing workflow looked like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Raw Dataset
      │
      ▼
Separate Numerical &amp;amp; Categorical Features
      │
      ├───────────────┐
      │               │
      ▼               ▼
 Numerical        Categorical
      │               │
KNN Imputer    Simple Imputer
      │               │
StandardScaler  Encoding
      │               │
      └──────┬────────┘
             ▼
     ColumnTransformer
             ▼
     Machine Learning Model
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of transforming every column manually, the pipeline automatically applied the correct preprocessing to each feature type.&lt;/p&gt;

&lt;p&gt;This made the code cleaner, reusable, and less error-prone.&lt;/p&gt;




&lt;h1&gt;
  
  
  Handling Missing Values
&lt;/h1&gt;

&lt;p&gt;Missing values are unavoidable in real-world datasets.&lt;/p&gt;

&lt;p&gt;Instead of dropping rows and losing valuable information, I applied different imputation strategies depending on the feature type.&lt;/p&gt;

&lt;p&gt;For numerical features, I used &lt;strong&gt;KNN Imputer&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The idea behind KNN Imputation is simple.&lt;/p&gt;

&lt;p&gt;Instead of filling missing values with a mean or median, it looks for the most similar observations and estimates the missing value based on those neighbors.&lt;/p&gt;

&lt;p&gt;For categorical features, I used &lt;strong&gt;Simple Imputer&lt;/strong&gt; with the most frequent category.&lt;/p&gt;

&lt;p&gt;This preserved the integrity of categorical data while avoiding unnecessary data loss.&lt;/p&gt;




&lt;h1&gt;
  
  
  Encoding Categorical Variables
&lt;/h1&gt;

&lt;p&gt;Machine learning models cannot understand text directly.&lt;/p&gt;

&lt;p&gt;Therefore, categorical variables needed to be converted into numerical representations.&lt;/p&gt;

&lt;p&gt;I divided categorical columns into two groups.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ordinal Features
&lt;/h3&gt;

&lt;p&gt;These have a natural order.&lt;/p&gt;

&lt;p&gt;Examples include activity levels or stress levels.&lt;/p&gt;

&lt;p&gt;For these variables, I used &lt;strong&gt;Ordinal Encoding&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Low      → 0
Medium   → 1
High     → 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since these categories have meaningful ordering, ordinal encoding preserves that relationship.&lt;/p&gt;




&lt;h3&gt;
  
  
  Nominal Features
&lt;/h3&gt;

&lt;p&gt;Some features have no natural ordering.&lt;/p&gt;

&lt;p&gt;Examples include gender or diet type.&lt;/p&gt;

&lt;p&gt;Assigning numbers such as&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Male = 0
Female = 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;could unintentionally imply a mathematical relationship.&lt;/p&gt;

&lt;p&gt;Instead, I applied &lt;strong&gt;One-Hot Encoding&lt;/strong&gt;, where each category receives its own binary column.&lt;/p&gt;

&lt;p&gt;This prevents the model from assuming nonexistent order.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why I Used ColumnTransformer
&lt;/h1&gt;

&lt;p&gt;Without a &lt;code&gt;ColumnTransformer&lt;/code&gt;, preprocessing quickly becomes difficult to manage.&lt;/p&gt;

&lt;p&gt;Different feature groups require different transformations.&lt;/p&gt;

&lt;p&gt;Instead of manually applying each transformation, &lt;code&gt;ColumnTransformer&lt;/code&gt; allows everything to happen in one unified preprocessing stage.&lt;/p&gt;

&lt;p&gt;This makes experimentation much easier because changing the model no longer requires rewriting preprocessing code.&lt;/p&gt;




&lt;h1&gt;
  
  
  Building Reusable Pipelines
&lt;/h1&gt;

&lt;p&gt;After creating the preprocessing pipeline, I combined it with different machine learning algorithms.&lt;/p&gt;

&lt;p&gt;Instead of writing separate preprocessing code for every model, I simply replaced the final estimator.&lt;/p&gt;

&lt;p&gt;Conceptually, every pipeline followed this structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Preprocessing
        │
        ▼
 Machine Learning Model
        │
        ▼
 Predictions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This allowed me to compare multiple algorithms while keeping preprocessing completely consistent.&lt;/p&gt;




&lt;h1&gt;
  
  
  Training Multiple Ensemble Models
&lt;/h1&gt;

&lt;p&gt;Rather than relying on a single algorithm, I trained several ensemble models to compare their performance.&lt;/p&gt;

&lt;p&gt;The models included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Random Forest&lt;/li&gt;
&lt;li&gt;XGBoost&lt;/li&gt;
&lt;li&gt;CatBoost&lt;/li&gt;
&lt;li&gt;LightGBM&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each model has its own strengths.&lt;/p&gt;




&lt;h2&gt;
  
  
  Random Forest
&lt;/h2&gt;

&lt;p&gt;Random Forest was my baseline ensemble model.&lt;/p&gt;

&lt;p&gt;Its advantages include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Robust performance&lt;/li&gt;
&lt;li&gt;Handles nonlinear relationships&lt;/li&gt;
&lt;li&gt;Resistant to overfitting&lt;/li&gt;
&lt;li&gt;Useful for feature importance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It gave me a strong benchmark before experimenting with boosting algorithms.&lt;/p&gt;




&lt;h2&gt;
  
  
  XGBoost
&lt;/h2&gt;

&lt;p&gt;XGBoost is one of the most popular gradient boosting libraries in competitive machine learning.&lt;/p&gt;

&lt;p&gt;In my implementation, I configured parameters such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;300 estimators&lt;/li&gt;
&lt;li&gt;Learning rate of 0.05&lt;/li&gt;
&lt;li&gt;Maximum tree depth&lt;/li&gt;
&lt;li&gt;Subsampling&lt;/li&gt;
&lt;li&gt;Column sampling&lt;/li&gt;
&lt;li&gt;Histogram-based tree construction&lt;/li&gt;
&lt;li&gt;GPU acceleration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal was to balance predictive performance with computational efficiency.&lt;/p&gt;




&lt;h2&gt;
  
  
  CatBoost
&lt;/h2&gt;

&lt;p&gt;CatBoost is particularly effective when working with datasets containing categorical variables.&lt;/p&gt;

&lt;p&gt;Even though my preprocessing pipeline already handled encoding, CatBoost still provided another strong ensemble model for comparison.&lt;/p&gt;

&lt;p&gt;I trained it using GPU acceleration to reduce computation time.&lt;/p&gt;




&lt;h2&gt;
  
  
  LightGBM
&lt;/h2&gt;

&lt;p&gt;LightGBM is designed for efficiency.&lt;/p&gt;

&lt;p&gt;It uses histogram-based learning and leaf-wise tree growth, making it extremely fast while maintaining competitive performance.&lt;/p&gt;

&lt;p&gt;Its ability to scale efficiently makes it a popular choice in Kaggle competitions.&lt;/p&gt;




&lt;h1&gt;
  
  
  Evaluating Model Performance
&lt;/h1&gt;

&lt;p&gt;Training a model is only half of the workflow.&lt;/p&gt;

&lt;p&gt;The next step is evaluating how well it performs.&lt;/p&gt;

&lt;p&gt;I compared the models using several evaluation metrics instead of relying on accuracy alone.&lt;/p&gt;

&lt;p&gt;These included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Accuracy&lt;/li&gt;
&lt;li&gt;Precision&lt;/li&gt;
&lt;li&gt;Recall&lt;/li&gt;
&lt;li&gt;F1 Score&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each metric provides different insights into model behavior.&lt;/p&gt;

&lt;p&gt;Looking at multiple metrics helps avoid misleading conclusions that can arise from using only accuracy.&lt;/p&gt;




&lt;h1&gt;
  
  
  Classification Reports
&lt;/h1&gt;

&lt;p&gt;To gain a deeper understanding of performance, I generated classification reports for each model.&lt;/p&gt;

&lt;p&gt;These reports show:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Precision for every class&lt;/li&gt;
&lt;li&gt;Recall for every class&lt;/li&gt;
&lt;li&gt;F1-score&lt;/li&gt;
&lt;li&gt;Overall accuracy&lt;/li&gt;
&lt;li&gt;Macro average&lt;/li&gt;
&lt;li&gt;Weighted average&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of treating the model as a black box, these reports reveal where it performs well and where it struggles.&lt;/p&gt;




&lt;h1&gt;
  
  
  Confusion Matrix
&lt;/h1&gt;

&lt;p&gt;Another valuable visualization was the confusion matrix.&lt;/p&gt;

&lt;p&gt;Rather than simply knowing that a prediction was incorrect, the confusion matrix shows &lt;em&gt;which&lt;/em&gt; classes the model confuses with one another.&lt;/p&gt;

&lt;p&gt;This often reveals patterns that raw accuracy cannot.&lt;/p&gt;

&lt;p&gt;For multiclass classification problems, confusion matrices provide valuable insights into model weaknesses.&lt;/p&gt;




&lt;h1&gt;
  
  
  Comparing Models
&lt;/h1&gt;

&lt;p&gt;Instead of evaluating models separately, I created a comparison table containing metrics such as:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Accuracy&lt;/th&gt;
&lt;th&gt;Precision&lt;/th&gt;
&lt;th&gt;Recall&lt;/th&gt;
&lt;th&gt;F1 Score&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;XGBoost&lt;/td&gt;
&lt;td&gt;Compared&lt;/td&gt;
&lt;td&gt;Compared&lt;/td&gt;
&lt;td&gt;Compared&lt;/td&gt;
&lt;td&gt;Compared&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CatBoost&lt;/td&gt;
&lt;td&gt;Compared&lt;/td&gt;
&lt;td&gt;Compared&lt;/td&gt;
&lt;td&gt;Compared&lt;/td&gt;
&lt;td&gt;Compared&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LightGBM&lt;/td&gt;
&lt;td&gt;Compared&lt;/td&gt;
&lt;td&gt;Compared&lt;/td&gt;
&lt;td&gt;Compared&lt;/td&gt;
&lt;td&gt;Compared&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A comparison table makes it much easier to identify trade-offs between different algorithms.&lt;/p&gt;




&lt;h1&gt;
  
  
  Lessons I Learned
&lt;/h1&gt;

&lt;p&gt;Looking back, this competition taught me far more than simply training machine learning models.&lt;/p&gt;

&lt;p&gt;Some of the most important lessons were:&lt;/p&gt;

&lt;h3&gt;
  
  
  Understanding the data matters more than choosing the model.
&lt;/h3&gt;

&lt;p&gt;A strong preprocessing pipeline often improves performance more than switching algorithms.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pipelines save enormous amounts of time.
&lt;/h3&gt;

&lt;p&gt;Instead of rewriting preprocessing code repeatedly, everything becomes modular and reusable.&lt;/p&gt;

&lt;h3&gt;
  
  
  Evaluation should never rely on a single metric.
&lt;/h3&gt;

&lt;p&gt;Accuracy alone rarely tells the complete story.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ensemble methods are powerful.
&lt;/h3&gt;

&lt;p&gt;Comparing multiple algorithms helped me understand the strengths and limitations of each approach.&lt;/p&gt;




&lt;h1&gt;
  
  
  Challenges Along the Way
&lt;/h1&gt;

&lt;p&gt;Like every real project, this competition involved several debugging sessions.&lt;/p&gt;

&lt;p&gt;I encountered issues related to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;preprocessing&lt;/li&gt;
&lt;li&gt;pipeline construction&lt;/li&gt;
&lt;li&gt;model experimentation&lt;/li&gt;
&lt;li&gt;evaluation&lt;/li&gt;
&lt;li&gt;submission workflow&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Although these challenges were sometimes frustrating, solving them significantly improved my understanding of the complete machine learning lifecycle.&lt;/p&gt;

&lt;p&gt;In hindsight, those debugging sessions taught me as much as the successful model training itself.&lt;/p&gt;




&lt;h1&gt;
  
  
  Beyond a Kaggle Score
&lt;/h1&gt;

&lt;p&gt;One of the biggest misconceptions about Kaggle is that success is measured only by leaderboard position.&lt;/p&gt;

&lt;p&gt;For me, the real achievement wasn't just generating predictions.&lt;/p&gt;

&lt;p&gt;It was learning how to build an end-to-end machine learning workflow.&lt;/p&gt;

&lt;p&gt;This project required me to combine concepts that I had previously learned separately:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Exploratory Data Analysis&lt;/li&gt;
&lt;li&gt;Data Cleaning&lt;/li&gt;
&lt;li&gt;Feature Engineering&lt;/li&gt;
&lt;li&gt;Missing Value Handling&lt;/li&gt;
&lt;li&gt;Encoding&lt;/li&gt;
&lt;li&gt;Scaling&lt;/li&gt;
&lt;li&gt;Pipelines&lt;/li&gt;
&lt;li&gt;Ensemble Learning&lt;/li&gt;
&lt;li&gt;Model Evaluation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For the first time, these concepts came together in a single project.&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;This competition marked an important milestone in my machine learning journey.&lt;/p&gt;

&lt;p&gt;Before this project, preprocessing techniques, pipelines, ensemble models, and evaluation metrics were topics I had studied individually.&lt;/p&gt;

&lt;p&gt;Working through a real Kaggle competition showed me how these pieces fit together to solve an end-to-end machine learning problem.&lt;/p&gt;

&lt;p&gt;While there is still plenty to learn—from advanced feature engineering and hyperparameter optimization to model ensembling and deployment—this experience gave me confidence that I can move beyond tutorials and apply machine learning concepts in practical settings.&lt;/p&gt;

&lt;p&gt;If you're just beginning your Kaggle journey, my biggest advice is simple:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't chase the leaderboard first. Chase understanding.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A solid foundation in data analysis, preprocessing, and experimentation will take you much further than memorizing model parameters. Every competition is an opportunity to learn, refine your workflow, and become a better machine learning practitioner.&lt;/p&gt;

&lt;p&gt;For me, this wasn't just another notebook—it was the project that transformed weeks of studying into real, hands-on experience. And that's exactly what makes Kaggle such a valuable platform for anyone serious about learning machine learning.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>deeplearning</category>
      <category>datascience</category>
    </item>
    <item>
      <title>What Really Happens When You Search on Netflix, Spotify, or Amazon? Behind the Scenes of Modern Search Systems</title>
      <dc:creator>Vineet Chauhan</dc:creator>
      <pubDate>Fri, 03 Jul 2026 14:49:12 +0000</pubDate>
      <link>https://dev.to/vineet_chauhan_a828338181/what-really-happens-when-you-search-on-netflix-spotify-or-amazon-behind-the-scenes-of-modern-p9b</link>
      <guid>https://dev.to/vineet_chauhan_a828338181/what-really-happens-when-you-search-on-netflix-spotify-or-amazon-behind-the-scenes-of-modern-p9b</guid>
      <description>&lt;h2&gt;
  
  
  We type a few words. Millions of computations happen.
&lt;/h2&gt;

&lt;p&gt;Every day, billions of people search for something.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Interstellar" on Netflix&lt;/li&gt;
&lt;li&gt;"Shape of You" on Spotify&lt;/li&gt;
&lt;li&gt;"Wireless Mouse" on Amazon&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The results appear almost instantly.&lt;/p&gt;

&lt;p&gt;To most users, it feels simple. But behind that tiny search box is one of the most sophisticated engineering systems ever built.&lt;/p&gt;

&lt;p&gt;Search is no longer just about finding matching words. Modern platforms try to understand what you &lt;em&gt;mean&lt;/em&gt;, predict what you're looking for, personalize the results, rank millions of possibilities, and deliver everything within a fraction of a second.&lt;/p&gt;

&lt;p&gt;In this article, we'll follow the complete journey of a search query—from the moment you press &lt;strong&gt;Enter&lt;/strong&gt; to the instant the perfect result appears on your screen.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 1: You Type a Query
&lt;/h1&gt;

&lt;p&gt;Imagine you open Amazon and type:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;wireless gaming mouse&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Your computer sends this request to Amazon's servers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User
   │
   ▼
Search Box
   │
   ▼
Amazon Search Server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At this point, the system doesn't simply compare text with product names.&lt;/p&gt;

&lt;p&gt;Instead, it starts understanding the query itself.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 2: Understanding the Query
&lt;/h1&gt;

&lt;p&gt;Humans naturally understand language.&lt;/p&gt;

&lt;p&gt;Computers don't.&lt;/p&gt;

&lt;p&gt;So the first task is query preprocessing.&lt;/p&gt;

&lt;p&gt;The search engine breaks your sentence into meaningful pieces.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Original Query

Wireless Gaming Mouse
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After preprocessing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wireless
gaming
mouse
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then several operations happen.&lt;/p&gt;

&lt;h3&gt;
  
  
  Convert to lowercase
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Wireless → wireless
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Remove unnecessary words
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"The Best Wireless Mouse"

↓

best
wireless
mouse
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Correct spelling
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wirless

↓

wireless
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Understand synonyms
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TV

↓

Television
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Shoes

↓

Sneakers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Amazon, Netflix and Spotify all maintain massive synonym dictionaries.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 3: Searching the Index
&lt;/h1&gt;

&lt;p&gt;Suppose Amazon has 500 million products.&lt;/p&gt;

&lt;p&gt;Would it compare your query against every product?&lt;/p&gt;

&lt;p&gt;Absolutely not.&lt;/p&gt;

&lt;p&gt;That would take far too long.&lt;/p&gt;

&lt;p&gt;Instead, search engines build something called an &lt;strong&gt;Inverted Index&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Think of it like the index at the back of a textbook.&lt;/p&gt;

&lt;p&gt;Instead of reading every page, you jump directly to the pages containing a keyword.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wireless

↓

Product 4
Product 18
Product 52
Product 190
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gaming

↓

Product 18
Product 77
Product 190
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mouse

↓

Product 18
Product 190
Product 250
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The engine quickly finds products containing all three terms.&lt;/p&gt;

&lt;p&gt;This reduces the search space from millions of products to only a few thousand.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 4: Keyword Matching Isn't Enough
&lt;/h1&gt;

&lt;p&gt;Imagine searching for&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Laptop Stand
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A product named&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Adjustable Notebook Holder
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;might never appear.&lt;/p&gt;

&lt;p&gt;Even though both mean almost the same thing.&lt;/p&gt;

&lt;p&gt;Traditional keyword search struggles here because the words are different.&lt;/p&gt;

&lt;p&gt;Modern search engines solve this using &lt;strong&gt;semantic search&lt;/strong&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 5: Understanding Meaning with Embeddings
&lt;/h1&gt;

&lt;p&gt;AI converts every word, sentence or product into a list of numbers called an &lt;strong&gt;embedding&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Instead of storing words...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Dog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the AI stores something like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;0.42&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;-0.81&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;1.55&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Words with similar meanings appear close together inside this mathematical space.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Dog -------- Puppy

Cat -------- Kitten

Movie -------- Film

Laptop -------- Notebook
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now when someone searches&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Notebook
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the system can still recommend laptops because their embeddings are close together.&lt;/p&gt;

&lt;p&gt;This is why modern search feels much smarter than searching a PDF with Ctrl + F.&lt;/p&gt;




&lt;h1&gt;
  
  
  Practical Example in Python
&lt;/h1&gt;

&lt;p&gt;Using Sentence Transformers, we can perform semantic search in just a few lines.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;sentence_transformers&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;SentenceTransformer&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;sklearn.metrics.pairwise&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;cosine_similarity&lt;/span&gt;

&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;SentenceTransformer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;all-MiniLM-L6-v2&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;products&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Wireless Gaming Mouse&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Mechanical Keyboard&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Gaming Laptop&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Bluetooth Speaker&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;query&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Wireless Mouse&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="n"&gt;product_embeddings&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;products&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;query_embedding&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

&lt;span class="n"&gt;scores&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;cosine_similarity&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query_embedding&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product_embeddings&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;zip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;products&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;scores&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]):&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;score&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of matching exact words, the model compares meaning.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 6: Ranking the Results
&lt;/h1&gt;

&lt;p&gt;Suppose the search finds 5,000 matching products.&lt;/p&gt;

&lt;p&gt;Should they all appear randomly?&lt;/p&gt;

&lt;p&gt;Of course not.&lt;/p&gt;

&lt;p&gt;The system now ranks them.&lt;/p&gt;

&lt;p&gt;Some ranking signals include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Relevance&lt;/li&gt;
&lt;li&gt;Popularity&lt;/li&gt;
&lt;li&gt;Ratings&lt;/li&gt;
&lt;li&gt;Reviews&lt;/li&gt;
&lt;li&gt;Purchase history&lt;/li&gt;
&lt;li&gt;Availability&lt;/li&gt;
&lt;li&gt;Delivery speed&lt;/li&gt;
&lt;li&gt;User preferences&lt;/li&gt;
&lt;li&gt;Click-through rate&lt;/li&gt;
&lt;li&gt;Conversion rate&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A simplified ranking formula looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Final Score

=

0.4 × Relevance

+

0.3 × Popularity

+

0.2 × Rating

+

0.1 × Personalization
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The highest-scoring products appear first.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 7: Personalization
&lt;/h1&gt;

&lt;p&gt;Now comes one of the most powerful components.&lt;/p&gt;

&lt;p&gt;The same search query can produce completely different results for different users.&lt;/p&gt;

&lt;p&gt;Suppose two people search:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Shoes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  User A
&lt;/h3&gt;

&lt;p&gt;Previously searched:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Football&lt;/li&gt;
&lt;li&gt;Nike&lt;/li&gt;
&lt;li&gt;Adidas&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Amazon is likely to recommend football boots.&lt;/p&gt;

&lt;h3&gt;
  
  
  User B
&lt;/h3&gt;

&lt;p&gt;Previously searched:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Running&lt;/li&gt;
&lt;li&gt;Marathon&lt;/li&gt;
&lt;li&gt;Sports Watch&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Amazon is more likely to recommend running shoes.&lt;/p&gt;

&lt;p&gt;The query is identical.&lt;/p&gt;

&lt;p&gt;The user is different.&lt;/p&gt;

&lt;p&gt;So the results are different.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 8: Recommendation Systems
&lt;/h1&gt;

&lt;p&gt;Search isn't the only way users discover content.&lt;/p&gt;

&lt;p&gt;Recommendations are equally important.&lt;/p&gt;

&lt;p&gt;Netflix recommends movies.&lt;/p&gt;

&lt;p&gt;Spotify recommends songs.&lt;/p&gt;

&lt;p&gt;Amazon recommends products.&lt;/p&gt;

&lt;p&gt;These systems use several techniques:&lt;/p&gt;

&lt;h3&gt;
  
  
  Collaborative Filtering
&lt;/h3&gt;

&lt;p&gt;People with similar interests often enjoy similar items.&lt;/p&gt;

&lt;p&gt;If thousands of users who watched&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Interstellar
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;also watched&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Inception
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Netflix learns this relationship.&lt;/p&gt;




&lt;h3&gt;
  
  
  Content-Based Filtering
&lt;/h3&gt;

&lt;p&gt;Recommend similar items.&lt;/p&gt;

&lt;p&gt;Action movie&lt;/p&gt;

&lt;p&gt;↓&lt;/p&gt;

&lt;p&gt;More action movies.&lt;/p&gt;

&lt;p&gt;Rock song&lt;/p&gt;

&lt;p&gt;↓&lt;/p&gt;

&lt;p&gt;More rock songs.&lt;/p&gt;

&lt;p&gt;Gaming laptop&lt;/p&gt;

&lt;p&gt;↓&lt;/p&gt;

&lt;p&gt;Gaming accessories.&lt;/p&gt;




&lt;h3&gt;
  
  
  Hybrid Recommendation
&lt;/h3&gt;

&lt;p&gt;Most companies combine multiple recommendation methods with machine learning models.&lt;/p&gt;

&lt;p&gt;This provides significantly better recommendations than relying on a single technique.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 9: Why Results Are Instant
&lt;/h1&gt;

&lt;p&gt;Imagine rebuilding the ranking every time someone searches.&lt;/p&gt;

&lt;p&gt;It would be far too slow.&lt;/p&gt;

&lt;p&gt;Companies use multiple optimization techniques:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Caching&lt;/li&gt;
&lt;li&gt;Distributed databases&lt;/li&gt;
&lt;li&gt;Load balancing&lt;/li&gt;
&lt;li&gt;Parallel processing&lt;/li&gt;
&lt;li&gt;Search indexes&lt;/li&gt;
&lt;li&gt;Vector databases&lt;/li&gt;
&lt;li&gt;Content Delivery Networks (CDNs)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These systems reduce search latency from seconds to milliseconds.&lt;/p&gt;




&lt;h1&gt;
  
  
  Real Architecture
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User

↓

Search API

↓

Query Processing

↓

Keyword Search

+

Semantic Search

↓

Ranking Engine

↓

Recommendation Engine

↓

Personalization Layer

↓

Final Results
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each block may itself contain dozens of microservices working together.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why Vector Databases Matter
&lt;/h1&gt;

&lt;p&gt;Traditional databases answer questions like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Find all products costing less than ₹2000.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Vector databases answer questions like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Find products that are semantically similar to this product.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Popular vector databases include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;FAISS&lt;/li&gt;
&lt;li&gt;Pinecone&lt;/li&gt;
&lt;li&gt;Milvus&lt;/li&gt;
&lt;li&gt;Weaviate&lt;/li&gt;
&lt;li&gt;ChromaDB&lt;/li&gt;
&lt;li&gt;Qdrant&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They power modern AI search and Retrieval-Augmented Generation (RAG) systems.&lt;/p&gt;




&lt;h1&gt;
  
  
  Where Machine Learning Fits In
&lt;/h1&gt;

&lt;p&gt;Machine learning improves search in many ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Spell correction&lt;/li&gt;
&lt;li&gt;Query understanding&lt;/li&gt;
&lt;li&gt;Ranking&lt;/li&gt;
&lt;li&gt;Recommendations&lt;/li&gt;
&lt;li&gt;Fraud detection&lt;/li&gt;
&lt;li&gt;Personalized search&lt;/li&gt;
&lt;li&gt;Demand prediction&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal isn't just to find a matching result—it's to predict the result you're most likely to choose.&lt;/p&gt;




&lt;h1&gt;
  
  
  Key Takeaways
&lt;/h1&gt;

&lt;p&gt;Modern search systems are much more than databases with a search bar. They combine information retrieval, natural language processing, recommendation systems, machine learning, distributed computing, and efficient data structures to deliver highly relevant results in milliseconds.&lt;/p&gt;

&lt;p&gt;The next time you search for a movie on Netflix, a song on Spotify, or a product on Amazon, remember that your request isn't simply matching text. It's being interpreted, expanded, ranked, personalized, and optimized through dozens of intelligent systems working together behind the scenes.&lt;/p&gt;

&lt;p&gt;That tiny search box represents years of engineering innovation—and it's one of the best examples of how data structures, algorithms, AI, and software engineering come together to create an experience that feels almost effortless.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>datascience</category>
      <category>backenddevelopment</category>
    </item>
    <item>
      <title>Gradient Descent: The Engine That Made Deep Learning Possible : How one simple idea changed the way machines learn</title>
      <dc:creator>Vineet Chauhan</dc:creator>
      <pubDate>Fri, 03 Jul 2026 14:45:02 +0000</pubDate>
      <link>https://dev.to/vineet_chauhan_a828338181/gradient-descent-the-engine-that-made-deep-learning-possible-how-one-simple-idea-changed-the-way-1ini</link>
      <guid>https://dev.to/vineet_chauhan_a828338181/gradient-descent-the-engine-that-made-deep-learning-possible-how-one-simple-idea-changed-the-way-1ini</guid>
      <description>&lt;p&gt;When I first started learning deep learning, I thought the magic was inside the model architecture.&lt;/p&gt;

&lt;p&gt;CNNs looked powerful.&lt;/p&gt;

&lt;p&gt;RNNs looked intelligent.&lt;/p&gt;

&lt;p&gt;Transformers looked almost impossible to understand.&lt;/p&gt;

&lt;p&gt;But slowly I realized something important.&lt;/p&gt;

&lt;p&gt;Architecture is only one part of deep learning.&lt;/p&gt;

&lt;p&gt;The real question is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How does the model actually learn?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A neural network may contain millions or even billions of parameters.&lt;/p&gt;

&lt;p&gt;But at the beginning, all those parameters are almost useless.&lt;/p&gt;

&lt;p&gt;They are usually random numbers.&lt;/p&gt;

&lt;p&gt;The model does not know anything.&lt;/p&gt;

&lt;p&gt;It does not understand images.&lt;/p&gt;

&lt;p&gt;It does not understand language.&lt;/p&gt;

&lt;p&gt;It does not understand patterns.&lt;/p&gt;

&lt;p&gt;So the real magic is not that a neural network has many parameters.&lt;/p&gt;

&lt;p&gt;The real magic is that it can adjust those parameters automatically.&lt;/p&gt;

&lt;p&gt;That automatic adjustment is made possible by Gradient Descent.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Basic Problem
&lt;/h2&gt;

&lt;p&gt;Suppose we are training a simple model.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;y_pred&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;w = weight
b = bias
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At first, the model makes wrong predictions.&lt;/p&gt;

&lt;p&gt;So we calculate error.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;loss&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y_actual&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;y_pred&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The goal is simple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Reduce the loss
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But the question is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;How should w and b change?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Should weight increase?&lt;/p&gt;

&lt;p&gt;Should weight decrease?&lt;/p&gt;

&lt;p&gt;By how much?&lt;/p&gt;

&lt;p&gt;This is where Gradient Descent comes in.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Gradient Descent Really Means
&lt;/h2&gt;

&lt;p&gt;Gradient Descent simply means:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Move the parameters in the direction where loss decreases.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Imagine standing on a mountain in fog.&lt;/p&gt;

&lt;p&gt;You cannot see the full path.&lt;/p&gt;

&lt;p&gt;You only know the slope under your feet.&lt;/p&gt;

&lt;p&gt;So you move downward step by step.&lt;/p&gt;

&lt;p&gt;That is Gradient Descent.&lt;/p&gt;

&lt;p&gt;In machine learning:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Mountain height = Loss
Position = Parameters
Downward direction = Negative gradient
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The formula is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;new_weight = old_weight - learning_rate × gradient
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;lr&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;dw&lt;/span&gt;
&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;lr&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This small formula is one of the biggest reasons deep learning works.&lt;/p&gt;




&lt;h2&gt;
  
  
  A Very Small Numerical Example
&lt;/h2&gt;

&lt;p&gt;Suppose our model is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;y_pred&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = 2
y_actual = 10
w = 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Prediction:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;y_pred = 1 × 2 = 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Loss:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;loss = (10 - 2)² = 64
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The prediction is too small.&lt;/p&gt;

&lt;p&gt;So weight should increase.&lt;/p&gt;

&lt;p&gt;Gradient Descent tells us exactly how much to update.&lt;/p&gt;

&lt;p&gt;For squared error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;loss = (y - wx)²
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Gradient with respect to weight:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dL/dw = -2x(y - wx)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now substitute values:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dL/dw = -2 × 2 × (10 - 2)
      = -4 × 8
      = -32
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let learning rate be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;lr = 0.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Update:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;new_w = old_w - lr × gradient
new_w = 1 - 0.1 × (-32)
new_w = 1 + 3.2
new_w = 4.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now prediction becomes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;y_pred = 4.2 × 2 = 8.4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Earlier prediction was 2.&lt;/p&gt;

&lt;p&gt;Now it is 8.4.&lt;/p&gt;

&lt;p&gt;Much closer to 10.&lt;/p&gt;

&lt;p&gt;That is learning.&lt;/p&gt;

&lt;p&gt;Not memorization.&lt;/p&gt;

&lt;p&gt;Not magic.&lt;/p&gt;

&lt;p&gt;Just repeated improvement.&lt;/p&gt;




&lt;h2&gt;
  
  
  Code: Gradient Descent From Scratch
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;numpy&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;matplotlib.pyplot&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;plt&lt;/span&gt;

&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;array&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;array&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;

&lt;span class="n"&gt;lr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.01&lt;/span&gt;
&lt;span class="n"&gt;epochs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;

&lt;span class="n"&gt;losses&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;epoch&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;epochs&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;y_pred&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;

    &lt;span class="n"&gt;loss&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;y_pred&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;losses&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;loss&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;dw&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;y_pred&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;y_pred&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;lr&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;dw&lt;/span&gt;
    &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;lr&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Final weight:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Final bias:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Final weight: close to 2
Final bias: close to 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The model discovers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;y = 2x
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;by updating weights again and again.&lt;/p&gt;




&lt;h2&gt;
  
  
  Plotting The Loss Curve
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;losses&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;xlabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Epochs&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ylabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Loss&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;title&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Loss Decreasing During Gradient Descent&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;show&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This graph is very important.&lt;/p&gt;

&lt;p&gt;If loss goes down, the model is learning.&lt;/p&gt;

&lt;p&gt;If loss goes up, learning rate may be too high.&lt;/p&gt;

&lt;p&gt;If loss is flat, learning rate may be too low or model may not be powerful enough.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Happens If Learning Rate Is Too High?
&lt;/h2&gt;

&lt;p&gt;Suppose learning rate is very large.&lt;/p&gt;

&lt;p&gt;Then the model takes huge jumps.&lt;/p&gt;

&lt;p&gt;Instead of reaching the minimum, it may jump over it again and again.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Good learning rate:

Loss → ↓ ↓ ↓ ↓ ↓

Too high learning rate:

Loss → ↑ ↓ ↑ ↓ ↑
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Code experiment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;lr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You may see loss explode.&lt;/p&gt;

&lt;p&gt;This is called divergence.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Happens If Learning Rate Is Too Low?
&lt;/h2&gt;

&lt;p&gt;If learning rate is too small:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;lr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.000001&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The model learns extremely slowly.&lt;/p&gt;

&lt;p&gt;Loss decreases, but almost nothing happens for many epochs.&lt;/p&gt;

&lt;p&gt;This is why learning rate is one of the most important hyperparameters in deep learning.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Gradient Descent Changed Deep Learning
&lt;/h2&gt;

&lt;p&gt;Before deep learning became powerful, one big problem was:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;How do we train huge models?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A deep neural network may have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Millions of weights
Millions of biases
Multiple layers
Complex activations
Huge datasets
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Manually choosing weights is impossible.&lt;/p&gt;

&lt;p&gt;Trying all combinations is impossible.&lt;/p&gt;

&lt;p&gt;Gradient Descent made training possible because it gave a systematic way to improve every parameter.&lt;/p&gt;

&lt;p&gt;Even if a model has 10 million parameters, the idea remains:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Find gradient
Move opposite to gradient
Reduce loss
Repeat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is why Gradient Descent became the engine of deep learning.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Happens If There Is No Gradient Descent?
&lt;/h2&gt;

&lt;p&gt;Without Gradient Descent, deep learning would almost collapse.&lt;/p&gt;

&lt;p&gt;We would have neural networks, but we would not know how to train them efficiently.&lt;/p&gt;

&lt;p&gt;Without Gradient Descent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;No automatic weight improvement
No large-scale neural network training
No modern computer vision
No powerful language models
No practical deep learning revolution
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We could still use some alternatives like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Random search&lt;/li&gt;
&lt;li&gt;Genetic algorithms&lt;/li&gt;
&lt;li&gt;Manual tuning&lt;/li&gt;
&lt;li&gt;Closed-form solutions for very small models&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But they do not scale like Gradient Descent.&lt;/p&gt;

&lt;p&gt;Imagine a neural network with 100 million parameters.&lt;/p&gt;

&lt;p&gt;Randomly trying weights would be hopeless.&lt;/p&gt;

&lt;p&gt;Gradient Descent gives direction.&lt;/p&gt;

&lt;p&gt;That direction changed everything.&lt;/p&gt;




&lt;h2&gt;
  
  
  Gradient Descent In Neural Networks
&lt;/h2&gt;

&lt;p&gt;In a neural network, every layer has weights.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Input → Hidden Layer → Output
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each layer makes a small transformation.&lt;/p&gt;

&lt;p&gt;The final prediction produces loss.&lt;/p&gt;

&lt;p&gt;Then backpropagation calculates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;How much each weight contributed to the error
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Gradient Descent then updates all weights.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;optimizer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;zero_grad&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;loss&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;backward&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;optimizer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;step&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This PyTorch code looks small.&lt;/p&gt;

&lt;p&gt;But conceptually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;loss.backward()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;calculates gradients.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;optimizer.step()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;applies Gradient Descent.&lt;/p&gt;

&lt;p&gt;That is the heart of deep learning training.&lt;/p&gt;




&lt;h2&gt;
  
  
  PyTorch Example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;torch&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;torch.nn&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;nn&lt;/span&gt;

&lt;span class="n"&gt;X&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;torch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tensor&lt;/span&gt;&lt;span class="p"&gt;([[&lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;2.0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;3.0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;4.0&lt;/span&gt;&lt;span class="p"&gt;]])&lt;/span&gt;
&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;torch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tensor&lt;/span&gt;&lt;span class="p"&gt;([[&lt;/span&gt;&lt;span class="mf"&gt;2.0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;4.0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;6.0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;8.0&lt;/span&gt;&lt;span class="p"&gt;]])&lt;/span&gt;

&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;nn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Linear&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;loss_fn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;nn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;MSELoss&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;optimizer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;torch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;optim&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SGD&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parameters&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;lr&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.01&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;epoch&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;y_pred&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;model&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;X&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;loss&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;loss_fn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y_pred&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;optimizer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;zero_grad&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;loss&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;backward&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;optimizer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;step&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parameters&lt;/span&gt;&lt;span class="p"&gt;()))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This model also learns:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;y = 2x
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The difference is that PyTorch calculates gradients automatically.&lt;/p&gt;

&lt;p&gt;That automatic gradient calculation is called autograd.&lt;/p&gt;




&lt;h2&gt;
  
  
  Gradient Descent vs Backpropagation
&lt;/h2&gt;

&lt;p&gt;Many beginners confuse these two.&lt;/p&gt;

&lt;p&gt;They are related but not the same.&lt;/p&gt;

&lt;p&gt;Backpropagation answers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What are the gradients?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Gradient Descent answers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;How should we update the weights using those gradients?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Backpropagation = gradient calculation

Gradient Descent = parameter update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Together, they train deep neural networks.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Deep Learning Needed Gradient Descent More Than Traditional ML
&lt;/h2&gt;

&lt;p&gt;Traditional ML models often have fewer parameters.&lt;/p&gt;

&lt;p&gt;Some algorithms do not rely heavily on gradients.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;Decision Trees split data using rules.&lt;/p&gt;

&lt;p&gt;KNN stores examples.&lt;/p&gt;

&lt;p&gt;Naive Bayes uses probability formulas.&lt;/p&gt;

&lt;p&gt;But deep learning is different.&lt;/p&gt;

&lt;p&gt;Deep learning is mostly parameter learning.&lt;/p&gt;

&lt;p&gt;Millions of parameters must be adjusted.&lt;/p&gt;

&lt;p&gt;That is why Gradient Descent became more important in deep learning than almost anywhere else.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thought
&lt;/h2&gt;

&lt;p&gt;Gradient Descent changed deep learning because it converted learning into optimization.&lt;/p&gt;

&lt;p&gt;Instead of manually programming intelligence, we define:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Model
Loss Function
Optimizer
Data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then the model improves itself step by step.&lt;/p&gt;

&lt;p&gt;That is the real breakthrough.&lt;/p&gt;

&lt;p&gt;Deep learning is not just about big neural networks.&lt;/p&gt;

&lt;p&gt;It is about trainable neural networks.&lt;/p&gt;

&lt;p&gt;And Gradient Descent is what makes them trainable.&lt;/p&gt;

&lt;p&gt;Without it, deep learning would be like a powerful engine with no steering.&lt;/p&gt;

&lt;p&gt;With it, random weights slowly become useful knowledge.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>deeplearning</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Deep Learning Is More Logistic Regression Than You Think</title>
      <dc:creator>Vineet Chauhan</dc:creator>
      <pubDate>Sat, 06 Jun 2026 20:01:20 +0000</pubDate>
      <link>https://dev.to/vineet_chauhan_a828338181/deep-learning-is-more-logistic-regression-than-you-think-4bgj</link>
      <guid>https://dev.to/vineet_chauhan_a828338181/deep-learning-is-more-logistic-regression-than-you-think-4bgj</guid>
      <description>&lt;h2&gt;
  
  
  Why an Algorithm From the 1950s Still Powers Modern AI
&lt;/h2&gt;

&lt;p&gt;When I first learned Machine Learning, I treated Logistic Regression as a beginner algorithm.&lt;/p&gt;

&lt;p&gt;You learn it.&lt;/p&gt;

&lt;p&gt;You build a classifier.&lt;/p&gt;

&lt;p&gt;You get an accuracy score.&lt;/p&gt;

&lt;p&gt;Then you move on.&lt;/p&gt;

&lt;p&gt;At least that's what I thought.&lt;/p&gt;

&lt;p&gt;After Logistic Regression came:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Decision Trees&lt;/li&gt;
&lt;li&gt;Random Forests&lt;/li&gt;
&lt;li&gt;XGBoost&lt;/li&gt;
&lt;li&gt;Neural Networks&lt;/li&gt;
&lt;li&gt;Transformers&lt;/li&gt;
&lt;li&gt;Large Language Models&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The journey seemed straightforward.&lt;/p&gt;

&lt;p&gt;Old algorithm → Better algorithm → Even better algorithm.&lt;/p&gt;

&lt;p&gt;But after studying Deep Learning more to some extent, I discovered something surprising.&lt;/p&gt;

&lt;p&gt;The algorithm I thought I had left behind was everywhere.&lt;/p&gt;

&lt;p&gt;Not Decision Trees.&lt;/p&gt;

&lt;p&gt;Not Random Forests.&lt;/p&gt;

&lt;p&gt;Not SVMs.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Logistic Regression.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And the deeper I looked, the more I realized that modern Deep Learning did not replace Logistic Regression.&lt;/p&gt;

&lt;p&gt;It scaled its ideas.&lt;/p&gt;




&lt;h2&gt;
  
  
  The First Time I Noticed It
&lt;/h2&gt;

&lt;p&gt;I was learning about neural networks.&lt;/p&gt;

&lt;p&gt;The instructor drew a neuron:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;z&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;w1&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;x1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;w2&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;x2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
&lt;span class="n"&gt;output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;sigmoid&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I stared at the equation for a few seconds.&lt;/p&gt;

&lt;p&gt;Then it hit me.&lt;/p&gt;

&lt;p&gt;That is literally Logistic Regression.&lt;/p&gt;

&lt;p&gt;The exact same weighted sum.&lt;/p&gt;

&lt;p&gt;The exact same sigmoid activation.&lt;/p&gt;

&lt;p&gt;The exact same probability output.&lt;/p&gt;

&lt;p&gt;The exact same optimization process.&lt;/p&gt;

&lt;p&gt;The only difference?&lt;/p&gt;

&lt;p&gt;A neural network has many of them.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Exactly Does Logistic Regression Do?
&lt;/h2&gt;

&lt;p&gt;At its core, Logistic Regression performs two operations.&lt;/p&gt;

&lt;p&gt;Step 1:&lt;/p&gt;

&lt;p&gt;Take a weighted sum.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;z&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;w1&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;x1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;w2&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;x2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;w3&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;x3&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 2:&lt;/p&gt;

&lt;p&gt;Convert it into probability.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sigmoid(z) = 1/1+e^-x&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;The sigmoid function transforms any number into a value between 0 and 1.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Input = -10 → 0.00004

Input = 0 → 0.5

Input = 10 → 0.99995
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This probability becomes the final prediction.&lt;/p&gt;

&lt;p&gt;Simple.&lt;/p&gt;

&lt;p&gt;Elegant.&lt;/p&gt;

&lt;p&gt;Effective.&lt;/p&gt;




&lt;h2&gt;
  
  
  Now Look At A Neural Network
&lt;/h2&gt;

&lt;p&gt;A neuron performs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;z&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;w1&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;x1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;w2&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;x2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;activation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In early neural networks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;activation&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sigmoid&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which means:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Neuron
=
Logistic Regression Unit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The moment I realized this, neural networks became much easier to understand.&lt;/p&gt;

&lt;p&gt;Instead of imagining some magical AI machine, I started seeing thousands of Logistic Regression models stacked together.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Not Decision Trees?
&lt;/h2&gt;

&lt;p&gt;This question bothered me for a long time.&lt;/p&gt;

&lt;p&gt;Why didn't Deep Learning evolve from Decision Trees?&lt;/p&gt;

&lt;p&gt;Why not Random Forests?&lt;/p&gt;

&lt;p&gt;Why specifically Logistic Regression?&lt;/p&gt;

&lt;p&gt;The answer lies in mathematics.&lt;/p&gt;




&lt;h2&gt;
  
  
  Reason 1: Logistic Regression Is Differentiable
&lt;/h2&gt;

&lt;p&gt;Decision Trees make hard decisions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Age &amp;gt; 30 ?

Yes → Left

No → Right
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A tiny change in age can suddenly change the entire path.&lt;/p&gt;

&lt;p&gt;This creates discontinuities.&lt;/p&gt;

&lt;p&gt;Gradient Descent cannot work efficiently.&lt;/p&gt;

&lt;p&gt;Logistic Regression is different.&lt;/p&gt;

&lt;p&gt;Its sigmoid curve is smooth.&lt;/p&gt;

&lt;p&gt;Every tiny change produces a tiny output change.&lt;/p&gt;

&lt;p&gt;This makes gradients possible.&lt;/p&gt;

&lt;p&gt;And gradients are the fuel of Deep Learning.&lt;/p&gt;

&lt;p&gt;Without gradients:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;No Backpropagation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Without backpropagation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;No Neural Networks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Without neural networks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;No ChatGPT
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Reason 2: Logistic Regression Produces Probabilities
&lt;/h2&gt;

&lt;p&gt;A Decision Tree says:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Class A
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Class B
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Logistic Regression says:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;P(Class A) = 0.92
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Probability matters.&lt;/p&gt;

&lt;p&gt;Modern AI relies heavily on probabilities.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;p&gt;Spam Detection&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;98% Spam
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Medical Diagnosis&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;73% Cancer Risk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Language Models&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;P(next word = "cat")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Transformers are fundamentally probability machines.&lt;/p&gt;

&lt;p&gt;And Logistic Regression introduced that philosophy long ago.&lt;/p&gt;




&lt;h2&gt;
  
  
  Reason 3: Cross Entropy Came From Logistic Regression
&lt;/h2&gt;

&lt;p&gt;One of the most important loss functions in Deep Learning is:&lt;/p&gt;

&lt;p&gt;L=-[y\log(p)+(1-y)\log(1-p)]&lt;/p&gt;

&lt;p&gt;Almost every deep learning engineer uses it.&lt;/p&gt;

&lt;p&gt;Image Classification.&lt;/p&gt;

&lt;p&gt;Medical AI.&lt;/p&gt;

&lt;p&gt;Fraud Detection.&lt;/p&gt;

&lt;p&gt;NLP.&lt;/p&gt;

&lt;p&gt;Large Language Models.&lt;/p&gt;

&lt;p&gt;The interesting part?&lt;/p&gt;

&lt;p&gt;This is the same loss function used in Logistic Regression.&lt;/p&gt;

&lt;p&gt;The entire deep learning world still depends on it.&lt;/p&gt;




&lt;h2&gt;
  
  
  Reason 4: Logistic Regression Is A Single Neuron
&lt;/h2&gt;

&lt;p&gt;This was the biggest realization for me.&lt;/p&gt;

&lt;p&gt;A Logistic Regression model can be represented as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Input
 ↓
Weighted Sum
 ↓
Sigmoid
 ↓
Output
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now look at a neural network:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Input
 ↓
100 Neurons
 ↓
100 Neurons
 ↓
100 Neurons
 ↓
Output
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each neuron is doing a very similar operation.&lt;/p&gt;

&lt;p&gt;The network becomes powerful because thousands of these simple units collaborate.&lt;/p&gt;

&lt;p&gt;Deep Learning is not complexity replacing simplicity.&lt;/p&gt;

&lt;p&gt;It is simplicity repeated at scale.&lt;/p&gt;




&lt;h2&gt;
  
  
  Let's Verify This With Code
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Logistic Regression
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;sklearn.linear_model&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;LogisticRegression&lt;/span&gt;

&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;LogisticRegression&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;X_train&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y_train&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;predictions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;predict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;X_test&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now a neural network.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;torch.nn&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;nn&lt;/span&gt;

&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;nn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Sequential&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;nn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Linear&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;nn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Sigmoid&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look carefully.&lt;/p&gt;

&lt;p&gt;Both perform:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Weighted Sum&lt;/li&gt;
&lt;li&gt;Sigmoid Transformation&lt;/li&gt;
&lt;li&gt;Probability Prediction&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Mathematically they are nearly identical.&lt;/p&gt;

&lt;p&gt;The PyTorch version is essentially Logistic Regression implemented as a neural network.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Real Difference
&lt;/h2&gt;

&lt;p&gt;If they are so similar, why use Deep Learning?&lt;/p&gt;

&lt;p&gt;Because Logistic Regression can only learn simple boundaries.&lt;/p&gt;

&lt;p&gt;Imagine separating red and blue dots.&lt;/p&gt;

&lt;p&gt;Logistic Regression creates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;One Straight Line
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Deep Learning creates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Curves
Shapes
Complex Regions
Non-Linear Patterns
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By stacking layers, the network gradually transforms simple linear boundaries into highly complex decision surfaces.&lt;/p&gt;

&lt;p&gt;That is the true power of Deep Learning.&lt;/p&gt;

&lt;p&gt;Not a different idea.&lt;/p&gt;

&lt;p&gt;A larger version of the same idea.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Most Surprising Place I Found Logistic Regression
&lt;/h2&gt;

&lt;p&gt;LSTMs.&lt;/p&gt;

&lt;p&gt;The architecture behind many sequence models.&lt;/p&gt;

&lt;p&gt;Inside every LSTM cell are gates.&lt;/p&gt;

&lt;p&gt;Forget Gate.&lt;/p&gt;

&lt;p&gt;Input Gate.&lt;/p&gt;

&lt;p&gt;Output Gate.&lt;/p&gt;

&lt;p&gt;Guess what activation function they use?&lt;/p&gt;

&lt;p&gt;Sigmoid.&lt;/p&gt;

&lt;p&gt;Every gate computes probabilities.&lt;/p&gt;

&lt;p&gt;Every gate decides:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Keep Information?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Forget Information?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;using Logistic Regression principles.&lt;/p&gt;

&lt;p&gt;Even modern AI systems still carry its DNA.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;When I first learned Logistic Regression, I thought it was something to finish and forget.&lt;/p&gt;

&lt;p&gt;Now I see it differently.&lt;/p&gt;

&lt;p&gt;I see it as the first neural network.&lt;/p&gt;

&lt;p&gt;I see it as the origin of probability-based learning.&lt;/p&gt;

&lt;p&gt;I see it as the mathematical foundation behind cross entropy, gradient descent, and backpropagation.&lt;/p&gt;

&lt;p&gt;The next time someone says Logistic Regression is an old algorithm, remember:&lt;/p&gt;

&lt;p&gt;Deep Learning did not replace Logistic Regression.&lt;/p&gt;

&lt;p&gt;Deep Learning scaled it.&lt;/p&gt;

&lt;p&gt;And some of the most advanced AI systems ever built still rely on ideas introduced by Logistic Regression decades ago.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>deeplearning</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Better Data Beats Better Algorithms: Before Changing the Model, Change the Data</title>
      <dc:creator>Vineet Chauhan</dc:creator>
      <pubDate>Sat, 06 Jun 2026 19:47:54 +0000</pubDate>
      <link>https://dev.to/vineet_chauhan_a828338181/better-data-beats-better-algorithms-before-changing-the-model-change-the-data-107k</link>
      <guid>https://dev.to/vineet_chauhan_a828338181/better-data-beats-better-algorithms-before-changing-the-model-change-the-data-107k</guid>
      <description>&lt;p&gt;&lt;em&gt;How Feature Engineering Taught Me That Better Data Often Beats Better Algorithms&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When I first started learning Machine Learning, I believed what many beginners believe:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If my model is not performing well, I need a better algorithm.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So I kept switching models.&lt;/p&gt;

&lt;p&gt;I moved from Logistic Regression to Decision Trees, then Random Forest, and later even started reading about XGBoost and Neural Networks.&lt;/p&gt;

&lt;p&gt;The results improved slightly, but never dramatically.&lt;/p&gt;

&lt;p&gt;What surprised me was that the biggest improvement didn't come from changing the algorithm.&lt;/p&gt;

&lt;p&gt;It came from changing the data.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;I was working on a dataset containing missing values, outliers, and categorical variables.&lt;/p&gt;

&lt;p&gt;Like many beginners, my first instinct was simple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;X_train&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y_train&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;pred&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;predict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;X_test&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The model trained successfully.&lt;/p&gt;

&lt;p&gt;The accuracy looked acceptable.&lt;/p&gt;

&lt;p&gt;But something felt wrong.&lt;/p&gt;

&lt;p&gt;The data itself was messy.&lt;/p&gt;

&lt;p&gt;Some columns contained missing values.&lt;/p&gt;

&lt;p&gt;Some numerical features had extreme outliers.&lt;/p&gt;

&lt;p&gt;Several categorical columns were represented as text.&lt;/p&gt;

&lt;p&gt;Yet I expected the model to magically learn everything.&lt;/p&gt;




&lt;h2&gt;
  
  
  My First Experiment
&lt;/h2&gt;

&lt;p&gt;I trained a Logistic Regression model on the raw dataset.&lt;/p&gt;

&lt;p&gt;Results:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Accuracy : 72%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Not terrible.&lt;/p&gt;

&lt;p&gt;Not impressive either.&lt;/p&gt;

&lt;p&gt;Instead of changing the model, I decided to investigate the data.&lt;/p&gt;

&lt;p&gt;This turned out to be the most important decision of the entire project.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 1: Handling Missing Values
&lt;/h2&gt;

&lt;p&gt;The dataset contained several missing values.&lt;/p&gt;

&lt;p&gt;At first I considered simply deleting rows.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dropna&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;inplace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The problem?&lt;/p&gt;

&lt;p&gt;I lost a significant portion of the data.&lt;/p&gt;

&lt;p&gt;So I experimented with multiple approaches:&lt;/p&gt;

&lt;h3&gt;
  
  
  Mean Imputation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;sklearn.impute&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;SimpleImputer&lt;/span&gt;

&lt;span class="n"&gt;imputer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;SimpleImputer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;strategy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;mean&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;X&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;imputer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fit_transform&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;X&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Median Imputation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;imputer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;SimpleImputer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;strategy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;median&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  KNN Imputation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;sklearn.impute&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;KNNImputer&lt;/span&gt;

&lt;span class="n"&gt;imputer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;KNNImputer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n_neighbors&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;X&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;imputer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fit_transform&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;X&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;KNN preserved relationships between records much better than simple averaging.&lt;/p&gt;

&lt;p&gt;This alone improved performance.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 2: Fighting Outliers
&lt;/h2&gt;

&lt;p&gt;I then visualized the numerical columns.&lt;/p&gt;

&lt;p&gt;The boxplots looked terrible.&lt;/p&gt;

&lt;p&gt;A few extreme values were stretching entire distributions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;sns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;boxplot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;experience&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The model was spending too much effort trying to fit a handful of unusual observations.&lt;/p&gt;

&lt;p&gt;I used IQR-based treatment.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;Q1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;experience&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;quantile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.25&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;Q3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;experience&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;quantile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.75&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;IQR&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Q3&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;Q1&lt;/span&gt;

&lt;span class="n"&gt;lower&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Q1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;1.5&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;IQR&lt;/span&gt;
&lt;span class="n"&gt;upper&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Q3&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;1.5&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;IQR&lt;/span&gt;

&lt;span class="n"&gt;df&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;experience&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;
        &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;experience&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;upper&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After removing outliers, the data distribution became much cleaner.&lt;/p&gt;

&lt;p&gt;More importantly, the model began learning actual patterns instead of noise.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 3: Encoding Categorical Features
&lt;/h2&gt;

&lt;p&gt;Machine Learning algorithms cannot understand text.&lt;/p&gt;

&lt;p&gt;They only understand numbers.&lt;/p&gt;

&lt;p&gt;So columns like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Male
Female

Private
Public

Graduate
Masters
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;needed transformation.&lt;/p&gt;

&lt;p&gt;I applied One-Hot Encoding.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_dummies&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
               &lt;span class="n"&gt;columns&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gender&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;company_type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and Ordinal Encoding where order mattered.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;education_level&lt;/span&gt;

&lt;span class="n"&gt;High&lt;/span&gt; &lt;span class="n"&gt;School&lt;/span&gt;
&lt;span class="n"&gt;Graduate&lt;/span&gt;
&lt;span class="n"&gt;Masters&lt;/span&gt;
&lt;span class="n"&gt;PhD&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This converted human-readable categories into machine-readable information.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 4: Feature Scaling
&lt;/h2&gt;

&lt;p&gt;Some columns ranged between:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0 – 5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;while others ranged between:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0 – 100000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Distance-based algorithms become biased toward larger values.&lt;/p&gt;

&lt;p&gt;I applied MinMax Scaling.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;sklearn.preprocessing&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;MinMaxScaler&lt;/span&gt;

&lt;span class="n"&gt;scaler&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MinMaxScaler&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;X_train&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;scaler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fit_transform&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;X_train&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;X_test&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;scaler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;X_test&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now every feature contributed fairly.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Happened Next?
&lt;/h2&gt;

&lt;p&gt;I trained the exact same Logistic Regression model again.&lt;/p&gt;

&lt;p&gt;Nothing changed except the data.&lt;/p&gt;

&lt;p&gt;Results:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Before Feature Engineering : 72%

After Feature Engineering  : 86%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A gain of 14 percentage points.&lt;/p&gt;

&lt;p&gt;Without changing the algorithm.&lt;/p&gt;

&lt;p&gt;Without using deep learning.&lt;/p&gt;

&lt;p&gt;Without adding complexity.&lt;/p&gt;

&lt;p&gt;Just by improving the data.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Most Important Lesson
&lt;/h2&gt;

&lt;p&gt;This project changed the way I think about Machine Learning.&lt;/p&gt;

&lt;p&gt;Earlier I believed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Better Algorithm
       ↓
Better Results
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now I believe:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Better Data
       ↓
Better Features
       ↓
Better Results
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Most real-world machine learning problems are not algorithm problems.&lt;/p&gt;

&lt;p&gt;They are data problems.&lt;/p&gt;

&lt;p&gt;A powerful model trained on poor-quality data will still struggle.&lt;/p&gt;

&lt;p&gt;A simple model trained on clean, meaningful data can often outperform much more complex alternatives.&lt;/p&gt;




&lt;h2&gt;
  
  
  Challenges I Faced
&lt;/h2&gt;

&lt;p&gt;The hardest part was not training the model.&lt;/p&gt;

&lt;p&gt;The hardest part was preparing the data.&lt;/p&gt;

&lt;p&gt;Some difficulties included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Losing rows during Complete Case Analysis&lt;/li&gt;
&lt;li&gt;Choosing between Mean, Median, and KNN Imputation&lt;/li&gt;
&lt;li&gt;Combining transformed datasets&lt;/li&gt;
&lt;li&gt;Handling dimensionality after One-Hot Encoding&lt;/li&gt;
&lt;li&gt;Identifying genuine outliers versus valuable rare cases&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These challenges taught me more than model training ever did.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Feature Engineering is not the most glamorous part of Machine Learning.&lt;/p&gt;

&lt;p&gt;Nobody posts screenshots of missing value treatment on social media.&lt;/p&gt;

&lt;p&gt;Nobody celebrates scaling features.&lt;/p&gt;

&lt;p&gt;Yet this is where much of the real improvement happens.&lt;/p&gt;

&lt;p&gt;After this project, I stopped asking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Which model should I use?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;and started asking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What is my data trying to tell me?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That single change in mindset improved my machine learning skills more than learning any new algorithm.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>datascience</category>
      <category>deeplearning</category>
    </item>
    <item>
      <title>Feature Engineering is Not Just “Cleaning Data”: What I Learned While Building a Real ML Pipeline</title>
      <dc:creator>Vineet Chauhan</dc:creator>
      <pubDate>Thu, 28 May 2026 10:43:45 +0000</pubDate>
      <link>https://dev.to/vineet_chauhan_a828338181/feature-engineering-is-not-just-cleaning-data-what-i-learned-while-building-a-real-ml-pipeline-4ng3</link>
      <guid>https://dev.to/vineet_chauhan_a828338181/feature-engineering-is-not-just-cleaning-data-what-i-learned-while-building-a-real-ml-pipeline-4ng3</guid>
      <description>&lt;p&gt;Most machine learning tutorials make preprocessing look straightforward.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Handle missing values.&lt;/li&gt;
&lt;li&gt;Encode categorical features.&lt;/li&gt;
&lt;li&gt;Train the model.&lt;/li&gt;
&lt;li&gt;Get accuracy.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But while working on a real classification dataset, I realized feature engineering is far less about applying textbook techniques and far more about making careful decisions under uncertainty.&lt;/p&gt;

&lt;p&gt;This project completely changed how I think about preprocessing.&lt;/p&gt;

&lt;p&gt;Instead of writing another “complete guide to feature engineering,” I wanted to document the actual engineering problems I faced while building a preprocessing pipeline — including debugging mistakes, failed assumptions, distribution shifts, encoding challenges, and how preprocessing itself changed model behaviour.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Dataset Looked Simple at First&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Initially, the dataset looked manageable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Numerical features&lt;/li&gt;
&lt;li&gt;Categorical features&lt;/li&gt;
&lt;li&gt;Missing values&lt;/li&gt;
&lt;li&gt;Binary target variable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Nothing seemed unusual.&lt;/p&gt;

&lt;p&gt;But the moment preprocessing started, the real complexity appeared.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The First Problem: Missing Values Were Uneven Everywhere&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the first things I checked was the percentage of missing values across columns.&lt;/p&gt;

&lt;p&gt;Some columns had:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;less than 1% missing values&lt;/li&gt;
&lt;li&gt;some had 5–10%&lt;/li&gt;
&lt;li&gt;others had more than 30%&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This immediately raised an important question:&lt;/p&gt;

&lt;p&gt;Should every missing value be handled using the same strategy?&lt;/p&gt;

&lt;p&gt;The answer quickly became no.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fghsj30fvxbf98938g4h5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fghsj30fvxbf98938g4h5.png" alt=" " width="350" height="351"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Initial Mistake: Applying One Strategy Everywhere&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At first, I tried treating all missing values similarly.&lt;/p&gt;

&lt;p&gt;That approach failed quickly because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Complete Case Analysis removed too many rows&lt;/li&gt;
&lt;li&gt;KNN Imputation behaved poorly on categorical-heavy features&lt;/li&gt;
&lt;li&gt;Encoded categorical values introduced unrealistic numeric relationships&lt;/li&gt;
&lt;li&gt;Feature distributions started changing unexpectedly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This was the first moment I realized:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Feature engineering is not a fixed recipe.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Different features require different preprocessing decisions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using Complete Case Analysis (CCA)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For columns with less than 5% missing values, I used Complete Case Analysis.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2xkue5c1zga1p9ttq9s5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2xkue5c1zga1p9ttq9s5.png" alt=" " width="380" height="99"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At first, this seemed harmless.&lt;/p&gt;

&lt;p&gt;But then I decided to compare feature distributions before and after row deletion.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbsre4jjde2kzofr46jl1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbsre4jjde2kzofr46jl1.png" alt=" " width="800" height="579"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This turned out to be one of the most important observations in the project.&lt;/p&gt;

&lt;p&gt;Even small row deletions slightly changed feature density and distributions.&lt;/p&gt;

&lt;p&gt;That was the moment I understood:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Missing value handling is not only about removing NaNs — it can also reshape the dataset itself.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A Small Pandas Mistake That Broke My Pipeline&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One debugging issue confused me for quite a while.&lt;/p&gt;

&lt;p&gt;Initially, I wrote:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;df[cols].dropna()&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This unintentionally removed all other columns from the dataframe.&lt;/p&gt;

&lt;p&gt;The correct approach was:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;df.dropna(subset=cols)&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The difference was tiny syntactically but huge logically.&lt;/p&gt;

&lt;p&gt;This taught me something surprisingly important:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Many machine learning problems are not model problems.&lt;br&gt;
They are dataframe manipulation problems.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why KNN Imputer Became Complicated&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Initially, I planned to use KNN Imputer for all remaining missing values.&lt;/p&gt;

&lt;p&gt;But another issue appeared immediately.&lt;/p&gt;

&lt;p&gt;KNN relies on distance calculations.&lt;/p&gt;

&lt;p&gt;Distance works naturally for numerical data, but categorical columns require encoding first.&lt;/p&gt;

&lt;p&gt;That introduced several complications:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Label encoding created artificial numeric relationships&lt;/li&gt;
&lt;li&gt;One Hot Encoding exploded feature dimensionality&lt;/li&gt;
&lt;li&gt;NaN values converted into strings accidentally during preprocessing&lt;/li&gt;
&lt;li&gt;Encoded categories distorted neighbor similarity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This made me realize:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;KNN Imputer works much better for numerical features than heavily categorical datasets.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Eventually, I switched to a hybrid preprocessing strategy instead of forcing one solution everywhere.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Final Missing Value Strategy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I ended up using:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Feature Type:-                        Strategy:-&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Low missing numerical    ---&amp;gt;        Complete Case Analysis&lt;/li&gt;
&lt;li&gt;High missing numerical   ---&amp;gt;        Median/KNN Imputation&lt;/li&gt;
&lt;li&gt;High missing categorical ---&amp;gt;        Most Frequent / “Missing” category&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This hybrid approach worked far better than blindly applying one technique globally.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Encoding Was More Important Than I Expected&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Encoding looked simple in theory.&lt;/p&gt;

&lt;p&gt;But in practice, deciding between:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One Hot Encoding&lt;/li&gt;
&lt;li&gt;Ordinal Encoding&lt;/li&gt;
&lt;li&gt;Label Encoding&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;actually mattered a lot.&lt;/p&gt;

&lt;p&gt;I used:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One Hot Encoding&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;gender&lt;/li&gt;
&lt;li&gt;major_discipline&lt;/li&gt;
&lt;li&gt;company_type&lt;/li&gt;
&lt;li&gt;enrolled_university&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;because these categories had no natural order.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ordinal Encoding&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;education_level&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;because educational levels actually contain ranking:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Primary School &amp;lt; High School &amp;lt; Graduate &amp;lt; Masters &amp;lt; PhD&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This distinction improved model behavior more than I initially expected.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Most Interesting Observation: Preprocessing Changed the Models More Than the Models Changed Themselves&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I trained multiple models:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Logistic Regression&lt;/li&gt;
&lt;li&gt;Decision Tree&lt;/li&gt;
&lt;li&gt;Random Forest&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;both before and after preprocessing.&lt;/p&gt;

&lt;p&gt;The results were surprisingly different.&lt;/p&gt;

&lt;p&gt;Linear models improved heavily after scaling and proper encoding.&lt;/p&gt;

&lt;p&gt;Random Forest remained comparatively stable even before aggressive preprocessing.&lt;/p&gt;

&lt;p&gt;That observation completely changed my perspective.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Data preprocessing often influences performance more than changing the algorithm itself.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Another Real Problem: Feature Explosion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After applying One Hot Encoding, the number of features increased rapidly.&lt;/p&gt;

&lt;p&gt;This was another practical challenge rarely discussed in beginner tutorials.&lt;/p&gt;

&lt;p&gt;Encoding solved categorical representation issues, but it also increased dimensionality and preprocessing complexity significantly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Pipelines Became Necessary&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At one point, preprocessing became chaotic.&lt;/p&gt;

&lt;p&gt;Different transformations were happening separately:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;scaling&lt;/li&gt;
&lt;li&gt;imputation&lt;/li&gt;
&lt;li&gt;encoding&lt;/li&gt;
&lt;li&gt;train-test transformations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tracking transformed columns manually became painful.&lt;/p&gt;

&lt;p&gt;This was when I finally understood why sklearn Pipelines and ColumnTransformers matter so much.&lt;/p&gt;

&lt;p&gt;Not because they look advanced —&lt;br&gt;
but because preprocessing becomes unmanageable very quickly in real projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What This Project Changed for Me&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before this project, I thought feature engineering mostly meant:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;removing null values&lt;/li&gt;
&lt;li&gt;encoding categories&lt;/li&gt;
&lt;li&gt;scaling features&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now I think differently.&lt;/p&gt;

&lt;p&gt;Feature engineering is closer to:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;understanding how data behaves under transformation.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Every preprocessing decision changes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;distributions&lt;/li&gt;
&lt;li&gt;feature relationships&lt;/li&gt;
&lt;li&gt;dimensionality&lt;/li&gt;
&lt;li&gt;information retention&lt;/li&gt;
&lt;li&gt;model assumptions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even small preprocessing choices can significantly change model behavior.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Final Thoughts&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
One thing became very clear after this project:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Machine learning is not just model training.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Most real effort goes into:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;understanding data&lt;/li&gt;
&lt;li&gt;debugging preprocessing&lt;/li&gt;
&lt;li&gt;handling edge cases&lt;/li&gt;
&lt;li&gt;preserving useful information&lt;/li&gt;
&lt;li&gt;testing assumptions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feature engineering is where datasets stop behaving like clean classroom examples and start behaving like real systems.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;"And honestly, that is where machine learning starts becoming interesting."&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>datascience</category>
      <category>programming</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Building a Hantavirus Misinformation Detector: Challenges of NLP in Low-Data Health Domains</title>
      <dc:creator>Vineet Chauhan</dc:creator>
      <pubDate>Sat, 16 May 2026 17:00:47 +0000</pubDate>
      <link>https://dev.to/vineet_chauhan_a828338181/building-a-hantavirus-misinformation-detector-challenges-of-nlp-in-low-data-health-domains-3m5o</link>
      <guid>https://dev.to/vineet_chauhan_a828338181/building-a-hantavirus-misinformation-detector-challenges-of-nlp-in-low-data-health-domains-3m5o</guid>
      <description>&lt;p&gt;Most fake news detection projects rely on massive datasets containing thousands of examples.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I wanted to explore something much more difficult:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Can a small NLP system detect misinformation around an emerging disease like Hantavirus?&lt;/p&gt;

&lt;p&gt;What made this project interesting was not the model itself, but the challenge of working in a low-data environment where reliable misinformation examples barely exist.&lt;/p&gt;

&lt;p&gt;Unlike COVID-19 misinformation datasets, hantavirus-related misinformation is extremely limited online. This forced me to manually curate both factual and misleading claims while understanding how health misinformation behaves linguistically.&lt;/p&gt;

&lt;p&gt;This project became less about achieving high accuracy and more about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;understanding NLP pipelines,&lt;/li&gt;
&lt;li&gt;handling imperfect datasets,&lt;/li&gt;
&lt;li&gt;and analyzing misinformation patterns.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Understanding the Problem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Health misinformation spreads differently from normal fake news.&lt;/p&gt;

&lt;p&gt;Many misleading claims are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1. partially believable,&lt;/li&gt;
&lt;li&gt;2. emotionally framed,&lt;/li&gt;
&lt;li&gt;3. or based on incomplete truths.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“Natural remedies can cure hantavirus”&lt;/li&gt;
&lt;li&gt;“Governments are hiding outbreak data”&lt;/li&gt;
&lt;li&gt;“Hot water prevents infection”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The challenge was not simply classifying text as fake or real, but understanding how subtle misinformation patterns emerge in health-related discussions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Dataset Creation (The Hardest Part)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This was by far the most difficult stage of the project.&lt;/p&gt;

&lt;p&gt;Unlike mainstream misinformation domains, there are very few structured datasets specifically related to hantavirus misinformation. Because of this, I manually curated a small dataset using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;trusted medical sources,&lt;/li&gt;
&lt;li&gt;news articles,&lt;/li&gt;
&lt;li&gt;and realistic misinformation patterns.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Real Data Sources&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I collected factual information from:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;WHO&lt;/li&gt;
&lt;li&gt;CDC&lt;/li&gt;
&lt;li&gt;Reuters&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Examples included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;transmission details,&lt;/li&gt;
&lt;li&gt;symptoms,&lt;/li&gt;
&lt;li&gt;prevention methods,&lt;/li&gt;
&lt;li&gt;and treatment limitations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. Fake Data Construction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Finding real misinformation examples for hantavirus was difficult because the topic is relatively niche.&lt;/p&gt;

&lt;p&gt;Instead of generating random false statements, I focused on realistic misinformation patterns commonly seen in health-related fake news:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;miracle cures,&lt;/li&gt;
&lt;li&gt;conspiracy theories,&lt;/li&gt;
&lt;li&gt;exaggerated transmission claims,&lt;/li&gt;
&lt;li&gt;and misleading prevention methods.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“Garlic water can completely cure hantavirus”&lt;/li&gt;
&lt;li&gt;“The virus spreads rapidly through city air systems”&lt;/li&gt;
&lt;li&gt;“A secret vaccine already exists”&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Dataset Structure&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The dataset included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;text&lt;/li&gt;
&lt;li&gt;label&lt;/li&gt;
&lt;li&gt;source&lt;/li&gt;
&lt;li&gt;category&lt;/li&gt;
&lt;li&gt;difficulty&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This structure helped organize misinformation types and analyze which claims were easier or harder for the model to classify.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Dataset Analysis&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fake vs Real Distribution&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fllj7a23hu7x36h4uf4vv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fllj7a23hu7x36h4uf4vv.png" alt=" " width="704" height="566"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Category Distribution&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fynva9uz1a9ds5xywkyzk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fynva9uz1a9ds5xywkyzk.png" alt=" " width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Difficulty Distribution&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frrobr4azjk7yn5nndwgv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frrobr4azjk7yn5nndwgv.png" alt=" " width="703" height="566"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. NLP Pipeline&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The NLP pipeline was intentionally kept simple to better understand the fundamentals.&lt;/p&gt;

&lt;p&gt;The workflow consisted of:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Text preprocessing&lt;/li&gt;
&lt;li&gt;TF-IDF vectorization&lt;/li&gt;
&lt;li&gt;Logistic Regression classification&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;9. Text Preprocessing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The first step involved cleaning the text data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;converting text to lowercase,&lt;/li&gt;
&lt;li&gt;removing punctuation,&lt;/li&gt;
&lt;li&gt;removing unnecessary spaces,&lt;/li&gt;
&lt;li&gt;and standardizing sentence structure.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffi9i1jlluuimt4xvc191.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffi9i1jlluuimt4xvc191.png" alt=" " width="675" height="334"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10. TF-IDF Vectorization&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Machine learning models cannot directly understand raw text.&lt;/p&gt;

&lt;p&gt;TF-IDF converts words into numerical representations based on their importance across the dataset.&lt;/p&gt;

&lt;p&gt;This allowed the model to identify patterns such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“secret cure”&lt;/li&gt;
&lt;li&gt;“government hiding”&lt;/li&gt;
&lt;li&gt;“supportive care”&lt;/li&gt;
&lt;li&gt;“WHO reports”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;11. Most Interesting Observation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the most surprising findings was:&lt;/p&gt;

&lt;p&gt;believable misinformation is much harder to classify than extreme misinformation.&lt;/p&gt;

&lt;p&gt;Claims like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“Herbal remedies may reduce hantavirus symptoms”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;were more difficult for the model than clearly absurd claims.&lt;/p&gt;

&lt;p&gt;This highlighted an important limitation of simple NLP models:&lt;br&gt;
they rely heavily on statistical language patterns rather than true medical understanding.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;12. Limitations&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This project has several limitations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;small dataset size,&lt;/li&gt;
&lt;li&gt;manually curated misinformation,&lt;/li&gt;
&lt;li&gt;limited real-world social media data,&lt;/li&gt;
&lt;li&gt;and no deep learning models.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because of these constraints, the model should not be treated as a production-ready misinformation detector.&lt;/p&gt;

&lt;p&gt;Instead, this project should be viewed as:&lt;/p&gt;

&lt;p&gt;an exploratory NLP experiment in a low-data health misinformation domain.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;13. Future Improvements&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are several directions for improving this project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;collecting real social media misinformation,&lt;/li&gt;
&lt;li&gt;increasing dataset size,&lt;/li&gt;
&lt;li&gt;using transformer-based models like BERT,&lt;/li&gt;
&lt;li&gt;multilingual misinformation detection,&lt;/li&gt;
&lt;li&gt;and explainable AI methods such as SHAP or LIME.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;14. Final Thoughts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This project taught me that the hardest part of NLP is often not the model itself.&lt;/p&gt;

&lt;p&gt;It is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;collecting meaningful data,&lt;/li&gt;
&lt;li&gt;understanding ambiguity,&lt;/li&gt;
&lt;li&gt;and dealing with imperfect real-world information.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Working on a low-data problem like hantavirus misinformation made the project far more challenging — and far more educational — than simply training a model on a large public dataset.&lt;/p&gt;

&lt;p&gt;Even though the model itself was simple, the process revealed how difficult health misinformation detection actually is in practice&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyw0qhyzqg1xnqf555ugm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyw0qhyzqg1xnqf555ugm.png" alt=" " width="673" height="562"&gt;&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>nlp</category>
      <category>machinelearning</category>
      <category>dataengineering</category>
    </item>
  </channel>
</rss>
