示例#1
0
        public static double getLindisSumReverse(this SAFuzzySystem source, int indexDataBase = 0)
        {
            double result = 0.0;

            if (source != null)
            {
                double temp = 0.0;
                for (int i = 0; i < source.CountFeatures; i++)
                {
                    temp = 0.0;
                    List <Term> termList = source.RulesDatabaseSet[indexDataBase].TermsSet.Where(x => x.NumVar == i).ToList();
                    if (termList.Count() <= 1)
                    {
                        temp = 0.0;
                    }
                    else
                    {
                        for (int j = 0; j < termList.Count; j++)
                        {
                            for (int k = j + 1; k < termList.Count; k++)
                            {
                                temp += 1 - TermOnterpreting.getIndexByLinds(termList[j], termList[k], termList);
                            }
                        }
                    }
                    result += temp;
                }
                result = result / (double)source.CountFeatures;
            }
            return(result);
        }
示例#2
0
        public override SAFuzzySystem TuneUpFuzzySystem(SAFuzzySystem Approx, ILearnAlgorithmConf conf)
        {
            SAFuzzySystem result        = Approx;
            double        minValue      = 5;
            int           minFeature    = 0;
            int           minATerm      = 0;
            int           minBTerm      = 1;
            int           indexDatabase = 0;

            for (int i = 0; i < result.CountFeatures; i++)
            {
                List <Term> soureceByFeature = result.RulesDatabaseSet[indexDatabase].TermsSet.Where(x => x.NumVar == i).ToList();
                for (int j = 0; j < soureceByFeature.Count(); j++)
                {
                    for (int k = j + 1; k < soureceByFeature.Count(); k++)
                    {
                        double temp = TermOnterpreting.getIndexByLinds(soureceByFeature[j], soureceByFeature[k], soureceByFeature);
                        if (temp < minValue)
                        {
                            minValue   = temp;
                            minATerm   = j;
                            minBTerm   = k;
                            minFeature = i;
                        }
                    }
                }
            }
            result = BreakCrossTerm(result, minFeature, minATerm, minBTerm, indexDatabase);
            result.RulesDatabaseSet[0].TermsSet.Trim();
            return(result);
        }
示例#3
0
        public static double getIndexSumReverse(this SAFuzzySystem source, double goodsForBorder = 0, double goodsForAreas = 0, int indexDataBase = 0)
        {
            double result = 0.0;

            if (goodsForBorder == 0)
            {
                goodsForBorder = FuzzyCore.Properties.Settings.Default.Pareto_simpler_UnionTerms_byBorderPercent * 0.01;
            }
            if (goodsForAreas == 0)
            {
                goodsForAreas = FuzzyCore.Properties.Settings.Default.Pareto_simpler_UnionTerms_bySqarePercent * 0.01;
            }
            if (source != null)
            {
                double temp = 0;
                for (int i = 0; i < source.CountFeatures; i++)
                {
                    temp = 0.0;
                    List <Term> termList = source.RulesDatabaseSet[indexDataBase].TermsSet.Where(x => x.NumVar == i).ToList();
                    if (termList.Count() <= 1)
                    {
                        temp = 1.0;
                    }
                    else
                    {
                        for (int j = 0; j < termList.Count; j++)
                        {
                            for (int k = j + 1; k < termList.Count; k++)
                            {
                                double[] tempParts = { (1.0 - TermOnterpreting.getG3(termList[j],           termList[k], termList.Count(), source.LearnSamplesSet.InputAttributes[i].Scatter, goodsForBorder, goodsForAreas))
                                                       ,
                                                       (1.0 - TermOnterpreting.getIndexByLinds(termList[j], termList[k], termList)) };
                                temp += tempParts.Max();
                            }
                        }
                    }
                    result += temp;
                }
                result = result / (double)source.CountFeatures;
            }
            return(result);
        }