View source: R/complex_filters.R

layer_filter | R Documentation |

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.

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

`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. |

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

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.