public static class SVMLightFormatterFactory.SVMLightFormatter extends LibSVMFormatterFactory.LibSVMFormatter
Modifier and Type | Field and Description |
---|---|
protected SortedMap<Boolean,SortedMap<Long,String>> |
foldInstanceLabelMap |
exportProperties, kernelUtil, labelToClassIndexMap, maxAttributeIndex, nominalAttributeMap, numericAttributeMap, outdir
ATTR_INSTANCE_ID, SCOPE, SCOPE_FOLD, SCOPE_LABEL
Constructor and Description |
---|
SVMLightFormatter(KernelUtil kernelUtil) |
Modifier and Type | Method and Description |
---|---|
void |
clearFold()
clean up fold specific state
|
void |
exportFold(SparseData sparseData,
SortedMap<Long,String> instanceClassMap,
boolean train,
String label,
Integer run,
Integer fold)
export the given train/test set
|
protected List<Long> |
exportTransductiveData(String filename,
String idFilename,
SparseData bagOfWordsData,
SortedMap<Long,String> trainClassMap,
Set<Long> testInstances,
com.google.common.collect.BiMap<String,Integer> classToIndexMap)
Export data file and id file
|
protected void |
fillLabelToClassIndexMap(Map<String,SortedSet<String>> labelToClassMap) |
void |
initializeExport(InstanceData instanceLabel,
Properties properties,
SparseData sparseData)
add the "0" class for transductive learning
|
void |
initializeFold(SparseData sparseData,
String label,
Integer run,
Integer fold,
SortedMap<Boolean,SortedMap<Long,String>> foldInstanceLabelMap)
write a file with the attribute names corresponding to the indices in
the libsvm data file
|
clearLabel, exportDataForInstances, exportDataForLabel, initializeLabel, writeLibsvmLine
addNumericAttribute, exportAttributeNames, exportAttributeNames, exportSparseMatrix, exportSparseRow, getSparseLineValues, updateLabelClassMapTransductive
public SVMLightFormatter(KernelUtil kernelUtil)
public void exportFold(SparseData sparseData, SortedMap<Long,String> instanceClassMap, boolean train, String label, Integer run, Integer fold) throws IOException
exportFold
in interface SparseDataFormatter
exportFold
in class LibSVMFormatterFactory.LibSVMFormatter
IOException
protected List<Long> exportTransductiveData(String filename, String idFilename, SparseData bagOfWordsData, SortedMap<Long,String> trainClassMap, Set<Long> testInstances, com.google.common.collect.BiMap<String,Integer> classToIndexMap) throws IOException
filename
- idFilename
- bagOfWordsData
- instanceClassMap
- numericAttributeMap
- nominalAttributeMap
- label
- IOException
public void initializeExport(InstanceData instanceLabel, Properties properties, SparseData sparseData) throws IOException
initializeExport
in interface SparseDataFormatter
initializeExport
in class LibSVMFormatterFactory.LibSVMFormatter
IOException
protected void fillLabelToClassIndexMap(Map<String,SortedSet<String>> labelToClassMap)
public void clearFold()
clearFold
in interface SparseDataFormatter
clearFold
in class LibSVMFormatterFactory.LibSVMFormatter
public void initializeFold(SparseData sparseData, String label, Integer run, Integer fold, SortedMap<Boolean,SortedMap<Long,String>> foldInstanceLabelMap) throws IOException
LibSVMFormatterFactory.LibSVMFormatter
initializeFold
in interface SparseDataFormatter
initializeFold
in class LibSVMFormatterFactory.LibSVMFormatter
IOException
Copyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.