randUnderTPhi: Temporal and Relevance Biased Random Undersampling

Description Usage Arguments Value Examples

View source: R/randUnderTPhi.R

Description

Temporal and Relevance Biased Random Undersampling

Usage

1
2
3
4
5
6
7
8
randUnderTPhi(
  form,
  data,
  rel = "auto",
  thr.rel = 0.5,
  C.perc = "balance",
  repl = FALSE
)

Arguments

form

a model formula

data

the original training set (with the unbalanced distribution)

rel

is the relevance determined automatically (default: "auto") or provided by the user through a matrix. See examples.

thr.rel

is the relevance threshold above which a case is considered as an extreme value

C.perc

is a list containing the under-sampling percentage/s to apply to all/each "class" obtained with the relevance threshold. This percentage represents the percentage of examples that is maintained in each "class". Examples are randomly removed in each "class". Moreover, different percentages maybe provided for each "class". Alternatively, it may be "balance" or "extreme", cases where the under-sampling percentages are automatically estimated.

repl

is it allowed to perform sampling with replacement (bootstrapping)

Value

a new training data set resulting from the application of the resampling strategy

Examples

1
2
3
4
5
6
7
library(rewind)
data(temp)
ds <- create.data(temp,10)
C.perc <- list(0.5)
underTPhi <- randUnderTPhi(V10 ~ ., ds, C.perc=C.perc)
underTPhi.Bal <- randUnderTPhi(V10 ~ ., ds, C.perc="balance")
underTPhi.Ext <- randUnderTPhi(V10 ~ ., ds, C.perc="extreme")

nunompmoniz/rewind documentation built on July 8, 2021, 12:25 a.m.