Java Reference
In-Depth Information
the same predictors as the CUSTOMER_RESPONSE table, but does
not contain the target attribute 'response' since that is what we are
predicting. We then create the object that indicates the results we are
interested in, namely, the customer ID, and the probability that the
customer will respond (response
1). We then create the apply task
specifying the apply dataset, the model, the apply settings, and the
location for the apply result, namely, the scores. After executing the
task, we have a dataset with all the customers scored.
// Create the physical representation of the input data
PhysicalDataSetFactory pdsFactory (PhysicalDataSetFactory)
dmeConn.getFactory( ”javax.datamining.data.PhysicalDataSet” );
PhysicalDataSet applyInputData
pdsFactory.create( ”CUSTOMER_APPLY”, PhysicalDataSet.IMPORT_META_DATA );
dmeConn.saveObject( ”customer_apply”, applyInputData, REPLACE );
// Create the output specification of apply
ClassificationApplySettingsFactory casFactory
(ClassificationApplySettingsFactory) dmeConn.getFactory
( ”javax.datamining.supervised.classification.ClassificationApplySettings” );
ClassificationApplySettings applySettings casFactory.create();
java.util.Map sourceDestMap new java.util.HashMap();
// Output column containing the customer id
sourceDestMap.put( ”customer_id”, ”ID” );
applySettings.setSourceDestinationMap( sourceDestMap );
// Output column for the probability of response 1
applySettings.mapClass (ClassificationApplyContent.probability,
”probability” );
dmeConn.saveObject( ”response_apply_settings”, applySettings, REPLACE );
// Create a task for apply with dataset
DataSetApplyTaskFactory datFactory (DataSetApplyTaskFactory)
dmeConn.getFactory( ”javax.datamining.task.apply.DataSetApplyTask” );
DataSetApplyTask applyTask
datFactory.create( ”customer_apply”, ”resp_model_1”,
”response_apply_settings”, ”response_scores” );
dmeConn.saveObject( ”response_apply_task”, applyTask, REPLACE );
// Execute the apply task
ExecutionHandle execHandle dmeConn.execute( ”responseApplyTask” );
execHandle.waitForCompletion( Connection.WAIT_FOR_COMPLETION );
Now, we order the cases so that we can skim off the top 40 percent
(392,000) of likely responders. The following SQL orders the cases.
SELECT customer_id
from RESPONSE_SCORES
order by probability
 
Search WWH ::




Custom Search