public class VectorFileToRandomAccessFileConverter extends SOMLibSparseInputData
This is a specific, memory saving implementation, that could otherwise be handled with
InputDataFileFormatConverter
Modifier and Type | Field and Description |
---|---|
private java.io.RandomAccessFile |
file |
(package private) boolean |
headerWritten |
data, DEFAULT_NORMALISED, DEFAULT_NUM_CACHE_BLOCKS, DEFAULT_RANDOM_SEED, DEFAULT_SPARSE, INPUT_VECTOR_FILE_FORMAT_CORRUPT_MESSAGE, nonZeros, sparse
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 |
---|
VectorFileToRandomAccessFileConverter(java.lang.String inputVectorFile) |
Modifier and Type | Method and Description |
---|---|
protected void |
initMatrix(boolean sparse) |
static void |
main(java.lang.String[] args)
Starts the conversion
|
protected void |
processLine(int documentIndex,
java.lang.String[] lineElements)
Stores the information read in the random access file.
|
addInstance, getDataAsMatrix, getDimensionality, getInputDatum, getInputVector, getValue, init, initDataStructures, mqe0, openFile, parse, parseDouble, readVectorFile, setLabel, setMatrixValue, setValue, subset
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
public VectorFileToRandomAccessFileConverter(java.lang.String inputVectorFile) throws java.io.IOException
java.io.IOException
protected void processLine(int documentIndex, java.lang.String[] lineElements) throws java.lang.Exception
processLine
in class SOMLibSparseInputData
documentIndex
- the line indexlineElements
- the line elements, split by the delimetersjava.lang.Exception
protected void initMatrix(boolean sparse)
initMatrix
in class SOMLibSparseInputData
public static void main(java.lang.String[] args) throws java.io.IOException
args
- Needed program arguments:
java.io.IOException
- If the input vector file can't be read, or the output binary file can't be written.