calibrate: Calibrate parameters

Description Usage Arguments Value Examples

View source: R/impute.R

Description

This function returns a vector with the two parameters requiered by the biokNN method where the first value is the weighting parameter and the second the number of neighbors

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
calibrate(
  data,
  className,
  varNames,
  prop_valid = 0.1,
  nIter = 10,
  distance = "gower",
  alpha_space = NULL,
  k_space = NULL,
  print = FALSE
)

Arguments

data

A dataframe with missing values

className

name of the variable that contains the classes

varNames

vector with the names of the variables to be imputed

prop_valid

proportion of missing values

nIter

number of iterations, default = 10

distance

distance function used to get the k-nearest neighbors

alpha_space

vector with the calibration values to test for the weight parameter

k_space

vector with the calibration values to test for the number of neighbors

print

option to print the RMSE values of the parameters used for calibration (print = TRUE).

Value

A dataframe with the imputed data

Examples

1
2
3
4
5
6
7
8
data(data_example)
calibrate(data_example,
          className = "class",
          varNames = c("y"),
          prop_valid = 0.3,
          alpha_space = c(0.5, 0.7, 0.9),
          k_space = c(10, 15),
          print = TRUE)

mcubillos3/biokNN documentation built on Dec. 21, 2021, 4:50 p.m.