hcluster

How to build & install hcluster?

房东的猫 提交于 2019-12-20 03:06:53
问题 I download hcluster from http://pypi.python.org/pypi/hcluster , then unzip to a folder , then type "python setup.py install" . It seems OK for it shows: Z:\>python setup.py install running install running build running build_py running build_ext building '_hierarchy_wrap' extension error: None But I try to "import hcluster" , it shows: In [2]: import hcluster --------------------------------------------------------------------------- ImportError Traceback (most recent call last) <ipython

Converting ndarray generated by hcluster into a Newick string for use with ete2 package

大憨熊 提交于 2019-12-03 10:09:06
问题 I have a list of vectors created by running: import hcluster import numpy as np from ete2 import Tree vecs = [np.array(i) for i in document_list] where document_list is a collection of web documents I am analysing. I then perform hierarchical clustering: Z = hcluster.linkage(vecs, metric='cosine') This generates an ndarray such as: [[ 12. 19. 0. 1. ] [ 15. 21. 0. 3. ] [ 18. 22. 0. 4. ] [ 3. 16. 0. 7. ] [ 8. 23. 0. 6. ] [ 5. 27. 0. 6. ] [ 1. 28. 0. 7. ] [ 0. 21. 0. 2. ] [ 5. 29. 0.18350472 2.