Examples of asFormatString()


Examples of org.apache.mahout.math.Vector.asFormatString()

        Vector theVec = point.getVector();
        line.append(',');
        if (theVec instanceof NamedVector){
          line.append(((NamedVector)theVec).getName());
        } else {
          String vecStr = theVec.asFormatString();
          //do some basic manipulations for display
          vecStr = VEC_PATTERN.matcher(vecStr).replaceAll("_");
          line.append(vecStr);
        }
      }
View Full Code Here

Examples of org.apache.mahout.math.Vector.asFormatString()

        float targetX = x + (float) (distance * Math.cos(angleRads));
        float targetY = y + (float) (distance * Math.sin(angleRads));
        if (theVec instanceof NamedVector) {
          vecStr = ((NamedVector) theVec).getName();
        } else {
          vecStr = theVec.asFormatString();
          //do some basic manipulations for display
          vecStr = VEC_PATTERN.matcher(vecStr).replaceAll("_");
        }
        if (subString > 0 && vecStr.length() > subString) {
          vecStr = vecStr.substring(0, subString);
View Full Code Here

Examples of org.apache.mahout.matrix.DenseVector.asFormatString()

    }
    Vector result = new DenseVector(doubles.size());
    int index = 0;
    for (Double d : doubles)
      result.set(index++, d);
    output.collect(null, new Text(result.asFormatString()));
  }

}
View Full Code Here

Examples of org.apache.mahout.matrix.SparseVector.asFormatString()

    }*/
    Text txt = new Text();
    SparseVector vector = new SparseVector();
    while (reader.next(txt, vector)) {
      count++;
      System.out.println("Txt: " + txt + " Vec: " + vector.asFormatString());
    }
    // the point [3.0,3.0] is covered by both canopies
    assertEquals("number of points", 2 + 2 * points.size(), count);
    reader.close();
  }
View Full Code Here

Examples of org.apache.mahout.matrix.Vector.asFormatString()

    }
    Vector result = new DenseVector(doubles.size());
    int index = 0;
    for (Double d : doubles)
      result.set(index++, d);
    output.collect(null, new Text(result.asFormatString()));
  }

}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.