Author: Not specified Language: python
Description: Not specified Timestamp: 2018-06-03 22:03:51 +0000
View raw paste Reply
  1. def getCorresponding(self, Pv, Utree):
  2.         # Inicializacion de Ulist, Plist, dist y size
  3.        
  4.         i = 0
  5.         while i < size:
  6.             k = random.randint(0, len(Pv) - 1)
  7.             Plist[i] = Pv[k]        
  8.             dsits, indexs = Utree.query( Pv[k], 5)
  9.             j = self.findNearestNormal(k, indexs)
  10.             dist = np.linalg.norm(Pv[k]-self.baseSet[j])
  11.             dists.append(dist)
  12.             Ulist[i] = self.baseSet[j]
  13.             i += 1
  14.            
  15.         rejected = reject_outliers(dists)
  16.         Ulist = Ulist[rejected]
  17.         Plist = Plist[rejected]
  18.            
  19.         return (Ulist, Plist)
View raw paste Reply