public class CSV extends AbstractOutput
-p <range> The range of attributes to print in addition to the classification. (default: none)
-distribution Whether to turn on the output of the class distribution. Only for nominal class attributes. (default: off)
-decimals <num> The number of digits after the decimal point. (default: 3)
-file <path> The file to store the output in, instead of outputting it on stdout. Gets ignored if the supplied path is a directory. (default: .)
-suppress In case the data gets stored in a file, then this flag can be used to suppress the regular output. (default: not suppressed)
-use-tab Whether to use TAB as separator instead of comma. (default: comma)
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
m_Delimiter
the delimiter.
|
m_Attributes, m_Buffer, m_FileBuffer, m_Header, m_NumDecimals, m_OutputDistribution, m_OutputFile, m_SuppressOutput| Constructor and Description |
|---|
CSV() |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
attributeValuesString(Instance instance)
Builds a string listing the attribute values in a specified range of
indices, separated by commas and enclosed in brackets.
|
protected void |
doPrintClassification(Classifier classifier,
Instance inst,
int index)
Store the prediction made by the classifier as a string.
|
protected void |
doPrintClassification(double[] dist,
Instance inst,
int index)
Store the prediction made by the classifier as a string.
|
protected void |
doPrintFooter()
Does nothing.
|
protected void |
doPrintHeader()
Performs the actual printing of the header.
|
java.lang.String |
getDisplay()
Returns a short display text, to be used in comboboxes.
|
java.lang.String[] |
getOptions()
Gets the current option settings for the OptionHandler.
|
boolean |
getUseTab()
Returns whether tab is used as separator.
|
java.lang.String |
globalInfo()
Returns a string describing the output generator.
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration of all the available options..
|
void |
setOptions(java.lang.String[] options)
Sets the OptionHandler's options using the given list.
|
void |
setUseTab(boolean value)
Sets whether to use tab instead of comma as separator.
|
java.lang.String |
useTabTipText()
Returns the tip text for this property.
|
append, attributesTipText, checkBasic, checkHeader, fromCommandline, generatesOutput, getAttributes, getBuffer, getDefaultNumDecimals, getHeader, getNumDecimals, getOutputDistribution, getOutputFile, getSuppressOutput, numDecimalsTipText, outputDistributionTipText, outputFileTipText, preProcessInstance, print, print, printClassification, printClassification, printClassifications, printClassifications, printFooter, printHeader, setAttributes, setBuffer, setHeader, setNumDecimals, setOutputDistribution, setOutputFile, setSuppressOutput, suppressOutputTipTextpublic java.lang.String globalInfo()
globalInfo in class AbstractOutputpublic java.lang.String getDisplay()
getDisplay in class AbstractOutputpublic java.util.Enumeration<Option> listOptions()
listOptions in interface OptionHandlerlistOptions in class AbstractOutputpublic void setOptions(java.lang.String[] options)
throws java.lang.Exception
setOptions in interface OptionHandlersetOptions in class AbstractOutputoptions - the list of options as an array of stringsjava.lang.Exception - if an option is not supportedpublic java.lang.String[] getOptions()
getOptions in interface OptionHandlergetOptions in class AbstractOutputpublic void setUseTab(boolean value)
value - true if tab is to be usedpublic boolean getUseTab()
public java.lang.String useTabTipText()
protected void doPrintHeader()
doPrintHeader in class AbstractOutputprotected java.lang.String attributeValuesString(Instance instance)
instance - the instance to print the values fromprotected void doPrintClassification(double[] dist,
Instance inst,
int index)
throws java.lang.Exception
doPrintClassification in class AbstractOutputdist - the distribution to useinst - the instance to generate text fromindex - the index in the datasetjava.lang.Exception - if something goes wrongprotected void doPrintClassification(Classifier classifier, Instance inst, int index) throws java.lang.Exception
doPrintClassification in class AbstractOutputclassifier - the classifier to useinst - the instance to generate text fromindex - the index in the datasetjava.lang.Exception - if something goes wrongprotected void doPrintFooter()
doPrintFooter in class AbstractOutput