Beispiel #1
0
        public ExpAccuracy Run()//お手本
        {
            var roundAccLog = L.g("roundacc");

            Initialize();

            //1st step
            PrepareAlgorithm();

            ////////////評価開始:正確性を求める////////////

            double correctRound   = 0;
            double incorrectRound = 0;
            double undeterRound   = 0;

            roundAccLog.WriteLine("<LEARNING> RoundNum: " + RoundNum);

            //LEARNING
            while (!this.LearningIsFinished)
            {
                ///////////////////////////////ラウンドを実行///////////////////////////////

                // このラウンドでの事実bを決める
                Environment.TheFact.randomNext();

                //ラウンドを実行
                var roundResult = ExecRound();

                //////////////////////////////////////////////////////////////////////

                roundAccLog.WriteLine(
                    string.Format("{0}, {1}, {2}, ",
                                  Round,                     //ラウンド番号:すなわち,センサーのランダムのシード
                                  Environment.TheFact.Value, //事実の値
                                  roundResult));             //正解率およびImportanceLevelと推定値の平均
            }

            roundAccLog.WriteLine("***EVALUATION***");

            //EVALUATION
            while (!this.EvaluationIsFinished)
            {
                ///////////////////////////////ラウンドを実行///////////////////////////////
                // このラウンドでの事実bを決める
                Environment.TheFact.randomNext();

                //ラウンドを実行
                var roundResult = ExecRound(false);//学習しないラウンドを実行

                //////////////////////////////////////////////////////////////////////

                correctRound   += roundResult.Accuracy.Correct;
                incorrectRound += roundResult.Accuracy.Incorrect;
                undeterRound   += roundResult.Accuracy.Undeter;


                //ラウンドを実行して,そのラウンドでの正確性を求める
                roundAccLog.WriteLine(
                    string.Format("{0}, {1}, {2}, ",
                                  Round,                     //ラウンド番号:すなわち,センサーのランダムのシード
                                  Environment.TheFact.Value, //事実の値
                                  roundResult));             //正解率およびImportanceLevelと推定値の平均
            }

            //すべてのラウンドの平均
            double correctRoundRate   = correctRound / RoundNum;   // = accuracy
            double incorrectRoundRate = incorrectRound / RoundNum;
            double undeterRoundRate   = undeterRound / RoundNum;


            var res = new ExpAccuracy(correctRoundRate, incorrectRoundRate, undeterRoundRate);

            L.g("all").WriteLine(",," + res.ToString());

            return(res);
        }
Beispiel #2
0
        //お手本
        public ExpAccuracy Run()
        {
            var roundAccLog = L.g("roundacc");

            Initialize();

            //1st step
            BuildCandidates();

            ////////////評価開始:正確性を求める////////////

            double correctRound = 0;
            double incorrectRound = 0;
            double undeterRound = 0;

            roundAccLog.WriteLine("<LEARNING> RoundNum: " + RoundNum);

            //LEARNING
            while (!this.LearningIsFinished)
            {
                ///////////////////////////////ラウンドを実行///////////////////////////////

                // このラウンドでの事実bを決める
                Environment.TheFact.randomNext();

                //ラウンドを実行
                var roundResult = ExecRound();

                //////////////////////////////////////////////////////////////////////

                roundAccLog.WriteLine(
                    string.Format("Round: {0} fact: {1} {2}",
                        Round,
                        Environment.TheFact.Value,
                        roundResult ));

            }

            roundAccLog.WriteLine("***EVALUATION***");

            //EVALUATION
            while (!this.EvaluationIsFinished)
            {
                ///////////////////////////////ラウンドを実行///////////////////////////////
                // このラウンドでの事実bを決める
                Environment.TheFact.randomNext();

                //ラウンドを実行
                var roundResult = ExecRound(false);//学習しないラウンドを実行

                //////////////////////////////////////////////////////////////////////

                correctRound   += roundResult.Accuracy.Correct;
                incorrectRound += roundResult.Accuracy.Incorrect;
                undeterRound   += roundResult.Accuracy.Undeter;

                //ラウンドを実行して,そのラウンドでの正確性を求める
                roundAccLog.WriteLine(
                    string.Format("Round: {0} fact: {1} {2}",
                        Round,
                        Environment.TheFact.Value,
                        roundResult ));

            }

            //すべてのラウンドの平均
            double correctRoundRate   =   correctRound / RoundNum; // = accuracy
            double incorrectRoundRate = incorrectRound / RoundNum;
            double undeterRoundRate   =   undeterRound / RoundNum;

            var res = new ExpAccuracy(correctRoundRate, incorrectRoundRate, undeterRoundRate);

            L.g("roundacc,console").WriteLine(res.ToString());

            return res;
        }
