自动聚类超参数优化包
hypercluster的Python项目详细描述
超光泽度
一个用sklearn进行聚类优化的软件包。在
要求:
熊猫
数字
scipy
matplotlib
海伯恩
scikit学习
HDB扫描
可选: 蛇咬
安装
使用pip:
pip install hypercluster
或者是康达:
^{pr2}$如果在安装conda时遇到问题,请尝试更改频道优先级。建议优先考虑conda forge>;bioconda>;默认值。
要检查频道优先级:conda config --get channels
它应该看起来像:
--add channels 'defaults' # lowest priority
--add channels 'bioconda'
--add channels 'conda-forge' # highest priority
如果不是这样,试试:
conda config --add channels bioconda
conda config --add channels conda-forge
文件
https://hypercluster.readthedocs.io/en/latest/index.html
在clustering上查看sklearn的页面也很有用 和evaluation metrics
示例
https://github.com/liliblu/hypercluster/tree/dev/examples
使用SnakeMake快速启动
默认的config.yml
和{
编辑config.yml
文件或参数。在
snakemake -s hypercluster.smk --configfile config.yml --config input_data_files=test_data input_data_folder=.
使用python编辑示例:
importyamlwithopen('config.yml','r')asfh:config=yaml.load(fh)input_data_prefix='test_data'config['input_data_folder']=os.path.abspath('.')config['input_data_files']=[input_data_prefix]config['read_csv_kwargs']={input_data_prefix:{'index_col':[0]}}withopen('config.yml','w')asfh:yaml.dump(config,stream=fh)
那就打电话给蛇吧。在
snakemake -s hypercluster.smk
或将snakemake调度程序作为sbatch作业提交,例如使用BigPurple Slurm:
module add slurm sbatch snakemake_submit.sh
snakemake_submit.sh
和{
python快速入门
importpandasaspdfromsklearn.datasetsimportmake_blobsimporthyperclusterdata,labels=make_blobs()data=pd.DataFrame(data)labels=pd.Series(labels,index=data.index,name='labels')# With a single clustering algorithmclusterer=hypercluster.AutoClusterer()clusterer.fit(data).evaluate(methods=hypercluster.constants.need_ground_truth+hypercluster.constants.inherent_metrics,gold_standard=labels)clusterer.visualize_evaluations()# With a range of algorithmsclusterer=hypercluster.MultiAutoClusterer()clusterer.fit(data).evaluate(methods=hypercluster.constants.need_ground_truth+hypercluster.constants.inherent_metrics,gold_standard=labels)clusterer.visualize_evaluations()
- 项目
标签: