June 2018
Intermediate to advanced
276 pages
6h 26m
English
In previous chapters, especially in Chapter 1, Introduction to Machine Learning in Pen Testing, we saw the statistical procedure of principal component analysis (PCA). Linear discriminant analysis (LDA) is a dimensionality reduction technique, as well. It is used to find a linear combination of features that separate classes:

To use LDA with scikit-learn, import it with this line:
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis as LDA
Use it as follows:
sklearn_lda = LDA(n_components=2) X_lda_sklearn = sklearn_lda.fit_transform(X, y)
Read now
Unlock full access