Package elki.database
Class DatabaseUtil
- java.lang.Object
-
- elki.database.DatabaseUtil
-
public final class DatabaseUtil extends java.lang.Object
Class with Database-related utility functions such as centroid computation, covariances etc.- Since:
- 0.2
- Author:
- Erich Schubert
-
-
Constructor Summary
Constructors Modifier Constructor Description private
DatabaseUtil()
Fake constructor: Do not instantiate!
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.SortedSet<ClassLabel>
getClassLabels(Database database)
Retrieves all class labels within the database.static java.util.SortedSet<ClassLabel>
getClassLabels(Relation<? extends ClassLabel> database)
Retrieves all class labels within the database.static ArrayModifiableDBIDs
getObjectsByLabelMatch(Database database, java.util.regex.Pattern name_pattern)
Find object by matching their labels.static Relation<java.lang.String>
guessLabelRepresentation(Database database)
Guess a potentially label-like representation, preferring class labels.static Relation<java.lang.String>
guessObjectLabelRepresentation(Database database)
Guess a potentially object label-like representation.
-
-
-
Method Detail
-
guessLabelRepresentation
public static Relation<java.lang.String> guessLabelRepresentation(Database database)
Guess a potentially label-like representation, preferring class labels.- Parameters:
database
-- Returns:
- string representation
-
guessObjectLabelRepresentation
public static Relation<java.lang.String> guessObjectLabelRepresentation(Database database)
Guess a potentially object label-like representation.- Parameters:
database
-- Returns:
- string representation
-
getClassLabels
public static java.util.SortedSet<ClassLabel> getClassLabels(Relation<? extends ClassLabel> database)
Retrieves all class labels within the database.- Parameters:
database
- the database to be scanned for class labels- Returns:
- a set comprising all class labels that are currently set in the database
-
getClassLabels
public static java.util.SortedSet<ClassLabel> getClassLabels(Database database)
Retrieves all class labels within the database.- Parameters:
database
- the database to be scanned for class labels- Returns:
- a set comprising all class labels that are currently set in the database
-
getObjectsByLabelMatch
public static ArrayModifiableDBIDs getObjectsByLabelMatch(Database database, java.util.regex.Pattern name_pattern)
Find object by matching their labels.- Parameters:
database
- Database to search inname_pattern
- Name to match against class or object label- Returns:
- found cluster or it throws an exception.
-
-