Hadoop 如何读取负面分类结果
我使用Mahout 0.8,在使用NaiveBayes分类后,我得到了结果:Hadoop 如何读取负面分类结果,hadoop,vector,classification,mahout,Hadoop,Vector,Classification,Mahout,我使用Mahout 0.8,在使用NaiveBayes分类后,我得到了结果: FileName Category Score 1000221 male -13059.636009313888 1000378369 female -6660.011396382251 10004522 male -20388.73959786186 怎么读这个分数?我想得到每个文件名的准确性。在代码中,我有: // some
FileName Category Score
1000221 male -13059.636009313888
1000378369 female -6660.011396382251
10004522 male -20388.73959786186
怎么读这个分数?我想得到每个文件名的准确性。在代码中,我有:
// some code...
vector.setQuick(wordId, tfValue);
// some code...
Vector resultVector = classifier.classifyFull(vector);
double bestScore = -Double.MAX_VALUE;
for(Element element: resultVector.all()) {
int categoryId = element.index();
double score = element.get();
if (score > bestScore) {
bestScore = score;
bestCategoryId = categoryId;
}
}
return bestScore;