Class AbstractBiclustering<M extends BiclusterModel>

  • Type Parameters:
    M - Cluster model type
    All Implemented Interfaces:
    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
    • Field Detail

      • iter

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

        protected 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​(Relation<? extends 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 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 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 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