예제 #1
0
  /**
   * Gets the current settings of SimpleKMeans.
   *
   * @return an array of strings suitable for passing to setOptions()
   */
  public String[] getOptions() {
    ArrayList<String> options = new ArrayList<String>();

    options.add("-I");
    options.add("" + getMaxIterations());
    options.add("-min");
    options.add("" + getMinNumClusters());
    options.add("-max");
    options.add("" + getMaxNumClusters());
    options.add("-restarts");
    options.add("" + getRestarts());
    if (isManuallySelectNumClusters()) {
      options.add("-manual");
    }
    if (getInitializeUsingKMeansPlusPlusMethod()) {
      options.add("-P");
    }
    if (isPrintDebug()) {
      options.add("-debug");
    }

    options.add("-A");
    options.add(
        (distanceFunction.getClass().getName()
                + " "
                + Utils.joinOptions(distanceFunction.getOptions()))
            .trim());

    return (String[]) options.toArray(new String[options.size()]);
  }
예제 #2
0
  /**
   * Ustawia w??asn?? funkcj?? obliczaj??c?? odleg??o???? mi??dzy klastrami.
   *
   * @param distanceFunction Obiekt z funkcj?? dystansu.
   */
  public void setDistanceFunction(DistanceFunction distanceFunction) {
    this.instancesForDistanceFunction = distanceFunction.getInstances().toString();
    this.attributeIndicesForDistanceFunction = distanceFunction.getAttributeIndices();
    this.invertSelectionForDistanceFunction = distanceFunction.getInvertSelection();
    this.optionsForDistanseFunction = distanceFunction.getOptions().clone();

    // this.distanceFunction = distanceFunction;
  }