Package rdkit :: Package ML :: Package DecTree :: Module QuantTree :: Class QuantTreeNode

[hide private]
[frames] | no frames]

# Class QuantTreeNode

source code

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

Instance Methods | [hide private]

__init__(self, *args, **kwargs) constructor | source code

ClassifyExample(self, example, appendExamples=0) Recursively classify an example by running it through the tree | source code

SetQuantBounds(self, qBounds) | source code

GetQuantBounds(self) | source code

__cmp__(self, other) allows tree1 == tree2 | source code

__lt__(self, other) allows tree1 < tree2 | source code

__eq__(self, other) | source code

__str__(self) returns a string representation of the tree | 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`, `NameModel`, `NameTree`, `Pickle`, `Print`, `PruneChild`, `ReplaceChildIndex`, `SetData`, `SetLabel`, `SetLevel`, `SetName`, `SetParent`, `SetTerminal`

Method Details | [hide private]

### __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)

### ClassifyExample(self, example, appendExamples=0)

source code

    Recursively classify an example by running it through the tree

    **Arguments**

      - example: the example to be classified

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

    **Returns**

      the classification of _example_

    **NOTE:**
      In the interest of speed, I don't use accessor functions
      here.  So if you subclass DecTreeNode for your own trees, you'll
      have to either include ClassifyExample or avoid changing the names
      of the instance variables this needs.

Overrides: DecTree.DecTreeNode.ClassifyExample

### __cmp__(self, other)
(Comparison operator)

source code

    allows tree1 == tree2

    **Note**

      This works recursively

Overrides: Tree.TreeNode.__cmp__
  (inherited documentation)

### __lt__(self, other)
(Less-than operator)

source code

    allows tree1 < tree2

    **Note**

      This works recursively

Overrides: Tree.TreeNode.__lt__
  (inherited documentation)

### __eq__(self, other)
(Equality operator)

source code

Overrides: Tree.TreeNode.__eq__

### __str__(self)
(Informal representation operator)

source code

    returns a string representation of the tree

    **Note**

      this works recursively

Overrides: Tree.TreeNode.__str__