Package uk.ac.ucl.panda.retrieval

Examples of uk.ac.ucl.panda.retrieval.TopMeanVarianceDocCollector


      double c) throws IOException {
    double log2toe = 1.0d / Math.log(2.0d);
    TopDocsMeanVariance f_td = td;
    MeanVarianceScoreDoc temp[] = f_td.MeanVariancescoreDocs;
    // System.out.println("number: "+temp.length);
    TopMeanVarianceDocCollector collector = null;
    for (int d = 0; d < 19; d++) {
      collector = new TopMeanVarianceDocCollector(temp.length);
      for (int j = 0; j <= d; j++) {
        collector.collect(temp[j].doc, temp[j].score + 100.0d,
            temp[j].mean, temp[j].variance);
      }
      for (int i = d + 1; i < temp.length; i++) {
        temp[i].score -= c / Math.log(d + 2) / log2toe
            * correlation(temp[d].doc, temp[i].doc) * 0.01;
        // c *correlation(temp[d].doc,temp[i].doc);
        // System.out.println(temp[d].doc+"  "+temp[i].doc);
        // System.out.println("Score: "+temp[i].score +
        // " Correlation: "+correlation(temp[d].doc,temp[i].doc));
        collector.collect(temp[i].doc, temp[i].score, temp[i].mean,
            temp[i].variance);
      }
      f_td = collector.topDocs();
      temp = f_td.MeanVariancescoreDocs;
    }
    return f_td;
  }
View Full Code Here


      double c) throws IOException {
    double log2toe = 1.0d / Math.log(2.0d);
    TopDocsMeanVariance f_td = td;
    MeanVarianceScoreDoc temp[] = f_td.MeanVariancescoreDocs;
    // System.out.println("number: "+temp.length);
    TopMeanVarianceDocCollector collector = null;
    HashMap scoreHM = new HashMap();
    for (int k = 0; k < temp.length; k++) {
      scoreHM.put(temp[k].doc, temp[k].score);
    }
    for (int d = 0; d < 19; d++) {
      collector = new TopMeanVarianceDocCollector(temp.length);
      for (int j = 0; j <= d; j++) {
        collector.collect(temp[j].doc, temp[j].score + 100.0d,
            temp[j].mean, temp[j].variance);
      }
      for (int i = d + 1; i < temp.length; i++) {
        double currentScore = Double.parseDouble(scoreHM.get(
            temp[i].doc).toString());
        double adjustAmount = currentScore / (d + 2);
        for (int s = 0; s <= d; s++) {
          double docScore = Double.parseDouble(scoreHM.get(
              temp[s].doc).toString());
          adjustAmount += 1.0 / (d + 2)
              * (correlation(temp[s].doc, temp[i].doc) * 0.01);// Math.sqrt(temp[s].variance
          // *temp[i].variance));//+
          // currentScore*docScore
        }
        // b_correlation /2.0/Math.log(d+2)/ log2toe
        // *correlation(temp[d].doc,temp[i].doc)*0.01;//Math.sqrt(temp[d].variance
        // *temp[i].variance);
        // System.out.println(
        // Double.toString(correlation(temp[d].doc,temp[i].doc)) +"\t" +
        // Double.toString(adjustAmount));
        temp[i].score = adjustAmount;// *temp[d].score*temp[i].score;
        // c *correlation(temp[d].doc,temp[i].doc);
        // System.out.println(temp[d].doc+"  "+temp[i].doc);
        // System.out.println("Score: "+temp[i].score +
        // " Correlation: "+correlation(temp[d].doc,temp[i].doc));
        collector.collect(temp[i].doc, temp[i].score, temp[i].mean,
            temp[i].variance);
        // temp[i].score-= c /Math.log(d+2)/ log2toe
        // *correlation(temp[d].doc,temp[i].doc);
        // //c *correlation(temp[d].doc,temp[i].doc);
        // // System.out.println(temp[d].doc+"  "+temp[i].doc);
        // // System.out.println("Score: "+temp[i].score +
        // " Correlation: "+correlation(temp[d].doc,temp[i].doc));
        // collector.collect(temp[i].doc, temp[i].score, temp[i].mean,
        // temp[i].variance);
      }
      f_td = collector.topDocs();
      temp = f_td.MeanVariancescoreDocs;
    }
    return f_td;
  }
