本文整理汇总了Java中org.apache.mahout.math.Vector.maxValue方法的典型用法代码示例。如果您正苦于以下问题:Java Vector.maxValue方法的具体用法?Java Vector.maxValue怎么用?Java Vector.maxValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.mahout.math.Vector
的用法示例。
在下文中一共展示了Vector.maxValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: classifyAndWrite
import org.apache.mahout.math.Vector; //导入方法依赖的package包/类
private static void classifyAndWrite(List<Cluster> clusterModels, Double clusterClassificationThreshold,
boolean emitMostLikely, SequenceFile.Writer writer, VectorWritable vw, Vector pdfPerCluster) throws IOException {
if (emitMostLikely) {
int maxValueIndex = pdfPerCluster.maxValueIndex();
WeightedVectorWritable wvw = new WeightedVectorWritable(pdfPerCluster.maxValue(), vw.get());
write(clusterModels, writer, wvw, maxValueIndex);
} else {
writeAllAboveThreshold(clusterModels, clusterClassificationThreshold, writer, vw, pdfPerCluster);
}
}
示例2: shouldClassify
import org.apache.mahout.math.Vector; //导入方法依赖的package包/类
private boolean shouldClassify(Vector pdfPerCluster) {
return pdfPerCluster.maxValue() >= threshold;
}
示例3: shouldClassify
import org.apache.mahout.math.Vector; //导入方法依赖的package包/类
/**
* Decides whether the vector should be classified or not based on the max pdf
* value of the clusters and threshold value.
*
* @return whether the vector should be classified or not.
*/
private static boolean shouldClassify(Vector pdfPerCluster, Double clusterClassificationThreshold) {
return pdfPerCluster.maxValue() >= clusterClassificationThreshold;
}