Java Reference
In-Depth Information
42. mJDMConnection.saveObject(lTaskName, lBuildTask, true);
43. boolean lSuccess executeTask(lTaskName);
44.
45. // Check success/error
46.
if (lSuccess) {
47.
// We need to present the key influencers to the campaign manager
48.
AttributeImportanceModel lModel
49.
(AttributeImportanceModel) mJDMConnection
50.
.retrieveObject(lModelName,
51.
NamedObject.model);
52.
Collection lAttributes
lModel.
53.
getAttributesByRank(SortOrder.descending);
54.
intlAttrIdx 1;
55.
for (Iterator lAttrIter lAttributes.iterator();
56.
(lAttrIter.hasNext()) && (lAttrIdx iAttributeCount); ) {
57.
StringlAttrName (String) lAttrIter.next();
58.
report("Attribute " lAttrIdx " is " lAttrName);
59.
lAttrIdx ;
60.
lFactors.add(lAttrName);
61.
}
62.
}
63.
return lFactors;
64. }
In lines 1 to 42, all the objects needed to create an attribute impor-
tance model are created and saved. Then, the BuildTask is executed
and, if successful, the model is retrieved from the MOR at line 50.
The attribute names are extracted from the AttributeImportanceModel
in descending order at line 53 and the most important attributes are
collected into a vector, which is returned by this method at line 63.
The vector of attribute names returned by this method can be directly
fed into the argument iActiveAttributes of the buildModel method.
12.2.2
Scenario 2 Conclusion
The attribute importance-related code presented in this section will
likely be used in conjunction with other modeling techniques. In the
previous scenario, we designed our CampaignOptimizer methods in a
way that makes it possible to directly take the output of the findKey-
Factors method and to use it as the input for building a classification
model.
Again, the assumption that we made here is that the JDM imple-
mentation can work on unprepared data for attribute importance.
 
Search WWH ::




Custom Search