Class XML
java.lang.Object
weka.classifiers.evaluation.output.prediction.AbstractOutput
weka.classifiers.evaluation.output.prediction.XML
- All Implemented Interfaces:
Serializable,OptionHandler
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:
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringthe index attribute.static final Stringthe "name" attribute.static final Stringthe predicted attribute.static final Stringthe "type" attribute.static final Stringthe "version" attribute.static final Stringthe DTD.static final Stringthe ANY placeholder.static final Stringthe at least one marker.static final Stringthe AttList definition.static final Stringthe CDATA placeholder.static final Stringthe DocType definition.static final Stringthe Element definition.static final Stringthe #IMPLIED placeholder.static final Stringthe optional marker.static final Stringthe #PCDATA placeholder.static final Stringthe #REQUIRED placeholder.static final Stringthe option separator.static final Stringthe zero or more marker.static final Stringthe actual_nominal tag.static final Stringthe actual_numeric tag.static final Stringthe attribute tag.static final Stringthe attributes tag.static final Stringthe class_label tag.static final Stringthe distribution tag.static final Stringthe error tag.static final Stringthe predicted_nominal tag.static final Stringthe predicted_numeric tag.static final Stringthe prediction tag.static final Stringthe predictions tag.static final Stringthe value "no".static final Stringthe value "yes". -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a short display text, to be used in comboboxes.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 Details
-
DTD_DOCTYPE
the DocType definition.- See Also:
-
DTD_ELEMENT
the Element definition.- See Also:
-
DTD_ATTLIST
the AttList definition.- See Also:
-
DTD_OPTIONAL
the optional marker.- See Also:
-
DTD_AT_LEAST_ONE
the at least one marker.- See Also:
-
DTD_ZERO_OR_MORE
the zero or more marker.- See Also:
-
DTD_SEPARATOR
the option separator.- See Also:
-
DTD_CDATA
the CDATA placeholder.- See Also:
-
DTD_ANY
the ANY placeholder.- See Also:
-
DTD_PCDATA
the #PCDATA placeholder.- See Also:
-
DTD_IMPLIED
the #IMPLIED placeholder.- See Also:
-
DTD_REQUIRED
the #REQUIRED placeholder.- See Also:
-
ATT_VERSION
the "version" attribute.- See Also:
-
ATT_NAME
the "name" attribute.- See Also:
-
ATT_TYPE
the "type" attribute.- See Also:
-
VAL_YES
the value "yes".- See Also:
-
VAL_NO
the value "no".- See Also:
-
TAG_PREDICTIONS
the predictions tag.- See Also:
-
TAG_PREDICTION
the prediction tag.- See Also:
-
TAG_ACTUAL_LABEL
the actual_nominal tag.- See Also:
-
TAG_PREDICTED_LABEL
the predicted_nominal tag.- See Also:
-
TAG_ERROR
the error tag.- See Also:
-
TAG_DISTRIBUTION
the distribution tag.- See Also:
-
TAG_CLASS_LABEL
the class_label tag.- See Also:
-
TAG_ACTUAL_VALUE
the actual_numeric tag.- See Also:
-
TAG_PREDICTED_VALUE
the predicted_numeric tag.- See Also:
-
TAG_ATTRIBUTES
the attributes tag.- See Also:
-
TAG_ATTRIBUTE
the attribute tag.- See Also:
-
ATT_INDEX
the index attribute.- See Also:
-
ATT_PREDICTED
the predicted attribute.- See Also:
-
DTD
the DTD.
-
-
Constructor Details
-
XML
public XML()
-
-
Method Details
-
globalInfo
Returns a string describing the output generator.- Specified by:
globalInfoin classAbstractOutput- Returns:
- a description suitable for displaying in the GUI
-
getDisplay
Returns a short display text, to be used in comboboxes.- Specified by:
getDisplayin classAbstractOutput- Returns:
- a short display text
-