|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.logging.AbstractLoggable de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm<V> de.lmu.ifi.dbs.elki.algorithm.clustering.biclustering.AbstractBiclustering<V>
V
- a certain subtype of RealVector - 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 objectspublic abstract class AbstractBiclustering<V extends RealVector<V,Double>>
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 RealVectors. The database is supposed to present a data matrix with a row representing an entry (RealVector
),
a column representing a dimension (attribute)
of the RealVector
s.
Field Summary | |
---|---|
private int[] |
colIDs
The column ids corresponding to the currently set database . |
private Database<V> |
database
Keeps the currently set database. |
private Biclustering<V> |
result
Keeps the result. |
private int[] |
rowIDs
The row ids corresponding to the currently set database . |
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable |
---|
optionHandler |
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debug |
Constructor Summary | |
---|---|
AbstractBiclustering()
|
Method Summary | ||
---|---|---|
protected void |
addBiclusterToResult(Bicluster<V> bicluster)
Adds the given Bicluster to the result of this Biclustering. |
|
protected void |
addInvertedRows(Bicluster<V> bicluster,
BitSet invertedRows)
Adds the ids of the inverted rows as specified to the given bicluster. |
|
protected abstract void |
biclustering()
Any concrete biclustering algorithm should be implemented within this method. |
|
protected Bicluster<V> |
defineBicluster(BitSet rows,
BitSet cols)
Defines a bicluster as given by the included rows and columns. |
|
protected int |
getColDim()
Provides the number of columns of the data matrix. |
|
Result<V> |
getResult()
Returns the result of the algorithm. |
|
protected int |
getRowDim()
Provides the number of rows of the data matrix. |
|
protected double |
meanOfBicluster(BitSet rows,
BitSet cols)
Provides the mean of all entries in the submatrix as specified by a set of columns and a set of rows. |
|
protected double |
meanOfCol(BitSet rows,
int col)
Provides the mean value for a column on a set of rows. |
|
protected double |
meanOfRow(int row,
BitSet cols)
Provides the mean value for a row on a set of columns. |
|
protected void |
runInTime(Database<V> database)
Prepares the algorithm for running on a specific database. |
|
private
|
sort(int[] ids,
int from,
int to,
List<P> properties,
Comparator<P> comp)
Sorts an array based on specified properties. |
|
protected
|
sortCols(int from,
int to,
List<P> properties,
Comparator<P> comp)
Sorts the columns. |
|
protected
|
sortRows(int from,
int to,
List<P> properties,
Comparator<P> comp)
Sorts the rows. |
|
protected double |
valueAt(int row,
int col)
Returns the value of the data matrix at row row and column col . |
Methods inherited from class de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm |
---|
description, isTime, isVerbose, run, setParameters, setTime, setVerbose |
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable |
---|
addOption, checkGlobalParameterConstraints, deleteOption, description, description, getAttributeSettings, getParameters, getParameterValue, getPossibleOptions, inlineDescription, isSet, setParameters |
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, verbose, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.lmu.ifi.dbs.elki.algorithm.Algorithm |
---|
getDescription |
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable |
---|
checkGlobalParameterConstraints, getAttributeSettings, getParameters, getPossibleOptions, inlineDescription |
Field Detail |
---|
private Database<V extends RealVector<V,Double>> database
private int[] rowIDs
database
.
private int[] colIDs
database
.
private Biclustering<V extends RealVector<V,Double>> result
runInTime(Database)
is called.
Constructor Detail |
---|
public AbstractBiclustering()
Method Detail |
---|
protected final void runInTime(Database<V> database) throws IllegalStateException
biclustering()
.
Any concrete algorithm should be implemented within method
biclustering()
by an inheriting biclustering approach.
runInTime
in class AbstractAlgorithm<V extends RealVector<V,Double>>
database
- the database to run the algorithm on
IllegalStateException
- if the algorithm has not been initialized
properly (e.g. the setParameters(String[]) method has been failed
to be called).AbstractAlgorithm.runInTime(de.lmu.ifi.dbs.elki.database.Database)
protected abstract void biclustering() throws IllegalStateException
RealVector
s
is encapsulated, methods
sortRows(int,int,List,Comparator)
,
sortCols(int,int,List,Comparator)
,
meanOfBicluster(BitSet,BitSet)
,
meanOfRow(int,BitSet)
,
meanOfCol(BitSet,int)
,
valueAt(int,int)
,
allow typical operations like on a data matrix.
This method is supposed to be called only from the method
runInTime(Database)
.
If a bicluster is to be appended to the result, the methods
defineBicluster(BitSet,BitSet)
and
addBiclusterToResult(Bicluster)
should be used.
IllegalStateException
- if the properties are not set properly (e.g. method is not called from method
runInTime(Database)
, but directly)protected Bicluster<V> defineBicluster(BitSet rows, BitSet cols)
rows
- the rows included in the biclustercols
- the columns included in the bicluster
protected void addInvertedRows(Bicluster<V> bicluster, BitSet invertedRows)
bicluster
- the bicluster where to add the ids of inverted rowsinvertedRows
- specifies the inverted rowsprotected void addBiclusterToResult(Bicluster<V> bicluster)
bicluster
- the bicluster to add to the resultprotected <P> void sortRows(int from, int to, List<P> properties, Comparator<P> comp)
from
(inclusively)
to row to
(exclusively)
are sorted
according to the specified properties
and Comparator.
The List of properties must be of size to - from
and reflect the properties corresponding to the row ids rowIDs[from]
to rowIDs[to-1]
.
P
- the type of properties
suitable to the comparatorfrom
- begin of range to be sorted (inclusively)to
- end of range to be sorted (exclusively)properties
- the properties to sort the rows of the data matrix according tocomp
- a Comparator suitable to the type of properties
protected <P> void sortCols(int from, int to, List<P> properties, Comparator<P> comp)
from
(inclusively)
to column to
(exclusively)
are sorted
according to the specified properties
and Comparator.
The List of properties must be of size to - from
and reflect the properties corresponding to the column ids colIDs[from]
to colIDs[to-1]
.
P
- the type of properties
suitable to the comparatorfrom
- begin of range to be sorted (inclusively)to
- end of range to be sorted (exclusively)properties
- the properties to sort the columns of the data matrix according tocomp
- a Comparator suitable to the type of properties
private <P> void sort(int[] ids, int from, int to, List<P> properties, Comparator<P> comp)
from
(inclusively)
to index to
(exclusively)
according to the specified properties
and Comparator.
The List of properties must be of size to - from
and reflect the properties corresponding to ids ids[from]
to ids[to-1]
.
P
- the type of properties
suitable to the comparatorids
- the ids to sortfrom
- begin of range to be sorted (inclusively)to
- end of range to be sorted (exclusively)properties
- the properties to sort the ids according tocomp
- a Comparator suitable to the type of properties
protected 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])
protected double meanOfRow(int row, BitSet cols)
colIDs
.
row
- the row to compute the mean value w.r.t. the given set of columns
(relates to database entry id rowIDs[row]
)cols
- the set of columns to include in the computation of the mean of the given row
protected double meanOfCol(BitSet rows, int col)
rowIDs
.
rows
- the set of rows to include in the computation of the mean of the given columncol
- the column index to compute the mean value w.r.t. the given set of rows
(relates to attribute colIDs[col]
of the corresponding database entries)
protected double meanOfBicluster(BitSet rows, BitSet cols)
rows
- the set of rows to include in the computation of the mean of the submatrixcols
- the set of columns to include in the computation of the mean of the submatrix
public Result<V> getResult()
Algorithm
Algorithm.getResult()
protected int getRowDim()
protected int getColDim()
|
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |