Java Reference
In-Depth Information
empty values. If we assume that this RESPONSE column is filled
later with the actual responses of 1 (positive response), 0 (negative
response), or it remains NULL if the customer has not been con-
tacted, then we can use SCORE_ALL to check the expected revenue
with the actual revenue generated by the campaign. Computing
revenue, taking into account the cost structure, is exactly the same
as the formula used to predict the expected profit, as shown in lines
13 to 15.
1. public void checkRevenue()
2.
throws SQLException {
3.
String lSQLCountQuery " select count(*), sum(RESPONSE) from "
4.
mApplyOutputDataName "_ALL "
5.
"where RESPONSE IS NOT NULL and Proba " mBestModelProbaThreshold;
6.
Statement lStatementCount mJDBCConnection.createStatement();
7.
ResultSet lResultSetCount
8.
lStatementCount.executeQuery(lSQLCountQuery);
9.
lResultSetCount.next();
10.
int lResponseCount lResultSetCount.getInt(1);
11.
int lActualResponses lResultSetCount.getInt(2);
12.
doublelActualProfit 0.0;
13.
lActualProfit ((lActualResponses * mIndividualProfit)
14.
((lResponseCount - lActualResponses) * mIndividualCost))
15.
mGlobalCost;
16.
report("Actual Profit using model [" getBestModelName() "]: "
17.
lActualProfit " to be compared with expected "
18.
mExpectedProfit);
19. }
That concludes the project, in which JDM and JDBC were used to
improve target marketing campaigns.
12.1.4
Scenario 1 Conclusion
The code in this section has been tested. It shows how to write an
operational application using JDBC for basic data manipulation and
JDM for data mining operations. One important aspect of the preced-
ing code is that it did not require extensive data mining knowledge.
The most complex part of the code implies a clear understanding of
the values returned by the ROC curve obtained through a TestMetrics
task. The second important thing to notice is the compactness of the
code. The number of lines is small compared to its business value
for HEW.
 
Search WWH ::




Custom Search