<?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 Lucas Greenwell on Medium]]></title>
        <description><![CDATA[Stories by Lucas Greenwell on Medium]]></description>
        <link>https://medium.com/@lucasgreenwell15?source=rss-90a6afd870dd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*TJMuoh2JokkAVX7P2oSegg.jpeg</url>
            <title>Stories by Lucas Greenwell on Medium</title>
            <link>https://medium.com/@lucasgreenwell15?source=rss-90a6afd870dd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 09:56:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lucasgreenwell15/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[Intro to Decision Trees for Computer Science Students]]></title>
            <link>https://medium.com/@lucasgreenwell15/intro-to-decision-trees-for-computer-science-students-671d3093a531?source=rss-90a6afd870dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/671d3093a531</guid>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[binary-tree]]></category>
            <category><![CDATA[decision-tree]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Lucas Greenwell]]></dc:creator>
            <pubDate>Thu, 30 Jul 2020 18:28:43 GMT</pubDate>
            <atom:updated>2020-07-30T23:12:06.728Z</atom:updated>
            <content:encoded><![CDATA[<p>Quick Overview of what’s here:</p><ul><li>What Are Decision Trees?</li><li>Where you’ve already seen Decision Trees</li><li>Advantages of Decision Trees</li><li>Disadvantages of Decision Trees</li><li>Where Decision Trees are used in industry</li><li>How Decision Trees are used in machine learning today</li><li>Deciding the optimal split</li><li>Pruning a Decision Tree</li></ul><h3>What are Decision Trees?</h3><p>Decision Trees are a kind of machine learning algorithm that can help with a wide variety of tasks. There are two kinds of Decision Trees. Classification trees help you group items categorically such as grouping all of the passengers on the titanic into categories of “Survived” or “Didn’t Survive”. Regression trees help you predict a specific number along a continuous span, such as deciding a credit score based on an individual’s history and behaviour.</p><p>Decision Trees are a basic model used for both classification and regression. This means that given some training data to practice with, they can predict specific features about new data. One common classic machine learning example is predicting whether or not passengers on the Titanic will survive or not. The challenge is to be given a spreadsheet of the passengers data and produce a Decision Tree that accurately predicts whether or not a passenger that wasn’t in the original data will survive the journey or not.</p><p>Decision Tree made from the Titanic dataset</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2PJ8bBI8OL55F13f" /></figure><h3>Where You’ve seen Decision Trees before</h3><p>If you’re familiar with computer science fundamentals or data structures, then you’re probably thinking that this looks a lot like a Binary Search Tree . And that’s perfect! You see, Binary Search Trees are nothing but a type of Decision Tree. The decision that you’re making at each node is a very simple one: is the number that you’re searching for/inserting a larger or a smaller number than the node that you’re currently on. If it’s a larger number then you go to the right, if it’s a smaller number then you go to the left.</p><p>All the other convenient tricks that you know about Binary Search Trees still apply to Decision Trees too. You can still perform both search and insertion in logarithmic time because you’re able to remove about half of the search space each iteration. You can also carry over a lot of your Binary Search Tree vocab to Decision Trees. “Branches” means the same thing: a subtree that could be considered a complete tree in some cases. Nodes also means the same thing, though in Decision Trees nodes usually hold only a question rather than any data. And leaves, or terminal nodes, are still the end of the tree, but in Decision Trees they hold the final prediction or classification of the model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HY0teXOHnmsO1MfN" /></figure><p>Another place that you might have seen a Decision Tree is in a Choose Your own Adventure Book or movie. Many video games also take this style of game behind the scenes. It’s very simple to represent any plot with multiple endings in a Decision Tree. In fact, a lot of things that don’t look like they have a tree structure at first can actually be represented in some kind of treelike architecture after only a little bit of wrangling.</p><h3>Advantages of Decision Trees</h3><p>It’s also quick and easy to represent if-then logic or switch statements in this way. If you think about each if-statement as a node asking a question and then the inner code block being the next node on the tree. If you’ve ever heard machine learning called “infinite if logic” or something similar, it was probably because of Decision Trees.</p><p>There are a lot of advantages to using Decision Tree algorithms to solve machine learning problems. The biggest is how computationally efficient they are compared to other machine learning solutions, especially artificial neural networks. Decision Trees perform in logarithmic time for both search and insertion. The speed with which you can train a Decision Tree will vary based on the function used, but it will never come near the massive compute time necessary for training a deep neural network.</p><p>Another huge advantage of Decision Trees over neural networks, the standard state of the art machine learning model, is in how transparent the prediction process is. For communicating your findings to stakeholders and explaining the model to anyone without technical expertise, a Decision Tree is a quick and safe bet. Neural networks famously work with a “black box” model, meaning that it’s unclear what exactly causes a decision to be made. In contrast, Decision Trees are transparent the entire time and can even have a specific step isolated and analysed. This is especially important if a Decision Tree is being used in hiring or in a financial loan setting because these practices are required by law to be transparent about their decision making.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*n836XXgxkVlQbKLm" /></figure><h3>Disadvantages of Decision Trees</h3><p>Basically Decision Trees have two big advantages over other machine learning algorithms. They are vastly more computationally efficient, leaving neural networks in the dust. And they’re extremely easy to explain, even to someone without any technical background. So why would anyone use neural networks? The two things that machine learning is always chasing, generality and accuracy. While they have plenty of use cases in the real world, Decision Trees trail neural networks both in how accurately they can be tuned, and how they will generalize to new data and new problems.</p><p>With generality Decision Trees often suffer from a problem called overfitting. This is where a Decision Tree essentially learns the dataset too well and isn’t able to be applied to new data. There are a variety of methods designed to counteract overfitting called “pruning”. Even with proper pruning measures, many Decision Trees are unable to be applied to new data as they have simply learned the “noise” in the training data and are not useful models on new samples.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FnnNdQ4xBTHw8LM0" /></figure><p>The Green line is a classic example of overfitting, the black line is the ideal model ^</p><p>Decision Trees are also unable to achieve the level of accuracy that neural networks do and are therefore unsuitable for certain tasks that require a high degree of accuracy. For example, a Decision Tree would be a completely improper algorithm for a self driving car or a surgical robot, the degree of error is far too high. Decision Trees are not a very robust algorithm either, meaning that small changes in the training data can cause large changes in the final model.</p><h3>Where Decision Trees are used in industry</h3><p>Decision Trees are used all over in the finance and insurance industries. For years, the cutting edge in algorithmic trading was powered by decision trees. Financial traders would make massive numbers of decision trees in order to maximize their earnings and minimize risks in the stock market. Credit scores are an example of a regression based decision tree. Instead of outputting a specific category such as “Loanable” or “Bad Credit Guy” they output a number along a continuous range, in this case from 300–850.</p><p>Decision Trees can also be used to help guide human behaviour. At some point you’ve probably seen a Decision Tree in a training manual or textbook that you were supposed to follow. Helping humans make better decisions is a huge application of Decision Trees and you can see it widespread in the customer service and medical fields where expert designed Decision Trees dictate nearly all employee behaviour.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YTxnaji-JQ7IDC2M" /></figure><p>Predictive hiring is a style of hiring employees that are predicted to perform well according to statistical tests and machine learning models. This is one of the bigger picture ways that Decision Trees are being used and will affect you directly. Some of the other places that Decision Trees are being used to make really big decisions åre in government, military, and corporations. All three of these groups rely on various machine learning models to help generate strategy and competitive edge. Many intelligence, conflict, and trade choices are made with the aid of a statistically produced Decision Tree.</p><h3>How Decision Trees are used in machine learning</h3><p>In the real world a single Decision Tree isn’t a very useful prediction model. As we discussed earlier, trees are prone to overfitting or low accuracy. Out in the wild, you’re much more likely to use a random forest. A random forest is a machine learning model made up of a ton of Decision Trees! Obviously if you made all the trees in the forest out of the same data, you’d just have a bunch of copies of the same tree. To deal with this, a random selection of columns is made from the dataset each time that a tree is made, this is where we get the Random part of the name. By combining a large number of Decision Trees that are similar in nature but slightly different, we can create a much more accurate and general model than with a single tree.</p><p>We’re able to algorithmically produce effective Decision Trees when given a training dataset. When trying to reason about the algorithm for creating the optimal Decision Tree given a dataset, it is often helpful to remember the algorithm for producing a Binary Search Tree. The main differences between the algorithm for creating a Binary Search Tree and a Decision Tree are that you do not need to store data in each node but rather a function determining whether you should continue to the right or to the left and also that you must calculate what function you would like to store at each step. In other words, we’re just making a Binary Search Tree but at each node we have to calculate “what question do we ask at this node”.</p><h3>Deciding the optimal split</h3><p>Think about that for a second because it’s not immediately clear how complicated the request is. How do you really figure out which question to ask at each level in order to produce the most accurate model? It turns out that there’s four ways to do it mathematically. Two of them are only useful in Regression Trees, the kind of tree that outputs a number within a range rather than a classification. The other two are called Information Gain and Gini Impurity.</p><p>Information Gain is an algorithm that relies on measuring the entropy of a system after a split. Entropy can be described as the amount of information gain or “surprise” in the different outcomes. Essentially when using Information Gain you measure how much all possible splits decreased entropy and pick the best one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IAmO8JEb9jOKKwEBUa2uqw.png" /></figure><p>Gin Impurity relies on the same concept of trying all the different possible splits and picking the best one. The only difference is that instead of measuring entropy within the split dataset you’re measuring the Gini Index, a different measure for how mixed up a sample is. A sample would have a Gini Index of 0.0 if it only had one prediction value throughout the sample and it would have a Gini Index of 1.0 if the samples were completely random.</p><blockquote>Gini Index = proportion1(1 — proportion1) + proportion2(1 — proportion2) + … proportionN(1 — proportionN)</blockquote><h3>Pruning a Decision Tree</h3><p>When making a Decision Tree, it’s critical to perform proper pruning. Pruning is the process of trying to reduce overfitting and noise learning in your model. There are two types of pruning, prepruning and postpruning. Prepruning involves setting limitations on how your tree can grow, such as setting a maximum depth. Postpruning is the process of taking your model after it’s been completed and testing it on data that it wasn’t trained on. You then remove any branches that caused a negative prediction rate compared to their parent branches.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h_pC5pye4LC-WcEdggK6Mw.png" /></figure><p>It can often be useful to set some limitations on how your tree grows and can also help cut down on the amount of hands on work you have to do because, unlike postpruning, prepruning is automated. Setting a max depth on trees is very common and this can be a very effective way to help prevent overfitting. However, if the max depth is too shallow then you end up underfitting and trading too much accuracy for simplicity.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=671d3093a531" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is linguistics and how can it help me in the tech sector?]]></title>
            <link>https://medium.com/@lucasgreenwell15/what-is-linguistics-and-how-can-it-help-me-in-the-tech-sector-e7823268f501?source=rss-90a6afd870dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7823268f501</guid>
            <category><![CDATA[linguistics]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[nlp]]></category>
            <dc:creator><![CDATA[Lucas Greenwell]]></dc:creator>
            <pubDate>Tue, 30 Jun 2020 00:17:30 GMT</pubDate>
            <atom:updated>2020-06-30T00:17:30.465Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is linguistics and how can it help me in the tech industry?</h3><p>Linguistics is the overarching study of human language and its structure. This obviously makes it a giant science that must be subdivided into a few different fields. Some of the subfields of linguistics include syntax, morphology, phonetics, and historical linguistics. Some of the phenomena being explored by linguists include second language acquisition, speech formation in young children, and creating accurate dictionaries. And it might have a lot more applications to the technology industry than you can see right off the bat.</p><p>The biggest example of how linguistics and computer science are fusing is in the field of Natural Language Processing(NLP). This is a subfield of Artificial Intelligence and Big Data processing that can be loosely thought of as how to teach language to computers. Since the vast majority of data in our possession is in unstructured language form, the field of Natural Language Processing has been exploding right alongside the Big Data boom. While NLP is a huge passion of mine, it involves a lot of nitty gritty that I don’t want to fit here so I’ll mostly be focusing on ways that classical (non-computational) linguistics can be applied to the tech industry in this article. Let’s get into it.</p><p>As a programmer, I regularly have to pick up unfamiliar programming languages and libraries. Applying some thought to how these languages break down has helped me to cut down my ramp up time by a significant amount. Things to focus on when trying to analyze a programming language linguistically: what style of syntax does this language use? How important is punctuation? How can you remember what each punctuation mark represents in this language? What patterns can you see from other languages that are represented in this new language? What are the patterns you see in this language’s community?</p><p>Another thing that I bring from linguistics into approaching programming is from linguistic research tenets. There is a clear distinction, made by linguists, between prescriptive and descriptive statements regarding language. When writing technical documentation and communicating with the members of a technical community, it is usually more productive to list the various ways that a task CAN BE accomplished as opposed to how a particular problem SHOULD BE solved.</p><p>Linguistics can also aid accessibility for technical products in a great variety of ways. Linguistics can aid in bringing your product to your users who have visual or auditory impairments by allowing you to focus on how your content translates between spoken, written, and signed language. As more and more products are using all of these possibilities to deliver their content, keeping in mind how to provide consistent language across your platforms is vital.</p><p>Along similar lines is addressing the scalability caps that you run into before translating your product into additional languages. Understanding how to effectively translate both the language and the culture of your products can open your product up to potentially millions or even billions of new users. Having effective systems in place to translate both existing products and future features to your various target audiences is vital to maintaining an international presence.</p><p>I hope this article shed some light on what linguistics is and how it can be useful to you in a great variety of roles throughout the tech industry. Keep an eye out for my next article where I’ll be discussing some exciting developments in the field of Natural Language Processing!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7823268f501" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>