public static class SparseMatrixFormatterFactory.SparseMatrixDataFormatter extends LibSVMFormatterFactory.LibSVMFormatter
Modifier and Type | Field and Description |
---|---|
(package private) InstanceDataExporter |
instanceDataExporter |
(package private) InstanceData |
instanceLabel |
exportProperties, kernelUtil, labelToClassIndexMap, maxAttributeIndex, nominalAttributeMap, numericAttributeMap, outdir
ATTR_INSTANCE_ID, SCOPE, SCOPE_FOLD, SCOPE_LABEL
Constructor and Description |
---|
SparseMatrixFormatterFactory.SparseMatrixDataFormatter(InstanceDataExporter instanceDataExporter,
KernelUtil kernelUtil) |
Modifier and Type | Method and Description |
---|---|
protected int |
exportAttributeNames(java.io.BufferedWriter w,
SparseData sparseData)
add instance_id as first in the map of numeric attribute
|
void |
exportFold(SparseData sparseData,
java.util.SortedMap<java.lang.Long,java.lang.String> instanceClassMap,
boolean train,
java.lang.String label,
java.lang.Integer run,
java.lang.Integer fold)
export the given train/test set
|
private void |
exportSparseMatrix(SparseData sparseData,
java.lang.String label,
java.lang.Integer run,
java.lang.Integer fold) |
protected java.util.SortedMap<java.lang.Integer,java.lang.Double> |
getSparseLineValues(SparseData bagOfWordsData,
java.util.Map<java.lang.String,java.lang.Integer> numericAttributeMap,
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Integer>> nominalAttributeMap,
long instanceId)
add instance_id to sparse line values
|
void |
initializeExport(InstanceData instanceLabel,
java.util.Properties properties,
SparseData sparseData)
get needed properties out of outdir.
|
void |
initializeFold(SparseData sparseData,
java.lang.String label,
java.lang.Integer run,
java.lang.Integer fold,
java.util.SortedMap<java.lang.Boolean,java.util.SortedMap<java.lang.Long,java.lang.String>> foldInstanceLabelMap)
write a file with the attribute names corresponding to the indices in
the libsvm data file
|
void |
initializeLabel(java.lang.String label,
java.util.SortedMap<java.lang.Integer,java.util.SortedMap<java.lang.Integer,java.util.SortedMap<java.lang.Boolean,java.util.SortedMap<java.lang.Long,java.lang.String>>>> labelInstances,
java.util.Properties properties,
SparseData sparseData) |
clearFold, clearLabel, exportDataForInstances, exportDataForLabel, writeLibsvmLine
addNumericAttribute, exportAttributeNames, exportSparseMatrix, exportSparseRow, updateLabelClassMapTransductive
InstanceData instanceLabel
InstanceDataExporter instanceDataExporter
public SparseMatrixFormatterFactory.SparseMatrixDataFormatter(InstanceDataExporter instanceDataExporter, KernelUtil kernelUtil)
public void initializeExport(InstanceData instanceLabel, java.util.Properties properties, SparseData sparseData) throws java.io.IOException
BaseSparseDataFormatter
initializeExport
in interface SparseDataFormatter
initializeExport
in class LibSVMFormatterFactory.LibSVMFormatter
java.io.IOException
public void initializeLabel(java.lang.String label, java.util.SortedMap<java.lang.Integer,java.util.SortedMap<java.lang.Integer,java.util.SortedMap<java.lang.Boolean,java.util.SortedMap<java.lang.Long,java.lang.String>>>> labelInstances, java.util.Properties properties, SparseData sparseData) throws java.io.IOException
initializeLabel
in interface SparseDataFormatter
initializeLabel
in class LibSVMFormatterFactory.LibSVMFormatter
java.io.IOException
public void initializeFold(SparseData sparseData, java.lang.String label, java.lang.Integer run, java.lang.Integer fold, java.util.SortedMap<java.lang.Boolean,java.util.SortedMap<java.lang.Long,java.lang.String>> foldInstanceLabelMap) throws java.io.IOException
LibSVMFormatterFactory.LibSVMFormatter
initializeFold
in interface SparseDataFormatter
initializeFold
in class LibSVMFormatterFactory.LibSVMFormatter
java.io.IOException
public void exportFold(SparseData sparseData, java.util.SortedMap<java.lang.Long,java.lang.String> instanceClassMap, boolean train, java.lang.String label, java.lang.Integer run, java.lang.Integer fold) throws java.io.IOException
LibSVMFormatterFactory.LibSVMFormatter
exportFold
in interface SparseDataFormatter
exportFold
in class LibSVMFormatterFactory.LibSVMFormatter
java.io.IOException
private void exportSparseMatrix(SparseData sparseData, java.lang.String label, java.lang.Integer run, java.lang.Integer fold) throws java.io.IOException
java.io.IOException
protected int exportAttributeNames(java.io.BufferedWriter w, SparseData sparseData) throws java.io.IOException
exportAttributeNames
in class BaseSparseDataFormatter
java.io.IOException
protected java.util.SortedMap<java.lang.Integer,java.lang.Double> getSparseLineValues(SparseData bagOfWordsData, java.util.Map<java.lang.String,java.lang.Integer> numericAttributeMap, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Integer>> nominalAttributeMap, long instanceId)
getSparseLineValues
in class BaseSparseDataFormatter