Esempio n. 1
0
        public void Can_create_id3_tree()
        {
            var matrix = GetDataSet();

            var tree = DecisionTrees.ID3(matrix, new[] { "A", "B" });

            Assert.IsNotNull(tree);
        }
Esempio n. 2
0
        public void Can_serialize_decision_tree()
        {
            var tree = DecisionTrees.ID3(new Matrix(new Number[, ]
            {
                { 1, 1, 1 },                          // YES
                { 1, 1, 1 },                          // YES
                { 1, 0, 0 },                          // NO
                { 0, 1, 0 },                          // NO
                { 0, 1, 0 },                          // NO
            }), new[] { "A", "B" });

            var json = tree.ToJson();

            AssertValidJson(json);
            Console.WriteLine(json);
        }