Ticket #1161: pca.diff
File pca.diff, 629 bytes (added by lanz, 2 years ago) 


Orange/projection/linear.py
diff git a/Orange/projection/linear.py b/Orange/projection/linear.py
a b 1374 1374 def _perform_pca(self, dataset, Xd, Xg): 1375 1375 n, m = Xd.shape 1376 1376 if n < m: 1377 C = numpy.dot(Xg.T, Xd.T) / (m  self.ddof) 1378 V, D, T = numpy.linalg.svd(C) 1379 U = numpy.dot(V.T, Xd) / numpy.sqrt(D.reshape(1, 1) * (m  self.ddof)) 1377 _, D, U = numpy.linalg.svd(Xd, full_matrices=0) 1378 D **= 2 1380 1379 else: 1381 1380 C = numpy.dot(Xg, Xd) / (n  self.ddof) 1382 1381 U, D, T = numpy.linalg.svd(C)