コード例 #1
0
ファイル: Program.cs プロジェクト: mgltorsa/FeelSoft
        public static void Test()
        {
            setUpStage1();
            int[][] input =
            {
                new int[] { 6, 180, 12 }, //
                new int[] { 4, 190, 11 }, //1
                new int[] { 6, 170, 12 }, //1
                new int[] { 7, 165, 10 }, //1
                new int[] { 5, 100,  6 }, //0
                new int[] { 6, 150,  8 }, //0
                new int[] { 4, 130,  7 }, //0
                new int[] { 6, 150,  9 }, //0
            };
            int[]  outp  = { 1, 1, 1, 1, 0, 0, 0, 0 };
            double fail  = analytic.FailTrainig * 100;
            double fail2 = analytic.FailDecided * 100;

            Console.Write(fail + "% Error " + fail2 + "%");
            Console.WriteLine();
            int[] res = analytic.Decided(input);
            for (int i = 0; i < res.Length; i++)
            {
                string resp = "Fail";
                if (outp[i] == res[i])
                {
                    resp = "Yes";
                }
                Console.Write(resp + " " + res[i]);
                Console.WriteLine();
            }
        }
コード例 #2
0
        public void TestMatriz()
        {
            SetupStage1();

            int[][] input =
            {
                new int[] { 6, 130,  8 },
                new int[] { 6, 180, 12 },
                new int[] { 4, 190, 11 }
            };
            int[]  outp    = { 0, 1, 1 };
            double failTra = analytic.FailTrainig;

            Assert.IsTrue(failTra == 0);

            int[] res = analytic.Decided(input);
            for (int i = 0; i < res.Length; i++)
            {
                Assert.IsTrue(outp[i] == res[i]);
                Console.Write("" + res[i]);
            }
        }
コード例 #3
0
ファイル: ManagerData.cs プロジェクト: mgltorsa/FeelSoft
        private double DecidedNaive(List <IPublication> lis)
        {
            double ret = 0;

            foreach (IPublication item in lis)
            {
                int de = naive.Decided(item.LemmatizedMessage.Split(' '));
                if (de == 1)
                {
                    ret++;
                }
            }
            ret = ret / lis.Count;
            return(ret);
        }