Create Segmentation Tree
create_segmentation_treeCreate a SAS Intelligent Decisioning segmentation tree by defining variable tests, ordered value nodes, and outcomes to route cases and assign decision values.
Instructions
Create a SAS Intelligent Decisioning segmentation tree.
A node tests one variable; its valueNodes are checked in order and
the first match wins, then goes to next (another node) or to an
outcomeName. A value is a value, several separated by ;
("A;B"), a comparison (">=630"), a range with v
("600<=v<630"), or "Other" for everything else, missing values
included. Example::
node = {"variable": "score", "valueNodes": [
{"value": ">=630", "outcome": "low_risk"},
{"value": "Other", "outcome": "high_risk"}]}
outcomes = [{"name": "low_risk", "assign": {"band": "LOW"}},
{"name": "high_risk", "assign": {"band": "HIGH"}}]An outcome assigns with assign (variable to value) or runs DS2
statements with code. To build a large tree from a strategy table,
use create_segmentation_tree_from_table.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Tree name. | |
| node | Yes | The root node. | |
| folder | No | Where to store the tree: a folder path, ``My Folder``, a folder ID or URI. Omit to use the default folder; if there is none, ask the user. | |
| matrices | No | Matrix definitions, for nodes of type matrix. | |
| outcomes | No | The outcomes the value nodes lead to. | |
| signature | Yes | Every variable the tree tests or assigns, each ``{"name", "dataType", "direction"}`` — dataType string, decimal, integer, date, datetime or boolean; direction input, output or inOut. Add ``valueListId`` / ``valueListContentId`` to tie a variable to a value list. | |
| code_files | No | Internal code files ``{"name", "type": "internal", "code"}``. | |
| description | No | Optional description. | |
| boolean_expressions | No | Named DS2 conditions, ``{"name", "expression"}``, for nodes of type booleanExpression (value nodes "true" / "false"). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||