V
- a certain subtype of NumberVector - the data matrix is supposed to
consist of rows where each row relates to an object of type V and the
columns relate to the attribute values of these objectsM
- Cluster model typepublic abstract class AbstractBiclustering<V extends NumberVector,M extends BiclusterModel> extends AbstractAlgorithm<Clustering<M>> implements ClusteringAlgorithm<Clustering<M>>
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 NumberVector
s.
Modifier and Type | Field and Description |
---|---|
private int |
colDim
Column dimensionality.
|
private Database |
database
Keeps the currently set database.
|
private DBIDArrayIter |
iter
Iterator to use for more efficient random access.
|
protected Relation<V> |
relation
Relation we use.
|
protected ArrayDBIDs |
rowIDs
The row ids corresponding to the currently set
relation . |
ALGORITHM_ID
Modifier | Constructor and Description |
---|---|
protected |
AbstractBiclustering()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected abstract Clustering<M> |
biclustering()
Run the actual biclustering algorithm.
|
protected int[] |
colsBitsetToIDs(java.util.BitSet cols)
Convert a bitset into integer column ids.
|
protected int[] |
colsBitsetToIDs(long[] cols)
Convert a bitset into integer column ids.
|
protected Cluster<BiclusterModel> |
defineBicluster(java.util.BitSet rows,
java.util.BitSet cols)
Defines a Bicluster as given by the included rows and columns.
|
protected Cluster<BiclusterModel> |
defineBicluster(long[] rows,
long[] cols)
Defines a Bicluster as given by the included rows and columns.
|
protected int |
getColDim()
The number of columns of the data matrix.
|
Database |
getDatabase()
Getter for database.
|
Relation<V> |
getRelation()
Getter for the relation.
|
protected DBID |
getRowDBID(int row)
Deprecated.
Expensive!
|
protected int |
getRowDim()
The number of rows of the data matrix.
|
protected ArrayDBIDs |
rowsBitsetToIDs(java.util.BitSet rows)
Convert a bitset into integer row ids.
|
protected ArrayDBIDs |
rowsBitsetToIDs(long[] rows)
Convert a bitset into integer row ids.
|
Clustering<M> |
run(Relation<V> 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 . |
getInputTypeRestriction, getLogger, run
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
run
getInputTypeRestriction
private Database database
protected Relation<V extends NumberVector> relation
private DBIDArrayIter iter
protected ArrayDBIDs rowIDs
relation
.private int colDim
public final Clustering<M> run(Relation<V> relation)
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.
relation
- Relation to processprotected abstract Clustering<M> biclustering()
This method is supposed to be called only from the method run(de.lmu.ifi.dbs.elki.database.relation.Relation<V>)
.
protected int[] colsBitsetToIDs(java.util.BitSet cols)
cols
- protected ArrayDBIDs rowsBitsetToIDs(java.util.BitSet rows)
rows
- protected Cluster<BiclusterModel> defineBicluster(java.util.BitSet rows, java.util.BitSet cols)
rows
- the rows included in the Biclustercols
- the columns included in the Biclusterprotected Cluster<BiclusterModel> defineBicluster(long[] rows, long[] cols)
rows
- the rows included in the Biclustercols
- the columns included in the Biclusterprotected double valueAt(int row, int col)
row
and column
col
.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])
)database.get(rowIDs[row]).getValue(colIDs[col])
@Deprecated protected DBID getRowDBID(int row)
row
- Row numberprotected int[] colsBitsetToIDs(long[] cols)
cols
- protected ArrayDBIDs rowsBitsetToIDs(long[] rows)
rows
- protected int getRowDim()
protected int getColDim()
public Database getDatabase()
Copyright © 2019 ELKI Development Team. License information.