<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dingariuttam on Medium]]></title>
        <description><![CDATA[Stories by Dingariuttam on Medium]]></description>
        <link>https://medium.com/@dingariuttam?source=rss-ff595e644f2c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*2vlTazkLf8Rl6gYX</url>
            <title>Stories by Dingariuttam on Medium</title>
            <link>https://medium.com/@dingariuttam?source=rss-ff595e644f2c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 22:13:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dingariuttam/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Comparative Study of High-Cardinality Encoding Techniques: Which One Works Best?]]></title>
            <link>https://medium.com/@dingariuttam/a-comparative-study-of-high-cardinality-encoding-techniques-which-one-works-best-548ec936147b?source=rss-ff595e644f2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/548ec936147b</guid>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[feature-engineering]]></category>
            <category><![CDATA[artificail-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Dingariuttam]]></dc:creator>
            <pubDate>Tue, 17 Nov 2026 18:36:43 GMT</pubDate>
            <atom:updated>2026-11-17T18:36:43.743Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hRxgEVgE75REsITFKJwRZg.png" /></figure><p><em>An experimental comparison of eight categorical encoding techniques using LightGBM and XGBoost on a Ride-Hailing Dataset.</em></p><h3>1. Introduction</h3><p>Machine learning algorithms generally work with numerical data. However, real-world datasets often contain categorical information such as customer IDs, driver IDs, city names, postal codes, and vehicle models.</p><p>To make this information usable by machine learning algorithms, we use a process called <strong>Categorical Encoding</strong>.</p><p>Categorical encoding converts text-based categories into numerical representations that machine learning models can understand.</p><p>One major challenge in this process is <strong>High Cardinality</strong>.</p><p>High cardinality occurs when a categorical feature contains a large number of unique values. For example, a dataset containing thousands of different driver IDs or postal codes is considered to have high-cardinality features.</p><p>Traditional One-Hot Encoding can create hundreds or thousands of additional columns, increasing dimensionality and computational complexity.</p><p>So, which encoding technique works best?</p><p>To answer this question, I conducted a comparative experiment using eight different categorical encoding techniques on a Ride-Hailing dataset. The objective was to understand how each technique behaves and identify which approach delivers the best predictive performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nWcNYAqQjp7_pP_ChJq6_w.png" /></figure><h3>2. Understanding the Dataset</h3><p>For this experiment, I used the provided Ride-Hailing dataset, which contains information related to rides, drivers, vehicles, and customer complaints.</p><p>The dataset contains:</p><ul><li>Total records: 30,000</li><li>Unique driver IDs: 600</li><li>Unique pickup ZIP codes: 1,500</li><li>Unique drop-off ZIP codes: 1,500</li><li>Unique vehicle models: 5</li></ul><p><strong>Target Variable: </strong><strong>complained</strong></p><p>The objective is to predict whether a customer will raise a complaint.</p><ul><li>0 — No complaint</li><li>1 — Complaint</li></ul><p>The dataset contains approximately 84% no-complaint records and 16% complaint records.</p><h3>Important Features</h3><p>FeatureUnique ValuesTypedriver_id600High Cardinalitypickup_zip1,500High Cardinalitydropoff_zip1,500High Cardinalityvehicle_model5Low Cardinality</p><p>The three high-cardinality features required special encoding techniques, while vehicle_model was handled consistently using One-Hot Encoding in the first six experiments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V5mcUl2qItZJkVNvu16FVA.png" /></figure><h3>3. Understanding the Eight Encoding Techniques</h3><p>I implemented eight different approaches to compare their performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SQmouypaymcuHKuRKnyNwA.png" /></figure><h3>Experiment 1: Capped One-Hot Encoding</h3><p>One-Hot Encoding converts each category into a separate binary column.</p><p>For example, if a vehicle feature contains Sedan, SUV, and Hatchback, it creates three separate columns.</p><p>However, applying this technique to thousands of unique driver IDs and ZIP codes can create a large number of features.</p><p>To control this, I used max_categories=50 to limit the number of categories.</p><p><strong>Advantages:</strong></p><ul><li>Easy to understand and implement.</li><li>Suitable for low-cardinality features.</li><li>Creates explicit category representations.</li></ul><p><strong>Limitations:</strong></p><ul><li>Can increase dimensionality.</li><li>May lose information about infrequent categories.</li><li>Can increase memory usage.</li></ul><h3>Experiment 2: Frequency Encoding</h3><p>Frequency Encoding replaces each category with the number of times it appears in the training dataset.</p><p>For example, if driver D1 appears 120 times, the encoded value becomes 120.</p><p>This technique significantly reduces the number of columns because each categorical feature is replaced by a single numerical column.</p><p><strong>Advantages:</strong></p><ul><li>Simple implementation.</li><li>Reduces dimensionality.</li><li>Handles high-cardinality features efficiently.</li></ul><p><strong>Limitations:</strong></p><ul><li>Different categories may have identical frequencies.</li><li>Frequency does not directly represent complaint probability.</li><li>Unseen categories require a fallback value.</li></ul><h3>Experiment 3: Target / Mean Encoding</h3><p>Target Encoding replaces each category with the average target value associated with that category.</p><p>For example, suppose a driver has completed 20 rides, and 5 of those rides resulted in complaints.</p><p>The encoded value becomes:</p><p>5 / 20 = 0.25</p><p>This represents the average complaint rate associated with that driver.</p><p><strong>Advantages:</strong></p><ul><li>Captures the relationship between categories and the target.</li><li>Reduces the number of features.</li><li>Useful for high-cardinality datasets.</li></ul><p><strong>Limitations:</strong></p><ul><li>Can overfit rare categories.</li><li>Target leakage can occur if encoding is not implemented carefully.</li><li>Requires proper handling of unseen categories.</li></ul><p>In this experiment, I used out-of-fold encoding for training data to prevent each row’s target from directly influencing its own encoded value.</p><h3>Experiment 4: Smoothed Target Encoding</h3><p>Smoothed Target Encoding improves ordinary Target Encoding by combining the category-level target mean with the overall target mean.</p><p>Why is this necessary?</p><p>Imagine a driver has completed only one ride, and that ride resulted in a complaint. Assigning that driver a complaint probability of 100% may be misleading because the observation count is very small.</p><p>Smoothing reduces the influence of such categories by moving their encoded values towards the global target mean.</p><p>For this experiment, I used:</p><ul><li>Smoothing: 20</li><li>Minimum samples per category: 2</li></ul><p><strong>Advantages:</strong></p><ul><li>Reduces overfitting.</li><li>Handles categories with fewer observations.</li><li>Provides more stable category estimates.</li></ul><p><strong>Limitations:</strong></p><ul><li>Requires choosing suitable smoothing parameters.</li><li>Excessive smoothing can remove useful category information.</li></ul><h3>Experiment 5: Leave-One-Out Encoding</h3><p>Leave-One-Out Encoding calculates the target mean for a category while excluding the current observation’s target value.</p><p>For every training observation, its own target is removed before calculating the category-level mean.</p><p>This helps reduce self-target leakage.</p><p>A small amount of noise can also be added to training encodings to reduce overfitting.</p><p><strong>Advantages:</strong></p><ul><li>Reduces self-target leakage.</li><li>Uses category-level target information.</li><li>Useful for high-cardinality features.</li></ul><p><strong>Limitations:</strong></p><ul><li>Can be unstable for rare categories.</li><li>Requires careful handling of categories with only one observation.</li><li>Noise selection can affect performance.</li></ul><h3>Experiment 6: Weight of Evidence (WoE) Encoding</h3><p>Weight of Evidence is an encoding technique that represents the relationship between a categorical feature and the target classes using logarithmic ratios.</p><p>In this experiment:</p><ul><li>Good observations: No complaint (0)</li><li>Bad observations: Complaint (1)</li></ul><p>WoE calculates how strongly a category is associated with one class compared with the other.</p><p>It uses logarithms of class-conditional proportions to represent this relationship.</p><p>Additive smoothing was used to avoid zero probabilities.</p><p><strong>Advantages:</strong></p><ul><li>Provides interpretable category relationships.</li><li>Converts categorical values into numerical representations.</li><li>Can be useful in binary classification.</li></ul><p><strong>Limitations:</strong></p><ul><li>Can be unstable for categories with very few observations.</li><li>Requires careful probability calculations.</li><li>May need smoothing for sparse categories.</li></ul><h3>Experiment 7: XGBoost Native Categorical Handling</h3><p>Instead of manually converting categorical columns into numerical values, XGBoost provides native categorical feature support.</p><p>For this experiment, I converted the categorical columns into Pandas category dtype and enabled:</p><p>enable_categorical=True</p><p>This allows XGBoost to process categorical features directly.</p><p><strong>Advantages:</strong></p><ul><li>Avoids manual high-cardinality encoding.</li><li>Reduces preprocessing requirements.</li><li>Supports categorical feature handling within the model.</li></ul><p><strong>Limitations:</strong></p><ul><li>Requires correct categorical data types.</li><li>Depends on compatible library versions.</li><li>Performance depends on the dataset and model configuration.</li></ul><h3>Experiment 8: LightGBM Native Categorical Handling</h3><p>LightGBM also supports native categorical feature handling.</p><p>Instead of manually encoding driver IDs and ZIP codes, I converted the categorical columns into Pandas category dtype and identified them as categorical features during model training.</p><p>This allows LightGBM to handle categorical features directly.</p><p><strong>Advantages:</strong></p><ul><li>Avoids large One-Hot encoded feature matrices.</li><li>Reduces manual preprocessing.</li><li>Provides native categorical split handling.</li></ul><p><strong>Limitations:</strong></p><ul><li>Requires correct categorical data types.</li><li>Training and testing category levels must be handled consistently.</li><li>Native handling does not guarantee better performance.</li></ul><h3>4. Experimental Methodology</h3><p>To make the comparison fair, I followed the same experimental approach across all eight experiments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tqpbnga-Xxyt82JCquBFwA.png" /></figure><h3>Train-Test Split</h3><p>I used a single stratified 70:30 train-test split with random_state=42.</p><p>The same split was reused for every experiment.</p><h3>Preprocessing</h3><ul><li>Applied high-cardinality encoding only to driver_id, pickup_zip, and dropoff_zip.</li><li>Applied One-Hot Encoding to vehicle_model consistently in Experiments 1–6.</li><li>Retained numerical features.</li><li>Fitted encoders using training data only.</li><li>Used the fitted encoders to transform test data.</li></ul><h3>Models Used</h3><ul><li>LightGBM for Experiments 1–6.</li><li>XGBoost for Experiment 7.</li><li>LightGBM native categorical handling for Experiment 8.</li></ul><p>The same LightGBM evaluation settings were maintained across the first six experiments.</p><h3>Evaluation Metrics</h3><p>I used two evaluation metrics.</p><p><strong>1. Accuracy Score</strong></p><p>Accuracy measures the proportion of correctly predicted observations.</p><p><strong>2. ROC-AUC Score</strong></p><p>ROC-AUC measures how effectively a model distinguishes between the two classes.</p><p>For this experiment:</p><ul><li>Primary evaluation metric: ROC-AUC</li><li>Secondary evaluation metric: Accuracy</li></ul><p>ROC-AUC was given more importance because the dataset contains an imbalance between complaint and no-complaint records.</p><h3>5. Implementation and Results</h3><p>After implementing all eight experiments, I collected the evaluation results using Pandas DataFrame.</p><h3>Performance Comparison</h3><p>ExperimentEncoding TechniqueModelAccuracyROC-AUC1Capped One-HotLightGBM0.83880.56582FrequencyLightGBM0.83940.54423Target / MeanLightGBM0.83960.71374Smoothed TargetLightGBM0.8384<strong>0.7174</strong>5Leave-One-OutLightGBM0.83840.70726WoELightGBM0.83840.71477Native CategoricalXGBoost0.82130.70938Native CategoricalLightGBM0.82520.7057</p><h3>Key Results</h3><ul><li>Highest ROC-AUC: Smoothed Target Encoding — 0.7174.</li><li>Highest Accuracy: Target / Mean Encoding — 0.8396.</li><li>Lowest ROC-AUC: Frequency Encoding — 0.5442.</li></ul><p>The results show that different encoding techniques produce different model performances, even when the same dataset and evaluation setup are used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L2dx2HGDO5hDiWLGRtuH1A.png" /></figure><h3>6. Results and Discussion</h3><p>After comparing all eight experiments, a few important observations emerged.</p><h3>Which technique performed best?</h3><p>Smoothed Target Encoding combined with LightGBM achieved the highest ROC-AUC score of 0.7174.</p><p>It slightly outperformed ordinary Target Encoding, which achieved 0.7137.</p><p>This suggests that smoothing helped reduce the influence of categories with fewer observations.</p><h3>Which technique achieved the highest accuracy?</h3><p>Target / Mean Encoding achieved the highest accuracy of 0.8396.</p><p>However, the difference between the accuracy scores was relatively small.</p><h3>Why did Frequency Encoding perform poorly?</h3><p>Frequency Encoding achieved a ROC-AUC of 0.5442.</p><p>Although it reduces dimensionality, it does not directly capture the relationship between a category and the target variable.</p><p>Therefore, knowing how frequently a driver appears does not necessarily tell us whether that driver is associated with customer complaints.</p><h3>How did native categorical handling perform?</h3><p>XGBoost achieved a ROC-AUC of 0.7093, while LightGBM native categorical handling achieved 0.7057.</p><p>Both approaches produced reasonable results, but neither outperformed Smoothed Target Encoding in this experiment.</p><h3>Important Observation: Class Imbalance</h3><p>Approximately 84% of the dataset belongs to the no-complaint class.</p><p>This means a model predicting no complaint for every record could already achieve approximately 84% accuracy.</p><p>Therefore, accuracy alone does not provide a complete picture of model performance.</p><p>ROC-AUC gives a more meaningful comparison for this experiment.</p><h3>7. Challenges and Learnings</h3><p>During this experiment, I explored several challenges associated with high-cardinality categorical features.</p><p><strong>1. High Cardinality</strong></p><p>Driver IDs and ZIP codes contain many unique values. Handling them with traditional One-Hot Encoding can increase dimensionality.</p><p><strong>2. Target Leakage</strong></p><p>Target Encoding can introduce leakage when the target information of a training observation is used to calculate its own encoded value.</p><p>I addressed this by using out-of-fold encoding for training observations.</p><p><strong>3. Unseen Categories</strong></p><p>Some categories may appear in the test dataset but not in the training dataset. These require suitable fallback values.</p><p><strong>4. Rare Categories</strong></p><p>Categories with very few observations can produce unreliable target estimates. Smoothed Target Encoding helped reduce this issue.</p><p><strong>5. Model Evaluation</strong></p><p>I learned that accuracy can be misleading when a dataset contains imbalanced classes. Comparing ROC-AUC alongside accuracy provides a better understanding of model performance.</p><p>Overall, this experiment helped me understand that selecting an encoding technique requires more than simply converting categorical values into numbers. It requires understanding the dataset, preventing leakage, handling rare categories, and evaluating actual model performance.</p><h3>8. Conclusion</h3><p>In this comparative study, I implemented and evaluated eight different high-cardinality categorical encoding techniques using a Ride-Hailing dataset.</p><p>Among all the approaches, <strong>Smoothed Target Encoding with LightGBM achieved the best ROC-AUC score of 0.7174</strong>.</p><p>Target / Mean Encoding achieved the highest accuracy of 0.8396.</p><p>The experiment demonstrated that encoding techniques behave differently depending on the dataset and the relationship between categorical features and the target variable.</p><p>There is no single encoding technique that works best for every machine learning problem.</p><p>The most important takeaway from this experiment is that <strong>encoding selection should be based on actual experimentation, proper preprocessing, and meaningful evaluation metrics rather than assumptions.</strong></p><h3>9. References</h3><p>The following documentation was referred to while implementing the experiments:</p><ol><li><a href="https://scikit-learn.org/stable/modules/preprocessing.html">Scikit-learn Documentation</a></li><li><a href="https://lightgbm.readthedocs.io/">LightGBM Documentation</a></li><li><a href="https://xgboost.readthedocs.io/en/stable/tutorials/categorical.html">XGBoost Categorical Data Tutorial</a></li><li><a href="https://pandas.pydata.org/docs/user_guide/categorical.html">Pandas Categorical Data Documentation</a></li></ol><p><em>This article presents my implementation, experimental comparison, and learnings from studying different high-cardinality categorical encoding techniques.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=548ec936147b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding the Foundations of Machine Learning]]></title>
            <link>https://medium.com/@dingariuttam/understanding-the-foundations-of-machine-learning-eac0f49b0de3?source=rss-ff595e644f2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/eac0f49b0de3</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Dingariuttam]]></dc:creator>
            <pubDate>Fri, 30 Oct 2026 05:33:41 GMT</pubDate>
            <atom:updated>2026-10-31T05:14:01.833Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ClZsMPZnUTaKgCIvq6LSIw.png" /></figure><h3><strong>Section 1: The Evolution of Machine Learning</strong></h3><h3>1.Rule-Based Programming and Its Limitations</h3><p>What is rule-based programming?</p><p>Rule-based programming is a traditional programming approach in which developers manually write instructions and conditions to make a computer perform a particular task.</p><p>It follows the principle:</p><p>- Input + Rules = Output</p><p>Example: Email spam detection</p><p>Suppose we want to identify spam emails. In traditional programming, we write rules such as:</p><ul><li>If an email contains the word “Win Money”, mark it as spam.</li><li>If an email contains too many links, mark it as suspicious.</li><li>If the sender is unknown, check the email carefully.</li></ul><p>Limitations:</p><ol><li>Developers must manually create rules.</li><li>It cannot easily handle new or unknown situations.</li><li>Managing thousands of rules becomes difficult.</li><li>It cannot automatically improve from experience.</li><li>Complex real-world problems are difficult to solve using fixed rules.</li></ol><h3>2. The Evolution and Need for Machine Learning</h3><p>Machine Learning evolved because traditional programming could not handle every complex problem using manually written rules.</p><p>Instead of programming every instruction, we allow computers to learn patterns from data.</p><p>Example: Face Recognition</p><p>In traditional programming, developers would need to define rules for identifying eyes, noses, faces, and other features.</p><p>With Machine Learning, we provide thousands of face images to a model. It learns patterns and uses them to recognize faces in new images.</p><p>Why do we need Machine Learning?</p><ul><li>To process large amounts of data.</li><li>To identify hidden patterns.</li><li>To make predictions.</li><li>To automate complex tasks.</li><li>To improve performance using experience and data.</li></ul><p>Traditional Programming vs Machine Learning</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*D_D-fSiBgsBXnnRX9NyXiA.png" /></figure><h3>3. The Role of Data Analysis in Building ML Models Learn</h3><p>Data is the foundation of Machine Learning. Before building a model, we must understand and analyse the available data.</p><p>Data analysis helps us identify patterns, missing values, errors, and relationships between variables.</p><p>Important steps:</p><ol><li>Data Collection — Collect information from databases, websites, sensors, etc.</li><li>Data Cleaning — Remove duplicate records and handle missing or incorrect values.</li><li>Exploratory Data Analysis (EDA) — Understand data using statistics, graphs and charts.</li><li>Feature Selection — Identify the most useful variables for prediction.</li><li>Data Preprocessing — Convert data into a suitable format for Machine Learning.</li></ol><p>Example: Predicting house prices.</p><p>We collect information about:</p><ul><li>House size</li><li>Number of bedrooms</li><li>Location</li><li>Age of the building</li><li>Previous selling prices</li></ul><p>By analysing this data, we understand which factors influence house prices.</p><h3><strong>Section 2: Understanding How ML Models Learn</strong></h3><h3>1. Parametric and Non-Parametric Models</h3><p>These are two approaches used by Machine Learning algorithms to learn from data.</p><p>Parametric Models</p><p>Parametric models assume a particular mathematical structure and learn a fixed number of parameters during training.</p><p>Example: Linear Regression.</p><p>The equation is:</p><p>[ y = mx + c ]</p><p>Here:</p><ul><li>y = Predicted output</li><li>x = Input</li><li>m = Slope</li><li>c = Intercept</li></ul><p>The model learns the values of m and c from training data.</p><p>Other examples:</p><ul><li>Logistic Regression</li><li>Naive Bayes</li></ul><p>Non-Parametric Models</p><p>Non-parametric models do not assume a fixed mathematical structure. Their complexity can grow depending on the training data.</p><p>They can learn more flexible patterns.</p><p>Examples:</p><ul><li>K-Nearest Neighbors (KNN)</li><li>Decision Trees</li><li>Random Forest</li></ul><p>Differences</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*fnAxfxpMmUv9KRLXKd1o0Q.png" /></figure><h3>2. Generalization and Memorization</h3><p>Memorization</p><p>Memorization happens when a Machine Learning model remembers the training examples instead of learning general patterns.</p><p>This often leads to overfitting.</p><p>Example:</p><p>A student memorizes answers to 100 questions but cannot answer a slightly different question in the examination.</p><p>Similarly, a model that memorizes training data may perform poorly on new data.</p><p>Generalization</p><p>Generalization means a model learns meaningful patterns from training data and performs well on previously unseen data.</p><p>Example:</p><p>A student understands mathematical formulas and can solve new problems, even if those exact questions were never practised.</p><p>Important concept: Overfitting and Underfitting</p><ul><li>Overfitting: Model performs very well on training data but poorly on new data.</li><li>Underfitting: Model is too simple to understand the patterns in the data.</li><li>Good Fit: Model learns the important patterns and performs well on both training and testing data.</li></ul><h3>3. Rat-and-Food and Pigeon-Superstition Examples</h3><p>These examples explain how learning happens through experience and how patterns can sometimes be misleading.</p><p>Rat-and-Food Example</p><p>Imagine a rat inside a maze. Initially, it moves randomly to find food.</p><p>Whenever it discovers food by following a particular path, it learns from that experience. After repeated attempts, it starts choosing the successful path more frequently.</p><p>This demonstrates learning through experience, feedback and rewards.</p><p>It is related to the basic idea of Reinforcement Learning.</p><p>Pigeon-Superstition Example</p><p>Imagine a pigeon receiving food at random intervals. By chance, it performs a particular action, such as turning around, just before receiving food.</p><p>The pigeon may start repeating that action, believing it causes the food to appear.</p><p>This demonstrates how an animal can mistakenly associate unrelated events.</p><p>Key lesson: Not every pattern found in data represents a meaningful relationship. Machine Learning models must learn genuine patterns rather than misleading correlations.</p><h3><strong>Section 3: Types of Machine Learning</strong></h3><p>There are four major approaches you need to explain.</p><h3>1. Supervised Learning</h3><p>Supervised Learning is a type of Machine Learning in which a model learns from labelled data.</p><p>Labelled data means that each training example has an input and its correct output.</p><p>How it works:</p><ol><li>Collect labelled data.</li><li>Provide the data to the model.</li><li>The model makes predictions.</li><li>Compare predictions with actual answers.</li><li>Adjust the model to reduce errors.</li><li>Test it using new data.</li></ol><p>Example: House Price Prediction</p><p>We provide the model with house sizes and their actual selling prices.</p><p>After training, it learns the relationship and predicts the price of a new house.</p><p>Applications:</p><ul><li>Email spam detection</li><li>House price prediction</li><li>Disease detection</li><li>Credit risk prediction</li></ul><h3>2. Unsupervised Learning</h3><p>Unsupervised Learning uses data without predefined labels.</p><p>The model tries to identify hidden patterns, similarities and groups within the data.</p><p>Example: Customer Segmentation</p><p>An e-commerce company has thousands of customers.</p><p>It uses Unsupervised Learning to group customers based on:</p><ul><li>Shopping frequency</li><li>Purchase history</li><li>Spending habits</li></ul><p>The company can identify different customer groups and create suitable marketing strategies.</p><p>Common algorithms:</p><ul><li>K-Means Clustering</li><li>Hierarchical Clustering</li><li>PCA</li></ul><p>Applications:</p><ul><li>Customer segmentation</li><li>Anomaly detection</li><li>Market research</li><li>Grouping similar documents</li></ul><h3>3. Reinforcement Learning</h3><p>Reinforcement Learning is a learning approach in which an agent learns by interacting with an environment and receiving rewards or penalties.</p><p>How it works:</p><ol><li>Agent takes an action.</li><li>Environment responds.</li><li>Agent receives a reward or penalty.</li><li>Agent learns from the feedback.</li><li>It improves its future decisions.</li></ol><p>Example: Self-driving cars in simulation</p><p>A simulated driving agent learns to navigate roads by receiving rewards for safe driving and penalties for collisions or unsafe actions.</p><p>Other applications:</p><ul><li>Robotics</li><li>Game-playing AI</li><li>Traffic signal optimization</li><li>Autonomous systems</li></ul><h3>4. Self-Supervised Learning</h3><p>Self-Supervised Learning is an approach where a model learns from data by creating its own learning targets from the data itself.</p><p>It does not require humans to manually label every training example.</p><p>Example: Predicting Missing Words</p><p>Consider this sentence:</p><p>“Machine Learning helps computers to _____ from data.”</p><p>A model is trained to predict the missing word.</p><p>By solving many such tasks, it learns language patterns and relationships between words.</p><p>Applications:</p><ul><li>Large Language Models</li><li>Image representation learning</li><li>Speech recognition</li><li>Natural Language Processing</li></ul><p>Comparison of Four Learning Types</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*JsIyKQVXFwcizqdsaKS5_A.png" /></figure><h3><strong>Section 4: Types of ML Problems</strong></h3><h3>1. Classification</h3><p>Classification is a Machine Learning problem in which the model predicts a category or class.</p><p>The output is a label rather than a continuous numerical value.</p><p>Examples:</p><ul><li>Email: Spam or Not Spam</li><li>Medical diagnosis: Positive or Negative</li><li>Image recognition: Cat, Dog or Bird</li><li>Loan application: Approved or Rejected</li></ul><p>Types of Classification:</p><ol><li>Binary Classification — Two possible categories.</li><li>Multi-Class Classification — More than two categories.</li><li>Multi-Label Classification — One input can belong to multiple categories.</li></ol><p>Common algorithms:</p><ul><li>Logistic Regression</li><li>Decision Tree</li><li>Random Forest</li><li>Support Vector Machine</li></ul><h3>2. Regression</h3><p>Regression is a Machine Learning problem in which a model predicts a continuous numerical value.</p><p>Examples:</p><ul><li>Predicting house prices.</li><li>Predicting monthly sales.</li><li>Forecasting temperature.</li><li>Estimating employee salaries.</li></ul><p>Common algorithms:</p><ul><li>Linear Regression</li><li>Decision Tree Regression</li><li>Random Forest Regression</li></ul><h3>3. Classification vs Regression</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*a0t9XJJAT1ynImWDZiPOMg.png" /></figure><h3><strong>Section 5: Machine Learning in the Real World</strong></h3><p>Machine Learning is used in almost every major industry. It helps organizations automate tasks, analyse information and make better decisions.</p><h3>1. Healthcare</h3><p>Machine Learning helps doctors analyse medical information and identify possible health problems.</p><p>Applications:</p><ul><li>Detecting abnormalities in X-rays and MRI scans.</li><li>Predicting disease risks.</li><li>Analysing patient records.</li><li>Supporting drug discovery.</li></ul><p>Example: ML models can assist radiologists in identifying suspicious patterns in medical images.</p><h3>2. Finance and Banking</h3><p>Financial institutions use Machine Learning to improve security and analyse financial transactions.</p><p>Applications:</p><ul><li>Fraud detection.</li><li>Credit risk assessment.</li><li>Loan approval support.</li><li>Stock market analysis.</li><li>Customer spending analysis.</li></ul><p>Example: If a customer’s card suddenly makes an unusual transaction, an ML model can flag it for further verification.</p><h3>3. E-Commerce</h3><p>Online shopping platforms use Machine Learning to understand customer behaviour.</p><p>Applications:</p><ul><li>Product recommendations.</li><li>Customer behaviour analysis.</li><li>Demand forecasting.</li><li>Price optimization.</li><li>Inventory management.</li></ul><p>Example: An online shopping platform recommends products based on your previous searches and purchases.</p><h3>4. Education</h3><p>Machine Learning helps make education more personalized.</p><p>Applications:</p><ul><li>Personalized learning recommendations.</li><li>Student performance prediction.</li><li>Automated evaluation.</li><li>Identifying students who need additional support.</li></ul><p>Example: An online learning platform can recommend easier or more advanced lessons depending on a student’s performance.</p><h3>5. Agriculture</h3><p>Machine Learning supports farmers in making better agricultural decisions.</p><p>Applications:</p><ul><li>Crop disease detection.</li><li>Weather prediction.</li><li>Soil analysis.</li><li>Crop yield prediction.</li><li>Smart irrigation.</li></ul><p>Example: An image recognition model can analyse leaf images and help identify possible crop diseases.</p><h3>6. Recommendation Systems</h3><p>Recommendation systems analyse user interests and behaviour to suggest relevant content or products.</p><p>Applications:</p><ul><li>Movie recommendations.</li><li>Music recommendations.</li><li>Social media feeds.</li><li>Product suggestions.</li><li>Video recommendations.</li></ul><p>Example: Streaming platforms recommend movies based on viewing history, ratings and similar users’ interests.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eac0f49b0de3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>