Package elki.clustering.biclustering
Class ChengAndChurch.BiclusterCandidate
- java.lang.Object
-
- elki.clustering.biclustering.ChengAndChurch.BiclusterCandidate
-
- Enclosing class:
- ChengAndChurch
protected static class ChengAndChurch.BiclusterCandidate extends java.lang.Object
Bicluster candidate.- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description (package private) double
allM
Mean of the current bicluster.(package private) int
colcard
Cardinalities.(package private) double[]
colM
Means.(package private) long[]
cols
Row and column bitmasks.(package private) long[]
irow
Row and column bitmasks.private ChengAndChurch.CellVisitor
MEANVISITOR
Visitor for updating the means.(package private) double
residue
The current bicluster score (mean squared residue).(package private) int
rowcard
Cardinalities.(package private) double[]
rowM
Means.(package private) long[]
rows
Row and column bitmasks.
-
Constructor Summary
Constructors Modifier Constructor Description protected
BiclusterCandidate(int rows, int cols)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected double
computeColResidue(double[][] mat, int col)
Computes the mean column residue of the givencol
.protected double
computeMeanSquaredDeviation(double[][] mat)
Compute the mean square residue.protected double
computeRowResidue(double[][] mat, int row, boolean rowinverted)
Computes the mean row residue of the givenrow
.protected void
invertRow(int rnum, boolean b)
protected void
maskMatrix(double[][] mat, Distribution replacement, java.util.Random rnd)
Updates the mask with replacement values for all data in the given rows and columns.protected void
reset()
Resets the values for the next cluster search.protected void
selectColumn(int cnum, boolean set)
Select or deselect a column.protected void
selectRow(int rnum, boolean set)
Select or deselect a row.protected double
updateRowAndColumnMeans(double[][] mat, boolean all)
Update the row means and column means.protected void
visitAll(double[][] mat, int mode, ChengAndChurch.CellVisitor visitor)
Visit all selected cells in the data matrix.protected void
visitColumn(double[][] mat, int col, int mode, ChengAndChurch.CellVisitor visitor)
Visit a column of the matrix.protected void
visitRow(double[][] mat, int row, int mode, ChengAndChurch.CellVisitor visitor)
Visit a row of the data matrix.
-
-
-
Field Detail
-
rowcard
int rowcard
Cardinalities.
-
colcard
int colcard
Cardinalities.
-
rowM
double[] rowM
Means.
-
colM
double[] colM
Means.
-
rows
long[] rows
Row and column bitmasks.
-
irow
long[] irow
Row and column bitmasks.
-
cols
long[] cols
Row and column bitmasks.
-
allM
double allM
Mean of the current bicluster.
-
residue
double residue
The current bicluster score (mean squared residue).
-
MEANVISITOR
private final ChengAndChurch.CellVisitor MEANVISITOR
Visitor for updating the means.
-
-
Method Detail
-
reset
protected void reset()
Resets the values for the next cluster search.
-
visitAll
protected void visitAll(double[][] mat, int mode, ChengAndChurch.CellVisitor visitor)
Visit all selected cells in the data matrix.- Parameters:
mat
- Data matrixmode
- Operation modevisitor
- Visitor function
-
visitColumn
protected void visitColumn(double[][] mat, int col, int mode, ChengAndChurch.CellVisitor visitor)
Visit a column of the matrix.- Parameters:
mat
- Data matrixcol
- Column to visitmode
- Operation modevisitor
- Visitor function
-
visitRow
protected void visitRow(double[][] mat, int row, int mode, ChengAndChurch.CellVisitor visitor)
Visit a row of the data matrix.- Parameters:
mat
- Data matrixrow
- Row to visitvisitor
- Visitor function
-
updateRowAndColumnMeans
protected double updateRowAndColumnMeans(double[][] mat, boolean all)
Update the row means and column means.- Parameters:
mat
- Data matrixall
- Flag, to update all- Returns:
- overall mean
-
computeMeanSquaredDeviation
protected double computeMeanSquaredDeviation(double[][] mat)
Compute the mean square residue.- Parameters:
mat
- Data matrix- Returns:
- mean squared residue
-
computeRowResidue
protected double computeRowResidue(double[][] mat, int row, boolean rowinverted)
Computes the mean row residue of the givenrow
.- Parameters:
mat
- Data matrixrow
- The row who's residue should be computed.rowinverted
- Indicates if the row should be considered inverted.- Returns:
- The row residue of the given
row
.
-
computeColResidue
protected double computeColResidue(double[][] mat, int col)
Computes the mean column residue of the givencol
.- Parameters:
col
- The column who's residue should be computed.- Returns:
- The row residue of the given
col
um.
-
maskMatrix
protected void maskMatrix(double[][] mat, Distribution replacement, java.util.Random rnd)
Updates the mask with replacement values for all data in the given rows and columns.- Parameters:
mat
- Mask to update.replacement
- Distribution to sample replacement values from.rnd
- Random generator.
-
selectColumn
protected void selectColumn(int cnum, boolean set)
Select or deselect a column.- Parameters:
cnum
- Column to selectset
- Value to set
-
selectRow
protected void selectRow(int rnum, boolean set)
Select or deselect a row.- Parameters:
rnum
- Row to selectset
- Value to set
-
invertRow
protected void invertRow(int rnum, boolean b)
-
-