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
...@@ -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)" -> Training Linear Machine using LDA")" -> 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)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment