示例#1
0
        public void testNumerizesAndDeNumerizesIrisDataSetExample3()
        {
            DataSet   ds    = DataSetFactory.getIrisDataSet();
            Example   first = ds.getExample(100);
            Numerizer n     = new IrisDataSetNumerizer();
            Pair <List <Double>, List <Double> > io = n.numerize(first);

            AssertListsEqual <double>(new List <double>()
            {
                6.3, 3.3, 6.0, 2.5
            }, io.getFirst());
            AssertListsEqual <double>(new List <double>()
            {
                1.0, 0.0, 0.0
            }, io.getSecond());

            String plant_category = n.denumerize(new List <double>()
            {
                1.0, 0.0, 0.0
            });

            Assert.AreEqual("virginica", plant_category);
        }
示例#2
0
        public void testNumerizesAndDeNumerizesIrisDataSetExample2()
        {
            DataSet   ds    = DataSetFactory.getIrisDataSet();
            Example   first = ds.getExample(51);
            Numerizer n     = new IrisDataSetNumerizer();
            Pair <List <Double>, List <Double> > io = n.numerize(first);

            AssertListsEqual <double>(new List <double>()
            {
                6.4, 3.2, 4.5, 1.5
            }, io.getFirst());
            AssertListsEqual <double>(new List <double>()
            {
                0.0, 1.0, 0.0
            }, io.getSecond());

            String plant_category = n.denumerize(new List <double>()
            {
                0.0, 1.0, 0.0
            });

            Assert.AreEqual("versicolor", plant_category);
        }