Specifying Transformation Instructions for an Attribute

A transformation list is defined as a table of transformation records. Each record (transform_rec) specifies the transformation instructions for an attribute.

TYPE transform_rec IS RECORD (
    attribute_name      VARCHAR2(30),
    attribute_subname   VARCHAR2(4000),
    expression          EXPRESSION_REC,
    reverse_expression  EXPRESSION_REC,
    attribute_spec      VARCHAR2(4000));

The fields in a transformation record are described in Table 4-2.


Table 4-2 Fields in a Transformation Record for an Attribute

Field Description

attribute_name and attribute_subname

These fields identify the attribute, as described in "Scoping of Model Attribute Name"

expression

A SQL expression for transforming the attribute. For example, this expression transforms the age attribute into two categories: child and adult:[0,19) for 'child' and [19,) for adult

CASE WHEN age < 19 THEN 'child' ELSE 'adult'

Expression and reverse expressions are stored in expression_rec objects. See "Expression Records" for details.

reverse_expression

A SQL expression for reversing the transformation. For example, this expression reverses the transformation of the age attribute:

DECODE(age,'child','(-Inf,19)','[19,Inf)')

attribute_spec

Specifies special treatment for the attribute. The attribute_spec field can be null or it can have one or more of these values:

  • FORCE_IN — For GLM, forces the inclusion of the attribute in the model build when the ftr_selection_enable setting is enabled. (ftr_selection_enable is disabled by default.) If the model is not using GLM, this value has no effect. FORCE_IN cannot be specified for nested attributes or text.

  • NOPREP — When ADP is on, prevents automatic transformation of the attribute. If ADP is not on, this value has no effect. You can specify NOPREP for a nested attribute, but not for an individual subname (row) in the nested attribute.

  • TEXT — Indicates that the attribute contains unstructured text. ADP has no effect on this setting. TEXT may optionally include subsettings POLICY_NAME, TOKEN_TYPE, and MAX_FEATURES.

See Example 4-1 and Example 4-2.