FastSK-PyPi包
fastsk-test的Python项目详细描述
FastSK:基于支持向量机的快速精确序列分类
一种用于序列分析的支持向量机分类器训练的Python包和字符串核算法。用FastSK-gaped k-mer算法,pybind11,scikit-learn和{a4}构建。在
正在下载此分支
git clone --recursive -b pypi_repo https://github.com/QData/FastSK.git
引文
^{pr2}$先决条件
在Unix(Linux,OS X)上
- 一个C++ 11的编译器支持
- CMake>;=2.8.12
在Windows上
- Visual Studio 2015(所有Python版本都需要,请参阅下面的注释)
- CMake>;=3.1
从纯C++版本
中安装和使用如果你喜欢使用纯C++而不是Python,你可以克隆这个存储库:
git clone --recursive https://github.com/QData/FastSK.git
那就跑吧
cd FastSK
make
一个fastsk
可执行文件将安装到bin
目录中,您可以使用该目录进行内核计算和推理。例如:
./bin/fastsk -g 10 -m 6 -C 1 -t 1 -a data/EP300.train.fasta data/EP300.test.fasta
这将在EP300 TFBS数据集上运行近似的内核算法,使用g = 10
的特征长度,最多m = 6
不匹配。然后它将使用SVM参数C = 1
训练和评估SVM分类器。在
通过Pip安装进行安装(Linux和MacOS)
有pip
来自源
我们建议在使用Python中的此项目时使用虚拟环境:
例如通过conda
conda create -n fastskenv python=3.7
conda activate fastskenv
然后克隆此存储库:
git clone --recursive https://github.com/QData/FastSK.git
然后运行:
cd FastSK
pip install -r requirements.txt
pip install ./fastsk
Python版本教程
Jupyter笔记本示例
- “演示”文件夹/FastSK_演示.ipynb在
示例python用法脚本:
cd test
python run_check.py
您可以检查fastsk库是否正确安装在pythonshell中:
from fastsk import FastSK
from sklearn.svm import LinearSVC
from sklearn.calibration import CalibratedClassifierCV
import numpy as np
## Compute kernel matrix
fastsk = FastSK(g=10, m=6, t=1, approx=True)
fastsk.compute_kernel('data/EP300.train.fasta', 'data/EP300.test.fasta')
Xtrain = fastsk.get_train_kernel()
Xtest = fastsk.get_test_kernel()
## Use linear SVM
svm = LinearSVC(C=1)
Windows特别注意事项
cd test
python run_check.py
from fastsk import FastSK
from sklearn.svm import LinearSVC
from sklearn.calibration import CalibratedClassifierCV
import numpy as np
## Compute kernel matrix
fastsk = FastSK(g=10, m=6, t=1, approx=True)
fastsk.compute_kernel('data/EP300.train.fasta', 'data/EP300.test.fasta')
Xtrain = fastsk.get_train_kernel()
Xtest = fastsk.get_test_kernel()
## Use linear SVM
svm = LinearSVC(C=1)
编译器要求
许可证
请参见许可证文件。在
- 项目
标签: