Answers.Body: <blockquote>
  <p>Padilha, V. A. &amp; Campello, R. J. G. B. (2017). A systematic comparative evaluation of biclustering techniques. BMC Bioinformatics, 18(1):55.</p>
  </blockquote>
  <p><a href="https://github.com/padilha/biclustlib" rel="nofollow noreferrer">https://github.com/padilha/biclustlib</a></p>
  <p>It needs the r-bicluster library which is available on conda <a href="https://anaconda.org/conda-forge/r-biclust" rel="nofollow noreferrer">https://anaconda.org/conda-forge/r-biclust</a></p>
  <p>Citing the authors GitHub page for instructions</p>
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  
  from biclustlib.algorithms import ChengChurchAlgorithm
  from biclustlib.datasets import load_yeast_tavazoie
  
  # load yeast data used in the original Cheng and Church's paper
  data = load_yeast_tavazoie().values
  
  # missing value imputation suggested by Cheng and Church
  missing = np.where(data &lt; 0.0)
  data[missing] = np.random.randint(low=0, high=800, size=len(missing[0]))
  
  # creating an instance of the ChengChurchAlgorithm class and running with the parameters of the original study
  cca = ChengChurchAlgorithm(num_biclusters=100, msr_threshold=300.0, multiple_node_deletion_threshold=1.2)
  biclustering = cca.run(data)
  print(biclustering)
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-22T20:03:58.197Z
Answers.Text: Thank you for the response, however, I don't mean that the code has installation or execution problem. Actually, I want to be sure of the logic to be aligned with the algorithm.
Answers.UserDisplayName: ShokofehVS
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-22T16:21:10.640Z
Answers.LastActivityDate: 2024-02-22T20:09:59.087Z
Answers.LastEditDate: 2024-02-22T20:09:59.087Z
Answers.UserDisplayName: M__
Body: <p>Cheng and Church Algorithm is a biclustering algorithm or an unsupervised learning task with which both rows and columns in a data matrix can be placed in concurrent clusters.</p>
  <p>In the <a href="https://www.researchgate.net/publication/12345321_Biclustering_of_Expression_Data" rel="nofollow noreferrer">original paper</a>, authors explained that a row or column of an input matrix <span class="math-container">$A$</span> with the largest <span class="math-container">$d(i)$</span> or <span class="math-container">$d(j)$</span> should be removed in single node deletion phase:</p>
  <ul>
  <li>Find the row <span class="math-container">$i \in I$</span> with largest: <span class="math-container">$d(i) = \frac{\sum_{j \in J} (a_{ij} - a_{iJ} - a_{Ij} + a_{IJ})}{\lvert J \rvert}$</span></li>
  <li>Find the column <span class="math-container">$j \in J$</span> with largest: <span class="math-container">$d(j) = \frac{\sum{i \in I} (a_{ij} - a_{iJ} - a_{Ij} + a_{IJ})}{\lvert I \rvert}$</span></li>
  </ul>
  <p>I found one implementation of the algorithm trying to do the following operations for single node deletion:</p>
  <pre class="lang-py prettyprint-override"><code>row_max_msr = np.argmax(row_msr) #finding the index of rows having largest d(i)
  col_max_msr = np.argmax(col_msr) #finding the index of columns having largest d(j)
  
  #Continue with removing row where <span class="math-container">$d(i) &gt;= d(j)$</span> or column <span class="math-container">$d(j) &gt; d(i)$</span> 
  if row_msr[row_max_msr] &gt;= col_msr[col_max_msr]: 
      row2remove = row_indices[row_max_msr]
      rows[row2remove] = False
  else:
      col2remove = col_indices[col_max_msr]
      cols[col2remove] = False
  </code></pre>
  <p>I was wondering whether anyone has a suggestion for this matter. I don't mean that the code has installation or execution problem. Actually, I want to be sure of the logic to be aligned with the algorithm.</p>
  
Tags: <python><machine-learning><algorithms>
Title: Single Node Deletion in Cheng and Church Algorithm
ThreadText: # Single Node Deletion in Cheng and Church Algorithm
  
  (Asked by: username_0 on 2024-02-22)
  
  Cheng and Church Algorithm is a biclustering algorithm or an unsupervised learning task with which both rows and columns in a data matrix can be placed in concurrent clusters.
  
  In the [original paper](https://www.researchgate.net/publication/12345321_Biclustering_of_Expression_Data), authors explained that a row or column of an input matrix $A$ with the largest $d(i)$ or $d(j)$ should be removed in single node deletion phase:
  
  * Find the row $i \in I$ with largest: $d(i) = \frac{\sum\_{j \in J} (a\_{ij} - a\_{iJ} - a\_{Ij} + a\_{IJ})}{\lvert J \rvert}$
  * Find the column $j \in J$ with largest: $d(j) = \frac{\sum{i \in I} (a\_{ij} - a\_{iJ} - a\_{Ij} + a\_{IJ})}{\lvert I \rvert}$
  
  I found one implementation of the algorithm trying to do the following operations for single node deletion:
  
  ```py
  row_max_msr = np.argmax(row_msr) #finding the index of rows having largest d(i)
  col_max_msr = np.argmax(col_msr) #finding the index of columns having largest d(j)
  
  #Continue with removing row where $d(i) >= d(j)$ or column $d(j) > d(i)$ 
  if row_msr[row_max_msr] >= col_msr[col_max_msr]: 
      row2remove = row_indices[row_max_msr]
      rows[row2remove] = False
  else:
      col2remove = col_indices[col_max_msr]
      cols[col2remove] = False
  
  ```
  
  I was wondering whether anyone has a suggestion for this matter. I don't mean that the code has installation or execution problem. Actually, I want to be sure of the logic to be aligned with the algorithm.
  
  **Tags:** python, machine-learning, algorithms
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-02-22. Score: 0
  
  > Padilha, V. A. & Campello, R. J. G. B. (2017). A systematic comparative evaluation of biclustering techniques. BMC Bioinformatics, 18(1):55.
  
  <https://github.com/padilha/biclustlib>
  
  It needs the r-bicluster library which is available on conda <https://anaconda.org/conda-forge/r-biclust>
  
  Citing the authors GitHub page for instructions
  
  ```py
  import numpy as np
  
  from biclustlib.algorithms import ChengChurchAlgorithm
  from biclustlib.datasets import load_yeast_tavazoie
  
  # load yeast data used in the original Cheng and Church's paper
  data = load_yeast_tavazoie().values
  
  # missing value imputation suggested by Cheng and Church
  missing = np.where(data < 0.0)
  data[missing] = np.random.randint(low=0, high=800, size=len(missing[0]))
  
  # creating an instance of the ChengChurchAlgorithm class and running with the parameters of the original study
  cca = ChengChurchAlgorithm(num_biclusters=100, msr_threshold=300.0, multiple_node_deletion_threshold=1.2)
  biclustering = cca.run(data)
  print(biclustering)
  
  ```
  
  > **Comments:**
  > **username_0**: Thank you for the response, however, I don't mean that the code has installation or execution problem. Actually, I want to be sure of the logic to be aligned with the algorithm.  
  
  ---
  
  