Trees | Indices | Help |
|
---|
|
object --+ | Forest
a forest of unique decision trees. adding an existing tree just results in its count field being incremented and the errors being averaged. typical usage: 1) grow the forest with AddTree until happy with it 2) call AverageErrors to calculate the average error values 3) call SortTrees to put things in order by either error or count
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
Inherited from |
|
collects votes across every member of the forest for the given example **Returns** a list of the results |
classifies the given example using the entire forest **returns** a result and a measure of confidence in it. **FIX:** statistics sucks... I'm not seeing an obvious way to get the confidence intervals. For that matter, I'm not seeing an unobvious way. For now, this is just treated as a voting problem with the confidence measure being the percent of trees which voted for the winning result. |
Returns the details of the last vote the forest conducted this will be an empty list if no voting has yet been done |
Grows the forest by adding trees **Arguments** - examples: the examples to be used for training - attrs: a list of the attributes to be used in training - nPossibleVals: a list with the number of possible values each variable (as well as the result) can take on - nTries: the number of new trees to add - pruneIt: a toggle for whether or not the tree should be pruned - lessGreedy: toggles the use of a less greedy construction algorithm where each possible tree root is used. The best tree from each step is actually added to the forest. |
Writes this forest off to a file so that it can be easily loaded later **Arguments** fileName is the name of the file to be written |
Adds a tree to the forest If an identical tree is already present, its count is incremented **Arguments** - tree: the new tree - error: its error value **NOTE:** the errList is run as an accumulator, you probably want to call AverageErrors after finishing the forest |
convert summed error to average error This does the conversion in place |
sorts the list of trees **Arguments** sortOnError: toggles sorting on the trees' errors rather than their counts |
returns all relevant data about a particular tree in the forest **Arguments** i: an integer indicating which tree should be returned **Returns** a 3-tuple consisting of: 1) the tree 2) its count 3) its error |
sets all relevant data for a particular tree in the forest **Arguments** - i: an integer indicating which tree should be returned - tup: a 3-tuple consisting of: 1) the tree 2) its count 3) its error |
Returns everything we know **Returns** a 3-tuple consisting of: 1) our list of trees 2) our list of tree counts 3) our list of tree errors |
allows forest[i] to work. return the data tuple |
allows the forest to show itself as a string
|
x.__init__(...) initializes x; see help(type(x)) for signature
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Feb 1 16:13:01 2018 | http://epydoc.sourceforge.net |