Java Reference
In-Depth Information
Listing 10-5(b) illustrates the JDM Schema for the CostMatrix
complex type. In line 2, we define the category elements of type Data-
ValueType to list the target values in the cost matrix. The DataValueType
is used to specify any target attribute value. The CategoryMatrixEle-
ment type (line 4) is used to define a cell of the matrix.
Listing 10-5(a)
Cost Matrix XML document
<JDM version="1.1"> <object>
<costMatrix>
<!-- List of target values -->
<category string="Yes">
<category string="No">
<!-- False Negative cost cell -->
<costElement value="3">
<predictedCategory string="No"/>
<actualCategory string="Yes"/>
</costElement>
</object> </JDM>
Listing 10-5(b)
CostMatrix complex type
1. <xsd:complexType name=" CostMatrix ">
<xsd:complexContent>
<xsd:extension base="MiningObject">
<xsd:sequence>
2. <xsd:element name="category" type=" DataValueType " minOccurs="2"
maxOccurs="unbounded"/>
3. <xsd:element name="costElement" type=" CategoryMatrixElement "
minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
4. <xsd:complexType name=" CategoryMatrixElement ">
<xsd:sequence>
<xsd:element name="predictedCategory" type="DataValueType"/>
<xsd:element name="actualCategory" type="DataValueType"/>
</xsd:sequence>
<xsd:attribute name="value" type="xsd:double" use="required"/>
</xsd:complexType>
The JDM API extensively uses enumerations to provide a type-safe
list of values and the ability to extend standard enumeration values
with vendor-specific extensions. Listing 10-6 shows the schema defi-
nitions for the javax.datamining.MiningAlgorithm enumeration class.
Search WWH ::




Custom Search