예제 #1
0
        public override int Run(string[] args)
        {
            Console.WriteLine("Start");
            fill_params(args);
            Console.WriteLine("Params get \nfile in {0} \n", file_in);

            Approx_learn_set = BaseUFSLoader.LoadLearnFromUFS(file_in);
            Console.WriteLine("Tra load");

            Approx_test_set = BaseUFSLoader.LoadTestFromUFS(file_in);
            Console.WriteLine("Tst load");
            conf = new MultiGoalOptimaze_conf();
            conf.Init(Approx_learn_set.CountVars);
            conf.loadParams(confParams);
            Console.WriteLine("Conf Filed");

            Approx_Singletone = new SAFuzzySystem(Approx_learn_set, Approx_test_set);
            Approx_Singletone = SAFSUFSLoader.loadUFS(Approx_Singletone, file_in);

            Console.WriteLine("Classifier created");
            optimaze          = new MultiGoalOpimize();
            Approx_Singletone = optimaze.TuneUpFuzzySystem(Approx_Singletone, conf);
            Console.WriteLine("Optimization complite");
            // a_FS_UFS.saveToUFS(Class_Pittsburg, file_out);
            Console.WriteLine("Saved");
            return(1);
        }
예제 #2
0
        public override int Run(string[] args)
        {
            Console.WriteLine("Start");
            fill_params(args);
            Console.WriteLine("Params get \nfile in {0} \n", file_in);

            Approx_learn_set = BaseUFSLoader.LoadLearnFromUFS(file_in);
            Console.WriteLine("Tra load");

            Approx_test_set = BaseUFSLoader.LoadTestFromUFS(file_in);
            Console.WriteLine("Tst load");
            conf = new PSOBacterySearchConf();
            conf.Init(Approx_learn_set.CountVars);
            conf.loadParams(confParams);
            Console.WriteLine("Conf Filed");

            Approx_Singletone = new SAFuzzySystem(Approx_learn_set, Approx_test_set);
            Approx_Singletone = SAFSUFSLoader.loadUFS(Approx_Singletone, file_in);

            Console.WriteLine("Classifier created");
            optimaze          = new PSOMethods.Approx.Term_config_PSO_Bactery();
            Approx_Singletone = optimaze.TuneUpFuzzySystem(Approx_Singletone, conf);
            Console.WriteLine("Optimization complite");
            SAFSUFSWriter.saveToUFS(Approx_Singletone, file_out);
            Console.WriteLine("Saved");
            return(1);
        }
예제 #3
0
        public override int Run(string[] args)
        {
            Console.WriteLine("Start");
            fill_params(args);
            Console.WriteLine("Params get \nfile in {0} \n", file_in);

            Class_learn_set = BaseUFSLoader.LoadLearnFromUFS(file_in);
            Console.WriteLine("Tra load");

            Class_test_set = BaseUFSLoader.LoadTestFromUFS(file_in);
            Console.WriteLine("Tst load");
            conf = new PSOBacterySearchConf();
            conf.Init(Class_learn_set.CountVars);
            conf.loadParams(confParams);
            Console.WriteLine("Conf Filed");

            Class_Pittsburg = new PCFuzzySystem(Class_learn_set, Class_test_set);
            Class_Pittsburg = PCFSUFSLoader.loadUFS(Class_Pittsburg, file_in);

            Console.WriteLine("Classifier created");
            optimaze        = new Term_config_PSO_Bactery();
            Class_Pittsburg = optimaze.TuneUpFuzzySystem(Class_Pittsburg, conf);
            Console.WriteLine("Optimization complite");
            PCFSUFSWriter.saveToUFS(Class_Pittsburg, file_out);
            Console.WriteLine("Saved");
            return(1);
        }
예제 #4
0
        public RecombineUFSClassifier(string UFSPAth)
            : base(UFSPAth)
        {
            SampleSet LearnTable = BaseUFSLoader.LoadLearnFromUFS(Source);
            SampleSet TestTable  = BaseUFSLoader.LoadTestFromUFS(Source);

            fuzzy_system = new PCFuzzySystem(LearnTable, TestTable);
            fuzzy_system = fuzzy_system.loadUFS(Source);
        }
