Package rdkit :: Package ML :: Package DecTree :: Module SigTree :: Class SigTreeNode
[hide private]
[frames] | no frames]

Class SigTreeNode

source code

  Tree.TreeNode --+    
                  |    
DecTree.DecTreeNode --+
                      |
                     SigTreeNode



  

Instance Methods [hide private]
 
NameModel(self, *args, **kwargs)
Set the names of each node in the tree from a list of variable names.
source code
 
ClassifyExample(self, example, appendExamples=0)
Recursively classify an example by running it through the tree
source code
 
__init__(self, *args, **kwargs)
constructor
source code

Inherited from DecTree.DecTreeNode: AddChild, ClearExamples, GetBadExamples, GetExamples, GetTestExamples, GetTrainingExamples, SetBadExamples, SetExamples, SetTestExamples, SetTrainingExamples

Inherited from Tree.TreeNode: AddChildNode, Destroy, GetChildren, GetData, GetLabel, GetLevel, GetName, GetParent, GetTerminal, NameTree, Pickle, Print, PruneChild, ReplaceChildIndex, SetData, SetLabel, SetLevel, SetName, SetParent, SetTerminal, __cmp__, __eq__, __lt__, __str__

Method Details [hide private]

NameModel(self, *args, **kwargs)

source code 
Set the names of each node in the tree from a list of variable names.

**Arguments**

  - varNames: a list of names to be assigned

**Notes**

   1) this works its magic by recursively traversing all children

   2) The assumption is made here that the varNames list can be indexed
      by the labels of tree nodes

Overrides: Tree.TreeNode.NameTree
(inherited documentation)

ClassifyExample(self, example, appendExamples=0)

source code 
Recursively classify an example by running it through the tree

**Arguments**

  - example: the example to be classified, a sequence at least
    2 long:
     ( id, sig )
    where sig is a BitVector (or something supporting __getitem__)
    additional fields will be ignored.

  - appendExamples: if this is nonzero then this node (and all children)
    will store the example

**Returns**

  the classification of _example_

Overrides: DecTree.DecTreeNode.ClassifyExample

__init__(self, *args, **kwargs)
(Constructor)

source code 
constructor

**Arguments**

  - parent: the parent of this node in the tree

  - name: the name of the node

  - label: the node's label (should be an integer)

  - data: an optional data field

  - level: an integer indicating the level of this node in the hierarchy
    (used for printing)

  - isTerminal: flags a node as being terminal.  This is useful for those
    times when it's useful to know such things.

Overrides: Tree.TreeNode.__init__
(inherited documentation)