<?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 Shehr Bano on Medium]]></title>
        <description><![CDATA[Stories by Shehr Bano on Medium]]></description>
        <link>https://medium.com/@shehrrbano?source=rss-10351e51ffdb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*mfGDILixq9ytzzwjdMpJbg.jpeg</url>
            <title>Stories by Shehr Bano on Medium</title>
            <link>https://medium.com/@shehrrbano?source=rss-10351e51ffdb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 20:35:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shehrrbano/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[Introduction to Machine Learning]]></title>
            <link>https://medium.com/@shehrrbano/introduction-to-machine-learning-e0fdb27e6baa?source=rss-10351e51ffdb------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0fdb27e6baa</guid>
            <dc:creator><![CDATA[Shehr Bano]]></dc:creator>
            <pubDate>Wed, 31 Jul 2024 13:40:33 GMT</pubDate>
            <atom:updated>2024-08-01T04:58:36.512Z</atom:updated>
            <content:encoded><![CDATA[<p>Before immersing ourselves into the specifics of machine learning, let us understand what the term “Machine Learning” means. Machine learning is a technology that enables computers to learn from data and make decisions or predictions based on that learning, without the need to be programmed explicitly for every single task.</p><h3><strong>Decision Trees</strong></h3><p>Now, let us explore one of the important models in machine learning: the Decision Tree. As the name shows, this model is designed to help make decisions. While there are more highly developed models that can deliver more correct predictions, decision trees are great models to start with because they are to the point and easy to understand. Additionally, they serve as the building blocks for some of the most powerful models in data science.</p><blockquote><strong><em>The Working of Decision Trees</em></strong></blockquote><p>In a decision tree, datasets are split into groups using. For example, when foretelling house prices, a decision tree might divide houses into diverse groups based on characteristics like size or location. Each split in the tree helps improve the prediction, targeting to group houses that share similar characteristics.</p><p>This method of using data to enhance predictions is known as <strong>fitting</strong> or <strong>training</strong> the model. The dataset used for this process is called the <strong>training data</strong>.</p><blockquote><strong><em>Training Data: An Introduction</em></strong></blockquote><p>In machine learning, the <strong>training data</strong> is the dataset used to train the model on how to make predictions or decisions. It has an input data coupled with known outcomes or labels, allowing the model to learn the link between the two. This process of teaching the model is called <strong>training</strong>.</p><blockquote><strong><em>Making Predictions</em></strong></blockquote><p>When the decision tree model has been trained, it can be implemented to new data to predict outcomes, such as the price of added homes. More modern decision trees have various splits and are referred to as <strong>deeper</strong> trees. These deeper trees can collect more complex patterns but can also become more tough to clarify.</p><p>At the bottom of the tree, where predictions are made, we find what are known as <strong>leaves</strong>. The splits in the tree and the values at the leaves are decided by the training data.</p><h3><strong>Understanding Decision Trees: Balancing Overfitting and Underfitting</strong></h3><p>While building a decision tree, one of the notable features to consider is the tree’s depth, which decides how many splits the data encounter before reaching a final prediction. Think of a tree where each split divides the data into smaller and smaller groups. A tree having 1 split generates 2 groups, with 2 splits it generates 4 groups, and so on. When you reach 10 splits, you could end up with 1024 diverse groups or leaves.</p><blockquote><strong><em>Deep Trees and Overfitting</em></strong></blockquote><p>As the tree extends deeper, it becomes extremely specific to the training data, creating many groups or leaves with fewer data points each. This can lead to overfitting. In overfitting, the tree behaves remarkably well on the training data but poorly on new, unseen data. This occurs because the model becomes too adapted to the training data, capturing noise and spurious patterns that do not conclude well.</p><blockquote><strong><em>Shallow Trees and Underfitting</em></strong></blockquote><p>Conversely, a very shallow tree makes comprehensive generalizations, grouping the data into only a few large leaves. This may result in underfitting, where the model does not gather key patterns and distinctions in the data. As a result, the predictions are inaccurate on the training and new data.</p><blockquote><strong><em>Finding the Right Balance</em></strong></blockquote><p>The aim is to find a tree depth that balances these extremes. You want a tree that is deep enough to gather meaningful patterns but not so deep that it overfits the training data. This balance is gained by using validation data to test the model’s performance. The sweet spot is where the model acts well on both the training data and the validation data, showing that it has generalized well and abstained both overfitting and underfitting.</p><p>In short, to build an adequate decision tree, it is important to manage its depth deliberately. Too deep, and you will risk overfitting; too shallow, and you will risk underfitting. Utilizing validation data helps in finding that best depth where the model gains the best precision and generalizes well to new data.</p><h3><strong>Enhancing Decision Trees: Why Random Forests Are the Way Forward?</strong></h3><p>When dealing with decision trees, you experience a tough choice. A deep decision tree, with many divisions and leaves, might overfit the data. This shows that it becomes too tailored to the training data, making predictions based on just a few examples, which can accelerate flawed performance with new data. On the other hand, a shallow tree, with fewer divisions, might underfit the data, not gathering vital details and patterns, giving inaccurate predictions.</p><blockquote><strong><em>Enter Random Forests</em></strong></blockquote><p>To address these issues, Random Forests offer a better approach. Instead of using a single decision tree, a Random Forest combines many trees. Each tree makes its own prediction, and then the Random Forest averages these predictions. This method provides much better accuracy than any single tree on its own.</p><blockquote><strong><em>Advantages of Random Forests</em></strong></blockquote><p>1. <strong>Improved Accuracy:</strong> By averaging predictions from multiple trees, Random Forests reduce the errors that a single tree might make. This results in better performance, even with default settings.</p><p>2. <strong>Less Tuning Needed:</strong> Random Forests work well without needing extensive adjustments. While fine-tuning can improve results further, the default settings are usually effective.</p><p>In conclusion, decision trees serve as a fundamental building block in machine learning, offering a clear and straightforward method for making predictions. They work by splitting data into groups based on various features, which helps in refining predictions. However, the challenge lies in managing the depth of the tree: too deep and the model risks overfitting to the training data, while too shallow and it may underfit, not capturing key patterns.</p><p>Enter Random Forests, a powerful solution to these issues. By combining multiple decision trees and averaging their predictions, Random Forests enhance accuracy and reduce the likelihood of overfitting. This ensemble approach not only provides more reliable results but also minimizes the need for extensive tuning, making it an effective and user-friendly tool in the machine learning toolkit.</p><p>So, whether you are just starting out or looking to improve your model’s performance, understanding, and applying decision trees and Random Forests can make a significant difference in your machine learning projects.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0fdb27e6baa" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>