double cosineSum = 0.0;
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);
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);
double sim = llda.cosineSimilarity(baseline);
cosineSum += sim;
cosineCount++;
}
}
double avgCosine = cosineSum/cosineCount;