Synopsis
Writes attributes in a special user defined format.
Description
Using the parameter 'special_format', the user can specify the exact format. The $ sign has a special meaning and introduces a command (the following character) Additional arguments to this command may be supplied enclosing it in square brackets.
- $a
- All attributes separated by the default separator
- $a[separator]
- All attributes separated by separator
- $s[separator][indexSeparator]
- Sparse format. For all non zero attributes the following strings are concatenated: the column index, the value of indexSeparator, the attribute value. Attributes are separated by separator.
- $v[name]
- The value of the attribute with the given name (both regular and special attributes)
- $k[index]
- The value of the attribute with the given index
- $l
- The label
- $p
- The predicted label
- $d
- All prediction confidences for all classes in the form conf(class)=value
- $d[class]
- The prediction confidence for the defined class as a simple number
- $i
- The id
- $w
- The weight
- $b
- The batch number
- $n
- The newline character
- $t
- The tabulator character
- $$
- The dollar sign
- $[
- The '[' character
- $]
- The ']' character
Make sure the format string ends with $n if you want examples to be separated by newlines.
Input
- input: expects: ExampleSet
Output
- through:
Parameters
- example set file: File to save the example set to.
- special format: Format string to use for output.
- fraction digits: The number of fraction digits in the output file (-1: all possible digits).
- quote nominal values: Indicates if nominal values should be quoted with double quotes.
- zipped: Indicates if the data file content should be zipped.
- overwrite mode: Indicates if an existing table should be overwritten or if data should be appended.
- encoding: The encoding used for reading or writing files.