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.
|
java.lang.String |
getHeader() |
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 |
isAutoEncoder() |
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, wait
getDomainValues, getNames, getUUID, predict, predict
public int getNumCols()
IGeneratedModel
getNumCols
in interface IGeneratedModel
public int getResponseIdx()
IGeneratedModel
getResponseIdx
in interface IGeneratedModel
public java.lang.String getResponseName()
IGeneratedModel
getResponseName
in interface IGeneratedModel
public int getNumResponseClasses()
IGeneratedModel
getNumResponseClasses
in interface IGeneratedModel
public boolean isClassifier()
IGeneratedModel
isClassifier
in interface IGeneratedModel
public 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 java.lang.String getHeader()
public boolean isAutoEncoder()
public int getColIdx(java.lang.String name)
IGeneratedModel
getColIdx
in interface IGeneratedModel
public int getNumClasses(int i)
IGeneratedModel
getNumClasses
in interface IGeneratedModel
public java.lang.String[] getDomainValues(java.lang.String name)
IGeneratedModel
getDomainValues
in interface IGeneratedModel
name
- column namepublic java.lang.String[] getDomainValues(int i)
IGeneratedModel
getDomainValues
in interface IGeneratedModel
i
- index of columnpublic int mapEnum(int colIdx, java.lang.String enumValue)
IGeneratedModel
mapEnum
in interface IGeneratedModel
public int getPredsSize()
IGeneratedModel
IGeneratedModel.predict(double[], float[])
function.getPredsSize
in interface IGeneratedModel
public 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)