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>
<!-- List of target values -->
<category string="Yes">
<category string="No">
<!-- False Negative cost cell -->
<costElement value="3">
<predictedCategory string="No"/>
<actualCategory string="Yes"/>
</object> </JDM>
Listing 10-5(b)
CostMatrix complex type
1. <xsd:complexType name=" CostMatrix ">
<xsd:extension base="MiningObject">
2. <xsd:element name="category" type=" DataValueType " minOccurs="2"
3. <xsd:element name="costElement" type=" CategoryMatrixElement "
minOccurs="1" maxOccurs="unbounded"/>
4. <xsd:complexType name=" CategoryMatrixElement ">
<xsd:element name="predictedCategory" type="DataValueType"/>
<xsd:element name="actualCategory" type="DataValueType"/>
<xsd:attribute name="value" type="xsd:double" use="required"/>
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