filter: Metric filter

Description Usage Arguments Value Examples

View source: R/metrics.R

Description

Metric filter

Usage

1
2
3
4
5
6
7
filter(
  df,
  class,
  by = "AUC",
  uplimit = .Machine$integer.max,
  lowlimit = -.Machine$integer.max
)

Arguments

df

data.frame. Each colum represent a variable

class

name of the class variable

by

metric to apply the filter. AUC, Variance and Entropy are available.

uplimit

metric uplimit value

lowlimit

metric uplimit value. Default

Value

Filtered data.frame

Examples

1
2
3
4
5
6
7
8
9
class <- c(rep(TRUE, 50), rep(FALSE, 50))
pos <- sample.int(100, 100)
random.y <- class[order(pos)]
df.numeric <- data.frame("V1" = sample.int(10,100,replace=TRUE), "V2" = sample.int(10,100,replace=TRUE), "V3" = sample.int(100,100,replace=TRUE), "Class" =  random.y)
df.cat <- data.frame("V1" = as.factor(sample.int(3,100,replace=TRUE)), "V2" =  as.factor(sample.int(3,100,replace=TRUE)),  "V4" =  as.factor(sample.int(3,100,replace=TRUE)), "Class" =  random.y)
filter(df.numeric, class = "Class", by = "AUC", uplimit = 1, lowlimit = 0.5)
filter(df.numeric, class = "Class", by = "Variance", uplimit = 100, lowlimit = 0)
filter(df.cat, class = "Class", by = "Entropy", uplimit = 2, lowlimit = 0)
filter(df.cat, class = "Class", by = "Entropy")

AnderEhu/sme documentation built on Jan. 31, 2022, 12:01 a.m.