InputType
- Type of data upon which the KNearestNeighborExhaustive operates,
something like Vector, Double, or StringOutputType
- Output of the evaluator, like Matrix, Double, Stringpublic static class KNearestNeighborExhaustive.Learner<InputType,OutputType> extends KNearestNeighborExhaustive<InputType,OutputType> implements SupervisedBatchLearner<InputType,OutputType,KNearestNeighborExhaustive<InputType,OutputType>>
KNearestNeighborExhaustive.Learner<InputType,OutputType>, KNearestNeighborExhaustive.Neighbor
divergenceFunction
DEFAULT_K
Constructor and Description |
---|
Learner()
Default constructor.
|
Learner(int k,
DivergenceFunction<? super InputType,? super InputType> divergenceFunction,
Summarizer<? super OutputType,OutputType> averager)
Creates a new instance of Learner
|
Modifier and Type | Method and Description |
---|---|
KNearestNeighborExhaustive<InputType,OutputType> |
learn(java.util.Collection<? extends InputOutputPair<? extends InputType,OutputType>> data)
Creates a new KNearestNeighborExhaustive from a Collection of InputType.
|
clone, computeNeighborhood, getData, setData
evaluate, getAverager, getK, setAverager, setK
add
getDivergenceFunction, setDivergenceFunction
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clone
add, getDivergenceFunction
public Learner()
public Learner(int k, DivergenceFunction<? super InputType,? super InputType> divergenceFunction, Summarizer<? super OutputType,OutputType> averager)
k
- Number of neighbors to consider, must be greater than zerodivergenceFunction
- Divergence function that determines how "far" two objects are apart,
where lower values indicate two objects are more similaraverager
- Creates a single object from a collection of datapublic KNearestNeighborExhaustive<InputType,OutputType> learn(java.util.Collection<? extends InputOutputPair<? extends InputType,OutputType>> data)
learn
in interface BatchLearner<java.util.Collection<? extends InputOutputPair<? extends InputType,OutputType>>,KNearestNeighborExhaustive<InputType,OutputType>>
data
- Dataset from which to create a new KNearestNeighborExhaustive