private double ComputeCentroidQuantile(Centroid c) { double sum = 0; foreach (var c_i in C) { sum += c_i.Value.count; if (c_i.Key >= c.mean) { break; } } return((c.count / 2.0 + sum) / n); }
public void UpdateCentroid(Centroid centroid, double x, double weight) { C.Delete(centroid.mean); centroid.Update(x, weight); AddCentroid(centroid); }
public void AddCentroid(Centroid centroid) { C.Put(centroid.mean, centroid); }
private double ComputeCentroidQuantile(Centroid c) { double sum = 0; foreach (var c_i in C) { sum += c_i.Value.count; if (c_i.Key >= c.mean) break; } return (c.count/2.0 + sum)/n; }