public abstract class GeneratedModel extends java.lang.Object implements IGeneratedModel
| Constructor and Description |
|---|
GeneratedModel() |
| Modifier and Type | Method and Description |
|---|---|
int |
getColIdx(java.lang.String name)
Returns index of column with give name or -1 if column is not found.
|
java.lang.String[] |
getDomainValues(int i)
Returns domain values for i-th column.
|
java.lang.String[] |
getDomainValues(java.lang.String name)
Gets domain of given column.
|
int |
getNumClasses(int i)
Get number of classes in in given column.
|
int |
getNumCols()
Returns number of columns used as input for training (i.e., exclude response column).
|
int |
getNumResponseClasses()
Return a number of classes in response column.
|
int |
getPredsSize()
Returns the expected size of preds array which is passed to
IGeneratedModel.predict(double[], float[]) function. |
int |
getResponseIdx()
Returns an index of the response column.
|
java.lang.String |
getResponseName()
The name of the response column.
|
static boolean |
grpContains(byte[] gcmp,
int offset,
int idx)
Return
true if the given index is in given bit array else false. |
boolean |
isClassifier()
Return true if this model represents a classifier, else it is used for regression.
|
double[] |
map(java.util.Map<java.lang.String,java.lang.Double> row,
double[] data)
Takes a HashMap mapping column names to doubles.
|
int |
mapEnum(int colIdx,
java.lang.String enumValue)
Maps given column's enum to integer used by this model.
|
float[] |
predict(java.util.Map<java.lang.String,java.lang.Double> row) |
float[] |
predict(java.util.Map<java.lang.String,java.lang.Double> row,
double[] data,
float[] preds) |
float[] |
predict(java.util.Map<java.lang.String,java.lang.Double> row,
float[] preds) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDomainValues, getNames, predict, predictpublic int getNumCols()
IGeneratedModelgetNumCols in interface IGeneratedModelpublic int getResponseIdx()
IGeneratedModelgetResponseIdx in interface IGeneratedModelpublic java.lang.String getResponseName()
IGeneratedModelgetResponseName in interface IGeneratedModelpublic int getNumResponseClasses()
IGeneratedModelgetNumResponseClasses in interface IGeneratedModelpublic boolean isClassifier()
IGeneratedModelisClassifier in interface IGeneratedModelpublic static boolean grpContains(byte[] gcmp,
int offset,
int idx)
true if the given index is in given bit array else false.
The method returns false if idx is less than
offset. It also returns false if the idx
is greater then length of given bit set!
gcmp - bit set arrayoffset - number of bits skipped by default since there are 0idx - index of bit to be checked if it is in bitsetpublic int getColIdx(java.lang.String name)
IGeneratedModelgetColIdx in interface IGeneratedModelpublic int getNumClasses(int i)
IGeneratedModelgetNumClasses in interface IGeneratedModelpublic java.lang.String[] getDomainValues(java.lang.String name)
IGeneratedModelgetDomainValues in interface IGeneratedModelname - column namepublic java.lang.String[] getDomainValues(int i)
IGeneratedModelgetDomainValues in interface IGeneratedModeli - index of columnpublic int mapEnum(int colIdx,
java.lang.String enumValue)
IGeneratedModelmapEnum in interface IGeneratedModelpublic int getPredsSize()
IGeneratedModelIGeneratedModel.predict(double[], float[]) function.getPredsSize in interface IGeneratedModelpublic double[] map(java.util.Map<java.lang.String,java.lang.Double> row,
double[] data)
Looks up the column names needed by the model, and places the doubles into the data array in the order needed by the model. Missing columns use NaN.
public float[] predict(java.util.Map<java.lang.String,java.lang.Double> row,
double[] data,
float[] preds)
public float[] predict(java.util.Map<java.lang.String,java.lang.Double> row,
float[] preds)
public float[] predict(java.util.Map<java.lang.String,java.lang.Double> row)