Package elki.clustering.biclustering
Class AbstractBiclustering<M extends BiclusterModel>
- java.lang.Object
-
- elki.clustering.biclustering.AbstractBiclustering<M>
-
- 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 theNumberVector
s.- Since:
- 0.1
- Author:
- Arthur Zimek
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface elki.Algorithm
Algorithm.Utils
-
-
Field Summary
Fields Modifier and Type Field Description private int
colDim
Column dimensionality.private DBIDArrayIter
iter
Iterator to use for more efficient random access.protected Relation<? extends NumberVector>
relation
Relation we use.protected ArrayDBIDs
rowIDs
The row ids corresponding to the currently setrelation
.
-
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 DBID
getRowDBID(int row)
Deprecated.Expensive!protected int
getRowDim()
The number of rows of the data matrix.protected ArrayDBIDs
rowsBitsetToIDs(long[] rows)
Convert a bitset into integer row ids.protected ArrayDBIDs
rowsBitsetToIDs(java.util.BitSet rows)
Convert a bitset into integer row ids.Clustering<M>
run(Relation<? extends 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 rowrow
and columncol
.-
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
-
Methods inherited from interface elki.clustering.ClusteringAlgorithm
autorun
-
-
-
-
Field Detail
-
relation
protected Relation<? extends NumberVector> relation
Relation we use.
-
iter
private DBIDArrayIter iter
Iterator to use for more efficient random access.
-
rowIDs
protected ArrayDBIDs rowIDs
The row ids corresponding to the currently setrelation
.
-
colDim
private int colDim
Column dimensionality.
-
-
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
-
biclustering
protected abstract Clustering<M> biclustering()
Run the actual biclustering algorithm.This method is supposed to be called only from the method
run(elki.database.relation.Relation<? extends elki.data.NumberVector>)
.
-
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 Biclustercols
- 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 Biclustercols
- 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 rowrow
and columncol
.- Parameters:
row
- the row in the data matrix according to the current order of rows (refers to database entrydatabase.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 entrygetValue(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
-
-