Class XML
- java.lang.Object
-
- weka.classifiers.evaluation.output.prediction.AbstractOutput
-
- weka.classifiers.evaluation.output.prediction.XML
-
- All Implemented Interfaces:
java.io.Serializable,OptionHandler
public class XML extends AbstractOutput
Outputs the predictions in XML.
The following DTD is used:
<!DOCTYPE predictions
[
<!ELEMENT predictions (prediction*)>
<!ATTLIST predictions version CDATA "3.5.8">
<!ATTLIST predictions name CDATA #REQUIRED>
<!ELEMENT prediction ((actual_label,predicted_label,error,(prediction|distribution),attributes?)|(actual_value,predicted_value,error,attributes?))>
<!ATTLIST prediction index CDATA #REQUIRED>
<!ELEMENT actual_label ANY>
<!ATTLIST actual_label index CDATA #REQUIRED>
<!ELEMENT predicted_label ANY>
<!ATTLIST predicted_label index CDATA #REQUIRED>
<!ELEMENT error ANY>
<!ELEMENT prediction ANY>
<!ELEMENT distribution (class_label+)>
<!ELEMENT class_label ANY>
<!ATTLIST class_label index CDATA #REQUIRED>
<!ATTLIST class_label predicted (yes|no) "no">
<!ELEMENT actual_value ANY>
<!ELEMENT predicted_value ANY>
<!ELEMENT attributes (attribute+)>
<!ELEMENT attribute ANY>
<!ATTLIST attribute index CDATA #REQUIRED>
<!ATTLIST attribute name CDATA #REQUIRED>
<!ATTLIST attribute type (numeric|date|nominal|string|relational) #REQUIRED>
]
> Valid options are:-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)
- Version:
- $Revision: 8937 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringATT_INDEXthe index attribute.static java.lang.StringATT_NAMEthe "name" attribute.static java.lang.StringATT_PREDICTEDthe predicted attribute.static java.lang.StringATT_TYPEthe "type" attribute.static java.lang.StringATT_VERSIONthe "version" attribute.static java.lang.StringDTDthe DTD.static java.lang.StringDTD_ANYthe ANY placeholder.static java.lang.StringDTD_AT_LEAST_ONEthe at least one marker.static java.lang.StringDTD_ATTLISTthe AttList definition.static java.lang.StringDTD_CDATAthe CDATA placeholder.static java.lang.StringDTD_DOCTYPEthe DocType definition.static java.lang.StringDTD_ELEMENTthe Element definition.static java.lang.StringDTD_IMPLIEDthe #IMPLIED placeholder.static java.lang.StringDTD_OPTIONALthe optional marker.static java.lang.StringDTD_PCDATAthe #PCDATA placeholder.static java.lang.StringDTD_REQUIREDthe #REQUIRED placeholder.static java.lang.StringDTD_SEPARATORthe option separator.static java.lang.StringDTD_ZERO_OR_MOREthe zero or more marker.static java.lang.StringTAG_ACTUAL_LABELthe actual_nominal tag.static java.lang.StringTAG_ACTUAL_VALUEthe actual_numeric tag.static java.lang.StringTAG_ATTRIBUTEthe attribute tag.static java.lang.StringTAG_ATTRIBUTESthe attributes tag.static java.lang.StringTAG_CLASS_LABELthe class_label tag.static java.lang.StringTAG_DISTRIBUTIONthe distribution tag.static java.lang.StringTAG_ERRORthe error tag.static java.lang.StringTAG_PREDICTED_LABELthe predicted_nominal tag.static java.lang.StringTAG_PREDICTED_VALUEthe predicted_numeric tag.static java.lang.StringTAG_PREDICTIONthe prediction tag.static java.lang.StringTAG_PREDICTIONSthe predictions tag.static java.lang.StringVAL_NOthe value "no".static java.lang.StringVAL_YESthe value "yes".
-
Constructor Summary
Constructors Constructor Description XML()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDisplay()Returns a short display text, to be used in comboboxes.java.lang.StringglobalInfo()Returns a string describing the output generator.-
Methods inherited from class weka.classifiers.evaluation.output.prediction.AbstractOutput
attributesTipText, fromCommandline, generatesOutput, getAttributes, getBuffer, getDefaultNumDecimals, getHeader, getNumDecimals, getOptions, getOutputDistribution, getOutputFile, getSuppressOutput, listOptions, numDecimalsTipText, outputDistributionTipText, outputFileTipText, print, print, printClassification, printClassification, printClassifications, printClassifications, printFooter, printHeader, setAttributes, setBuffer, setHeader, setNumDecimals, setOptions, setOutputDistribution, setOutputFile, setSuppressOutput, suppressOutputTipText
-
-
-
-
Field Detail
-
DTD_DOCTYPE
public static final java.lang.String DTD_DOCTYPE
the DocType definition.- See Also:
- Constant Field Values
-
DTD_ELEMENT
public static final java.lang.String DTD_ELEMENT
the Element definition.- See Also:
- Constant Field Values
-
DTD_ATTLIST
public static final java.lang.String DTD_ATTLIST
the AttList definition.- See Also:
- Constant Field Values
-
DTD_OPTIONAL
public static final java.lang.String DTD_OPTIONAL
the optional marker.- See Also:
- Constant Field Values
-
DTD_AT_LEAST_ONE
public static final java.lang.String DTD_AT_LEAST_ONE
the at least one marker.- See Also:
- Constant Field Values
-
DTD_ZERO_OR_MORE
public static final java.lang.String DTD_ZERO_OR_MORE
the zero or more marker.- See Also:
- Constant Field Values
-
DTD_SEPARATOR
public static final java.lang.String DTD_SEPARATOR
the option separator.- See Also:
- Constant Field Values
-
DTD_CDATA
public static final java.lang.String DTD_CDATA
the CDATA placeholder.- See Also:
- Constant Field Values
-
DTD_ANY
public static final java.lang.String DTD_ANY
the ANY placeholder.- See Also:
- Constant Field Values
-
DTD_PCDATA
public static final java.lang.String DTD_PCDATA
the #PCDATA placeholder.- See Also:
- Constant Field Values
-
DTD_IMPLIED
public static final java.lang.String DTD_IMPLIED
the #IMPLIED placeholder.- See Also:
- Constant Field Values
-
DTD_REQUIRED
public static final java.lang.String DTD_REQUIRED
the #REQUIRED placeholder.- See Also:
- Constant Field Values
-
ATT_VERSION
public static final java.lang.String ATT_VERSION
the "version" attribute.- See Also:
- Constant Field Values
-
ATT_NAME
public static final java.lang.String ATT_NAME
the "name" attribute.- See Also:
- Constant Field Values
-
ATT_TYPE
public static final java.lang.String ATT_TYPE
the "type" attribute.- See Also:
- Constant Field Values
-
VAL_YES
public static final java.lang.String VAL_YES
the value "yes".- See Also:
- Constant Field Values
-
VAL_NO
public static final java.lang.String VAL_NO
the value "no".- See Also:
- Constant Field Values
-
TAG_PREDICTIONS
public static final java.lang.String TAG_PREDICTIONS
the predictions tag.- See Also:
- Constant Field Values
-
TAG_PREDICTION
public static final java.lang.String TAG_PREDICTION
the prediction tag.- See Also:
- Constant Field Values
-
TAG_ACTUAL_LABEL
public static final java.lang.String TAG_ACTUAL_LABEL
the actual_nominal tag.- See Also:
- Constant Field Values
-
TAG_PREDICTED_LABEL
public static final java.lang.String TAG_PREDICTED_LABEL
the predicted_nominal tag.- See Also:
- Constant Field Values
-
TAG_ERROR
public static final java.lang.String TAG_ERROR
the error tag.- See Also:
- Constant Field Values
-
TAG_DISTRIBUTION
public static final java.lang.String TAG_DISTRIBUTION
the distribution tag.- See Also:
- Constant Field Values
-
TAG_CLASS_LABEL
public static final java.lang.String TAG_CLASS_LABEL
the class_label tag.- See Also:
- Constant Field Values
-
TAG_ACTUAL_VALUE
public static final java.lang.String TAG_ACTUAL_VALUE
the actual_numeric tag.- See Also:
- Constant Field Values
-
TAG_PREDICTED_VALUE
public static final java.lang.String TAG_PREDICTED_VALUE
the predicted_numeric tag.- See Also:
- Constant Field Values
-
TAG_ATTRIBUTES
public static final java.lang.String TAG_ATTRIBUTES
the attributes tag.- See Also:
- Constant Field Values
-
TAG_ATTRIBUTE
public static final java.lang.String TAG_ATTRIBUTE
the attribute tag.- See Also:
- Constant Field Values
-
ATT_INDEX
public static final java.lang.String ATT_INDEX
the index attribute.- See Also:
- Constant Field Values
-
ATT_PREDICTED
public static final java.lang.String ATT_PREDICTED
the predicted attribute.- See Also:
- Constant Field Values
-
DTD
public static final java.lang.String DTD
the DTD.
-
-
Method Detail
-
globalInfo
public java.lang.String globalInfo()
Returns a string describing the output generator.- Specified by:
globalInfoin classAbstractOutput- Returns:
- a description suitable for displaying in the GUI
-
getDisplay
public java.lang.String getDisplay()
Returns a short display text, to be used in comboboxes.- Specified by:
getDisplayin classAbstractOutput- Returns:
- a short display text
-
-