k_fold_cross_validation: k-Fold Cross Validation

Description Usage Arguments Value Author(s) Examples

View source: R/k_fold_cross_validation.R

Description

k-Fold Cross Validation for knn Classifier algorithm

Usage

1
2
3
k_fold_cross_validation(data, target, method = c("k_fold",
  "multi_k_fold"), algorithm = "knn", k_fold = 10, times = 5,
  metric = "Accuracy", ...)

Arguments

data

Dataframe that will be used

target

Integer with the column number of the target variable

method

Could be "k_fold" or "multi_k_fold"

algorithm

Only "knn" available

k_fold

Number of folds that will be created

times

Number of times to create "multi_k_fold"

metric

Metric that will be evaluated. Possible values: "Accuracy", "Sensitivity" or "Specificity"

Value

Returns the mean values for the metric selected

Author(s)

Alberto Almui?a

Examples

1
data<-k_fold_cross_validation(data = iris, target = 5, method = "k_fold", k_fold = 3, metric = "Sensitivity")

AlbertoAlmuinha/knnClassifier documentation built on Oct. 30, 2019, 4:48 a.m.