Java Reference
In-Depth Information
43.
lModelName);
44.
VerificationReport lVerifTask lBuildTask.verify();
45.
if (lVerifTask ! null) {
46.
reportError(lVerifTask.getReportText());
47.
return;
48.
}
49.
mJDMConnection.saveObject(lBuildTaskName, lBuildTask, true);
50.
boolean lSuccess executeTask(lBuildTaskName);
51.
if (!lSuccess) {
52.
report("Did not manage to build clustering model!");
53.
return;
54.
}
The previous lines create as many build tasks as needed. These
tasks only differ with the maximum number of clusters in the Clus-
teringSettings object, which is set at line 33. The purpose of this oper-
ation is to compare cluster models started with different maximum
numbers of clusters. The JDM clustering mining function does not
require that the effective number of clusters will be the same as the
maximum number of clusters specified in the build settings. This is
often dependent on the algorithm used. As such, it could be that
some models built through this process have the same number of
effective clusters. However, even if two models have the same effec-
tive number of clusters, their resulting clusters could be different,
and comparing these cluster models could prove useful. The overall
process will stop if any problem is found.
The following code applies the clustering model to the build
dataset to assign customer cluster identifiers.
55.
ClusteringApplySettingsFactory lApplySettFactory
56.
(ClusteringApplySettingsFactory) mJDMConnection.getFactory(
57.
"javax.datamining.clustering.ClusteringApplySettings");
58.
ClusteringApplySettings lApplySett lApplySettFactory.create();
59.
String lApplyDSSettName lModelName "_AS" lClusterCount;
60.
String lClusterAttributeName iModelPrefix "_" lClusterCount;
61.
lApplySett.mapTopCluster(ClusteringApplyContent.clusterIdentifier,
62.
lClusterAttributeName);
63.
mJDMConnection.saveObject(lApplyDSSettName, lApplySett, true);
64.
DataSetApplyTaskFactory lApplyTaskFactory
65.
(DataSetApplyTaskFactory) mJDMConnection.getFactory(
66.
"javax.datamining.task.apply.DataSetApplyTask");
67.
String lApplyOutTableName iApplyOutputPrefix;
68.
if (mUseApplyOutPrefix)
69.
lApplyOutTableName "_" lClusterCount;
70.
DataSetApplyTask lApplyTask lApplyTaskFactory.create(
Search WWH ::




Custom Search