Ejemplo n.º 1
0
 internal static void Reset()
 {
     mostRecent = null;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Generate a random query.  No need to pass labelForUnlabeled here, since the random queries are all given labels.
        /// Still pass scoreForDegenerateQuery just in case some query gets all labels the same.
        /// Scores are not set here.
        /// </summary>
        /// <param name="priors"></param>
        /// <param name="scale"></param>
        /// <param name="nScores"></param>
        /// <param name="rangen"></param>
        /// <param name="nRows"></param>
        public Query(float[] priors, double scale, int nScores, int nRows, string queryID, Random rangen)
        {
            length = nRows;
            QueryID = queryID;

            QueryRow[] qr = new QueryRow[length];
            ftrVectors = new float[length][];
            scores = new double[length];
            labels = new float[length];
            for (int i = 0; i < nRows; ++i)
            {
                qr[i] = new QueryRow(priors, scale, nScores, rangen);
                labels[i] = qr[i].Label;
                ftrVectors[i] = qr[i].Features;
            }

            DCGScorer dcg = new DCGScorer();
            FillMaxDCGs(dcg);
        }
Ejemplo n.º 3
0
 public QueryRow(float label, float[] features, float labelForUnlabeled)
 {
     this.label = (label == -1) ? labelForUnlabeled : label;
     this.features = features;
     previous = mostRecent;
     mostRecent = this;
 }