AIMA.Test.Core.Unit.Learning.Learners.DecisionTreeTest.createInducedRestaurantDecisionTree C# (CSharp) Метод

createInducedRestaurantDecisionTree() приватный статический Метод

private static createInducedRestaurantDecisionTree ( ) : DecisionTree
Результат AIMA.Core.Learning.Inductive.DecisionTree
        private static DecisionTree createInducedRestaurantDecisionTree()
        {
            // from AIMA 2nd ED
            // Fig 18.6
            // friday saturday node
            DecisionTree frisat = new DecisionTree("fri/sat");
            frisat.addLeaf(Util.YES, Util.YES);
            frisat.addLeaf(Util.NO, Util.NO);

            // type node
            DecisionTree type = new DecisionTree("type");
            type.addLeaf("French", Util.YES);
            type.addLeaf("Italian", Util.NO);
            type.addNode("Thai", frisat);
            type.addLeaf("Burger", Util.YES);

            // hungry node
            DecisionTree hungry = new DecisionTree("hungry");
            hungry.addLeaf(Util.NO, Util.NO);
            hungry.addNode(Util.YES, type);

            // patrons node
            DecisionTree patrons = new DecisionTree("patrons");
            patrons.addLeaf("None", Util.NO);
            patrons.addLeaf("Some", Util.YES);
            patrons.addNode("Full", hungry);

            return patrons;
        }