Java Reference
In-Depth Information
attributes: (1) as a side effect of model building or (2) by building a
specific model of type AttributeImportanceModel .
The first technique can be used by a business user to deepen his
confidence in the quality of the models, and the second technique
can be used before building any classification models to have a
reduced set of attributes on which to build models.
We augment the CampaignOptimizer with these two possibilities.
When several models have been built, one can use the method called
findKeyFactorsFromModels to retrieve the important attributes from
each model, or one can use the method called findKeyFactors to spe-
cifically compute the attribute importance independently of any clas-
sification model. Both methods take the number of attributes that the
campaign manager wants to inspect.
Following is the code for findKeyFactorsFromModels:
1. public void findKeyFactorsFromModels(int iAttributeCount)
2.
throws JDMException, InterruptedException {
for (Iterator lModelNameIter mModelNames.keySet().iterator();
3.
4.
lModelNameIter.hasNext();) {
String lModelName (String) lModelNameIter.next();
5.
6.
// We need to present the key factors to the campaign manager
ClassificationModel lModel (ClassificationModel)
7.
8.
mJDMConnection.retrieveObject(lModelName,
9.
NamedObject.model);
Collection lAttributes lModel.getSignature().
10.
11.
getAttributesByRank(SortOrder.descending);
if (0 lAttributes.size()) {
12.
intlAttrIdx 1;
13.
for (Iterator lAttrIter lAttributes.iterator();
14.
(lAttrIter.hasNext()) && (lAttrIdx iAttributeCount); ) {
15.
AttributelAttribute (Attribute) lAttrIter.next();
16.
report("Attribute " lAttrIdx
17.
" is " lAttribute.getName());
18.
lAttrIdx ;
19.
20.
}
21.
} else {
22.
report("This JDM DME does not support attribute ranking!");
23.
}
24.
}
25. }
In this method, we scan the different models that were built in the
CampaignOptimizer instance. We retrieve them from the DME at line 8,
and obtain their respective model signatures. As noted in Chapter 7,
the attribute ranking information is stored in this signature and
 
Search WWH ::




Custom Search