예제 #1
0
        public double testRun(out double optK1, out double optK2, out double optB, string path)
        {
            postQuery = new PostQueryEngine(ref indexer);
            int    bestScore = 0;
            double bestk1    = 0;
            double bestk2    = 0;
            double bestb     = 0;

            for (double k1 = 1.2; k1 <= 1.2; k1 += 0.01)
            {
                for (double k2 = 46; k2 <= 60; k2 += 2)
                {
                    for (double b = 0.5; b <= 1; b += 0.05)
                    {
                        postQuery.ranker = new Ranker(ref indexer, ref postQuery.searcher, k1, k2, b);
                        postQuery.queriesFile(Properties.Settings.Default.postingFiles + "\\queries.txt", "All languages", path);
                        int score = compareResults(postQuery.QueriesResults);
                        if (score > bestScore)
                        {
                            bestScore = score;
                            bestk1    = k1;
                            bestk2    = k2;
                            bestb     = b;
                        }
                    }
                }
            }
            optK1 = bestk1;
            optK2 = bestk2;
            optB  = bestb;
            return(bestScore);
        }
예제 #2
0
 public Optimizer(ref Indexer indexer)
 {
     this.indexer       = indexer;
     postQuery          = new PostQueryEngine(ref this.indexer);
     qrelsDictionary    = new Dictionary <int, Dictionary <string, int> >();
     postQuery.searcher = new Searcher(ref indexer, 5);
 }