Examples of cosineSimilarity()


Examples of uk.ac.cam.ha293.tweetlabel.topics.FullLLDAClassification.cosineSimilarity()

          int cosineCount = 0;
          for(Long uid : uids) {
            if(topicType.equals("alchemy")) {
              FullAlchemyClassification baseline = new FullAlchemyClassification(uid);
              FullLLDAClassification llda = new FullLLDAClassification(topicType,alpha,false,reduction,uid);
              double sim = llda.cosineSimilarity(baseline);
              cosineSum += sim;
              cosineCount++;
            } else if(topicType.equals("calais")) {
              FullCalaisClassification baseline = new FullCalaisClassification(uid);
              FullLLDAClassification llda = new FullLLDAClassification(topicType,alpha,false,reduction,uid);
View Full Code Here

Examples of uk.ac.cam.ha293.tweetlabel.topics.FullLLDAClassification.cosineSimilarity()

              cosineSum += sim;
              cosineCount++;
            } else if(topicType.equals("calais")) {
              FullCalaisClassification baseline = new FullCalaisClassification(uid);
              FullLLDAClassification llda = new FullLLDAClassification(topicType,alpha,false,reduction,uid);
              double sim = llda.cosineSimilarity(baseline);
              cosineSum += sim;
              cosineCount++;
            } else if(topicType.equals("textwiseproper")) {
              FullTextwiseClassification baseline = new FullTextwiseClassification(uid,true);
              FullLLDAClassification llda = new FullLLDAClassification(topicType,alpha,false,reduction,uid);
View Full Code Here

Examples of uk.ac.cam.ha293.tweetlabel.topics.FullLLDAClassification.cosineSimilarity()

              cosineSum += sim;
              cosineCount++;
            } else if(topicType.equals("textwiseproper")) {
              FullTextwiseClassification baseline = new FullTextwiseClassification(uid,true);
              FullLLDAClassification llda = new FullLLDAClassification(topicType,alpha,false,reduction,uid);
              double sim = llda.cosineSimilarity(baseline);
              cosineSum += sim;
              cosineCount++;
            }
          }
          double avgCosine = cosineSum/cosineCount;
View Full Code Here

Examples of uk.ac.cam.ha293.tweetlabel.topics.FullLLDAClassification.cosineSimilarity()

    double squareSum = 0.0;
    for(Long uid : uids) {
      if(topicType.equals("alchemy")) {
        FullAlchemyClassification baseline = new FullAlchemyClassification(uid);
        FullLLDAClassification inferred = new FullLLDAClassification(topicType,alpha,uid);
        double sim = inferred.cosineSimilarity(baseline);
        cosineSum += sim;
        squareSum += sim*sim;
        cosineCount++;
      } else if(topicType.equals("calais")) {
        FullCalaisClassification baseline = new FullCalaisClassification(uid);
View Full Code Here

Examples of uk.ac.cam.ha293.tweetlabel.topics.FullLLDAClassification.cosineSimilarity()

        squareSum += sim*sim;
        cosineCount++;
      } else if(topicType.equals("calais")) {
        FullCalaisClassification baseline = new FullCalaisClassification(uid);
        FullLLDAClassification inferred = new FullLLDAClassification(topicType,alpha,uid);
        double sim = inferred.cosineSimilarity(baseline);
        cosineSum += sim;
        squareSum += sim*sim;
        cosineCount++;
      } else if(topicType.equals("textwise")) {
        FullTextwiseClassification baseline = new FullTextwiseClassification(uid,true);
View Full Code Here

Examples of uk.ac.cam.ha293.tweetlabel.topics.FullLLDAClassification.cosineSimilarity()

        squareSum += sim*sim;
        cosineCount++;
      } else if(topicType.equals("textwise")) {
        FullTextwiseClassification baseline = new FullTextwiseClassification(uid,true);
        FullLLDAClassification inferred = new FullLLDAClassification("textwiseproper",alpha,uid);
        double sim = inferred.cosineSimilarity(baseline);
        cosineSum += sim;
        squareSum += sim*sim;
        cosineCount++;
      }
      //System.out.println("UID:"+uid+", CS:"+sim);
View Full Code Here

Examples of uk.ac.cam.ha293.tweetlabel.topics.FullLLDAClassification.cosineSimilarity()

    for(Long uid : uids) {
      if(topicType.equals("alchemy")) {
        FullAlchemyClassification baseline = new FullAlchemyClassification(uid);
        FullLLDAClassification inferred = new FullLLDAClassification(topicType,alpha,fewerProfiles,reduction,uid);
        if(inferred.getCategorySet().isEmpty()) continue;
        double sim = inferred.cosineSimilarity(baseline);
        cosineSum += sim;
        squareSum += sim*sim;
        cosineCount++;
      } else if(topicType.equals("calais")) {
        FullCalaisClassification baseline = new FullCalaisClassification(uid);
View Full Code Here

Examples of uk.ac.cam.ha293.tweetlabel.topics.FullLLDAClassification.cosineSimilarity()

        cosineCount++;
      } else if(topicType.equals("calais")) {
        FullCalaisClassification baseline = new FullCalaisClassification(uid);
        FullLLDAClassification inferred = new FullLLDAClassification(topicType,alpha,fewerProfiles,reduction,uid);
        if(inferred.getCategorySet().isEmpty()) continue;
        double sim = inferred.cosineSimilarity(baseline);
        cosineSum += sim;
        squareSum += sim*sim;
        cosineCount++;
      } else if(topicType.equals("textwise")) {
        FullTextwiseClassification baseline = new FullTextwiseClassification(uid,true);
View Full Code Here

Examples of uk.ac.cam.ha293.tweetlabel.topics.FullLLDAClassification.cosineSimilarity()

        cosineCount++;
      } else if(topicType.equals("textwise")) {
        FullTextwiseClassification baseline = new FullTextwiseClassification(uid,true);
        FullLLDAClassification inferred = new FullLLDAClassification("textwiseproper",alpha,fewerProfiles,reduction,uid);
        if(inferred.getCategorySet().isEmpty()) continue;
        double sim = inferred.cosineSimilarity(baseline);
        cosineSum += sim;
        squareSum += sim*sim;
        cosineCount++;
      }
      //System.out.println("UID:"+uid+", CS:"+sim);
View Full Code Here

Examples of uk.ac.cam.ha293.tweetlabel.topics.FullLLDAClassification.cosineSimilarity()

          writeOut.println("\"uid\",\"similarity\"");
          if(topicType.equals("alchemy")) {
            for(long uid : uids) {
              FullAlchemyClassification baseline = new FullAlchemyClassification(uid);
              FullLLDAClassification llda = new FullLLDAClassification(topicType,alpha,uid);
              writeOut.println(uid+","+llda.cosineSimilarity(baseline));
            }
          } else if(topicType.equals("calais")) {
            for(long uid : uids) {
              FullCalaisClassification baseline = new FullCalaisClassification(uid);
              FullLLDAClassification llda = new FullLLDAClassification(topicType,alpha,uid);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.