示例#1
0
 def distancesTo(self, vector):
     """
     Computes euclidean distance from a vector to all model vectors. Note: uses mask
     to scale.
     """
     retval = []
     for m in self.ravq.models:
         retval.append( euclideanDistance(vector, m.vector, self.ravq.mask) )
     return retval
示例#2
0
 def distancesTo(self, vector):
     """
     Computes euclidean distance from a vector to all model vectors. Note: uses mask
     to scale.
     """
     retval = []
     for m in self.ravq.models:
         retval.append( euclideanDistance(vector, m.vector, self.ravq.mask) )
     return retval
示例#3
0
 def incompatibility(self):
     """
     For each model, how different is it from each of the buffer items? Returns list of
     incompatibilities. Note: uses mask to scale.
     """
     retval = []
     for model in self.ravq.models:
         sum = 0.0
         for buff in model.contents:
             sum += euclideanDistance(model.vector, buff, self.ravq.mask)
         retval.append(sum)
     return retval
示例#4
0
 def incompatibility(self):
     """
     For each model, how different is it from each of the buffer items? Returns list of
     incompatibilities. Note: uses mask to scale.
     """
     retval = []
     for model in self.ravq.models:
         sum = 0.0
         for buff in model.contents:
             sum += euclideanDistance(model.vector, buff, self.ravq.mask)
         retval.append(sum)
     return retval