public class ProjectedCentroid extends Centroid
DatabaseUtil
for
easier to use APIs.Modifier and Type | Field and Description |
---|---|
private BitSet |
dims
The selected dimensions.
|
private static long |
serialVersionUID
Serial version
|
Constructor and Description |
---|
ProjectedCentroid(BitSet dims,
int dim)
Constructor for updating use.
|
Modifier and Type | Method and Description |
---|---|
static ProjectedCentroid |
make(BitSet dims,
Relation<? extends NumberVector<?,?>> relation)
Static Constructor from a relation.
|
static ProjectedCentroid |
make(BitSet dims,
Relation<? extends NumberVector<?,?>> relation,
Iterable<DBID> ids)
Static Constructor from a 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.
|
make, make, make, put, put, toVector
clone, copy, equals, euclideanLength, get, get, getArrayCopy, getArrayRef, getColumnDimensionality, getColumnVector, getDimensionality, getRowDimensionality, hashCode, increment, inverseVector, minus, minusEquals, minusEquals, minusTimes, minusTimesEquals, normalize, normF, plus, plusEquals, plusEquals, plusTimes, plusTimesEquals, projection, randomNormalizedVector, scalarProduct, set, set, setZero, sqrtVector, times, times, timesEquals, timesTranspose, toString, toStringNoWhitespace, transpose, transposeTimes, transposeTimes, unitVector
private static final long serialVersionUID
private BitSet dims
public ProjectedCentroid(BitSet dims, int dim)
dims
- Dimensions to use (indexed with 0)dim
- Full dimensionalitypublic void put(double[] val)
public void put(double[] val, double weight)
public void put(NumberVector<?,?> val)
public void put(NumberVector<?,?> val, double weight)
public static ProjectedCentroid make(BitSet dims, Relation<? extends NumberVector<?,?>> relation)
dims
- Dimensions to use (indexed with 0)relation
- Relation to processpublic static ProjectedCentroid make(BitSet dims, Relation<? extends NumberVector<?,?>> relation, Iterable<DBID> ids)
dims
- Dimensions to use (indexed with 0)relation
- Relation to processids
- IDs to process