| 
 | 
 | |||||||||||||||||||||
| 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 RealVector object of the specified database. | |
| static
 | centroid(Database<V> database,
         Collection<Integer> ids)Returns the centroid as a RealVector object of the specified objects stored in the given database. | |
| static
 | centroid(Database<V> database,
         Collection<Integer> ids,
         BitSet bitSet)Returns the centroid w.r.t. the dimensions specified by the given BitSet as a RealVector 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 RealVector 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
 | 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
 | guessObjectClass(Database<O> database)Do a cheap guess at the databases object class. | |
| static double[][] | min_max(Database<RealVector<?,?>> database)Determines the minimum and maximum values in each dimension of all 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 double[] | variances(Database<RealVector<?,?>> database,
          RealVector<?,?> centroid,
          Collection<Integer>[] ids)Determines the variances in each dimension of the specified 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 RealVector<V,?>> V centroid(Database<V> database,
                                                     Collection<Integer> ids)
RealVector.
V - Vector typedatabase - the database storing the objectsids - the ids of the objects
IllegalArgumentException - if the id list is empty
public static <V extends RealVector<V,?>> V centroid(Database<V> database,
                                                     Collection<Integer> ids,
                                                     BitSet bitSet)
RealVector.
V - Vector typedatabase - the database storing the objectsids - the identifiable objectsbitSet - the bitSet specifiying the dimensions to be considered
IllegalArgumentException - if the id list is empty
public static <V extends RealVector<V,?>> V centroid(Database<V> database,
                                                     Iterator<Integer> iter,
                                                     BitSet bitSet)
RealVector.
V - Vector typedatabase - the database storing the objectsiter - iterator over the identifiable objectsbitSet - the bitSet specifiying the dimensions to be considered
IllegalArgumentException - if the id list is emptypublic static <O extends RealVector<O,?>> O centroid(Database<O> database)
RealVector.
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 RealVector<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 RealVector<O,?>> Matrix covarianceMatrix(Database<O> database)
O - Vector typedatabase - the database storing the objects
public static <O extends RealVector<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 RealVector<O,?>> double[] variances(Database<O> database)
O - Vector typedatabase - the database storing the objects
public static <V extends RealVector<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 RealVector<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<RealVector<?,?>> database,
                                 RealVector<?,?> 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 double[][] min_max(Database<RealVector<?,?>> database)
database - 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
| 
 | 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||