View Full Code Here

      double c) throws IOException {
    double log2toe = 1.0d / Math.log(2.0d);
    TopDocsMeanVariance f_td = td;
    MeanVarianceScoreDoc temp[] = f_td.MeanVariancescoreDocs;
    // System.out.println("number: "+temp.length);
    TopMeanVarianceDocCollector collector = null;
    HashMap scoreHM = new HashMap();
    for (int k = 0; k < temp.length; k++) {
      scoreHM.put(temp[k].doc, temp[k].score);
    }
    for (int d = 0; d < 19; d++) {
      collector = new TopMeanVarianceDocCollector(temp.length);
      for (int j = 0; j <= d; j++) {
        collector.collect(temp[j].doc, temp[j].score + 100.0d,
            temp[j].mean, temp[j].variance);
      }
      for (int i = d + 1; i < temp.length; i++) {
        double currentScore = Double.parseDouble(scoreHM.get(
            temp[i].doc).toString());
        double adjustAmount = Math.pow(2.0, currentScore)
            + temp[i].variance * Math.pow(2.0, currentScore)
            * Math.log(2) * Math.log(2);
        // b_correlation /2.0/Math.log(d+2)/ log2toe
        // *correlation(temp[d].doc,temp[i].doc)*0.01;//Math.sqrt(temp[d].variance
        // *temp[i].variance);
        // System.out.println(
        // Double.toString(correlation(temp[d].doc,temp[i].doc)) +"\t" +
        // Double.toString(adjustAmount));
        temp[i].score = adjustAmount;// *temp[d].score*temp[i].score;
        // c *correlation(temp[d].doc,temp[i].doc);
        // System.out.println(temp[d].doc+"  "+temp[i].doc);
        // System.out.println("Score: "+temp[i].score +
        // " Correlation: "+correlation(temp[d].doc,temp[i].doc));
        collector.collect(temp[i].doc, temp[i].score, temp[i].mean,
            temp[i].variance);
        // temp[i].score-= c /Math.log(d+2)/ log2toe
        // *correlation(temp[d].doc,temp[i].doc);
        // //c *correlation(temp[d].doc,temp[i].doc);
        // // System.out.println(temp[d].doc+"  "+temp[i].doc);
        // // System.out.println("Score: "+temp[i].score +
        // " Correlation: "+correlation(temp[d].doc,temp[i].doc));
        // collector.collect(temp[i].doc, temp[i].score, temp[i].mean,
        // temp[i].variance);
      }
      f_td = collector.topDocs();
      temp = f_td.MeanVariancescoreDocs;
    }
    return f_td;
  }
View Full Code Here

      double c) throws IOException {
    double log2toe = 1.0d / Math.log(2.0d);
    TopDocsMeanVariance f_td = td;
    MeanVarianceScoreDoc temp[] = f_td.MeanVariancescoreDocs;
    // System.out.println("number: "+temp.length);
    TopMeanVarianceDocCollector collector = null;
    HashMap scoreHM = new HashMap();
    for (int k = 0; k < temp.length; k++) {
      scoreHM.put(temp[k].doc, temp[k].score);
    }
    for (int d = 0; d < 19; d++) {
      collector = new TopMeanVarianceDocCollector(temp.length);
      for (int j = 0; j <= d; j++) {
        collector.collect(temp[j].doc, temp[j].score + 100.0d,
            temp[j].mean, temp[j].variance);
      }
      for (int i = d + 1; i < temp.length; i++) {
        double expectedVi = 1.0;
        double cov = 1.0;
        for (int s = 0; s <= d; s++) {
          expectedVi = expectedVi
              * (1 - Double.parseDouble(scoreHM.get(temp[s].doc)
                  .toString()));
          cov = cov * (correlation(temp[s].doc, temp[i].doc))
              * Math.sqrt(temp[s].variance * temp[i].variance);
        }
        expectedVi = expectedVi
            * Double.parseDouble(scoreHM.get(temp[i].doc)
                .toString()) / (d + 2);
        cov = -cov / (d + 2);
        temp[i].score = expectedVi + cov;// adjustAmount;//*temp[d].score*temp[i].score;
        // c *correlation(temp[d].doc,temp[i].doc);
        // System.out.println(temp[d].doc+"  "+temp[i].doc);
        // System.out.println("Score: "+temp[i].score +
        // " Correlation: "+correlation(temp[d].doc,temp[i].doc));
        collector.collect(temp[i].doc, temp[i].score, temp[i].mean,
            temp[i].variance);
        // temp[i].score-= c /Math.log(d+2)/ log2toe
        // *correlation(temp[d].doc,temp[i].doc);
        // //c *correlation(temp[d].doc,temp[i].doc);
        // // System.out.println(temp[d].doc+"  "+temp[i].doc);
        // // System.out.println("Score: "+temp[i].score +
        // " Correlation: "+correlation(temp[d].doc,temp[i].doc));
        // collector.collect(temp[i].doc, temp[i].score, temp[i].mean,
        // temp[i].variance);
      }
      f_td = collector.topDocs();
      temp = f_td.MeanVariancescoreDocs;
    }
    return f_td;
  }
View Full Code Here

TOP

Related Classes of uk.ac.ucl.panda.retrieval.TopMeanVarianceDocCollector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.