gov.sandia.cognition.learning.algorithm.nearest
Class NearestNeighborKDTree.Learner<InputType extends Vectorizable,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>
              extended by gov.sandia.cognition.learning.algorithm.nearest.NearestNeighborKDTree<InputType,OutputType>
                  extended by gov.sandia.cognition.learning.algorithm.nearest.NearestNeighborKDTree.Learner<InputType,OutputType>
Type Parameters:
InputType - Type of data upon which the NearestNeighbor operates, something like Vector, Double, or String
OutputType - Output of the evaluator, like Matrix, Double, String
All Implemented Interfaces:
Evaluator<InputType,OutputType>, BatchLearner<Collection<? extends InputOutputPair<? extends InputType,OutputType>>,NearestNeighborKDTree<InputType,OutputType>>, NearestNeighbor<InputType,OutputType>, SupervisedBatchLearner<InputType,OutputType,NearestNeighborKDTree<InputType,OutputType>>, DivergenceFunctionContainer<InputType,InputType>, CloneableSerializable, Serializable, Cloneable
Enclosing class:
NearestNeighborKDTree<InputType extends Vectorizable,OutputType>

public static class NearestNeighborKDTree.Learner<InputType extends Vectorizable,OutputType>
extends NearestNeighborKDTree<InputType,OutputType>
implements SupervisedBatchLearner<InputType,OutputType,NearestNeighborKDTree<InputType,OutputType>>

This is a BatchLearner interface for creating a new NearestNeighbor from a given dataset, simply a pass-through to the constructor of NearestNeighbor

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class gov.sandia.cognition.learning.algorithm.nearest.NearestNeighborKDTree
NearestNeighborKDTree.Learner<InputType extends Vectorizable,OutputType>
 
Field Summary
 
Fields inherited from class gov.sandia.cognition.learning.function.distance.DefaultDivergenceFunctionContainer
divergenceFunction
 
Constructor Summary
NearestNeighborKDTree.Learner()
          Default constructor.
NearestNeighborKDTree.Learner(Metric<? super Vectorizable> divergenceFunction)
          Creates a new instance of Learner
 
Method Summary
 NearestNeighborKDTree<InputType,OutputType> learn(Collection<? extends InputOutputPair<? extends InputType,OutputType>> data)
          Creates a new NearestNeighbor from a Collection of InputType.
 
Methods inherited from class gov.sandia.cognition.learning.algorithm.nearest.NearestNeighborKDTree
clone, evaluate, getData, getDivergenceFunction, setData, setDivergenceFunction, setDivergenceFunction
 
Methods inherited from class gov.sandia.cognition.learning.algorithm.nearest.AbstractNearestNeighbor
add
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 

Constructor Detail

NearestNeighborKDTree.Learner

public NearestNeighborKDTree.Learner()
Default constructor.


NearestNeighborKDTree.Learner

public NearestNeighborKDTree.Learner(Metric<? super Vectorizable> divergenceFunction)
Creates a new instance of Learner

Parameters:
divergenceFunction - Divergence function that determines how "far" two objects are apart, where lower values indicate two objects are more similar
Method Detail

learn

public NearestNeighborKDTree<InputType,OutputType> learn(Collection<? extends InputOutputPair<? extends InputType,OutputType>> data)
Creates a new NearestNeighbor from a Collection of InputType. We build a balanced KDTree with the data, which is an O(n log(n)) operator for n data points.

Specified by:
learn in interface BatchLearner<Collection<? extends InputOutputPair<? extends InputType extends Vectorizable,OutputType>>,NearestNeighborKDTree<InputType extends Vectorizable,OutputType>>
Parameters:
data - Dataset from which to create a new NearestNeighbor
Returns:
NearestNeighbor based on the given dataset with a balanced KDTree.