Package org.apache.mahout.clustering

Examples of org.apache.mahout.clustering.WeightedPropertyVectorWritable


      writer.write("\tWeight : [props - optional]:  Point:\n\t");
      for (Iterator<WeightedVectorWritable> iterator = points.iterator(); iterator.hasNext(); ) {
        WeightedVectorWritable point = iterator.next();
        writer.write(String.valueOf(point.getWeight()));
        if (point instanceof WeightedPropertyVectorWritable) {
          WeightedPropertyVectorWritable tmp = (WeightedPropertyVectorWritable) point;
          Map<Text, Text> map = tmp.getProperties();
          writer.write(" : [");
          for (Map.Entry<Text, Text> entry : map.entrySet()) {
            writer.write(entry.getKey().toString());
            writer.write("=");
            writer.write(entry.getValue().toString());
View Full Code Here


        nearestDistance = distance;
      }
    }
    Map<Text, Text> props = new HashMap<Text, Text>();
    props.put(new Text("distance"), new Text(String.valueOf(nearestDistance)));
    context.write(new IntWritable(nearestCluster.getId()), new WeightedPropertyVectorWritable(1, vector, props));
  }
View Full Code Here

TOP

Related Classes of org.apache.mahout.clustering.WeightedPropertyVectorWritable

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.