Java Reference
In-Depth Information
The method
buildSQLStatement
is shown here:
1. public String buildSQLStatement(){
2. String lSQLStatement
"select c.*, sc.RESPONSE from "
3.
mOutputTableName
" sc left outer join "
4.
mInputTableName
" c on sc."
5.
mIdentifierColumnName
"
c."
mIdentifierColumnName
6.
" where (sc.RESPONSE IS NOT null)";
7. return lSQLStatement;
8. }
Now, we have to transform this SQL
select
statement into something
that can be used by the JDM implementation as a
PhysicalDataSet
for
use in the classification build task. In JDM, physical datasets are speci-
fied using a uniform resource identifier (URI) with a vendor-specific
syntax. Hence, the code that translates the SQL statement into a dataset
URI is vendor-specific. We have placed this code into the method
get-
VendorJDMDataSetURI
.
A vendor implementation may allow the use of a select statement
as part of the URI, perhaps creating a table using a CREATE TABLE
AS statement, or, the vendor implementation may allow the use of a
select statement directly, avoiding the creation of an intermediate
table. The next code listing contains this vendor-specific code start-
ing from an SQL statement at line 9. We set the case identifier
attribute in lines 12 to 14.
Then,
LogicalData
is used to select the active attributes. The list of
active attributes is provided by the campaign manager. We could use
the
LogicalAttributeFactory
to create logical attributes and provide the
AttributeType
explicitly to the create method for
LogicalAttribute
.
However, we will rely on the data mining engine (DME) to automati-
cally create the logical attributes from the physical dataset. This is
done at line 19. In this case, the DME assigns the
AttributeType
to
each attribute, and declares all the logical attributes to be active by
default. The
LogicalData
is saved at line 23. Note that all available
attributes will be used to build the model if the user specifies an
empty attribute list.
Next, a
ClassificationSettings
object is created and associated with
the target attribute name RESPONSE, as shown at line 34. If the user
has specified a list of active attributes, this
ClassificationSettings
object
must reference the saved
LogicalData
and the active attributes must
be specified. Recall that when logical attributes are created from the
physical dataset, they are declared as active by default. We first set all
Search WWH ::
Custom Search