gpalta.nodes
Class DistanceToCentroid

java.lang.Object
  extended by gpalta.nodes.Node
      extended by gpalta.nodes.DistanceToCentroid
All Implemented Interfaces:
NodeParent, java.io.Serializable, java.lang.Cloneable

public class DistanceToCentroid
extends Node

See Also:
Serialized Form

Field Summary
 double[] c
           
 
Constructor Summary
DistanceToCentroid()
           
 
Method Summary
 double eval(DataHolder data)
          Evaluate the Node for a sinlge sample.
 void evalVect(double[] outVect, double[][] kidOutVect, DataHolder data)
          Evaluate the Node for all samples (vectorial evaluation).
 void init(Config config, DataHolder data)
          Initialize the Node.
 java.lang.String name()
          Get the Node's short name (such as "plus", "minus", "x1", etc)
 int nKids()
          Read the number of kids of the Node
 
Methods inherited from class gpalta.nodes.Node
clone, deepClone, evalVect, getCurrentDepth, getKid, getMaxDepthFromHere, getNSubNodes, getParent, getWhichKidOfParent, newKids, parse, setCurrentDepth, setKid, setMaxDepthFromHere, setNSubNodes, setParent, setTypeOfKids, setWhichKidOfParent, toString, typeOfKids
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

c

public double[] c
Constructor Detail

DistanceToCentroid

public DistanceToCentroid()
Method Detail

init

public void init(Config config,
                 DataHolder data)
Description copied from class: Node
Initialize the Node. Override this if the node has a state that needs to be specified when created

Overrides:
init in class Node

eval

public double eval(DataHolder data)
Description copied from class: Node
Evaluate the Node for a sinlge sample. All Nodes must override this method. The Node is responsible for evaluating its children, if any.

Specified by:
eval in class Node
Returns:
The output of the Node

evalVect

public void evalVect(double[] outVect,
                     double[][] kidOutVect,
                     DataHolder data)
Description copied from class: Node
Evaluate the Node for all samples (vectorial evaluation). All Nodes must override this method

Specified by:
evalVect in class Node
Parameters:
outVect - The array where the outout must be stored
kidOutVect - A matrix holding the outputs of this Node's kids. Each row holds the output for each kid
data - The problem's data

nKids

public int nKids()
Description copied from class: Node
Read the number of kids of the Node

Specified by:
nKids in interface NodeParent
Specified by:
nKids in class Node
Returns:
The number of kids this Node has

name

public java.lang.String name()
Description copied from class: Node
Get the Node's short name (such as "plus", "minus", "x1", etc)

Specified by:
name in class Node
Returns:
The Node's name