Beispiel #3
0
        public ExpAccuracy Run()//お手本
        {
            var roundAccLog = L.g("roundacc");


            Initialize();

            //1st step
            BuildCandidates();

            ////////////評価開始:正確性を求める////////////

            double correctRound   = 0;
            double incorrectRound = 0;
            double undeterRound   = 0;

            roundAccLog.WriteLine("<LEARNING> RoundNum: " + RoundNum);

            //LEARNING
            while (!this.LearningIsFinished)
            {
                ///////////////////////////////ラウンドを実行///////////////////////////////

                // このラウンドでの事実bを決める
                Environment.TheFact.randomNext();

                //ラウンドを実行
                var roundResult = ExecRound();

                //////////////////////////////////////////////////////////////////////

                roundAccLog.WriteLine(
                    string.Format("Round: {0} fact: {1} {2}",
                                  Round,
                                  Environment.TheFact.Value,
                                  roundResult));
            }

            roundAccLog.WriteLine("***EVALUATION***");

            //EVALUATION
            while (!this.EvaluationIsFinished)
            {
                ///////////////////////////////ラウンドを実行///////////////////////////////
                // このラウンドでの事実bを決める
                Environment.TheFact.randomNext();

                //ラウンドを実行
                var roundResult = ExecRound(false);//学習しないラウンドを実行

                //////////////////////////////////////////////////////////////////////

                correctRound   += roundResult.Accuracy.Correct;
                incorrectRound += roundResult.Accuracy.Incorrect;
                undeterRound   += roundResult.Accuracy.Undeter;


                //ラウンドを実行して,そのラウンドでの正確性を求める
                roundAccLog.WriteLine(
                    string.Format("Round: {0} fact: {1} {2}",
                                  Round,
                                  Environment.TheFact.Value,
                                  roundResult));
            }

            //すべてのラウンドの平均
            double correctRoundRate   = correctRound / RoundNum;   // = accuracy
            double incorrectRoundRate = incorrectRound / RoundNum;
            double undeterRoundRate   = undeterRound / RoundNum;


            var res = new ExpAccuracy(correctRoundRate, incorrectRoundRate, undeterRoundRate);

            L.g("roundacc,console").WriteLine(res.ToString());

            return(res);
        }
Beispiel #4
0
        //お手本
        public ExpAccuracy Run()
        {
            var roundAccLog = L.g("roundacc");

            Initialize();

            //1st step
            PrepareAlgorithm();

            ////////////評価開始:正確性を求める////////////

            double correctRound = 0;
            double incorrectRound = 0;
            double undeterRound = 0;

            roundAccLog.WriteLine("<LEARNING> RoundNum: " + RoundNum);

            //LEARNING
            while (!this.LearningIsFinished)
            {
                ///////////////////////////////ラウンドを実行///////////////////////////////

                // このラウンドでの事実bを決める
                Environment.TheFact.randomNext();

                //ラウンドを実行
                var roundResult = ExecRound();

                //////////////////////////////////////////////////////////////////////

                roundAccLog.WriteLine(
                    string.Format("{0}, {1}, {2}, ",
                        Round, //ラウンド番号:すなわち,センサーのランダムのシード
                        Environment.TheFact.Value, //事実の値
                        roundResult ));//正解率およびImportanceLevelと推定値の平均
            }

            roundAccLog.WriteLine("***EVALUATION***");

            //EVALUATION
            while (!this.EvaluationIsFinished)
            {
                ///////////////////////////////ラウンドを実行///////////////////////////////
                // このラウンドでの事実bを決める
                Environment.TheFact.randomNext();

                //ラウンドを実行
                var roundResult = ExecRound(false);//学習しないラウンドを実行

                //////////////////////////////////////////////////////////////////////

                correctRound   += roundResult.Accuracy.Correct;
                incorrectRound += roundResult.Accuracy.Incorrect;
                undeterRound   += roundResult.Accuracy.Undeter;

                //ラウンドを実行して,そのラウンドでの正確性を求める
                roundAccLog.WriteLine(
                    string.Format("{0}, {1}, {2}, ",
                        Round, //ラウンド番号:すなわち,センサーのランダムのシード
                        Environment.TheFact.Value, //事実の値
                        roundResult ));//正解率およびImportanceLevelと推定値の平均

            }

            //すべてのラウンドの平均
            double correctRoundRate   =   correctRound / RoundNum; // = accuracy
            double incorrectRoundRate = incorrectRound / RoundNum;
            double undeterRoundRate   =   undeterRound / RoundNum;

            var res = new ExpAccuracy(correctRoundRate, incorrectRoundRate, undeterRoundRate);

            L.g("all").WriteLine(",," + res.ToString());

            return res;
        }