classifier: Logarithm Marginal Density Ratios Transformation and Support...

Description Usage Arguments Details Value Source Examples

View source: R/classifier.R

Description

Train SVM model based on train set which is logarithm marginal density ratio transformed. Apply trained model on test set to predict.

Usage

1
classifier(training, test, yname, levels, yflag = T, svm = c("svmt"))

Arguments

training

original train set.

test

original test set.

yname

the name of result-column.

levels

results in result-column.

yflag

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

svm

type of support vector machine.

Details

First, apply logarithm marginal density ratio transformation on train and test set. Then, train SVM model based on transformed train set. Finally, exert the model to predict category by transformed test set.

Value

The function gives the result of prediction base train and test set.

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. For SVM, based on • Chang, Chih-Chung and Lin, Chih-Jen: LIBSVM: a library for Support Vector Machines http://www.csie.ntu.edu.tw/~cjlin/libsvm • Exact formulations of models, algorithms, etc. can be found in the document: Chang, Chih-Chung and Lin, Chih-Jen: LIBSVM: a library for Support Vector Machines http://www.csie.ntu.edu.tw/~cjlin/papers/libsvm.ps.gz • More implementation details and speed benchmarks can be found on: Rong-En Fan and Pai-Hsune Chen and Chih-Jen Lin: Working Set Selection Using the Second Order Information for Training SVM http://www.csie.ntu.edu.tw/~cjlin/papers/quadworkset.pdf

Examples

1
2
3
4
intest = subnum(rawdata, k = 10)[[1]]
test = rawdata[intest,]
training = rawdata[-intest,]
classifier(training, test, 'class', c('normal', 'attack'), T, c('scmf', 'svmt'))

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