All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hex.ClusteringModel Maven / Gradle / Ivy

There is a newer version: 3.8.2.9
Show newest version
package hex;

import water.Key;
import water.util.SB;
import water.util.TwoDimTable;

/** Clustering Model
 *  Generates a 2-D array of clusters.
 */
public abstract class ClusteringModel, P extends ClusteringModel.ClusteringParameters, O extends ClusteringModel.ClusteringOutput> extends Model {

  public ClusteringModel( Key selfKey, P parms, O output ) { super(selfKey,parms,output);  }

  /** Clustering Model Parameters includes the number of clusters desired */
  public abstract static class ClusteringParameters extends Model.Parameters {
    /** Clustering models must specify the number of clusters to generate */
    public int _k = 1;
  }

  /** Output from all Clustering Models, includes generated clusters */
  public abstract static class ClusteringOutput extends Model.Output {
    /** Cluster centers_raw.  During model init, might be null or might have a "k"
    *   which is oversampled a lot.  Not standardized (although if standardization
    *   is used during the building process, the *builders* cluster centers_raw are standardized). */
    public double[/*k*/][/*features*/] _centers_raw;
    public double[/*k*/][/*features*/] _centers_std_raw;
    // For internal use only: means and 1/(std dev) of each training col
    public double[] _normSub;
    public double[] _normMul;

    public ClusteringOutput() {
      this(null);
    }

    /** Any final prep-work just before model-building starts, but after the
     *  user has clicked "go". */
    public ClusteringOutput(ClusteringModelBuilder b) { super(b); }

    @Override public boolean isSupervised() { return false; }

    // Output classes is weird for clustering - it's like a regression
    public int nclasses() { return 1; }

    @Override public ModelCategory getModelCategory() { return ModelCategory.Clustering; }
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy