public class WriteSVMLightFormat extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
FALSE_LAB |
static String |
TRUE_LAB |
| Constructor and Description |
|---|
WriteSVMLightFormat()
default constructor: binary task, no bias feature, don't store string values
|
WriteSVMLightFormat(boolean isBinaryTask,
boolean hasBias,
boolean storeStringValues) |
| Modifier and Type | Method and Description |
|---|---|
String |
getLexiconContentsAsString()
return a String representation of the lexicon (tab-separated key/value pairs, where the key
is an integer and the value is a feature's text representation
|
String |
writeFeatureExample(String label,
Collection<Feature> activeFeatures)
Generate a String value corresponding to a SVMLight format example from Edison feature
representation (String label and Collection of Feature).
|
void |
writeLexiconToOutputStream(OutputStream out)
write the lexicon out to an outputstream.
|
public static final String TRUE_LAB
public static final String FALSE_LAB
public WriteSVMLightFormat()
public WriteSVMLightFormat(boolean isBinaryTask,
boolean hasBias,
boolean storeStringValues)
public String getLexiconContentsAsString() throws IOException
IOExceptionpublic void writeLexiconToOutputStream(OutputStream out) throws IOException
out - where the lexicon will be writtenIOExceptionpublic String writeFeatureExample(String label, Collection<Feature> activeFeatures)
label - activeFeatures - Copyright © 2017. All rights reserved.