14 """Define a metric on a list of floating point numbers based on
18 """Store the list of numbers to measure distances between"""
19 IMP.statistics.Metric.__init__(self,
"MyMetric%1%")
22 def get_distance(self, i, j):
23 "Return the magnitude of the distance between the ith and jth number"
24 return math.fabs(self.
_nums[i] - self.
_nums[j])
26 def get_number_of_items(self):
27 return len(self.
_nums)
30 mm =
MyMetric([random.uniform(0, 1)
for i
in range(0, 15)])
33 print(cc.get_number_of_clusters())
PartitionalClustering * create_centrality_clustering(Embedding *d, double far, int k)
Strings setup_from_argv(const Strings &argv, std::string description, std::string positional_description, int num_positional)
Code to compute statistical measures.
Store data to be clustered for distance metric based algorithms.