randOverT: Temporal Biased Random Oversampling

Description Usage Arguments Value Examples

View source: R/randOverT.R

Description

Temporal Biased Random Oversampling

Usage

1
2
3
4
5
6
7
8
randOverT(
  form,
  dat,
  rel = "auto",
  thr.rel = 0.5,
  C.perc = "balance",
  repl = TRUE
)

Arguments

form

a model formula

dat

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 over-sampling percentage/s to apply to all/each "class" obtained with the relevance threshold. The percentage represents the percentage of replicas that are added. Replicas of the examples are added randomly in each "class". Moreover, different percentages may be provided for each "class". Alternatively, it may be "balance" (the default) or "extreme", cases where the over-sampling percentages are automatically estimated.

repl

is it allowed to perform sampling with replacement (bootstrapping). Defaults to TRUE because if the over-sampling percentage is >2 this is necessary.

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(4)
overT <- randOverT(V10 ~ ., ds, C.perc=C.perc)
overT.Bal <- randOverT(V10 ~ ., ds, C.perc="balance")
overT.Ext <- randOverT(V10 ~ ., ds, C.perc="extreme")

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