Skip to contents

Generalized k-Nearest Neighbors Classification or Regression

Usage

renoir_gknn(
  x,
  y = NULL,
  weights = NULL,
  offset = NULL,
  resp.type,
  observations = NULL,
  features = NULL,
  clean = FALSE,
  keep.call = TRUE,
  ...,
  k = 1
)

Arguments

x

the input matrix, where rows are observations and columns are variables

y

the response variable. Its number of rows must match the number of rows of x

weights

priors of the observations

offset

used only for GLM methods, it is an a priori known component to be included in the linear predictor during fitting

resp.type

the response type

observations

indices of observations to keep

features

indices of predictors to keep

...

further arguments to gknn

k

number of neighbours considered

Value

An object of class Trained

Author

Alessandro Barberis