public override IGeneratorConf getConf(int CountFeatures)
        {
            IGeneratorConf result = new InitEveryoneWithEveryone();

            result.Init(CountFeatures);
            return(result);
        }
Esempio n. 2
0
        protected override void fill_conf()
        {
            InitEveryoneWithEveryone conf1 = conf as InitEveryoneWithEveryone;

            conf1.IEWEFuncType = func;
            int[] param = new int[Approx_learn_set.CountVars];
            for (int i = 0; i < Approx_learn_set.CountVars; i++)
            {
                param[i] = CountN[i];
            }
        }
        public override SAFuzzySystem Generate(SAFuzzySystem Approximate, IGeneratorConf config)
        {
            SAFuzzySystem            result  = Approximate;
            InitEveryoneWithEveryone config1 = config as InitEveryoneWithEveryone;

            type_func        = config1.IEWEFuncType;
            count_slice_vars = config1.IEWECountSlice;
            InitRulesEveryoneWithEveryone(Approximate, type_func, count_slice_vars);



            return(result);
        }
Esempio n. 4
0
        public override PCFuzzySystem Generate(PCFuzzySystem Classifier, IGeneratorConf config)
        {
            PCFuzzySystem result = Classifier;

            Systems_ready_to_test = new List <KnowlegeBasePCRules>();
            errors_of_systems     = new List <double>();


            InitEveryoneWithEveryone config1 = config as InitEveryoneWithEveryone;

            type_func        = config1.IEWEFuncType;
            count_slice_vars = config1.IEWECountSlice;


            List <int> Varians_of_run_system = new List <int>();

            for (int i = 0; i < Classifier.CountFeatures; i++)
            {
                int count_terms_for_var = count_slice_vars[i];
                Varians_of_run_system.Add(count_terms_for_var);
            }

            Varians_of_run_system.Sort();
            Generate_all_variant_in_pool(Varians_of_run_system);

            for (int i = 0; i < Pull_of_systems.Count; i++)
            {
                Classifier.RulesDatabaseSet.Clear();

                GeneratorRulesEveryoneWithEveryone.InitRulesEveryoneWithEveryone(result, type_func, Pull_of_systems[i].ToArray());
                Systems_ready_to_test.Add(Classifier.RulesDatabaseSet[0]);
                errors_of_systems.Add(result.ErrorLearnSamples(result.RulesDatabaseSet[0]));
            }

            int best_index = errors_of_systems.IndexOf(errors_of_systems.Min());

            result.RulesDatabaseSet.Clear();
            result.RulesDatabaseSet.Add(Systems_ready_to_test[best_index]);
            for (int i = 0; i < count_slice_vars.Count(); i++)
            {
                count_slice_vars[i] = result.RulesDatabaseSet[0].TermsSet.Count(x => x.NumVar == i);
            }
            Console.WriteLine(Pull_of_systems.Count());

            GC.Collect();
            result.RulesDatabaseSet[0].TermsSet.Trim();
            return(result);
        }
        public override PCFuzzySystem Generate(PCFuzzySystem Classifier, IGeneratorConf config)
        {
            PCFuzzySystem result = Classifier;

            InitEveryoneWithEveryone config1 = config as InitEveryoneWithEveryone;

            type_func        = config1.IEWEFuncType;
            count_slice_vars = config1.IEWECountSlice;

            InitRulesEveryoneWithEveryone(result, type_func, count_slice_vars);

            InitRulesEveryoneWithEveryone(result, type_func, count_slice_vars);

            result.RulesDatabaseSet[0].TermsSet.Trim();


            return(result);
        }
Esempio n. 6
0
 public override int Run(string[] args)
 {
     Console.WriteLine("Start");
     fill_params(args);
     Console.WriteLine("Params get \nfile tra {0} \nfile name tst {1} ", file_learn, file_test);
     Approx_learn_set = new SampleSet(file_learn);
     Console.WriteLine("Tra create");
     Approx_test_set = new SampleSet(file_test);
     Console.WriteLine("Tst create");
     conf = new InitEveryoneWithEveryone();
     conf.Init(Approx_learn_set.CountVars);
     fill_conf();
     Console.WriteLine("Conf Filed");
     Approx_Singletone = new SAFuzzySystem(Approx_learn_set, Approx_test_set);
     Console.WriteLine("Classifier created");
     generator         = new GeneratorRulesEveryoneWithEveryone();
     Approx_Singletone = generator.Generate(Approx_Singletone, conf) as SAFuzzySystem;
     Console.WriteLine("Gereration complite");
     SAFSUFSWriter.saveToUFS(Approx_Singletone, file_out);
     Console.WriteLine("Saved");
     return(1);
 }