• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java ManhattanDistanceMeasure类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.apache.mahout.common.distance.ManhattanDistanceMeasure的典型用法代码示例。如果您正苦于以下问题:Java ManhattanDistanceMeasure类的具体用法?Java ManhattanDistanceMeasure怎么用?Java ManhattanDistanceMeasure使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

ManhattanDistanceMeasure类属于org.apache.mahout.common.distance包,在下文中一共展示了ManhattanDistanceMeasure类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getDistanceClass

点赞 3

import org.apache.mahout.common.distance.ManhattanDistanceMeasure; //导入依赖的package包/类
private DistanceMeasure getDistanceClass(String shortName){
	if (shortName.equalsIgnoreCase("manhattan")){
		return new ManhattanDistanceMeasure();
	} else if(shortName.equalsIgnoreCase("cosine")){
		return new CosineDistanceMeasure();
	} else if(shortName.equalsIgnoreCase("chebyshev")){
		return new ChebyshevDistanceMeasure();
	} else if(shortName.equalsIgnoreCase("euclidean")){
		return new EuclideanDistanceMeasure();
	} else if(shortName.equalsIgnoreCase("mahalanobis")){
		return new MahalanobisDistanceMeasure();
	} else if(shortName.equalsIgnoreCase("minkowski")){
		return new MinkowskiDistanceMeasure();
	} else if(shortName.equalsIgnoreCase("squaredeuclidean")){
		return new SquaredEuclideanDistanceMeasure();
	} else if(shortName.equalsIgnoreCase("tanimoto")){
		return new TanimotoDistanceMeasure();
	} else if(shortName.equalsIgnoreCase("weightedeuclidean")){
		return new WeightedEuclideanDistanceMeasure();
	} else if(shortName.equalsIgnoreCase("weightedmanhattan")){
		return new WeightedManhattanDistanceMeasure();
	} 
	return new ManhattanDistanceMeasure();
}
 

开发者ID:bytegriffin,
项目名称:recsys-offline,
代码行数:25,
代码来源:Constants.java

示例2: DistanceMeasureClusterDistribution

点赞 2

import org.apache.mahout.common.distance.ManhattanDistanceMeasure; //导入依赖的package包/类
public DistanceMeasureClusterDistribution(VectorWritable modelPrototype) {
  super(modelPrototype);
  this.measure = new ManhattanDistanceMeasure();
}
 

开发者ID:saradelrio,
项目名称:Chi-FRBCS-BigDataCS,
代码行数:5,
代码来源:DistanceMeasureClusterDistribution.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)