diff --git a/bob/bio/base/algorithm/LDA.py b/bob/bio/base/algorithm/LDA.py index 37b047bbe1b9ead95c7341618d4bc5fb3cac1edf..83bcc4c770a6dd1d8110e9fce39c99740719496f 100644 --- a/bob/bio/base/algorithm/LDA.py +++ b/bob/bio/base/algorithm/LDA.py @@ -56,7 +56,7 @@ class LDA (Algorithm): def _check_feature(self, feature, projected=False): """Checks that the features are appropriate""" - if not isinstance(feature, numpy.ndarray) or len(feature.shape) != 1 or feature.dtype != numpy.float64: + if not isinstance(feature, numpy.ndarray) or feature.ndim != 1 or feature.dtype != numpy.float64: raise ValueError("The given feature is not appropriate") index = 1 if projected else 0 if self.machine is not None and feature.shape[0] != self.machine.shape[index]: diff --git a/bob/bio/base/algorithm/PCA.py b/bob/bio/base/algorithm/PCA.py index edac88833cf5911ab61c4eed4289cd48193f46b3..708216e930dcd46c98b7d73497ce43ea6ab64db4 100644 --- a/bob/bio/base/algorithm/PCA.py +++ b/bob/bio/base/algorithm/PCA.py @@ -48,7 +48,7 @@ class PCA (Algorithm): def _check_feature(self, feature, projected=False): """Checks that the features are appropriate""" - if not isinstance(feature, numpy.ndarray) or len(feature.shape) != 1 or feature.dtype != numpy.float64: + if not isinstance(feature, numpy.ndarray) or feature.ndim != 1 or feature.dtype != numpy.float64: raise ValueError("The given feature is not appropriate") index = 1 if projected else 0 if self.machine is not None and feature.shape[0] != self.machine.shape[index]: