|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.lmu.ifi.dbs.elki.utilities.DatabaseUtil
public final class DatabaseUtil
Class with Database-related utility functions such as centroid computation, covariances etc.
Constructor Summary | |
---|---|
DatabaseUtil()
|
Method Summary | ||
---|---|---|
static
|
centroid(Database<O> database)
Returns the centroid as a NumberVector object of the specified database. |
|
static
|
centroid(Database<V> database,
Collection<Integer> ids)
Returns the centroid as a NumberVector object of the specified objects stored in the given database. |
|
static
|
centroid(Database<V> database,
Collection<Integer> ids,
BitSet dimensions)
Returns the centroid w.r.t. the dimensions specified by the given BitSet as a NumberVector object of the specified objects stored in the given database. |
|
static
|
centroid(Database<V> database,
Iterator<Integer> iter,
BitSet bitSet)
Returns the centroid w.r.t. the dimensions specified by the given BitSet as a NumberVector object of the specified objects stored in the given database. |
|
static Vector |
centroid(Matrix data)
Returns the centroid as a Vector object of the specified data matrix. |
|
static
|
computeMinMax(Database<NV> database)
Determines the minimum and maximum values in each dimension of all objects stored in the given database. |
|
static
|
covarianceMatrix(Database<O> database)
Determines the covariance matrix of the objects stored in the given database. |
|
static
|
covarianceMatrix(Database<O> database,
O centroid)
Determines the covariance matrix of the objects stored in the given database w.r.t. the given centroid. |
|
static
|
covarianceMatrix(Database<V> database,
Collection<Integer> ids)
Determines the covariance matrix of the objects stored in the given database. |
|
static Matrix |
covarianceMatrix(Matrix data)
Determines the d x d covariance matrix of the given n x d data matrix. |
|
static
|
getBaseObjectClassExpensive(Database<O> database)
Do a full inspection of the database to find the base object class. |
|
static SortedSet<ClassLabel> |
getClassLabels(Database<?> database)
Retrieves all class labels within the database. |
|
static String |
getClassOrObjectLabel(Database<?> database,
Integer objid)
Get the class label or object label of an object in the database |
|
static Collection<Integer> |
getObjectsByLabelMatch(Database<?> database,
Pattern name_pattern)
Find object by matching their labels. |
|
static
|
guessObjectClass(Database<O> database)
Do a cheap guess at the databases object class. |
|
static double[] |
variances(Database<NumberVector<?,?>> database,
NumberVector<?,?> centroid,
Collection<Integer>[] ids)
Determines the variances in each dimension of the specified objects stored in the given database. |
|
static
|
variances(Database<O> database)
Determines the variances in each dimension of all objects stored in the given database. |
|
static
|
variances(Database<V> database,
Collection<Integer> ids)
Determines the variances in each dimension of the specified objects stored in the given database. |
|
static
|
variances(Database<V> database,
V centroid,
Collection<Integer> ids)
Determines the variances in each dimension of the specified objects stored in the given database. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DatabaseUtil()
Method Detail |
---|
public static <V extends NumberVector<V,?>> V centroid(Database<V> database, Collection<Integer> ids)
NumberVector
.
V
- Vector typedatabase
- the database storing the objectsids
- the ids of the objects
IllegalArgumentException
- if the id list is emptypublic static <V extends NumberVector<V,?>> V centroid(Database<V> database, Collection<Integer> ids, BitSet dimensions)
NumberVector
.
V
- Vector typedatabase
- the database storing the objectsids
- the identifiable objectsdimensions
- the BitSet representing the dimensions to be considered
IllegalArgumentException
- if the id list is emptypublic static <V extends NumberVector<V,?>> V centroid(Database<V> database, Iterator<Integer> iter, BitSet bitSet)
NumberVector
.
V
- Vector typedatabase
- the database storing the objectsiter
- iterator over the identifiable objectsbitSet
- the bitSet specifying the dimensions to be considered
IllegalArgumentException
- if the id list is emptypublic static <O extends NumberVector<O,?>> O centroid(Database<O> database)
NumberVector
.
O
- Vector typedatabase
- the database storing the objects
IllegalArgumentException
- if the database is emptypublic static Vector centroid(Matrix data)
data
- the data matrix, where the data vectors are column vectors
public static <V extends NumberVector<V,?>> Matrix covarianceMatrix(Database<V> database, Collection<Integer> ids)
V
- Vector typedatabase
- the database storing the objectsids
- the ids of the objects
public static <O extends NumberVector<O,?>> Matrix covarianceMatrix(Database<O> database)
O
- Vector typedatabase
- the database storing the objects
public static <O extends NumberVector<O,?>> Matrix covarianceMatrix(Database<O> database, O centroid)
Determines the covariance matrix of the objects stored in the given database w.r.t. the given centroid.
O
- Vector typedatabase
- the database storing the objectscentroid
- the centroid of the database
public static Matrix covarianceMatrix(Matrix data)
data
- the database storing the objects
public static <O extends NumberVector<O,?>> double[] variances(Database<O> database)
O
- Vector typedatabase
- the database storing the objects
public static <V extends NumberVector<V,?>> double[] variances(Database<V> database, Collection<Integer> ids)
variances(database, centroid(database, ids), ids)
V
- Vector typedatabase
- the database storing the objectsids
- the ids of the objects
public static <V extends NumberVector<V,?>> double[] variances(Database<V> database, V centroid, Collection<Integer> ids)
V
- Vector typedatabase
- the database storing the objectsids
- the ids of the objectscentroid
- the centroid or reference vector of the ids
public static double[] variances(Database<NumberVector<?,?>> database, NumberVector<?,?> centroid, Collection<Integer>[] ids)
database
- the database storing the objectsids
- the array of ids of the objects to be considered in each
dimensioncentroid
- the centroid or reference vector of the ids
public static <NV extends NumberVector<NV,?>> Pair<NV,NV> computeMinMax(Database<NV> database)
NV
- vector typedatabase
- the database storing the objects
public static SortedSet<ClassLabel> getClassLabels(Database<?> database)
database
- the database to be scanned for class labels
public static <O extends DatabaseObject> Class<? extends O> guessObjectClass(Database<O> database)
O
- Restriction typedatabase
- Database
public static <O extends DatabaseObject> Class<? extends DatabaseObject> getBaseObjectClassExpensive(Database<O> database)
O
- Restriction typedatabase
- Database
public static Collection<Integer> getObjectsByLabelMatch(Database<?> database, Pattern name_pattern)
database
- Database to search inname_pattern
- Name to match against class or object label
public static String getClassOrObjectLabel(Database<?> database, Integer objid)
database
- Databaseobjid
- Object ID
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |