If specified as ``int``, defines the number of eigenvectors used in the PCA projection matrix.
If specified as ``int``, defines the number of eigenvectors used in the PCA projection matrix.
If specified as ``float`` (between 0 and 1), the number of eigenvectors is calculated such that the given percentage of variance is kept.
If specified as ``float`` (between 0 and 1), the number of eigenvectors is calculated such that the given percentage of variance is kept.
use_pinv : bool
Use the Pseudo-inverse to compute the LDA projection matrix?
Sometimes, the training fails because it is impossible to invert the covariance matrix.
In these cases, you might want to set ``use_pinv`` to ``True``, which solves this process, but slows down the processing noticeably.
distance_function : function
distance_function : function
A function taking two parameters and returns a float.
A function taking two parameters and returns a float.
If ``uses_variances`` is set to ``True``, the function is provided with a third parameter, which is the vector of variances (aka. eigenvalues).
If ``uses_variances`` is set to ``True``, the function is provided with a third parameter, which is the vector of variances (aka. eigenvalues).
...
@@ -52,6 +57,7 @@ class LDA (Algorithm):
...
@@ -52,6 +57,7 @@ class LDA (Algorithm):
self,
self,
lda_subspace_dimension=None,# if set, the LDA subspace will be truncated to the given number of dimensions; by default it is limited to the number of classes in the training set
lda_subspace_dimension=None,# if set, the LDA subspace will be truncated to the given number of dimensions; by default it is limited to the number of classes in the training set
pca_subspace_dimension=None,# if set, a PCA subspace truncation is performed before applying LDA; might be integral or float
pca_subspace_dimension=None,# if set, a PCA subspace truncation is performed before applying LDA; might be integral or float