![]() ![]() On the other hand nailing that it's Iron Man involved quite some luck. We could've for example skipped the question "Did the person appear in a movie?" since it's highly likely that there's a movie about most of the Avengers. One area of improvement we could identify is the way in which our tree is split. Looking at the trees visual representation it's easy to navigate around, gauge how well it might perform and troubleshoot issues which might arise during real-world usage. Given what we've learned so far about Decision Trees, it's easy to see that one of the huge advantages is the models understandability. Therefore a tree can have categorical as well as continuous Edge labels and output types. While this only defines the type of outputs a tree computes there's nothing preventing us from mixing and matching categorical and continuous values in the tree creation phase. An example for continuous values are the real numbers. The Regression Tree is a tree in which outputs can be continuous. The tree we've built above is a classification tree as its output will always yield a result from a category such as "Superheros" or more specifically "Iron Man". The Classification Tree is a tree where the prediction is categorical. Generally speaking there are 2 main Decision Tree models both of which differ in the prediction they produce: While we were playing the game you walked down the tree starting with the root Node at the top, following the Edges and Nodes until you eventually arrived at the Node which had no outgoing Edge: Your prediction. In our case the labels were binary which means that every question can be answered in one of two ways: "Yes" or "No". In our case every Node contained a question such as "Is it a person?" while the Edges contained the respective answers: "Yes" or "No". In the image above we can see that the Decision Tree consists of Nodes and Edges which point from parent Nodes to child Nodes. Let's visualize the Decision Tree you used during the game to better understand how it guided you to the prediction that the character I was thinking about was indeed Iron Man: ![]() In fact you've already built and used a Decision Tree model while we played the game of " Twenty Questions" in the introduction above. A tree-like structure which makes it possible to model decisions and their consequences. Let's dive in! Decision Trees PropertiesĪ Decision Tree is exactly what its name implies. We'll examine their properties, learn how we can ensure that the best tree is constructed given the data we're feeding it and how we can turn this knowledge into code to create our very own Decision Tree classifier which predicts if it's a good idea to practice our swings on the golf course given some data about the current weather conditions. In the following sections we'll take a deep dive into Decision Tree-based Machine Learning models. While this is certainly a contrived example it shows one of the core techniques Decision Trees, the topic of this post, use to construct themselves while "learning" from training data. You: "Is the person you're thinking about Iron Man?" You: "Is the person one of the Avengers?" You: "Has the person you're thinking about superpowers?" You: "Did the person you're thinking about appear in comics?" You: "Is the person you're thinking about a non-fictional character?" You: "Is the subject or object you're thinking about a person?" Since you're the only Questioner you're allowed to continue asking questions even if one of the answers is "No": In this case I'm the Answerer and you're a Questioner. Let's walk through a quick example to see the game in action. The Questioner who successfully guessed the subject or object the Answerer thought about has won and will be the next Answerer. The current Questioner continues to ask questions if her previous question was answered with a "Yes" and has to hand over the question asking to the next Questioner if the current question was answered with a "No". Questions should be asked such that they can only be answered in a "Yes" or "No" fashion. The others (the "Questioners") are encouraged to ask questions about such subject or object. The game starts with one person (the "Answerer") thinking about a subject or object without revealing it. In case you're not familiar with the rules, here's how it works: It's almost certain that anyone of us has played the game of " Twenty Questions" or a variation of it at least once in their lifetime. You can find working code examples (including this one) in my lab repository on GitHub. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |