public class KNearest extends StatModel
Modifier and Type | Field and Description |
---|---|
static int |
BRUTE_FORCE |
static int |
KDTREE |
COMPRESSED_INPUT, PREPROCESSED_INPUT, RAW_OUTPUT, UPDATE_MODEL
Modifier and Type | Method and Description |
---|---|
static KNearest |
create() |
float |
findNearest(Mat samples,
int k,
Mat results) |
float |
findNearest(Mat samples,
int k,
Mat results,
Mat neighborResponses,
Mat dist) |
int |
getAlgorithmType() |
int |
getDefaultK() |
int |
getEmax() |
boolean |
getIsClassifier() |
void |
setAlgorithmType(int val) |
void |
setDefaultK(int val) |
void |
setEmax(int val) |
void |
setIsClassifier(boolean val) |
empty, getVarCount, isClassifier, isTrained, predict, predict, train
clear, getDefaultName, save
public static final int BRUTE_FORCE
public static final int KDTREE
public static KNearest create()
public float findNearest(Mat samples, int k, Mat results, Mat neighborResponses, Mat dist)
public int getAlgorithmType()
public int getDefaultK()
public int getEmax()
public boolean getIsClassifier()
public void setAlgorithmType(int val)
public void setDefaultK(int val)
public void setEmax(int val)
public void setIsClassifier(boolean val)