/// <summary>Computes score factor from basic content metrics</summary>
        /// <remarks><para>What it will do?</para></remarks>
        /// <param name="remove">If true it will remove any existing ScoreModel Factors</param>
        /// <param name="metric">Kind of content metric to be consumed</param>
        /// <param name="weight">Weight associated with the term weight based document score factor</param>
        /// <seealso cref="aceOperationSetExecutorBase"/>
        public void aceOperation_setDocumentSelectionAddMetricFactor(
            [Description("If true it will remove any existing ScoreModel Factors")] Boolean remove               = true,
            [Description("Kind of content metric to be consumed")] ScoreModelMetricFactorEnum metric             = ScoreModelMetricFactorEnum.Count,
            [Description("Weight associated with the term weight based document score factor")] Double weight    = 1.0,
            [Description("Normalize score value on range from 0.0 to 1.0, across the sample")] Boolean normalize = true)
        {
            if (remove)
            {
                data.ranking.model.Factors.Clear();
                data.ranking.model.SerializedFactors.Clear();
            }

            ScoreModelMetricFactor mf = new ScoreModelMetricFactor();

            mf.weight       = weight;
            mf.functionName = metric; //.functionFlags = flags;
            mf.doNormalize  = normalize;

            data.ranking.model.Factors.Add(mf);
        }
예제 #2
0
        public static String ToStringCaption(this ScoreModelMetricFactorEnum functionName)
        {
            String score = "";

            switch (functionName)
            {
            case ScoreModelMetricFactorEnum.varianceFreq:
                score = "VAR";     // entry_stats.varianceFreq;
                break;

            case ScoreModelMetricFactorEnum.TotalScore:
                score = "TOTAL";     // entry_stats.TotalScore;
                break;

            case ScoreModelMetricFactorEnum.standardDeviation:
                score = "STD";     // entry_stats.standardDeviation;
                break;

            case ScoreModelMetricFactorEnum.entropyFreq:
                score = "ENT";     // entry_stats.entropyFreq;
                break;

            case ScoreModelMetricFactorEnum.avgFreq:
                score = "AVG";     //entry_stats.avgFreq;
                break;

            case ScoreModelMetricFactorEnum.Count:
                score = "DST";     // entry_stats.Count;
                break;

            case ScoreModelMetricFactorEnum.Ordinal:
                score = "OFF";     // assignedIDs.Count - assignedIDs.IndexOf(entry.AssignedID);
                break;

            default:
                score = functionName.ToString();
                break;
            }
            return(score);
        }