|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwater.Iced
water.OldModel
public abstract class OldModel
A Model models reality (hopefully). A model can be used to 'score' a row, or a collection of rows on any compatible dataset - meaning the row has all the columns with the same names as used to build the mode.
Field Summary | |
---|---|
Key |
_dataKey
Dataset key used to *build* the model, for models for which this makes sense, or null otherwise. |
Key |
_selfKey
Key associated with this OldModel, if any. |
ValueArray |
_va
Columns used in the model. |
static DocGen.FieldDoc[] |
DOC_FIELDS
|
Constructor Summary | |
---|---|
OldModel()
Empty constructor for deserialization |
|
OldModel(Key key)
|
|
OldModel(Key key,
int[] cols,
Key dataKey)
Default model, built from the selected columns of the given dataset. |
|
OldModel(Key key,
OldModel m)
Simple shallow copy constructor |
|
OldModel(Key key,
java.lang.String[] colNames,
java.lang.String[] classNames)
Default artificial model, built from given column names. |
|
OldModel(Key key,
ValueArray va,
Key dataKey)
Artificial model. |
Method Summary | |
---|---|
OldModel |
adapt(java.lang.String[] colNames)
Adapt model for given columns. |
OldModel |
adapt(ValueArray ary)
Adapt model for the given dataset. |
boolean |
columnFilter(ValueArray.Column C)
|
int[] |
columnMapping(java.lang.String[] names)
Map from the model's columns to the given column names, or to -1 if no column name maps. |
void |
delete()
Called when deleting this model, to cleanup any internal keys |
void |
fromJson(com.google.gson.JsonObject json)
|
static boolean |
identityMap(int[] mapping)
Check that this is the identity map |
static boolean |
isCompatible(int[] mapping)
Check if this mapping is compatible. |
boolean |
isCompatible(java.lang.String[] names)
Check if this model is compatible with this collection of column names. |
boolean |
isCompatible(ValueArray data)
Check if this dataset is compatible with this model. |
ValueArray.Column |
response()
Response column info |
java.lang.String |
responseName()
|
double |
score(double[] data)
|
double |
score(ValueArray ary,
AutoBuffer bits,
int rid)
|
protected abstract double |
score0(double[] 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.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 |
---|
public static DocGen.FieldDoc[] DOC_FIELDS
public final Key _selfKey
public final ValueArray _va
public final Key _dataKey
Constructor Detail |
---|
public OldModel()
public OldModel(Key key)
public OldModel(Key key, int[] cols, Key dataKey)
public OldModel(Key key, java.lang.String[] colNames, java.lang.String[] classNames)
public OldModel(Key key, ValueArray va, Key dataKey)
public OldModel(Key key, OldModel m)
Method Detail |
---|
public boolean columnFilter(ValueArray.Column C)
public void delete()
public final ValueArray.Column response()
public final java.lang.String responseName()
public final int[] columnMapping(java.lang.String[] names)
public static boolean identityMap(int[] mapping)
public static boolean isCompatible(int[] mapping)
public final boolean isCompatible(java.lang.String[] names)
public final boolean isCompatible(ValueArray data)
public OldModel adapt(ValueArray ary)
ary
- - tst dataset
public OldModel adapt(java.lang.String[] colNames)
colNames
-
public double score(double[] data)
public double score(ValueArray ary, AutoBuffer bits, int rid)
protected abstract double score0(double[] data)
protected double score0(ValueArray data, int row)
protected double score0(ValueArray data, AutoBuffer ab, int row_in_chunk)
public com.google.gson.JsonObject toJson()
public void fromJson(com.google.gson.JsonObject json)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |