layer_filter: Multilayer filter

View source: R/complex_filters.R

layer_filterR Documentation

Multilayer filter

Description

Experimental filter designed for use with imbalanced datasets. Each round a simple t-test is used to rank predictors and keep a certain number. After each round a set number of cases are culled determined as the most outlying cases - those which if used as a cutoff for classification have the smallest number of misclassified cases. The t-test is repeated on the culled dataset so that after successive rounds the most influential outlying samples have been removed and different samples drive the t-test filter.

Usage

layer_filter(
  y,
  x,
  nfilter = NULL,
  imbalance = TRUE,
  cull = 5,
  force_vars = NULL,
  verbose = FALSE,
  type = c("index", "names", "full")
)

Arguments

y

Response vector

x

Matrix of predictors

nfilter

Vector of number of target predictors to keep at each round. The length of this vector determines the number of rounds of culling.

imbalance

Logical whether to assume the dataset is imbalanced, in which case samples are only culled from the majority class.

cull

number of samples to cull at each round

force_vars

not implemented yet

verbose

whether to show sample IDs of culled individuals at each round

type

Type of vector returned. Default "index" returns indices, "names" returns predictor names.

Value

Integer vector of indices of filtered parameters (type = "index") or character vector of names (type = "names") of filtered parameters.


nestedcv documentation built on Oct. 26, 2023, 5:08 p.m.