hex
Class KMeansModel

java.lang.Object
  extended by water.Iced
      extended by water.OldModel
          extended by hex.KMeansModel
All Implemented Interfaces:
java.lang.Cloneable, Freezable, Job.Progress

public class KMeansModel
extends OldModel
implements Job.Progress


Nested Class Summary
static class KMeansModel.KMeansApply
           
static class KMeansModel.KMeansScore
           
 
Field Summary
 double[][] _clusters
           
 double _error
           
 KMeans.Initialization _initialization
           
 int _iteration
           
 int _maxIter
           
 boolean _normalized
           
 long _randSeed
           
static java.lang.String NAME
           
 
Fields inherited from class water.OldModel
_dataKey, _selfKey, _va, DOC_FIELDS
 
Constructor Summary
KMeansModel(Key selfKey, int[] cols, Key dataKey)
           
 
Method Summary
 double[][] clusters()
           
 boolean columnFilter(ValueArray.Column C)
           
 void print()
           
 float progress()
           
protected  double score0(double[] data)
          Single row scoring, on properly ordered data.
protected  double score0(ValueArray data, AutoBuffer ab, int row_in_chunk)
          Bulk scoring API, on a compatible ValueArray (when pushed throw the mapping)
protected  double score0(ValueArray data, int row)
          Single row scoring, on a compatible ValueArray (when pushed throw the mapping)
 com.google.gson.JsonObject toJson()
           
 
Methods inherited from class water.OldModel
adapt, adapt, columnMapping, delete, fromJson, identityMap, isCompatible, isCompatible, isCompatible, response, responseName, score, score
 
Methods inherited from class water.Iced
clone, frozenType, init, newInstance, read, toDocField, write, writeJSON, writeJSONFields
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME

_clusters

public double[][] _clusters

_error

public double _error

_iteration

public int _iteration

_initialization

public KMeans.Initialization _initialization

_maxIter

public int _maxIter

_randSeed

public long _randSeed

_normalized

public boolean _normalized
Constructor Detail

KMeansModel

public KMeansModel(Key selfKey,
                   int[] cols,
                   Key dataKey)
Method Detail

progress

public float progress()
Specified by:
progress in interface Job.Progress

columnFilter

public boolean columnFilter(ValueArray.Column C)
Overrides:
columnFilter in class OldModel

toJson

public com.google.gson.JsonObject toJson()
Overrides:
toJson in class OldModel

clusters

public double[][] clusters()

score0

protected double score0(double[] data)
Single row scoring, on properly ordered data. Will return NaN if any data element contains a NaN. Returns the cluster-number, which is mostly an internal value. Last data element refers to the response variable, which is not used for k-means.

Specified by:
score0 in class OldModel

score0

protected double score0(ValueArray data,
                        int row)
Single row scoring, on a compatible ValueArray (when pushed throw the mapping)

Overrides:
score0 in class OldModel

score0

protected double score0(ValueArray data,
                        AutoBuffer ab,
                        int row_in_chunk)
Bulk scoring API, on a compatible ValueArray (when pushed throw the mapping)

Overrides:
score0 in class OldModel

print

public final void print()