Package org.apache.mahout.common.distance

Examples of org.apache.mahout.common.distance.DistanceMeasure.configure()


  protected void setup(Context context) throws IOException, InterruptedException {
    super.setup(context);
    Configuration conf = context.getConfiguration();
    DistanceMeasure measure =
        ClassUtils.instantiateAs(conf.get(KMeansConfigKeys.DISTANCE_MEASURE_KEY), DistanceMeasure.class);
    measure.configure(conf);

    this.clusterer = new KMeansClusterer(measure);

    String clusterPath = conf.get(KMeansConfigKeys.CLUSTER_PATH_KEY);
    if (clusterPath != null && !clusterPath.isEmpty()) {
View Full Code Here


  protected void setup(Context context) throws IOException, InterruptedException {
    super.setup(context);
    Configuration conf = context.getConfiguration();
    DistanceMeasure measure =
        ClassUtils.instantiateAs(conf.get(KMeansConfigKeys.DISTANCE_MEASURE_KEY), DistanceMeasure.class);
    measure.configure(conf);

    String clusterPath = conf.get(KMeansConfigKeys.CLUSTER_PATH_KEY);
    if (clusterPath != null && !clusterPath.isEmpty()) {
      KMeansUtil.configureWithClusterInfo(conf, new Path(clusterPath), clusters);
      if (clusters.isEmpty()) {
View Full Code Here

  protected void setup(Context context) throws IOException, InterruptedException {
    super.setup(context);
    Configuration conf = context.getConfiguration();
    DistanceMeasure measure =
        ClassUtils.instantiateAs(conf.get(KMeansConfigKeys.DISTANCE_MEASURE_KEY), DistanceMeasure.class);
    measure.configure(conf);

    this.convergenceDelta = Double.parseDouble(conf.get(KMeansConfigKeys.CLUSTER_CONVERGENCE_KEY));
    this.clusterer = new KMeansClusterer(measure);
    this.clusterMap = Maps.newHashMap();
View Full Code Here

    Configuration conf = context.getConfiguration();
    try {
      ClassLoader ccl = Thread.currentThread().getContextClassLoader();
      DistanceMeasure measure = ccl.loadClass(conf.get(KMeansConfigKeys.DISTANCE_MEASURE_KEY))
          .asSubclass(DistanceMeasure.class).newInstance();
      measure.configure(conf);

      this.clusterer = new KMeansClusterer(measure);

      String clusterPath = conf.get(KMeansConfigKeys.CLUSTER_PATH_KEY);
      if ((clusterPath != null) && (clusterPath.length() > 0)) {
View Full Code Here

    Configuration conf = context.getConfiguration();
    try {
      ClassLoader ccl = Thread.currentThread().getContextClassLoader();
      DistanceMeasure measure = ccl.loadClass(conf.get(KMeansConfigKeys.DISTANCE_MEASURE_KEY))
          .asSubclass(DistanceMeasure.class).newInstance();
      measure.configure(conf);
     
      String clusterPath = conf.get(KMeansConfigKeys.CLUSTER_PATH_KEY);
      if ((clusterPath != null) && (clusterPath.length() > 0)) {
        KMeansUtil.configureWithClusterInfo(new Path(clusterPath), clusters);
        if (clusters.isEmpty()) {
View Full Code Here

    super.configure(job);
    try {
      ClassLoader ccl = Thread.currentThread().getContextClassLoader();
      Class<?> cl = ccl.loadClass(job.get(KMeansConfigKeys.DISTANCE_MEASURE_KEY));
      DistanceMeasure measure = (DistanceMeasure) cl.newInstance();
      measure.configure(job);
     
      this.clusterer = new KMeansClusterer(measure);
     
      String clusterPath = job.get(KMeansConfigKeys.CLUSTER_PATH_KEY);
      if ((clusterPath != null) && (clusterPath.length() > 0)) {
View Full Code Here

   
    try {
      ClassLoader ccl = Thread.currentThread().getContextClassLoader();
      Class<?> cl = ccl.loadClass(job.get(KMeansConfigKeys.DISTANCE_MEASURE_KEY));
      DistanceMeasure measure = (DistanceMeasure) cl.newInstance();
      measure.configure(job);
     
      String clusterPath = job.get(KMeansConfigKeys.CLUSTER_PATH_KEY);
      if ((clusterPath != null) && (clusterPath.length() > 0)) {
        KMeansUtil.configureWithClusterInfo(clusterPath, clusters);
        if (clusters.isEmpty()) {
View Full Code Here

     
    modelDistribution.setModelPrototype(new VectorWritable(prototype));

    if (modelDistribution instanceof DistanceMeasureClusterDistribution) {
      DistanceMeasure measure = ClassUtils.instantiateAs(distanceMeasure, DistanceMeasure.class);
      measure.configure(conf);
      ((DistanceMeasureClusterDistribution) modelDistribution).setMeasure(measure);
    }

    return modelDistribution;
  }
View Full Code Here

    Configuration conf = context.getConfiguration();
    try {
      ClassLoader ccl = Thread.currentThread().getContextClassLoader();
      DistanceMeasure measure = ccl.loadClass(conf.get(KMeansConfigKeys.DISTANCE_MEASURE_KEY))
          .asSubclass(DistanceMeasure.class).newInstance();
      measure.configure(conf);

      this.convergenceDelta = Double.parseDouble(conf.get(KMeansConfigKeys.CLUSTER_CONVERGENCE_KEY));
      this.clusterer = new KMeansClusterer(measure);
      this.clusterMap = new HashMap<String, Cluster>();
View Full Code Here

    Configuration conf = context.getConfiguration();
    try {
      ClassLoader ccl = Thread.currentThread().getContextClassLoader();
      DistanceMeasure measure = ccl.loadClass(conf.get(KMeansConfigKeys.DISTANCE_MEASURE_KEY))
          .asSubclass(DistanceMeasure.class).newInstance();
      measure.configure(conf);

      this.clusterer = new KMeansClusterer(measure);

      String clusterPath = conf.get(KMeansConfigKeys.CLUSTER_PATH_KEY);
      if (clusterPath != null && clusterPath.length() > 0) {
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.