基于信息论的层次聚类算法
pspartition的Python项目详细描述
Python绑定
如何构建
绑定使用Cython
。
要打包库,请使用python setup.py bdist_wheel
。
通过pip install --user pspartition
安装包。
以下是预构建的二进制软件包:
Platform | py3.6 | py3.7 |
---|---|---|
Windows | T | T |
MacOS | T | T |
Linux | T | T |
演示代码
importpspartition# classify the three data points shown in the above figureg=pspartion.PsPartition(3,[(0,1,1),(1,2,1),(0,2,5)])# index started from zero, similarity is 5 for vertex 0 and 2g.run()# default to use psp_i algorithm to classify themprint(g.get_critical_values())# [2,5]print(g.get_partitions())# get the result which has at least 2 categories, which is [0,1,0]
变更日志
- 版本0.2:暴露^ { CD4}}(C++)类,在Python中可高度定制。在
- 版本0.3:暴露^ {< CD5> }(C++)类,它具有与{{CD6}}相似的API,但不同的内部实现。在
- 版本0.5:为
InfoCluster
公开run_psp_i
。在 - 版本0.7:将python绑定名称从
info_cluster
更改为pspartition
。在
- 项目
标签: