Java Reference
In-Depth Information
To perform this selection, a view is created in the OMDB to select
only the customers with a probability higher than the threshold,
which is executed at line 57. The contents of this view will be for-
warded to TCA together with the names and addresses of the pro-
spective customers to contact.
We can also report the expected number of responses prior to
sending the mailing. This is obtained by summing the probabilities
for all customers in this dataset. The expected number of responders
can be used to compute the expected profit prior to sending the
actual mailings. Again this is done in SQL and executed at line 63.
Multiplying the individual profit by the expected positive responses
and subtracting from this the individual cost times the expected
negative responses leads to an estimation of the global profit of this
campaign, as shown between lines 68 and 70.
1. public void applymodel(String iTargetKey,
2.
String iApplyOutputDataName)
3.
throws JDMException, InterruptedException, SQLException {
String lApplyDSSettName getBestModelName() "_ApplyS";
4.
ClassificationApplySettingsFactory lApplySettFactory
5.
6.
(ClassificationApplySettingsFactory) mJDMConnection.getFactory(
7.
"javax.datamining.supervised.classification.ClassificationApplySettings");
ClassificationApplySettings lApplySett lApplySettFactory.create();
8.
9.
lApplySett.mapByCategory(ClassificationApplyContent.probability,
10.
iTargetKey,
11.
"Proba");
12.
mJDMConnection.saveObject(lApplyDSSettName, lApplySett, true);
13.
14.
String lApplyDataSetName getBestModelName() "_ApplyDS";
String lApplyDataSQLStatement "select a.* from "
15.
mInputTableName " a left outer join "
16.
mOutputTableName " b on a."
17.
mIdentifierColumnName " b." mIdentifierColumnName
18.
" where (b.RESPONSE IS null)";
19.
mApplyDataSQL lApplyDataSQLStatement;
20.
PhysicalDataSetFactory lPdsFactory
21.
22.
(PhysicalDataSetFactory) mJDMConnection.getFactory(
23.
"javax.datamining.data.PhysicalDataSet");
String lDataSetURI getVendorDatasetURI(lApplyDataSQLStatement);
24.
PhysicalDataSet lApplyData lPdsFactory.create(lDataSetURI, false);
25.
26.
lApplyData.importMetaData();
27.
PhysicalAttribute lAttr
lApplyData.getAttribute(mIdentifierColumnName.toUpperCase());
28.
29.
lAttr.setRole(PhysicalAttributeRole.caseId);
30.
mJDMConnection.saveObject(lApplyDataSetName, lApplyData, true);
mApplyOutputDataName iApplyOutputDataName;
31.
DataSetApplyTaskFactory lApplyTaskFactory
32.
33.
(DataSetApplyTaskFactory) mJDMConnection.getFactory(
 
Search WWH ::




Custom Search