trans: Features Extraction

Description Usage Arguments Details Value Source Examples

View source: R/trans.R

Description

Use the result of kernel density estimation to transform therefore augment features of train and test set.

Usage

1
trans(train, test, d0, d1, yname, yflag = T)

Arguments

train

a train set that needs to be transformed.

test

a test set that needs to be transformed.

d0

samples’ data in one class

d1

samples’ data in one class

yname

the name of result-column.

yflag

a flag that describes whether there is result-column in the test set.

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 features in train and test set by log(f(x)) - log(g(x)).

Value

The transform function outputs dataset of augmented features plus labeling 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
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]]
train=groups[[3]]
data=trans(train,test,d0,d1,'class',yflag=T)

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