Learning
Documentation
Community
Open Exchange
Global Masters
Home / Class Reference / ENSLIB namespace / %DeepSee.PMML.Utils.TreeBuilder
Private  Storage   

%DeepSee.PMML.Utils.TreeBuilder


class %DeepSee.PMML.Utils.TreeBuilder extends
%RegisteredObject

Utility class to build Tree models for a %DeepSee.PMML.Dataset object.

Inventory


Parameters Properties Methods Queries Indices ForeignKeys Triggers
8 11


Summary


Properties
ConsiderNullValues Dataset MinimalSplitCoverage SplitScoringAlgorithm
SplitsPerNode TargetField TrackDistributions Tree

Methods
%AddToSaveSet %ClassIsLatestVersion %ClassName %ConstructClone
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Extends
%GetParameter %IsA %IsModified %New
%NormalizeObject %ObjectModified %OriginalNamespace %PackageName
%RemoveFromSaveSet %SerializeObject %SetModified %ValidateObject
Build FindSplits GetInvertedFilter GetNodeFilters
MergeFilters Print Reset SplitNode


Properties


• property ConsiderNullValues as %Boolean [ InitialExpression = 0 ];
Whether or not to consider null (missing) values for split criteria
• property Dataset as %DeepSee.PMML.Dataset;
The dataset to mine.
• property MinimalSplitCoverage as %Numeric [ InitialExpression = 0.05 ];
Minimal % of the total number of records represented by a node that should be covered by a branch. If a branch covers fewer records than this value, it is ignored
• property SplitScoringAlgorithm as %String(VALUELIST=",Confidence,GiniImpurity,InformationGain") [ InitialExpression = "GiniImpurity" ];
Which metric to use to judge split quality. This metric is returned as the split "score" by FindSplits
• property SplitsPerNode as %Integer [ InitialExpression = 2 ];
Default (maximum) number of branches per node
• property TargetField as %String;
The target field whose value is to be derived through this tree. This field should be part of Dataset.
• property TrackDistributions as %Boolean [ InitialExpression = 1 ];
Whether or not to track distribution information for tree nodes
• property Tree as %Integer [ MultiDimensional ];
..Tree = $i ..Tree(NodeId) = $lb(parent, targetValue, confidence, count, isLeaf) ..Tree(NodeId, "condition") = [AND|OR|$lb(field, operator, value)] ..Tree(NodeId, "ch", ChildNode) = "" ..Tree(NodeId, "distribution", value) = count

Methods


• method Build(pMaxDepth As %Integer = 3)

Builds a tree structure with a maximum depth of pMaxDepth.

If a tree structure was already built, this method silently exits. Use Reset to erase an existing tree structure.

• method FindSplits(pNode As %Integer, Output pSplits) as %Status
Returns an unsorted array of candidate splits for node pNode: pSplits(n) = $lb(score, coverage, targetValue, confidence, recordCount, isLeaf) pSplits(n,"condition") = ...
• method GetInvertedFilter(ByRef pFilter, Output pInverted) as %Status
Returns the inverse of pFilter, equivalent to a boolean NOT of the entire pFilter.
• method GetNodeFilters(pNode As %Integer, Output pFilters) as %Status
Returns the combination of filter conditions (pFilters) a record should satisfy to end up in node pNode. This is a combination of the node's own condition, its full ancestry and any prior siblings' conditions.
• method MergeFilters(ByRef pFilter, ByRef pOtherFilter, pLogic As %String = "AND") as %Status
Appends pOtherFilter to pFilter using pLogic logic
• method Print(pNode As %Integer = 0, pLevel As %Integer = 0, pPrintDistribution As %Boolean = 0) as %Status
Prints the tree (starting with pNode) to the terminal.
• method Reset() as %Status
After changing building parameters, run this method to erase the current tree structure so Build can be run again.
• method SplitNode(pNode As %Integer) as %Status
Splits node pNode in SplitsPerNode sub-nodes (or fewer, if not enough candidate splits satisfy coverage and other selection criteria).