public class Node extends Object
Modifier | Constructor and Description |
---|---|
|
Node(int numberDimensions,
int level)
Initialze a normal node, which is not fake.
|
|
Node(int numberDimensions,
int level,
Entry[] argEntries)
USED FOR EM_TOP_DOWN BULK LOADING
|
protected |
Node(int numberDimensions,
int numberClasses,
int level,
boolean fakeRoot)
Initialiazes a node which is a fake root depending on the given
boolean . |
Modifier and Type | Method and Description |
---|---|
void |
addEntry(Entry newEntry,
long currentTime)
Add a new
Entry to this node. |
protected void |
clear()
Clear this Node, which means that the noiseBuffer is cleared, that
shallowClear is called upon all the entries of the node,
that the split counter is set to zero and the node is set to not be a
fake root. |
Entry[] |
getEntries()
Return an array with references to the children of this node.
|
protected Entry |
getIrrelevantEntry(double threshold)
If there exists an entry, whose relevance is under the threshold given
as a parameter to the tree, this entry is returned.
|
protected int |
getLevel(ClusTree tree)
Returns the level at which this node is in the tree.
|
protected int |
getRawLevel()
Return the level number in the node.
|
protected boolean |
isLeaf()
Checks if this node is a leaf.
|
protected void |
makeOlder(long currentTime,
double negLambda) |
protected void |
mergeEntries(int pos1,
int pos2)
Merge the two entries at the given position.
|
Entry |
nearestEntry(ClusKernel buffer)
Returns the neareast
Entry to the given Cluster . |
protected Entry |
nearestEntry(Entry newEntry)
Return the nearest entry to the given one.
|
protected int |
numFreeEntries()
Return the number of free
Entry s in this node. |
public Node(int numberDimensions, int level)
numberDimensions
- The dimensionality of the data points it
manipulates.level
- The INVERSE level at which this node hangs.protected Node(int numberDimensions, int numberClasses, int level, boolean fakeRoot)
boolean
.numberDimensions
- The dimensionality of the data points it
manipulates.level
- The level at which this node hangs.fakeRoot
- A parameter the says if the node is to be fake or not.public Node(int numberDimensions, int level, Entry[] argEntries)
numberDimensions
- level
- argEntries
- protected boolean isLeaf()
true
if the node is leaf, false
otherwise.public Entry nearestEntry(ClusKernel buffer)
Entry
to the given Cluster
.
The distance is minimized over Entry.calcDistance(Cluster)
.buffer
- The cluster to which the distance has to be compared.Entry
with minimal distance to the given
cluster.EmptyNodeException
- This Exception is thrown when this function is
called on an empty node.Kernel
,
Entry#calcDistance(moa.clusterers.tree.Kernel)
protected Entry nearestEntry(Entry newEntry)
calcDistance(Entry)
function is find the one with the
shortest distance in this node to the given one.newEntry
- The entry to which the entry with the minimal distance
to it is calculated.protected int numFreeEntries()
Entry
s in this node.Entry
s in this node.Entry
public void addEntry(Entry newEntry, long currentTime)
Entry
to this node. If there is no space left a
NoFreeEntryException
is thrown.newEntry
- The Entry
to be added.NoFreeEntryException
- Is thrown when there is no space left in
the node for the new entry.protected Entry getIrrelevantEntry(double threshold)
null
is returned.Entry
if there exists one,
null
otherwise.Entry
,
Entry.isIrrelevant(double)
public Entry[] getEntries()
Entry
protected int getRawLevel()
getLevel(Tree tree)
.#getLevel(moa.clusterers.LiarTree.Tree)
protected int getLevel(ClusTree tree)
tree
- The tree to which this node belongs.protected void clear()
shallowClear
is called upon all the entries of the node,
that the split counter is set to zero and the node is set to not be a
fake root. Notice that the level stays the same after calling this
function.Kernel#clear()
,
Entry.shallowClear()
protected void mergeEntries(int pos1, int pos2)
entries
array so that the non-empty entries are still
at the beginning.pos1
- The position of the first entry to be merged. This position
has to be smaller than the the second position.pos2
- The position of the second entry to be merged. This position
has to be greater than the the first position.protected void makeOlder(long currentTime, double negLambda)
Copyright © 2014 University of Waikato, Hamilton, NZ. All Rights Reserved.