Example #1
0
        public List<double> realVals; //Y (independent variable) values as read from the input file

        #endregion Fields

        #region Constructors

        public ValidCombination()
        {
            realVals = new List<double>();
            calcVals = new List<RowVal>();
            errors = new List<double>();
            coeffs = new PolCoeffs();
            dependentVars = new Combination();
            independentVar = new Variable();
            assessment = new Assessment();
        }
Example #2
0
        //Method called to add the assessing factors to the corresponding Assessment variable
        private Assessment addFactor(int curCount, Assessment curAssessment, ValidCombination curValidComb, Config curConfig)
        {
            AssessmentFactor curFactor = new AssessmentFactor();

            if (curCount == 0)
            {
                curFactor.name = "In-sample accuracy";
                curFactor.weight = 10.0;
                if (curValidComb.averError <= curConfig.limitVals.valueIsZero) //Zero cannot be considered because the (floating-point) double type might provoke errors
                {
                    //Too perfect to continue
                    curFactor.rating = 10.0;
                    curAssessment.factors.Add(curFactor);
                    curAssessment.totWeight = 10.0;
                    curAssessment.globalRating = 10.0;
                    return curAssessment;
                }

                if (curValidComb.averError <= curConfig.fitConfig.globalAver * 0.05)
                {
                    double curMinPercBelow = (double)curValidComb.lowErrorCount / (double)curValidComb.errors.Count;
                    if (curMinPercBelow >= 0.99) curFactor.rating = 9.0;
                    else if (curMinPercBelow >= 0.95) curFactor.rating = 8.0;
                }
                else
                {
                    curFactor.rating = 8.0 * (curConfig.fitConfig.globalAver - curValidComb.averError) / (0.95 * curConfig.fitConfig.globalAver);
                }
            }
            else if (curCount == 1 || curCount == 2)
            {
                curFactor.name = "Quality of independent variable";
                double averRatingVars = curValidComb.independentVar.input.preAnalysis.rating;
                if (curCount == 1)
                {
                    curFactor.name = "Quality of dependent variable(s)";
                    averRatingVars = curValidComb.dependentVars.items.Count == 0 ? 10 : curValidComb.dependentVars.items.Average(x => x.variable.input.preAnalysis.rating);
                }
                curFactor.weight = 8.0;
                if (curValidComb.errors.Count >= curConfig.fitConfig.minNoCases)
                {
                    curFactor.rating = 8.0;
                    if (curValidComb.errors.Count >= 1.25 * curConfig.fitConfig.minNoCases) curFactor.rating = 10.0;
                    else if (curValidComb.errors.Count >= 1.1 * curConfig.fitConfig.minNoCases) curFactor.rating = 9.0;
                }
                curFactor.rating = Math.Round(0.5 * (double)curFactor.rating + 0.5 * averRatingVars, 0);
            }
            else if (curCount == 3)
            {
                curFactor.name = "Solution tunability";
                curFactor.weight = 6.0;
                curFactor.rating = ratingTunability(curValidComb);
            }
            else if (curCount == 4)
            {
                curFactor.name = "Complexity of polynomial fit";
                curFactor.weight = 5.0;
                curFactor.rating = ratingFitComplexity(curValidComb);
            }

            if (curFactor.rating < 0.0) curFactor.rating = 0.0;
            curAssessment.totWeight = curAssessment.totWeight + curFactor.weight;
            curAssessment.factors.Add(curFactor);

            return curAssessment;
        }