public class InputDataWriter extends Object
InputData
, TemplateVector
and
SOMLibClassInformation
in a certain number of file formats, such as SOMLib, WEKA ARFF, SOMPak and ESOM.Modifier and Type | Field and Description |
---|---|
static String[] |
OUTPUT_FILE_FORMAT_TYPES
Supported Output File Format Types
|
private static String |
OUTPUT_FORMAT_CSV |
private static String |
OUTPUT_FORMAT_ORANGE |
private static String |
OUTPUT_FORMAT_VOWPAL |
Constructor and Description |
---|
InputDataWriter() |
Modifier and Type | Method and Description |
---|---|
static StringBuffer |
getAsWekaARFF(InputData data,
boolean writeInstanceNames,
boolean skipInputsWithoutClass,
String relationName) |
static StringBuffer |
getAsWekaARFFRandomized(InputData data,
boolean writeInstanceNames,
boolean skipInputsWithoutClass,
int randomSeed,
String relationName) |
static String |
getWekaClassHeader(String[] classNames) |
static void |
write(String fName,
InputData data,
String outputFormat,
boolean tabSeparatedClassFile,
boolean skipInstanceNames,
boolean skipInputsWithoutClass) |
static void |
writeAsCSV(InputData data,
String fileName) |
static void |
writeAsESOM(InputData data,
String fileName)
Writes the data to ESOM lrn/cls
format.
|
static void |
writeAsESOM(SOMLibClassInformation classInfo,
String fileName)
Writes the class information as ESOM
cls file.
|
static void |
writeAsOrange(InputData data,
String fileName)
Writes input data in the tab-separated format used by the Orange data mining toolkit (see
http://www.ailab.si/orange/)
|
static void |
writeAsSOMLib(Collection<InputDatum> data,
String fileName) |
static void |
writeAsSOMLib(HashMap<String,String> classInfo,
HashSet<String> classNames,
String fileName)
Writes the class information to a file in SOMLib format.
|
static void |
writeAsSOMLib(InputData data,
String fileName) |
static void |
writeAsSOMLib(InputData data,
TemplateVector templateVector,
SOMLibClassInformation classInformation,
boolean tabSeparatedClassFile,
String basicFileName)
Writes the class information to a file.
|
static void |
writeAsSOMLib(InputData data,
TemplateVector templateVector,
SOMLibClassInformation classInformation,
String basicFileName)
Writes the class information to a file.
|
static void |
writeAsSOMLib(InputDatum[] data,
String fileName) |
static void |
writeAsSOMLib(SOMLibClassInformation classInfo,
String fileName)
Writes the class information to a file in SOMLib format; elements will be sorted by label name.
|
static void |
writeAsSOMLib(TemplateVector tv,
String fileName) |
static void |
writeAsSOMPAK(InputData data,
String fileName)
Writes input data in the SOMPAK format (see
http://www.cis.hut.fi/projects/somtoolbox/package/docs2/som_read_data.html)
|
private static void |
writeAsVowpalWobbit(InputData data,
String fileName) |
private static void |
writeAsWekaARFF(InputData data,
boolean writeInstanceNames,
boolean skipInputsWithoutClass,
PrintWriter writer,
String relationName) |
static void |
writeAsWekaARFF(InputData data,
String fileName,
boolean writeInstanceNames,
boolean skipInputsWithoutClass)
Writes the data to Weka ARFF format.
|
static void |
writeElementToFile(PrintWriter writer,
int i,
TemplateVectorElement e) |
static void |
writeHeaderToFile(PrintWriter writer,
int numVectors,
int dim) |
static void |
writeInputDatumToFile(PrintWriter writer,
InputDatum inputDatum) |
static void |
writeInputDatumToFile(PrintWriter writer,
String label,
cern.colt.matrix.DoubleMatrix1D vector) |
static void |
writeTempplateHeaderToFile(PrintWriter writer,
String fileName,
int numVectors,
int dim,
int numInfo) |
static void |
writeToFileTabSeparated(SOMLibClassInformation classInfo,
String fileName)
Writes the class information to a tab-separated file.
|
private static final String OUTPUT_FORMAT_CSV
private static final String OUTPUT_FORMAT_ORANGE
private static final String OUTPUT_FORMAT_VOWPAL
public static final String[] OUTPUT_FILE_FORMAT_TYPES
public static void writeAsESOM(InputData data, String fileName) throws IOException, SOMLibFileFormatException
IOException
SOMLibFileFormatException
public static void writeAsESOM(SOMLibClassInformation classInfo, String fileName) throws IOException, SOMLibFileFormatException
IOException
SOMLibFileFormatException
public static void writeAsSOMLib(InputData data, String fileName) throws IOException
IOException
public static void writeAsSOMLib(InputDatum[] data, String fileName) throws IOException
IOException
public static void writeAsSOMLib(Collection<InputDatum> data, String fileName) throws IOException
IOException
public static void writeAsSOMLib(InputData data, TemplateVector templateVector, SOMLibClassInformation classInformation, boolean tabSeparatedClassFile, String basicFileName) throws IOException, SOMLibFileFormatException
IOException
SOMLibFileFormatException
public static void writeAsSOMLib(InputData data, TemplateVector templateVector, SOMLibClassInformation classInformation, String basicFileName) throws IOException, SOMLibFileFormatException
IOException
SOMLibFileFormatException
public static void writeAsSOMLib(SOMLibClassInformation classInfo, String fileName) throws IOException, SOMLibFileFormatException
IOException
SOMLibFileFormatException
public static void writeAsSOMLib(HashMap<String,String> classInfo, HashSet<String> classNames, String fileName) throws IOException, SOMLibFileFormatException
IOException
SOMLibFileFormatException
public static void writeAsSOMLib(TemplateVector tv, String fileName) throws IOException
IOException
public static void writeElementToFile(PrintWriter writer, int i, TemplateVectorElement e)
public static void writeAsSOMPAK(InputData data, String fileName) throws IOException
IOException
public static void writeAsWekaARFF(InputData data, String fileName, boolean writeInstanceNames, boolean skipInputsWithoutClass) throws IOException, SOMToolboxException
IOException
SOMToolboxException
private static void writeAsWekaARFF(InputData data, boolean writeInstanceNames, boolean skipInputsWithoutClass, PrintWriter writer, String relationName) throws SOMLibFileFormatException
SOMLibFileFormatException
public static StringBuffer getAsWekaARFF(InputData data, boolean writeInstanceNames, boolean skipInputsWithoutClass, String relationName) throws SOMLibFileFormatException
SOMLibFileFormatException
public static StringBuffer getAsWekaARFFRandomized(InputData data, boolean writeInstanceNames, boolean skipInputsWithoutClass, int randomSeed, String relationName) throws SOMLibFileFormatException
SOMLibFileFormatException
public static void writeAsOrange(InputData data, String fileName) throws IOException
IOException
public static void writeAsCSV(InputData data, String fileName) throws IOException
IOException
private static void writeAsVowpalWobbit(InputData data, String fileName) throws IOException, SOMToolboxException
IOException
SOMToolboxException
public static void writeHeaderToFile(PrintWriter writer, int numVectors, int dim) throws IOException
IOException
public static void writeInputDatumToFile(PrintWriter writer, InputDatum inputDatum) throws IOException
IOException
public static void writeInputDatumToFile(PrintWriter writer, String label, cern.colt.matrix.DoubleMatrix1D vector) throws IOException
IOException
public static void writeTempplateHeaderToFile(PrintWriter writer, String fileName, int numVectors, int dim, int numInfo) throws IOException
IOException
public static void writeToFileTabSeparated(SOMLibClassInformation classInfo, String fileName) throws IOException, SOMLibFileFormatException
IOException
SOMLibFileFormatException
public static void write(String fName, InputData data, String outputFormat, boolean tabSeparatedClassFile, boolean skipInstanceNames, boolean skipInputsWithoutClass) throws IOException, SOMToolboxException
IOException
SOMToolboxException