Database Reference
In-Depth Information
Example 12.3
// Create category hierarchy:
CategoryHierarchy cah
¼
new CategoryHierarchy();
// Parent category for sharp cutlery:
Category catSharp
¼
new Category("sharp");
// Relations:
cah.addRelationship(catSharp, catKnife); // knife is sharp
cah.addRelationship(catSharp, catFork); // fork is sharp
// Assign hierarchy to cutlery:
cutlery.setTaxonomy(cah);
■
We conclude with an example of
MiningDataSpecification.
Example 12.4
// Create object of metadata 'meal':
MiningDataSpecification meal
¼
new MiningDataSpecification
("meal");
// Create numeric attribute 'calories' and add to metadata:
NumericAttribute
¼
calories
new
NumericAttribute
("calories");
meal.addMiningAttribute( calories );
// Create numeric attribute 'numberOfGuests' and add to
metadata:
NumericAttribute numberOfGuests
¼
new NumericAttribute();
numberOfGuests.setName( "number of guests" );
meal.addMiningAttribute( numberOfGuests );
// Add previous categorical attribute 'cutlery' to metadata:
meal.addMiningAttribute( cutlery );
■
12.1.2.2 The Coordinates: MiningVector
After we have modeled the basis of the attribute space by
MiningDataSpecification
,
we will now model the coordinates of a vector. This is done through the class
MiningVector
.
MiningVector
contains a reference
metaData
(of the class
MiningDataSpeci-
fication
) to its basis and an array of real values which stores the coordinates of the
vector.
MiningVector
extends the CWM class
Object
of the CWM resource package
Instance
since it represents an instance of the data described by
MiningDataSpeci-
fication
(Fig.
12.6
)
.