Java Reference
In-Depth Information
12.
"ClassificationTestTask");
13.
ClassificationTestTask lClassificationTestTask
14.
lClassificationTestTaskFactory.create("myTestData",
15.
iModelName,
16.
"myMetrics");
17.
// Indicate the test option to compute.
18.
lClassificationTestTask.computeMetric(
19.
ClassificationTestMetricOption.lift,
20.
true);
21.
lClassificationTestTask.computeMetric(
22.
ClassificationTestMetricOption.
23.
confusionMatrix,
24.
true);
25.
lClassificationTestTask.computeMetric(
26.
ClassificationTestMetricOption.
27.
receiverOperatingCharacteristics,
28.
true);
29.
mDmeConn.saveObject("myTestTask",
30.
lClassificationTestTask, true);
31.
ExecutionHandle lTestTaskHandle
32.
mDmeConn.execute("myTestTask");
33.
boolean lTaskSucceed monitorTaskExecution(lTestTaskHandle);
34.
if (lTaskSucceed) {
35.
ClassificationTestMetrics lTestMetrics
36.
(ClassificationTestMetrics) mDmeConn.retrieveObject(
37.
"myMetrics",
38.
NamedObject.testMetrics);
39.
JDialog lDialog new JDialog(this, "Test Metrics Results");
40.
lDialog.getContentPane().setLayout(new BorderLayout());
41.
lDialog.getContentPane().add(
42.
new TestMetricsDisplayer(lTestMetrics),
43.
BorderLayout.CENTER);
44.
lDialog.pack();
45.
lDialog.setVisible(true);
46.
} else {
47.
JOptionPane.showMessageDialog(this,
48.
"Error during test: Last state: "
49.
lTestTaskHandle.getLatestStatus().getState().name()
50.
" > "
51.
lTestTaskHandle.getLatestStatus().getDescription());
52.
}
53.
} catch (JDMException lException) {
54.
throw new UnexpectedJDMException(lException);
55.
}
56.
}
First, the URI selected by the user in the mDataSetTextField is
retrieved. We use this URI to save a PhysicalDataSet object to the
MOR under the name myTestData. This name will be used later in the
test task. Then we use the ClassificationTestTaskFactory to create a test
task setting the PhysicalDataSet name, model name, and resulting test
 
Search WWH ::




Custom Search