Package elki.database

Class 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 Detail

      • DatabaseUtil

        private DatabaseUtil()
        Fake constructor: Do not instantiate!
    • 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 in
        name_pattern - Name to match against class or object label
        Returns:
        found cluster or it throws an exception.