InputType - Type of data upon which the KNearestNeighbor operates,
something like Vector, Double, or StringOutputType - Output of the evaluator, like Matrix, Double, Stringpublic static class KNearestNeighborKDTree.Learner<InputType extends Vectorizable,OutputType> extends KNearestNeighborKDTree<InputType,OutputType> implements SupervisedBatchLearner<InputType,OutputType,KNearestNeighborKDTree<InputType,OutputType>>
KNearestNeighborKDTree.Learner<InputType extends Vectorizable,OutputType>divergenceFunctionDEFAULT_K| Constructor and Description |
|---|
Learner()
Default constructor.
|
Learner(int k,
Metric<? super Vectorizable> divergenceFunction,
Summarizer<? super OutputType,? extends OutputType> averager)
Creates a new instance of Learner
|
Learner(Summarizer<? super OutputType,? extends OutputType> averager)
Creates a new instance of Learner.
|
| Modifier and Type | Method and Description |
|---|---|
KNearestNeighborKDTree<InputType,OutputType> |
learn(java.util.Collection<? extends InputOutputPair<? extends InputType,OutputType>> data)
Creates a new KNearestNeighbor from a Collection of InputType.
|
clone, computeNeighborhood, getData, getDivergenceFunction, rebalance, setData, setDivergenceFunction, setDivergenceFunctionevaluate, getAverager, getK, setAverager, setKaddequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcloneaddpublic Learner()
public Learner(Summarizer<? super OutputType,? extends OutputType> averager)
averager - Creates a single object from a collection of data.public Learner(int k,
Metric<? super Vectorizable> divergenceFunction,
Summarizer<? super OutputType,? extends 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 KNearestNeighborKDTree<InputType,OutputType> learn(java.util.Collection<? extends InputOutputPair<? extends InputType,OutputType>> data)
learn in interface BatchLearner<java.util.Collection<? extends InputOutputPair<? extends InputType extends Vectorizable,OutputType>>,KNearestNeighborKDTree<InputType extends Vectorizable,OutputType>>data - Dataset from which to create a new KNearestNeighbor