scalib.modeling.Lda#
- class scalib.modeling.Lda(acc, p)[source]#
See
LdaAcc.Estimates the PDF parameters that is the projection matrix \(\mathbf{W}\), the means \(\mathbf{\mu}_x\) and the covariance \(\mathbf{\Sigma}\).
- Parameters:
Methods
predict_log2_proba_class(traces, x)Computes the log2 probability for the given class for the traces,
predict_proba(traces)Computes the probability for each of the classes for the traces,
project(traces)Project the traces in the sub-linear space.
select_vars(vars)Make a new
Ldawith only a subset of the variables (in the order given by the list).- predict_proba(traces)[source]#
- Computes the probability for each of the classes for the traces,
for all variables.
- Parameters:
traces (array_like, int16) – Array that contains the traces. The array must be of dimension
(n,ns).- Returns:
Probability distributions. Shape
(nv, n, nc).- Return type:
list of array_like, f64
- predict_log2_proba_class(traces, x)[source]#
- Computes the log2 probability for the given class for the traces,
for all variables.
- Parameters:
traces (array_like, int16) – Array that contains the traces. The array must be of dimension
(n,ns).x (array_like, uint16) – Labels for each trace. Must be of shape
(n, nv)and must be uint16.
- Returns:
Log2 probabilities. Shape
(nv, n).- Return type:
list of array_like, f64