Class AbstractBiclustering<M extends BiclusterModel>

  • Type Parameters:
    M - Cluster model type
    All Implemented Interfaces:
    elki.Algorithm, ClusteringAlgorithm<Clustering<M>>
    Direct Known Subclasses:
    ChengAndChurch

    public abstract class AbstractBiclustering<M extends BiclusterModel>
    extends java.lang.Object
    implements ClusteringAlgorithm<Clustering<M>>
    Abstract class as a convenience for different biclustering approaches.

    The typically required values describing submatrices are computed using the corresponding values within a database of NumberVectors.

    The database is supposed to present a data matrix with a row representing an entry (NumberVector), a column representing a dimension (attribute) of the NumberVectors.

    Since:
    0.1
    Author:
    Arthur Zimek
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface elki.Algorithm

        elki.Algorithm.Utils
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int colDim
      Column dimensionality.
      private elki.database.ids.DBIDArrayIter iter
      Iterator to use for more efficient random access.
      protected elki.database.relation.Relation<? extends elki.data.NumberVector> relation
      Relation we use.
      protected elki.database.ids.ArrayDBIDs rowIDs
      The row ids corresponding to the currently set relation.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractBiclustering()
      Constructor.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      protected abstract Clustering<M> biclustering()
      Run the actual biclustering algorithm.
      protected int[] colsBitsetToIDs​(long[] cols)
      Convert a bitset into integer column ids.
      protected int[] colsBitsetToIDs​(java.util.BitSet cols)
      Convert a bitset into integer column ids.
      protected Cluster<BiclusterModel> defineBicluster​(long[] rows, long[] cols)
      Defines a Bicluster as given by the included rows and columns.
      protected Cluster<BiclusterModel> defineBicluster​(java.util.BitSet rows, java.util.BitSet cols)
      Defines a Bicluster as given by the included rows and columns.
      protected int getColDim()
      The number of columns of the data matrix.
      protected elki.database.ids.DBID getRowDBID​(int row)
      Deprecated.
      Expensive!
      protected int getRowDim()
      The number of rows of the data matrix.
      protected elki.database.ids.ArrayDBIDs rowsBitsetToIDs​(long[] rows)
      Convert a bitset into integer row ids.
      protected elki.database.ids.ArrayDBIDs rowsBitsetToIDs​(java.util.BitSet rows)
      Convert a bitset into integer row ids.
      Clustering<M> run​(elki.database.relation.Relation<? extends elki.data.NumberVector> relation)
      Prepares the algorithm for running on a specific database.
      protected double valueAt​(int row, int col)
      Returns the value of the data matrix at row row and column col.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface elki.Algorithm

        getInputTypeRestriction
    • Field Detail

      • relation

        protected elki.database.relation.Relation<? extends elki.data.NumberVector> relation
        Relation we use.
      • iter

        private elki.database.ids.DBIDArrayIter iter
        Iterator to use for more efficient random access.
      • rowIDs

        protected elki.database.ids.ArrayDBIDs rowIDs
        The row ids corresponding to the currently set relation.
      • colDim

        private int colDim
        Column dimensionality.
    • Constructor Detail

      • AbstractBiclustering

        protected AbstractBiclustering()
        Constructor.
    • Method Detail

      • run

        public final Clustering<M> run​(elki.database.relation.Relation<? extends elki.data.NumberVector> relation)
        Prepares the algorithm for running on a specific database.

        Assigns the database, the row ids, and the col ids, then calls biclustering().

        Any concrete algorithm should be implemented within method biclustering() by an inheriting biclustering approach.

        Parameters:
        relation - Relation to process
        Returns:
        Clustering result
      • colsBitsetToIDs

        protected int[] colsBitsetToIDs​(java.util.BitSet cols)
        Convert a bitset into integer column ids.
        Parameters:
        cols -
        Returns:
        integer column ids
      • rowsBitsetToIDs

        protected elki.database.ids.ArrayDBIDs rowsBitsetToIDs​(java.util.BitSet rows)
        Convert a bitset into integer row ids.
        Parameters:
        rows -
        Returns:
        integer row ids
      • defineBicluster

        protected Cluster<BiclusterModel> defineBicluster​(java.util.BitSet rows,
                                                          java.util.BitSet cols)
        Defines a Bicluster as given by the included rows and columns.
        Parameters:
        rows - the rows included in the Bicluster
        cols - the columns included in the Bicluster
        Returns:
        a Bicluster as given by the included rows and columns
      • defineBicluster

        protected Cluster<BiclusterModel> defineBicluster​(long[] rows,
                                                          long[] cols)
        Defines a Bicluster as given by the included rows and columns.
        Parameters:
        rows - the rows included in the Bicluster
        cols - the columns included in the Bicluster
        Returns:
        A Bicluster as given by the included rows and columns
      • valueAt

        protected double valueAt​(int row,
                                 int col)
        Returns the value of the data matrix at row row and column col.
        Parameters:
        row - the row in the data matrix according to the current order of rows (refers to database entry database.get(rowIDs[row]))
        col - the column in the data matrix according to the current order of rows (refers to the attribute value of an database entry getValue(colIDs[col]))
        Returns:
        the attribute value of the database entry as retrieved by database.get(rowIDs[row]).getValue(colIDs[col])
      • getRowDBID

        @Deprecated
        protected elki.database.ids.DBID getRowDBID​(int row)
        Deprecated.
        Expensive!
        Get the DBID of a certain row
        Parameters:
        row - Row number
        Returns:
        DBID of this row
      • colsBitsetToIDs

        protected int[] colsBitsetToIDs​(long[] cols)
        Convert a bitset into integer column ids.
        Parameters:
        cols -
        Returns:
        integer column ids
      • rowsBitsetToIDs

        protected elki.database.ids.ArrayDBIDs rowsBitsetToIDs​(long[] rows)
        Convert a bitset into integer row ids.
        Parameters:
        rows -
        Returns:
        integer row ids
      • getRowDim

        protected int getRowDim()
        The number of rows of the data matrix.
        Returns:
        the number of rows of the data matrix
      • getColDim

        protected int getColDim()
        The number of columns of the data matrix.
        Returns:
        the number of columns of the data matrix