public void TestC45()
        {
            var c45                  = new C45();
            var c45Parameter         = new C45Parameter(1, true, 0.2);
            var discreteToContinuous = new DiscreteToContinuous(car);

            discreteToContinuous.Convert();
            c45.Train(car.GetInstanceList(), c45Parameter);
            Assert.AreEqual(29.98, 100 * c45.Test(car.GetInstanceList()).GetErrorRate(), 0.01);
            discreteToContinuous = new DiscreteToContinuous(tictactoe);
            discreteToContinuous.Convert();
            c45.Train(tictactoe.GetInstanceList(), c45Parameter);
            Assert.AreEqual(34.66, 100 * c45.Test(tictactoe.GetInstanceList()).GetErrorRate(), 0.01);
        }
        public void TestC45()
        {
            var c45          = new C45();
            var c45Parameter = new C45Parameter(1, true, 0.2);
            var laryToBinary = new LaryToBinary(car);

            laryToBinary.Convert();
            c45.Train(car.GetInstanceList(), c45Parameter);
            Assert.AreEqual(10.76, 100 * c45.Test(car.GetInstanceList()).GetErrorRate(), 0.01);
            laryToBinary = new LaryToBinary(tictactoe);
            laryToBinary.Convert();
            c45.Train(tictactoe.GetInstanceList(), c45Parameter);
            Assert.AreEqual(16.08, 100 * c45.Test(tictactoe.GetInstanceList()).GetErrorRate(), 0.01);
            laryToBinary = new LaryToBinary(nursery);
            laryToBinary.Convert();
            c45.Train(nursery.GetInstanceList(), c45Parameter);
            Assert.AreEqual(24.95, 100 * c45.Test(nursery.GetInstanceList()).GetErrorRate(), 0.01);
        }
Пример #3
0
        public void TestC45()
        {
            var c45               = new C45();
            var c45Parameter      = new C45Parameter(1, true, 0.2);
            var discreteToIndexed = new DiscreteToIndexed(car);

            discreteToIndexed.Convert();
            c45.Train(car.GetInstanceList(), c45Parameter);
            Assert.AreEqual(10.76, 100 * c45.Test(car.GetInstanceList()).GetErrorRate(), 0.01);
            discreteToIndexed = new DiscreteToIndexed(tictactoe);
            discreteToIndexed.Convert();
            c45.Train(tictactoe.GetInstanceList(), c45Parameter);
            Assert.AreEqual(16.08, 100 * c45.Test(tictactoe.GetInstanceList()).GetErrorRate(), 0.01);
            discreteToIndexed = new DiscreteToIndexed(nursery);
            discreteToIndexed.Convert();
            c45.Train(nursery.GetInstanceList(), c45Parameter);
            Assert.AreEqual(24.95, 100 * c45.Test(nursery.GetInstanceList()).GetErrorRate(), 0.01);
        }
Пример #4
0
        public void TestTrain()
        {
            var c45          = new C45();
            var c45Parameter = new C45Parameter(1, true, 0.2);

            c45.Train(iris.GetInstanceList(), c45Parameter);
            Assert.AreEqual(4.67, 100 * c45.Test(iris.GetInstanceList()).GetErrorRate(), 0.01);
            c45.Train(bupa.GetInstanceList(), c45Parameter);
            Assert.AreEqual(42.03, 100 * c45.Test(bupa.GetInstanceList()).GetErrorRate(), 0.01);
            c45.Train(dermatology.GetInstanceList(), c45Parameter);
            Assert.AreEqual(6.28, 100 * c45.Test(dermatology.GetInstanceList()).GetErrorRate(), 0.01);
            c45.Train(car.GetInstanceList(), c45Parameter);
            Assert.AreEqual(21.35, 100 * c45.Test(car.GetInstanceList()).GetErrorRate(), 0.01);
            c45.Train(tictactoe.GetInstanceList(), c45Parameter);
            Assert.AreEqual(19.94, 100 * c45.Test(tictactoe.GetInstanceList()).GetErrorRate(), 0.01);
            c45.Train(nursery.GetInstanceList(), c45Parameter);
            Assert.AreEqual(29.03, 100 * c45.Test(nursery.GetInstanceList()).GetErrorRate(), 0.01);
        }