gov.sandia.cognition.learning.algorithm.nearest
Class AbstractNearestNeighbor<InputType,OutputType>

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.function.distance.DefaultDivergenceFunctionContainer<InputType,InputType>
          extended by gov.sandia.cognition.learning.algorithm.nearest.AbstractNearestNeighbor<InputType,OutputType>
Type Parameters:
InputType - Type of data upon which the KNearestNeighbor operates, something like Vector, Double, or String
OutputType - Output of the evaluator, like Matrix, Double, String
All Implemented Interfaces:
Evaluator<InputType,OutputType>, NearestNeighbor<InputType,OutputType>, DivergenceFunctionContainer<InputType,InputType>, CloneableSerializable, Serializable, Cloneable
Direct Known Subclasses:
AbstractKNearestNeighbor, NearestNeighborExhaustive, NearestNeighborKDTree

public abstract class AbstractNearestNeighbor<InputType,OutputType>
extends DefaultDivergenceFunctionContainer<InputType,InputType>
implements NearestNeighbor<InputType,OutputType>

Partial implementation of KNearestNeighbor.

Since:
3.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.sandia.cognition.learning.function.distance.DefaultDivergenceFunctionContainer
divergenceFunction
 
Constructor Summary
AbstractNearestNeighbor()
          Creates a new instance of AbstractNearestNeighbor
AbstractNearestNeighbor(DivergenceFunction<? super InputType,? super InputType> divergenceFunction)
          Creates a new instance of AbstractNearestNeighbor
 
Method Summary
 void add(InputOutputPair<? extends InputType,OutputType> value)
          Adds the Pair to the data.
 
Methods inherited from class gov.sandia.cognition.learning.function.distance.DefaultDivergenceFunctionContainer
clone, getDivergenceFunction, setDivergenceFunction
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.learning.algorithm.nearest.NearestNeighbor
getData, getDivergenceFunction
 
Methods inherited from interface gov.sandia.cognition.evaluator.Evaluator
evaluate
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 

Constructor Detail

AbstractNearestNeighbor

public AbstractNearestNeighbor()
Creates a new instance of AbstractNearestNeighbor


AbstractNearestNeighbor

public AbstractNearestNeighbor(DivergenceFunction<? super InputType,? super InputType> divergenceFunction)
Creates a new instance of AbstractNearestNeighbor

Parameters:
divergenceFunction - The internal divergence function for the object to use.
Method Detail

add

public void add(InputOutputPair<? extends InputType,OutputType> value)
Description copied from interface: NearestNeighbor
Adds the Pair to the data.

Specified by:
add in interface NearestNeighbor<InputType,OutputType>
Parameters:
value - Value to add to the data.