Train a k-Nearest Neighbors learner for regression or classification using FNN
s.KNN(x, y = NULL, x.test = NULL, y.test = NULL, x.name = NULL,
y.name = NULL, k = 3, algorithm = "kd_tree", print.plot = TRUE,
plot.fitted = NULL, plot.predicted = NULL,
plot.theme = getOption("rt.fit.theme", "lightgrid"), question = NULL,
rtclass = NULL, verbose = TRUE, outdir = NULL,
save.mod = ifelse(!is.null(outdir), TRUE, FALSE), ...)
Numeric vector or matrix of features, i.e. independent variables
Numeric vector of outcome, i.e. dependent variable
(Optional) Numeric vector or matrix of validation set features
must have set of columns as x
(Optional) Numeric vector of validation set outcomes
Integer: Number of neighbors considered
String: Algorithm to use. Options: "kd_tree", "cover_tree", "brute"
Optional. Path to directory to save output
Object of class rtMod
Note: FNN's KNN does not have a predict function
elevate for external cross-validation
Other Supervised Learning: s.ADABOOST
,
s.ADDTREE
, s.BART
,
s.BAYESGLM
, s.BRUTO
,
s.C50
, s.CART
,
s.CTREE
, s.DA
,
s.ET
, s.EVTREE
,
s.GAM.default
, s.GAM.formula
,
s.GAMSEL
, s.GAM
,
s.GBM3
, s.GBM
,
s.GLMNET
, s.GLM
,
s.GLS
, s.H2ODL
,
s.H2OGBM
, s.H2ORF
,
s.IRF
, s.LDA
,
s.LM
, s.MARS
,
s.MLRF
, s.MXN
,
s.NBAYES
, s.NLA
,
s.NLS
, s.NW
,
s.POLYMARS
, s.PPR
,
s.PPTREE
, s.QDA
,
s.QRNN
, s.RANGER
,
s.RFSRC
, s.RF
,
s.SGD
, s.SPLS
,
s.SVM
, s.TFN
,
s.XGBLIN
, s.XGB