8.4.1 decision Tree (decision Trees)

Source: Internet
Author: User

8.4.1 decision Tree (decision Trees)

Decision trees are one of the most popular algorithms in machine learning that can be used to make decisions based on data, or to classify inputs into different categories. The algorithm uses a tree to describe which properties of the data should be tested and what to do with each possible answer. Responses to answers can be either another test or a final answer.

Machine learning theory provides a sophisticated method for automating the generation of trees from data, but for our example, we will create the tree manually. Figure 8.3 shows the decision tree for our problem.


Figure 8.3 Check the decision tree for the loan; each diamond represents a problem, and a link is a possible answer to another question or conclusion (rectangle).

We will implement the F # version first. In F #, writing code is usually easy, and if our problem has an informal specification, here is the data structure to be processed. The specification of a decision tree might look like this:

Decision Tree

The decision tree is defined by the initial query, which forms the root of the tree. A query consists of the name of the test and the function that executes it, and you can return several possible answers. In our implementation, we will limit the answer to true or false. For each answer, the node may also contain a link to the next query, or the final decision of the path through the tree.

With this specification, we can start writing F # code. Before we see how to implement the key parts of this problem in C #, we want to demonstrate how easy it is to rewrite the F # specification like this.

8.4.1 decision Tree (decision Trees)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.