Skip to content
Snippets Groups Projects
Commit 24e704d8 authored by Manuel Günther's avatar Manuel Günther
Browse files

Now using Pseudo-Inverse for LDA to avoid errors when covariance matrix is not invertible

parent b98f996d
No related branches found
No related tags found
No related merge requests found
...@@ -168,7 +168,7 @@ class LDA (Algorithm): ...@@ -168,7 +168,7 @@ class LDA (Algorithm):
data = self._perform_pca(pca_machine, data) data = self._perform_pca(pca_machine, data)
logger.info(" -> Training Linear Machine using LDA") logger.info(" -> Training Linear Machine using LDA")
trainer = bob.learn.linear.FisherLDATrainer(strip_to_rank = (self.lda_subspace is None)) trainer = bob.learn.linear.FisherLDATrainer(use_pinv = True, strip_to_rank = (self.lda_subspace is None))
self.machine, self.variances = trainer.train(data) self.machine, self.variances = trainer.train(data)
if self.lda_subspace is not None: if self.lda_subspace is not None:
self.machine.resize(self.machine.shape[0], self.lda_subspace) self.machine.resize(self.machine.shape[0], self.lda_subspace)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment