Package uk.ac.cam.ha293.tweetlabel.topics

Examples of uk.ac.cam.ha293.tweetlabel.topics.FullLLDAClassification


    double cosineSum = 0.0;
    int cosineCount = 0;
    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++;
 
View Full Code Here


    double cosineSum = 0.0;
    int cosineCount = 0;
    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 = cosineKSimilarity(baseline,inferred,k);
        cosineSum += sim;
        squareSum += sim*sim;
        cosineCount++;
 
View Full Code Here

    double cosineSum = 0.0;
    int cosineCount = 0;
    double squareSum = 0.0;
    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;
 
View Full Code Here

    double cosineSum = 0.0;
    int cosineCount = 0;
    double squareSum = 0.0;
    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 = cosineKSimilarity(baseline,inferred,k);
        cosineSum += sim;
        squareSum += sim*sim;
 
View Full Code Here

    double cosineSum = 0.0;
    int cosineCount = 0;
    double squareSum = 0.0;
    for(Long uid : Tools.getCSVUserIDs()) {
      if(topicType.equals("alchemy")) {
        FullAlchemyClassification fac = new FullAlchemyClassification(uid);
        FullSVMClassification fsm = new FullSVMClassification(topicType,uid);
        double sim = fsm.cosineSimilarity(fac);
        cosineSum += sim;
        squareSum += sim*sim;
        cosineCount++;
 
View Full Code Here

        //if(fac.getScore(topic) < scoreThreshold) break; //stop getting low-prob topics
        topics.add(topic);
        count++;
      }
    } else if(topicType.equals("calais")) {
      FullCalaisClassification fcc = new FullCalaisClassification(userID);
      int topTopics = 3;
      int count = 0;
      for(String topic : fcc.getCategorySet()) {
        if(topic.equals("Other")) continue; //really prominent...
        if(count == topTopics) break; //stop getting more than 3 topics
        //if(fac.getScore(topic) < scoreThreshold) break; //stop getting low-prob topics
        topics.add(topic);
        count++;
View Full Code Here

          }
          classifications.add(classification);
        }
      } else if(topicType.equals("calais")) {
        for(long id : Tools.getCSVUserIDs()) {
          FullCalaisClassification c = new FullCalaisClassification(id);
          Map<String,Double> classification = new HashMap<String,Double>();
          int topicCount = 0;
          for(String topic : c.getCategorySet()) {
            if(topicCount == topTopics) break;
            if(topic.equals("Other")) continue;
            classification.put(topic, c.getScore(topic));
            topicCount++;
          }
          classifications.add(classification);
        }
      } else if(topicType.equals("textwise")) {
        for(long id : Tools.getCSVUserIDs()) {
          FullTextwiseClassification c = new FullTextwiseClassification(id,true);
          Map<String,Double> classification = new HashMap<String,Double>();
          int topicCount = 0;
          for(String topic : c.getCategorySet()) {
            if(topicCount == topTopics) break;
            classification.put(topic, c.getScore(topic));
            topicCount++;
          }
          classifications.add(classification);
        }
      }
    } else {
      for(long id : Tools.getCSVUserIDs()) {
        FullLLDAClassification c = new FullLLDAClassification(topicType,alpha,id);
        Map<String,Double> classification = new HashMap<String,Double>();
        int topicCount = 0;
        for(String topic : c.getCategorySet()) {
          if(topicCount == topTopics) break;
          if(topic.equals("Other")) continue;
          classification.put(topic, c.getScore(topic));
          topicCount++;
        }
        classifications.add(classification);
      }
    }
View Full Code Here

      FullAlchemyClassification c = new FullAlchemyClassification(uid);
      for(String cat : c.getCategorySet()) {
        valueSet.add(c.getScore(cat));
      }
    } else if(topicType.equals("calais")) {
      FullCalaisClassification c = new FullCalaisClassification(uid);
      for(String cat : c.getCategorySet()) {
        valueSet.add(c.getScore(cat));
      }
    } else if(topicType.equals("textwise")) {
      FullCalaisClassification c = new FullCalaisClassification(uid);
      for(String cat : c.getCategorySet()) {
        valueSet.add(c.getScore(cat));
      }
    }
    return valueSet;
  }
View Full Code Here

              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);
              double sim = llda.cosineSimilarity(baseline);
              cosineSum += sim;
              cosineCount++;
            } else if(topicType.equals("textwiseproper")) {
View Full Code Here

            if(kCount == k) break;
            kCount++;
            baselineTopicSet.add(topic);
          }
        } else if(topicType.equals("calais")) {
          FullCalaisClassification baseline = new FullCalaisClassification(uid);
          kCount=0;
          for(String topic : baseline.getCategorySet()) {
            if(kCount == k) break;
            if(topic.equals("Other")) continue;
            kCount++;
            baselineTopicSet.add(topic);
          }
        } else if(topicType.equals("textwise")) {
          FullTextwiseClassification baseline = new FullTextwiseClassification(uid,true);
          kCount=0;
          for(String topic : baseline.getCategorySet()) {
            if(kCount == k) break;
            kCount++;
            baselineTopicSet.add(topic);
          }
        }
View Full Code Here

TOP

Related Classes of uk.ac.cam.ha293.tweetlabel.topics.FullLLDAClassification

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.