Package org.apache.mahout.utils

Examples of org.apache.mahout.utils.DistanceMeasure


      String distanceMeasureClass, double threshold, int numIter)
      throws Exception {
    ClassLoader ccl = Thread.currentThread().getContextClassLoader();
    Class<?> cl = ccl.loadClass(distanceMeasureClass);

    DistanceMeasure measure = (DistanceMeasure) cl.newInstance();
    SoftCluster.config(measure, threshold);
    boolean converged = false;
    for (int iter = 0; !converged && iter < numIter; iter++) {
      converged = iterateReference(points, clusterList, measure);
    }
View Full Code Here


  public void testFuzzyKMeansMapper() throws Exception {
    List<Vector> points = TestKmeansClustering
        .getPoints(TestKmeansClustering.reference);

    DistanceMeasure measure = new EuclideanDistanceMeasure();
    SoftCluster.config(measure, 0.001);

    for (int k = 0; k < points.size(); k++) {
      System.out.println("testKFuzzyKMeansMRJob k= " + k);
      // pick k initial cluster centers at random
View Full Code Here

  public void testFuzzyKMeansCombiner() throws Exception {
    List<Vector> points = TestKmeansClustering
        .getPoints(TestKmeansClustering.reference);

    DistanceMeasure measure = new EuclideanDistanceMeasure();
    SoftCluster.config(measure, 0.001);

    for (int k = 0; k < points.size(); k++) {
      System.out.println("testKFuzzyKMeansMRJob k= " + k);
      // pick k initial cluster centers at random
View Full Code Here

  public void testFuzzyKMeansReducer() throws Exception {
    List<Vector> points = TestKmeansClustering
        .getPoints(TestKmeansClustering.reference);

    DistanceMeasure measure = new EuclideanDistanceMeasure();
    SoftCluster.config(measure, 0.001);

    for (int k = 0; k < points.size(); k++) {
      System.out.println("testKFuzzyKMeansMRJob k= " + k);
      // pick k initial cluster centers at random
View Full Code Here

  public void testFuzzyKMeansClusterMapper() throws Exception {
    List<Vector> points = TestKmeansClustering
        .getPoints(TestKmeansClustering.reference);

    DistanceMeasure measure = new EuclideanDistanceMeasure();
    SoftCluster.config(measure, 0.001);

    for (int k = 0; k < points.size(); k++) {
      System.out.println("testKFuzzyKMeansMRJob k= " + k);
      // pick k initial cluster centers at random
View Full Code Here

   *
   * @throws Exception
   */
  public void testReferenceImplementation() throws Exception {
    List<Vector> points = getPoints(reference);
    DistanceMeasure measure = new EuclideanDistanceMeasure();
    Cluster.config(measure, 0.001);
    // try all possible values of k
    for (int k = 0; k < points.size(); k++) {
      System.out.println("Test k=" + (k + 1) + ':');
      // pick k initial cluster centers at random
View Full Code Here

TOP

Related Classes of org.apache.mahout.utils.DistanceMeasure

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.