Package elki.math.linearalgebra
Class ProjectedCentroid
- java.lang.Object
-
- elki.math.linearalgebra.Centroid
-
- elki.math.linearalgebra.ProjectedCentroid
-
- All Implemented Interfaces:
FeatureVector<java.lang.Number>,NumberVector,SpatialComparable
public class ProjectedCentroid extends Centroid
Centroid only using a subset of dimensions.This class abstracts the mathematics of efficient and numerically stable computation of projected centroids.
See
DatabaseUtilfor easier to use APIs.- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface elki.data.NumberVector
NumberVector.Factory<V extends NumberVector>
-
-
Field Summary
Fields Modifier and Type Field Description private long[]dimsThe selected dimensions.-
Fields inherited from interface elki.data.FeatureVector
TYPE
-
Fields inherited from interface elki.data.NumberVector
ATTRIBUTE_SEPARATOR, FIELD, FIELD_1D, FIELD_2D, VARIABLE_LENGTH
-
-
Constructor Summary
Constructors Constructor Description ProjectedCentroid(long[] dims, int dim)Constructor for updating use.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ProjectedCentroidmake(long[] dims, Relation<? extends NumberVector> relation)Static Constructor from a relation.static ProjectedCentroidmake(long[] dims, Relation<? extends NumberVector> relation, DBIDs ids)Static Constructor from a relation.voidput(double[] val)Add a single value with weight 1.0.voidput(double[] val, double weight)Add data with a given weight.voidput(NumberVector val)Add a single value with weight 1.0.voidput(NumberVector val, double weight)Add data with a given weight.-
Methods inherited from class elki.math.linearalgebra.Centroid
doubleValue, getArrayRef, getDimensionality, longValue, make, toArray
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.data.FeatureVector
toString
-
Methods inherited from interface elki.data.NumberVector
byteValue, floatValue, getMax, getMin, getValue, intValue, shortValue
-
-
-
-
Method Detail
-
put
public void put(double[] val)
Add a single value with weight 1.0.
-
put
public void put(double[] val, double weight)Add data with a given weight.
-
put
public void put(NumberVector val)
Add a single value with weight 1.0.
-
put
public void put(NumberVector val, double weight)
Add data with a given weight.
-
make
public static ProjectedCentroid make(long[] dims, Relation<? extends NumberVector> relation)
Static Constructor from a relation.- Parameters:
dims- Dimensions to use (indexed with 0)relation- Relation to process- Returns:
- Centroid
-
make
public static ProjectedCentroid make(long[] dims, Relation<? extends NumberVector> relation, DBIDs ids)
Static Constructor from a relation.- Parameters:
dims- Dimensions to use (indexed with 0)relation- Relation to processids- IDs to process- Returns:
- Centroid
-
-