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 KNearestNeighbor<InputType,OutputType> extends NearestNeighbor<InputType,OutputType>
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_K
The default value for k is 1.
|
Modifier and Type | Method and Description |
---|---|
Summarizer<? super OutputType,? extends OutputType> |
getAverager()
Getter for averager.
|
int |
getK()
Getter for k
|
void |
setAverager(Summarizer<? super OutputType,? extends OutputType> averager)
Setter for averager.
|
void |
setK(int k)
Setter for k
|
add, getData, getDivergenceFunction
clone
static final int DEFAULT_K
Summarizer<? super OutputType,? extends OutputType> getAverager()
void setAverager(Summarizer<? super OutputType,? extends OutputType> averager)
averager
- Creates a single object from a collection of dataint getK()
void setK(int k)
k
- Number of neighbors to consider, must be greater than zero