public class DataBaseSOMLibSparseInputData extends AbstractSOMLibSparseInputData
InputData
by reading the vector information from a database.Modifier and Type | Field and Description |
---|---|
private MySQLConnector |
dbConnector |
classInfo, contentType, dataNames, dim, ERROR_MESSAGE_FILE_FORMAT_CORRUPT, featureMatrixCols, featureMatrixRows, isNormalized, meanVector, mqe0, nameCache, numVectors, rand, source, templateVector
inputFileNameSuffix, MISSING_VALUE
Constructor and Description |
---|
DataBaseSOMLibSparseInputData(MySQLConnector dbConnector,
boolean sparse,
boolean norm,
int numCacheBlocks,
long seed) |
DataBaseSOMLibSparseInputData(MySQLConnector dbConnector,
boolean sparse,
java.lang.String classInfoFileName,
boolean norm,
int numCacheBlocks,
long seed) |
Modifier and Type | Method and Description |
---|---|
protected void |
calculateMeanVector()
Initialise the mean-vector.
|
private java.lang.String |
getErrorMessage(java.lang.Exception e) |
InputDatum |
getInputDatum(int index)
Get an input datum with a specified index.
|
double[] |
getInputVector(int d)
Get the vector for the input datum of the specified index
|
double |
getValue(int x,
int y)
Returns the value of the y-th feature of input vector x.
|
double |
mqe0(DistanceMetric metric)
Calculates the mean quantisation error of the top-level unit.
|
private cern.colt.matrix.DoubleMatrix1D |
readVectorFromDataBase(int rowindex)
Read a vector from the database, identified by the given index.
|
private void |
readVectorMetaDataFromDataBase()
Read input meta data from the database.
|
InputData |
subset(java.lang.String[] names)
TODO: this reads the whole subset into the memory.
|
classInformation, create, dim, equals, getByNameDistanceSorted, getContentType, getData, getData, getDataIntervals, getDataSource, getDistanceMatrix, getDistances, getFeatureDensities, getFeatureMatrixColumns, getFeatureMatrixRows, getFileNameSuffix, getFormatName, getInputDatum, getInputDatum, getInputDatumIndex, getLabel, getLabels, getMaxValue, getMeanVector, getMeanVector, getMinValue, getNearestDistances, getNearestN, getNearestN, getNearestNUnsorted, getRandomInputDatum, initDistanceMatrix, isNormalizedToUnitLength, numVectors, setClassInfo, setTemplateVector, templateVector, transformValues
private MySQLConnector dbConnector
public DataBaseSOMLibSparseInputData(MySQLConnector dbConnector, boolean sparse, boolean norm, int numCacheBlocks, long seed)
public DataBaseSOMLibSparseInputData(MySQLConnector dbConnector, boolean sparse, java.lang.String classInfoFileName, boolean norm, int numCacheBlocks, long seed) throws SOMToolboxException
SOMToolboxException
private void readVectorMetaDataFromDataBase()
numVectors()
)dim()
)dataNames
)nameCache
)getMeanVector()
)public InputDatum getInputDatum(int index)
InputData
index
- the index of the input datum.public double[] getInputVector(int d)
InputData
private cern.colt.matrix.DoubleMatrix1D readVectorFromDataBase(int rowindex)
rowindex
- the index of the vector.public double mqe0(DistanceMetric metric)
InputData
metric
- the metric to use for distance calculation.public InputData subset(java.lang.String[] names)
names
- the label names of the desired subset data.InputData.subset(java.lang.String[])
protected void calculateMeanVector() throws java.sql.SQLException
java.sql.SQLException
private java.lang.String getErrorMessage(java.lang.Exception e)
public double getValue(int x, int y)
InputData