Java Reference
In-Depth Information
50. //Retrieve test metrics
51. public void output() throws JDMException {
52. . . . .
53. //Access apply output data that will have following columns:
54. // Customer Id, PredictedAttrition, Probability, Cost
55. // . . . Use JDBC if the output is a table in the database . . .
56.
57. // . . . Use java.io if the output is a data file . . .
58. }
In this example, top predicted category, probability, and cost
contents are specified to be computed by the apply task. In Table 9-16,
we describe the map methods of the ClassificationApplySettings inter-
face. For classification, JDM defines methods: mapTopPrediction
maps apply contents to the top prediction, mapByRank —maps apply
contents for the predictions ordered by their probability rank, mapBy-
Category —maps apply contents by the target value, and mapPredic-
tions —maps apply contents for all possible predictions. These map
methods enable specifying various types of apply output contents
that will be produced in the apply output results. However, an apply
settings object can only specify contents from a single map method.
If a user calls multiple map methods, only the last map method's con-
tents will be stored with the apply settings object. For example, when
a user invokes mapTopPrediction and mapByRank methods in
sequence, then the mapByRank overrides the mapTopPrediction
contents and the apply settings will have only the contents specified
by the mapByRank method calls.
Table 9-16
Classification apply settings methods
supervised.classification.ClassificationApplySettings extends task.apply.ApplySetting
Methods
Description
mapTopPrediction(
ClassificationApplyContent content,
String destPhysAttrName)
Used to specify top prediction apply contents for the apply task.
After completion of the task, the apply output data will have the
specified apply contents associated with the top prediction. For
example, when a user calls the following method, the apply task
will compute the top prediction value and populate the top-
Prediction column with the computed prediction value.
mapTopPrediction(ClassificationApplyContent.predicted-
Category,“topPrediction”)
 
Search WWH ::




Custom Search