Skip to content

A Python + R program for consensus clustering implementation.

Notifications You must be signed in to change notification settings

Amir-Reza-Sadri/Consensus-Clustering

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 

Repository files navigation

Consensus Clustering

A Python + R program for consensus clustering implementation based on this paper.

Requirements

Python packages: matplotlib, pandas, seaborn, numpy, and PIL

R libraries: no specific library is needed

Running

I explain the method via an example. Here we have a six clusters data corresponding to 'no artifact', 'other artifacts', 'ringing', 'ghosting', 'banding', and 'motion' classes. The values of the data for each cluster along with the cluster labels is saved in .txt files (see files directory).

Step 1

The first step is to run the R code named R. The input of the script is two .txt files and the output is a out_text.txt file and a folder named "saved_folder" containing the consensus plots. Since here we have six clusters (k=6) we will need the plot named consensus06.png which looks like the follwoing plot.

Step 2

The second step is to run the Python code named P. The input of the script is the out_text.txt file and the output is a report.xlsx file and three .png plots as follows.

Picture2

The metrics of each cluster is in the following format.

ClassNumber ClassName TP FP TN FN Accuracy Recall Precision
5 banding 9 0 90 1 0.99 0.9 1
1 no artifact 31 2 66 1 0.97 0.97 0.94
2 other artifacts 2 0 97 0 1 1 1
3 ringing 16 1 82 4 0.95 0.8 0.94
6 motion 12 1 86 3 0.96 0.8 0.92
4 ghosting 20 5 74 0 0.95 1 0.8

Step 3

Finally, a .pptx file is made to visualize the whole result.

About

A Python + R program for consensus clustering implementation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages