# NOT RUN {
# Load data in memory
# X_vars_sample: Predictor variables at sample (from getSample)
# Y_vars_sample: Response variables at sample (from getSample)
# train_idx: Rows of X_vars_sample and Y_vars_sample that are used for
# training (from (partition))
load(system.file("extdata/examples/example_trainNN.RData",package="foster"))
set.seed(1234) #for example reproducibility
kNN <- trainNN(x = X_vars_sample,
y=Y_vars_sample,
inTrain = train_idx,
k = 1,
method = "randomForest",
ntree = 200)
# }
Run the code above in your browser using DataLab