예제 #5
0
파일: StartF.cs 프로젝트: CDMMKY/fuzzy_core
        private void BrowseB_Click(object sender, EventArgs e)
        {
            if (openFSDialog.ShowDialog() == DialogResult.OK)
            {
                string fileName = openFSDialog.FileName;
                if (File.Exists(fileName))
                {
                    tempTable = BaseUFSLoader.LoadLearnFromUFS(fileName);

                    temptestTable = BaseUFSLoader.LoadTestFromUFS(fileName);

                    FSystem = BaseUFSLoader.LoadUFS(fileName, out TSystem);

                    switch (TSystem)
                    {
                    case FuzzySystemRelisedList.TypeSystem.PittsburghClassifier:
                    {
                        PCFS = FSystem as PCFuzzySystem;

                        break;
                    }

                    case FuzzySystemRelisedList.TypeSystem.Singletone:
                    {
                        SAFS = FSystem as SAFuzzySystem;
                        break;
                    }

                    case FuzzySystemRelisedList.TypeSystem.TakagiSugenoApproximate:
                    {
                        TSAFS = FSystem as TSAFuzzySystem;

                        break;
                    }
                    }


                    NamesOfTerms = new String[getCountVars()][];
                    indexofTerm  = new int[getCountVars()][];
                    makeNamesforAll();

                    FeatureCB.Items.Clear();
                    for (int i = 0; i < getCountVars(); i++)
                    {
                        FeatureCB.Items.Add(getNameAttribute(i));
                    }
                    FeatureCB.SelectedIndex = 0;
                    MakeRulesB.Enabled      = true;
                    RulesRTB.Text           = "";
                }
            }
        }
예제 #6
0
 private void loadSATestFromUFS(string fileName)
 {
     testSet = BaseUFSLoader.LoadTestFromUFS(fileName);
 }
예제 #7
0
 private void loadSALearnFromUFS(string file_name)
 {
     learnSet = BaseUFSLoader.LoadLearnFromUFS(file_name);
 }
예제 #8
0
        private void LoadAllFS()
        {
            PathFilesUFS = Directory.GetFiles(rootDitectory, "*.UFS", SearchOption.AllDirectories).ToList();
            PCFuzzySystem Classifier = null;
            SampleSet     tempcTable = null, temptestcTable = null;

            SAFuzzySystem Approx = null;
            SampleSet     tempaTable = null, temptestaTable = null;

            for (int i = 0; i < PathFilesUFS.Count(); i++)
            {
                try
                {
                    if (isApprox)
                    {
                        tempaTable     = BaseUFSLoader.LoadLearnFromUFS(PathFilesUFS[i]);
                        temptestaTable = BaseUFSLoader.LoadTestFromUFS(PathFilesUFS[i]);
                        Approx         = new SAFuzzySystem(tempaTable, temptestaTable);
                        Approx         = Approx.loadUFS(PathFilesUFS[i]);
                    }
                    else
                    {
                        tempcTable     = BaseUFSLoader.LoadLearnFromUFS(PathFilesUFS[i]);
                        temptestcTable = BaseUFSLoader.LoadTestFromUFS(PathFilesUFS[i]);
                        Classifier     = new PCFuzzySystem(tempcTable, temptestcTable);
                        Classifier     = Classifier.loadUFS(PathFilesUFS[i]);
                    }
                }
                catch (Exception ex)
                {
                    isApprox = !isApprox;
                    try
                    {
                        if (isApprox)
                        {
                            tempaTable     = BaseUFSLoader.LoadLearnFromUFS(PathFilesUFS[i]);
                            temptestaTable = BaseUFSLoader.LoadTestFromUFS(PathFilesUFS[i]);
                            Approx         = new SAFuzzySystem(tempaTable, temptestaTable);
                            Approx         = Approx.loadUFS(PathFilesUFS[i]);
                        }
                        else
                        {
                            tempcTable     = BaseUFSLoader.LoadLearnFromUFS(PathFilesUFS[i]);
                            temptestcTable = BaseUFSLoader.LoadTestFromUFS(PathFilesUFS[i]);
                            Classifier     = new PCFuzzySystem(tempcTable, temptestcTable);
                            Classifier     = Classifier.loadUFS(PathFilesUFS[i]);
                        }
                    }
                    catch (Exception ex1)
                    {
                        Console.Write("{0} \n{1} \n{2}", ex.Data.ToString(), ex.Message, ex.Source);
                        Console.Write("{0} \n{1} \n{2}", ex1.Data.ToString(), ex1.Message, ex.Source);
                        continue;
                    }
                }

                if (isApprox)
                {
                    addApproxValue(Approx);
                }
                else
                {
                    addClassifierValue(Classifier);
                }
                GC.Collect();
            }

            CleanRepeatesAndNullB_Click(this, null);
        }