public final class RelationUtil extends Object
Modifier | Constructor and Description |
---|---|
private |
RelationUtil()
Fake constructor: do not instantiate.
|
Modifier and Type | Method and Description |
---|---|
static <V extends FeatureVector<?>> |
assumeVectorField(Relation<V> relation)
Get the vector field type information from a relation.
|
static int |
dimensionality(Relation<? extends FeatureVector<?>> relation)
Get the dimensionality of a database relation.
|
static <V extends FeatureVector<?>> |
getColumnLabel(Relation<? extends V> rel,
int col)
Get the column name or produce a generic label "Column XY".
|
static <V extends NumberVector<? extends N>,N extends Number> |
getNumberVectorFactory(Relation<V> relation)
Get the number vector factory of a database relation.
|
static double[][] |
relationAsMatrix(Relation<? extends NumberVector<?>> relation,
ArrayDBIDs ids)
Copy a relation into a double matrix.
|
public static <V extends FeatureVector<?>> VectorFieldTypeInformation<V> assumeVectorField(Relation<V> relation)
V
- Vector typerelation
- relationpublic static <V extends NumberVector<? extends N>,N extends Number> NumberVector.Factory<V,N> getNumberVectorFactory(Relation<V> relation)
V
- Vector typeN
- Number typerelation
- relationpublic static int dimensionality(Relation<? extends FeatureVector<?>> relation)
relation
- relationpublic static double[][] relationAsMatrix(Relation<? extends NumberVector<?>> relation, ArrayDBIDs ids)
relation
- Relationids
- IDs, with well-defined order (i.e. array)public static <V extends FeatureVector<?>> String getColumnLabel(Relation<? extends V> rel, int col)
V
- Vector typerel
- Relationcol
- Column