Skip to content

Commit 888fd5d

Browse files
committedAug 25, 2018
Added heatmap sample code
1 parent a5ca6ac commit 888fd5d

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
 

‎example/sample_heatmap.py

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin.env python
2+
# coding: utf-8
3+
4+
from __future__ import (absolute_import, division, print_function,
5+
unicode_literals)
6+
7+
from future import standard_library
8+
9+
from pyHSICLasso import HSICLasso
10+
11+
standard_library.install_aliases()
12+
13+
14+
def main():
15+
hsic_lasso = HSICLasso()
16+
hsic_lasso.input("../tests/test_data/matlab_data.mat")
17+
18+
#max_neighbors=0 means that we only use the HSIC Lasso features to plot heatmap
19+
hsic_lasso.regression(5,max_neighbors=0)
20+
21+
#Compute linkage
22+
hsic_lasso.linkage()
23+
24+
#Run Hierarchical clustering
25+
# Features are clustered by using HSIC scores
26+
# Samples are clusterd by using Euclid distance
27+
hsic_lasso.plot_heatmap()
28+
29+
if __name__ == "__main__":
30+
main()

0 commit comments

Comments
 (0)
Please sign in to comment.