层次图分析
higra的Python项目详细描述
#higra:层次图分析
[![生成状态](https://travis-ci.org/higra/Higra.svg?branch=master)](https://travis-ci.org/higra/Higra) [![生成状态](https://ci.appveyor.com/api/projects/status/oo0v2uepcxihvwno?svg=true)](https://ci.appveyor.com/project/PerretB/higra-21ed3) [![codecov](https://codecov.io/gh/higra/Higra/branch/master/graph/badge.svg)](https://codecov.io/gh/higra/Higra) [![文档状态](https://readthedocs.org/projects/higra/badge/?version=latest)](https://higra.readthedocs.io/en/latest/?徽章=最新)
HigRA是一种高效的稀疏图分析的C++/Python库,特别侧重于层次化方法。一些主要功能是:
- 处理层次聚类双重表示的有效方法和数据结构:树(树状图)和显著图(超距离);
- 层次聚类:准平坦带层次、层次分水岭、聚集聚类(单连锁、平均连锁、完全连锁、指数连锁、ward或自定义规则)、约束连接性层次;
- 组件树:最小和最大树;
- 操作和探索层次结构:简化、累加器、簇提取、各种属性(大小、体积、动力学、周长、紧凑度、力矩等)、水平和非水平切割、层次对齐;
- 层次优化:最优切割,能量层次;
- 图的算法:累加器、顶点和簇的不相似性、区域邻接图、最小生成树和森林、分水岭切割;
- 评估:监督评估图形聚类和层次聚类;
- 图像工具箱:网格图的特殊方法,形状树,用于图像分析的层次聚类方法,Mumford Shah Energy的优化。
higra被认为具有模块性、性能和与经典数据分析管道的无缝集成。数据结构(图和树)与数据(顶点和边的权重)解耦,它们是简单的数组(在Python中用C++(++)数组和Python中的数组)。
##安装
###Python
python包可以与pypi一起安装:
`bash pip install higra `
支持的系统:
- Python 3.4, 3.5, 3.6, 3.7
- Linux 64 bits, macOS, Windows 64 bits
α+c++后端
C++后端是只头文件的库。目前没有提供全系统安装的设施:只需在需要的地方复制/通过!
##文档
[https://higra.readthedocs.io/](https://higra.readthedocs.io/)
##演示和教程
查看专用存储库[higra笔记本](https://github.com/higra/Higra-Notebooks)以获取专门用于higra的jupyter笔记本的集合。
##构建
###使用cmake
需要:
- 克
- python+numpy
命令:
`bash git clone https://github.com/higra/Higra.git mkdir build cd build cmake ../Higra/ make `
有时,当系统上安装了几个python版本时,cmake会感到困惑。 您可以指定要与-dpython_可执行文件一起使用的版本:filepath=/path-to-python/python,例如
` cmake -DPYTHON_EXECUTABLE:FILEPATH=/anaconda3/bin/python../Higra/ `
python包是在目录中构建的
` build/higra/ `
###使用setup.py
文件setup.py是一个围绕cmake脚本的薄包装,以提供与pythonsetuptools的兼容性。
` pip install cmake python setup.py bdist_wheel cd dist pip install higra*.whl `
##开发扩展
虽然higra提供了许多矢量化的操作符来高效地在python中实现算法,但是有可能 有些操作在python中无法高效完成。 在这种情况下,[higra cppextension cookiecutter](https://github.com/higra/Higra-cppextension-cookiecutter)启用 使用higra和python绑定轻松设置和生成c++扩展。
##第三方库
higra捆绑了几个第三方库(在lib文件夹中):
- [pybind11](https://github.com/pybind/pybind11)帮助创建c++方法和类的python绑定-[bsd样式许可证](https://github.com/pybind/pybind11/blob/master/LICENSE)
- [xtensor](https://github.com/QuantStack/xtensor)(使用[xtl](https://github.com/QuantStack/xtl)、[xsimd](https://github.com/QuantStack/xsimd)和[xtensor python](https://github.com/QuantStack/xtensor-python)为C++提供类似于numpy的数组,并与Python无缝集成—所有这些都在[BSD-3子句许可证](https://github.com/QuantStack/xtensor/blob/master/LICENSE)
- [catch2](https://github.com/catchorg/Catch2)是一个单元测试框架-[boost software license 1.0](https://github.com/catchorg/Catch2/blob/master/LICENSE.txt)