Learn R Programming

sideChannelAttack (version 1.0-6)

verify.loo: verify.loo

Description

The verify.loo function allows to estimate the quality of a model (an attack) with a leave-one-out approach.

Usage

verify.loo(model, filter, X, Y, nbreVarX, param.model=list(), param.fs=list(), ...)

Arguments

model
A model such as randomForest, gaussian, svm, etc.
filter
A feature selection such as filter.PCA, filter.mRMR, etc.
X
A matrix where each row is a physical measure.
Y
A vector where the $i_th$ element of the vector $y$ is the key for the $i_th$ physical measure in the matrix $x$.
nbreVarX
The number of variables which represents each physical measure after the reduction by the feature selection.
param.model
A list of parameters to insert into the model.
param.fs
A list of parameters to insert into the feature selection algorithm.
...
Currently ignored.

Value

The verify.loo function returns an object which can be used with the plot function to plot the quality of the model.
TP
number of true positive
TN
number of true negative
FN
number of false negative
FP
number of false positive
dim
the number of variables which represents each physical measure after the reduction by the feature selection.

Details

The verify.loo function estimates the quality of the attack with a leave-one-out approach. It is executed in $N$ rounds. Each round uses $N-1$ traces to learn a model and the remaining trace to assess the generalization accuracy of the model. This is repeated until every trace has been used for testing purposes. The best model is the one that maximizes the value returned by leave-one-out.

The advantages of this estimation is its accuracy but the estimation process is expensive in a computational point of view.

Examples

Run this code
#data collection
data(powerC)
traces = powerC[,-301]
traces = powerC[,1:10]
key = powerC[,301]
newIndice = c(sample(1:128,15),sample(129:256,15))
traces = traces[newIndice,]
key = key[newIndice]+1

#model checking
attack=verify.loo(model=dpa1,filter=filter.PCA,X=traces,Y=key,nbreVarX=c(4:5))
plot(attack)

Run the code above in your browser using DataLab