Package org.apache.mahout.clustering.classify

Examples of org.apache.mahout.clustering.classify.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();
          // map can be null since empty maps when written are returned as null
          writer.write(" : [");
          if (map != null) {
            for (Map.Entry<Text,Text> entry : map.entrySet()) {
              writer.write(entry.getKey().toString());
View Full Code Here


    Map<Integer,List<WeightedPropertyVectorWritable>> clusterIdToPoints = getClusterIdToPoints();
    List<WeightedPropertyVectorWritable> points = clusterIdToPoints.get(clusterWritable.getValue().getId());
    if (points != null) {
      writer.write("\tWeight : [props - optional]:  Point:\n\t");
      for (Iterator<WeightedPropertyVectorWritable> iterator = points.iterator(); iterator.hasNext();) {
        WeightedPropertyVectorWritable point = iterator.next();
        writer.write(String.valueOf(point.getWeight()));
        Map<Text,Text> map = point.getProperties();
        // map can be null since empty maps when written are returned as null
        writer.write(" : [");
        if (map != null) {
          for (Map.Entry<Text,Text> entry : map.entrySet()) {
            writer.write(entry.getKey().toString());
            writer.write("=");
            writer.write(entry.getValue().toString());
          }
        }
        writer.write("]");
       
        writer.write(": ");
       
        writer.write(AbstractCluster.formatVector(point.getVector(), dictionary));
        if (iterator.hasNext()) {
          writer.write("\n\t");
        }
      }
      writer.write('\n');
View Full Code Here

TOP

Related Classes of org.apache.mahout.clustering.classify.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.