diff options
Diffstat (limited to 'src/de/lmu/ifi/dbs/elki/data/model/KMeansModel.java')
-rw-r--r-- | src/de/lmu/ifi/dbs/elki/data/model/KMeansModel.java | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/de/lmu/ifi/dbs/elki/data/model/KMeansModel.java b/src/de/lmu/ifi/dbs/elki/data/model/KMeansModel.java index a1867695..5641c893 100644 --- a/src/de/lmu/ifi/dbs/elki/data/model/KMeansModel.java +++ b/src/de/lmu/ifi/dbs/elki/data/model/KMeansModel.java @@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.data.model; This file is part of ELKI: Environment for Developing KDD-Applications Supported by Index-Structures - Copyright (C) 2013 + Copyright (C) 2014 Ludwig-Maximilians-Universität München Lehr- und Forschungseinheit für Datenbanksysteme ELKI Development Team @@ -22,23 +22,37 @@ package de.lmu.ifi.dbs.elki.data.model; You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -import de.lmu.ifi.dbs.elki.data.NumberVector; +import de.lmu.ifi.dbs.elki.math.linearalgebra.Vector; /** * Trivial subclass of the {@link MeanModel} that indicates the clustering to be * produced by k-means (so the Voronoi cell visualization is sensible). * * @author Erich Schubert - * - * @param <V> Vector type. */ -public class KMeansModel<V extends NumberVector<?>> extends MeanModel<V> { +public class KMeansModel extends MeanModel { + /** + * Variance sum. + */ + double varsum; + /** * Constructor with mean. * * @param mean Mean vector. + * @param varsum Variance sum. */ - public KMeansModel(V mean) { + public KMeansModel(Vector mean, double varsum) { super(mean); + this.varsum = varsum; + } + + /** + * Get the variance contribution of the cluster (sum of variances) + * + * @return Sum of in-cluster variance + */ + public double getVarianceContribution() { + return varsum; } } |