InputType
- Type of data upon which the KNearestNeighbor operates,
something like Vector, Double, or StringOutputType
- Output of the evaluator, like Matrix, Double, String@PublicationReference(author="Wikipedia", title="k-nearest neighbor algorithm", type=WebPage, year=2008, url="http://en.wikipedia.org/wiki/K-nearest_neighbor_algorithm") public interface NearestNeighbor<InputType,OutputType> extends Evaluator<InputType,OutputType>, CloneableSerializable
NearestNeighborExhaustive
class implements a simple evaluator
that looks up a given input object in a collection of input-output pair
examples and returns the output associated with the most similar input.
Similarity is judged using the given divergence function. This is an
implementation of the standard nearest-neighbor algorithm, which is a corner
case of the k-nearest neighbor algorithm, implemented in the
KNearestNeighbor
class.Modifier and Type | Method and Description |
---|---|
void |
add(InputOutputPair<? extends InputType,OutputType> value)
Adds the Pair to the data.
|
java.util.Collection<InputOutputPair<? extends InputType,OutputType>> |
getData()
Gets the data from which this computes the nearest neighbors.
|
DivergenceFunction<? super InputType,? super InputType> |
getDivergenceFunction()
Getter for divergenceFunction
|
clone
void add(InputOutputPair<? extends InputType,OutputType> value)
value
- Value to add to the data.DivergenceFunction<? super InputType,? super InputType> getDivergenceFunction()
java.util.Collection<InputOutputPair<? extends InputType,OutputType>> getData()