
public class Centroid extends Vector
DatabaseUtil for
easier to use APIs.| Modifier and Type | Field and Description |
|---|---|
protected double |
wsum
The current weight
|
| Constructor and Description |
|---|
Centroid(int dim)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static Centroid |
make(Matrix mat)
Static Constructor from an existing matrix columns.
|
static Centroid |
make(Relation<? extends NumberVector<?,?>> relation)
Static constructor from an existing relation.
|
static Centroid |
make(Relation<? extends NumberVector<?,?>> relation,
DBIDs ids)
Static constructor from an existing relation.
|
void |
put(double[] val)
Add a single value with weight 1.0
|
void |
put(double[] val,
double weight)
Add data with a given weight.
|
void |
put(NumberVector<?,?> val)
Add a single value with weight 1.0
|
void |
put(NumberVector<?,?> val,
double weight)
Add data with a given weight.
|
void |
put(Vector val)
Add a single value with weight 1.0
|
void |
put(Vector val,
double weight)
Add data with a given weight.
|
<F extends NumberVector<? extends F,?>> |
toVector(Relation<? extends F> relation)
Get the data as vector
|
byteValue, clone, copy, doubleValue, equals, euclideanLength, floatValue, get, getArrayCopy, getArrayRef, getColumnVector, getDimensionality, getMax, getMin, getValue, hashCode, intValue, longValue, minus, minusEquals, minusEquals, minusTimes, minusTimesEquals, newFeatureVector, newNumberVector, newNumberVector, normalize, plus, plusEquals, plusEquals, plusTimes, plusTimesEquals, projection, randomNormalizedVector, rotate90Equals, set, setZero, shortValue, times, times, timesEquals, timesTranspose, timesTranspose, toString, toStringNoWhitespace, transposeTimes, transposeTimes, transposeTimesTimes, unitVectorpublic void put(double[] val)
val - Valuepublic void put(double[] val,
double weight)
val - dataweight - weightpublic final void put(Vector val)
val - Valuepublic final void put(Vector val, double weight)
val - dataweight - weightpublic void put(NumberVector<?,?> val)
val - Valuepublic void put(NumberVector<?,?> val, double weight)
val - dataweight - weightpublic <F extends NumberVector<? extends F,?>> F toVector(Relation<? extends F> relation)
public static Centroid make(Matrix mat)
mat - Matrix to use the columns from.public static Centroid make(Relation<? extends NumberVector<?,?>> relation)
relation - Relation to usepublic static Centroid make(Relation<? extends NumberVector<?,?>> relation, DBIDs ids)
relation - Relation to useids - IDs to use