Java Reference
In-Depth Information
accessed using the method getAttributesByRank , as shown at line 11.
The attributes, sorted in descending order, are reported to the user.
If the JDM implementation does not support this feature, the size of
the collection returned will be 0 and, thus, we report it to the campaign
manager as shown by the test at line 12 and the message at line 22.
If the campaign manager wants to know, before building any
model, which key factors affect predictions, he can execute the fol-
lowing method, called findKeyFactors:
1. public Vector findKeyFactors(int iAttributeCount)
2.
throws JDMException, InterruptedException {
Vector lFactors new Vector();
3.
String lModelName "KeyFactors";
4.
String lSettingsName lModelName "_S";
5.
AttributeImportanceSettingsFactory lCsFactory
6.
7.
(AttributeImportanceSettingsFactory) mJDMConnection.getFactory(
8.
"javax.datamining.attributeimportance"
".AttributeImportanceSettings");
9.
AttributeImportanceSettings lAttributeImportanceSettings
10.
11.
lCsFactory.create();
12.
lAttributeImportanceSettings.setTargetAttributeName("RESPONSE");
13.
mJDMConnection.saveObject(lSettingsName,
14.
lAttributeImportanceSettings,
15.
true);
16.
17. String lDataSetName lModelName "_DS";
18. String lBuildDataSQLStatement buildSQLStatement();
19. PhysicalDataSetFactory lPdsFactory
20. (PhysicalDataSetFactory) mJDMConnection.getFactory(
21. "javax.datamining.data.PhysicalDataSet");
22. String lDataSetURI getVendorDatasetURI(lBuildDataSQLStatement);
23. PhysicalDataSet lBuildData lPdsFactory.create(lDataSetURI, false);
24. lBuildData.importMetaData();
25. PhysicalAttribute lAttr
26. lBuildData.getAttribute(mIdentifierColumnName.toUpperCase());
27. lAttr.setRole(PhysicalAttributeRole.caseId);
28. mJDMConnection.saveObject(lDataSetName, lBuildData, true);
29.
30. String lTaskName lModelName "_T";
31.
BuildTaskFactory lBuildTaskFactory
32.
(BuildTaskFactory) mJDMConnection.getFactory(
33.
"javax.datamining.task.BuildTask");
BuildTask lBuildTask lBuildTaskFactory.create(lDataSetName,
34.
35.
lSettingsName,
36.
lModelName);
VerificationReport lVerifTask lBuildTask.verify();
37.
if (lVerifTask ! null) {
38.
39.
reportError(lVerifTask.getReportText());
40.
return lFactors;
41.
}
 
Search WWH ::




Custom Search