gov.sandia.cognition.learning.algorithm.nearest
Class KNearestNeighborExhaustive.Learner<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>
              extended by gov.sandia.cognition.learning.algorithm.nearest.AbstractKNearestNeighbor<InputType,OutputType>
                  extended by gov.sandia.cognition.learning.algorithm.nearest.KNearestNeighborExhaustive<InputType,OutputType>
                      extended by gov.sandia.cognition.learning.algorithm.nearest.KNearestNeighborExhaustive.Learner<InputType,OutputType>
Type Parameters:
InputType - Type of data upon which the KNearestNeighborExhaustive 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>>,KNearestNeighborExhaustive<InputType,OutputType>>, KNearestNeighbor<InputType,OutputType>, NearestNeighbor<InputType,OutputType>, SupervisedBatchLearner<InputType,OutputType,KNearestNeighborExhaustive<InputType,OutputType>>, DivergenceFunctionContainer<InputType,InputType>, CloneableSerializable, Serializable, Cloneable
Enclosing class:
KNearestNeighborExhaustive<InputType,OutputType>

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

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

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class gov.sandia.cognition.learning.algorithm.nearest.KNearestNeighborExhaustive
KNearestNeighborExhaustive.Learner<InputType,OutputType>, KNearestNeighborExhaustive.Neighbor
 
Field Summary
 
Fields inherited from class gov.sandia.cognition.learning.function.distance.DefaultDivergenceFunctionContainer
divergenceFunction
 
Fields inherited from interface gov.sandia.cognition.learning.algorithm.nearest.KNearestNeighbor
DEFAULT_K
 
Constructor Summary
KNearestNeighborExhaustive.Learner()
          Default constructor.
KNearestNeighborExhaustive.Learner(int k, DivergenceFunction<? super InputType,? super InputType> divergenceFunction, Summarizer<? super OutputType,OutputType> averager)
          Creates a new instance of Learner
 
Method Summary
 KNearestNeighborExhaustive<InputType,OutputType> learn(Collection<? extends InputOutputPair<? extends InputType,OutputType>> data)
          Creates a new KNearestNeighborExhaustive from a Collection of InputType.
 
Methods inherited from class gov.sandia.cognition.learning.algorithm.nearest.KNearestNeighborExhaustive
clone, computeNeighborhood, getData, setData
 
Methods inherited from class gov.sandia.cognition.learning.algorithm.nearest.AbstractKNearestNeighbor
evaluate, getAverager, getK, setAverager, setK
 
Methods inherited from class gov.sandia.cognition.learning.algorithm.nearest.AbstractNearestNeighbor
add
 
Methods inherited from class gov.sandia.cognition.learning.function.distance.DefaultDivergenceFunctionContainer
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.util.CloneableSerializable
clone
 
Methods inherited from interface gov.sandia.cognition.learning.algorithm.nearest.NearestNeighbor
add, getDivergenceFunction
 

Constructor Detail

KNearestNeighborExhaustive.Learner

public KNearestNeighborExhaustive.Learner()
Default constructor.


KNearestNeighborExhaustive.Learner

public KNearestNeighborExhaustive.Learner(int k,
                                          DivergenceFunction<? super InputType,? super InputType> divergenceFunction,
                                          Summarizer<? super OutputType,OutputType> averager)
Creates a new instance of Learner

Parameters:
k - Number of neighbors to consider, must be greater than zero
divergenceFunction - Divergence function that determines how "far" two objects are apart, where lower values indicate two objects are more similar
averager - Creates a single object from a collection of data
Method Detail

learn

public KNearestNeighborExhaustive<InputType,OutputType> learn(Collection<? extends InputOutputPair<? extends InputType,OutputType>> data)
Creates a new KNearestNeighborExhaustive from a Collection of InputType. This is simply a pass-through to the constructor, and there is no computation time associated with this function call.

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