logInPred: Feature Extraction

Description Usage Arguments Details Value Source Examples

View source: R/logInPred.R

Description

Use the result of kernel density estimation to transform therefore augment certain feature of train/test set.

Usage

1
logInPred(i, m, d0, d1, yname, Mkex = Mkex, Mkey = Mkey)

Arguments

i

a index of feature that needs to be transformed.

m

dataset consisting of features.

d0

samples’ data in one class

d1

samples’ data in the other class.

yname

the name of result-column.

Mkex

a function to estimate kernel density of x.

Mkey

a function to estimate kernel density of y.

Details

For dataset d0 and d1, the default algorithm use Mkex( ) and Mkey( ) to estimate kernel density. Use f( ) and g( ), the outcome of estimation, to transform the ith feature of dataset m by log(f(m)) - log(g(m)).

Value

The transform function outputs augmented feature.

Source

For transformation, based on Wang H , Gu J , Wang S . An effective intrusion detection framework based on SVM with feature augmentation[J]. Knowledge-Based Systems, 2017, 136(Nov.15):130-139. Fan J , Feng Y , Jiang J , et al. Feature Augmentation via Nonparametrics and Selection (FANS) in High Dimensional Classification[J]. Journal of the American Statal Association, 2016, 111(513):275.

Examples

1
2
3
4
5
6
7
8
9
intest = subnum(rawdata, k=10)[[1]]
test = rawdata[intest,]
training = rawdata[-intest,]
groups = subgroup(training, 'class', c('attack', 'normal'))
d0 = groups[[1]]
d1 = groups[[2]]
denx0 = Mkex(d0, yname)
deny0 = Mkey(d0, yname)
logInPred(1, training, d0, d1, class, Mkex = Mkex, Mkey = Mkey)

ShanLu92/FeaAug documentation built on Jan. 31, 2021, 7:21 p.m.