Java Reference
In-Depth Information
case with PHP. Once the Web service connection object is created, it is
important to remember that the JDM connection is managed by the
Web service provider application and, thus, the application can
readily start.
14.2.3
Creating BuildSettings
The first step is to create and save the BuildSettings object to create a
classification model. Axis has generated Java classes that fully map the
XML structure provided with the XML Schema of JDM Web services.
For example, in the following code the class ClassificationSettings has all
the “setter” and “getter” methods to specify all its elements. Writing
source code under any Java integrated development environment
(IDE) such as Eclipse will provide you with the list of possible meth-
ods that can be used on an instance of such a class, making this a very
easy exercise. In the following example, we assume that the target
attribute is called class and that there is a weight attribute called fnlwgt .
The methods called createBuildAttributes and askToSaveObject will be
explained later in the chapter.
1. public BuildSettings createBuildSettings(IDataMining iServices)
2. throws RemoteException {
3. ClassificationSettings lSettingsToSave
new ClassificationSettings();
4.
lSettingsToSave.setCreatorInfo("myClassifCreatorInfo");
5.
lSettingsToSave.setDescription("my First Classification Model");
6.
lSettingsToSave.setDesiredExecutionTimeInMinutes(new Integer(10));
7.
lSettingsToSave.setTargetAttributeName("class");
8.
lSettingsToSave.setBuildAttribute(createBuildAttributes());
9.
askToSaveObject(lSettingsToSave, "myBuildSettings", iServices);
10.
return lSettingsToSave;
11.}
We develop the method called createBuildAttributes as the first
example using logical attributes. Logical attributes can be used in
Settings to specify how the physical attributes should be interpreted
by the algorithm, or outlier treatment, for example. In this simple
example, we propose to associate a fixed set of four logical attributes
to the ClassificationSettings . In the XML Schema, the specification of
logical attributes in a Settings instance is presented as a sequence,
which has been translated by Axis as an array of BuildAttribute
objects. We show the initialization of this array at line 2 in the
following code. Out of the four active attributes, three will be used
as inputs ( education, marital-status, and capital-gain as used in the
 
Search WWH ::




Custom Search