hex
Class KMeans2.KMeans2Model

java.lang.Object
  extended by water.Iced
      extended by water.Model
          extended by hex.KMeans2.KMeans2Model
All Implemented Interfaces:
java.lang.Cloneable, Freezable, Job.Progress
Enclosing class:
KMeans2

public static class KMeans2.KMeans2Model
extends Model
implements Job.Progress


Nested Class Summary
 
Nested classes/interfaces inherited from class water.Model
Model.SB
 
Field Summary
 double[][] clusters
           
 double error
           
 int iterations
           
 int max_iter
           
 boolean normalized
           
 
Fields inherited from class water.Model
_dataKey, _domains, _names, _selfKey, DOC_FIELDS
 
Constructor Summary
KMeans2.KMeans2Model(Key selfKey, Key dataKey, Frame fr)
           
 
Method Summary
 float progress()
           
protected  float[] score0(Chunk[] chunks, int rowInChunk, double[] tmp, float[] preds)
          Bulk scoring API for one row.
protected  float[] score0(double[] data, float[] preds)
          Subclasses implement the scoring logic.
 
Methods inherited from class water.Model
adapt, classNames, cm, delete, getDomainMapping, isClassifier, nclasses, responseName, score, score, score, score, score, testJavaScoring, toJava, toJavaInit, toJavaInit, toJavaPredictBody
 
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

clusters

public double[][] clusters

error

public double error

normalized

public boolean normalized

max_iter

public int max_iter

iterations

public int iterations
Constructor Detail

KMeans2.KMeans2Model

public KMeans2.KMeans2Model(Key selfKey,
                            Key dataKey,
                            Frame fr)
Method Detail

progress

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

score0

protected float[] score0(Chunk[] chunks,
                         int rowInChunk,
                         double[] tmp,
                         float[] preds)
Description copied from class: Model
Bulk scoring API for one row. Chunks are all compatible with the model, and expect the last Chunks are for the final distribution & prediction. Default method is to just load the data into the tmp array, then call subclass scoring logic.

Overrides:
score0 in class Model

score0

protected float[] score0(double[] data,
                         float[] preds)
Description copied from class: Model
Subclasses implement the scoring logic. The data is pre-loaded into a re-used temp array, in the order the model expects. The predictions are loaded into the re-used temp array, which is also returned.

Specified by:
score0 in class Model