Java Reference
In-Depth Information
34.
"javax.datamining.task.apply.DataSetApplyTask");
35.
DataSetApplyTask lApplyTask lApplyTaskFactory.create(
36.
lApplyDataSetName,
37.
getBestModelName(),
38.
lApplyDSSettName,
39.
getVendorJDMDatasetURI(iApplyOutputDataName "_ALL"));
40.
41.
VerificationReport lVerifTask lApplyTask.verify();
42.
if (lVerifTask ! null) {
43.
reportError(lVerifTask.getReportText());
44.
return;
45.
}
46.
47.
mJDMConnection.saveObject(getBestModelName() "_ApplyT",
48.
lApplyTask,
49.
true);
50.
boolean lSuccess executeTask(getBestModelName() "_ApplyT");
51.
if (!lSuccess) {
52.
return;
53.
}
54.
String lSQLQuery "create view " iApplyOutputDataName
55.
" as (select * from " iApplyOutputDataName "_ALL"
56.
" where Proba " mBestModelProbaThreshold ")";
57.
Statement lStatement mJDBCConnection.createStatement();
58.
lStatement.executeQuery(lSQLQuery);
59.
String lSQLCountQuery " select count(*), sum(Proba) from "
60.
iApplyOutputDataName;
61.
Statement lStatementCount mJDBCConnection.createStatement();
62.
ResultSet lResultSetCount
63.
lStatementCount.executeQuery(lSQLCountQuery);
64.
lResultSetCount.next();
65.
mApplyCount lResultSetCount.getInt(1);
66.
mExpectedResponses lResultSetCount.getInt(2);
67.
68.
mExpectedProfit ((mExpectedResponses * mIndividualProfit)
69.
((mApplyCount - mExpectedResponses) * mIndividualCost))
70.
mGlobalCost;
71.
report("Expected Profit using model [" getBestModelName() "]: "
72.
mExpectedProfit);
73. }
Once the full campaign is complete, the last operation is to
check that the actual revenue is in line with the expected revenue.
This can be done using the following method, which assumes that
the responses have been collected in the table used to hold results
of the apply of the model. The name of that table can be obtained
through the member variable called mApplyOutputDataName . For
example, assuming that the table name iApplyOutputDataName
was set to SCORE in calling the method applyModel , the table
SCORE_ALL was created with a column RESPONSE with only
 
Search WWH ::




Custom Search