https://github.com/weekend37/string-kernels
Implementation of the Polynomial String Kernel and linear time String Kernel implementation. Compatible and ready for easy plug-in to Scikit-Learn's Support Vector Machines and supports multithreading.
https://github.com/weekend37/string-kernels
algorithms genomics kernelsvm machine-learning multithreading sequence-analysis
Last synced: about 1 month ago
JSON representation
Implementation of the Polynomial String Kernel and linear time String Kernel implementation. Compatible and ready for easy plug-in to Scikit-Learn's Support Vector Machines and supports multithreading.
- Host: GitHub
- URL: https://github.com/weekend37/string-kernels
- Owner: weekend37
- License: other
- Created: 2021-10-26T20:39:30.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-08-25T04:02:54.000Z (6 months ago)
- Last Synced: 2025-09-29T18:05:11.151Z (5 months ago)
- Topics: algorithms, genomics, kernelsvm, machine-learning, multithreading, sequence-analysis
- Language: Python
- Homepage:
- Size: 371 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README


[](https://pepy.tech/projects/string-kernels)
# String Kernels
This package contains an implementation of the **Polynomial String Kernel** and a linear time **String Kernel** algorithm as described in our paper, [High Resolution Ancestry Deconvolution for Next Generation Genomic Data](https://www.biorxiv.org/content/10.1101/2021.09.19.460980v1).

It offers
- Linear time computation of two effective string kernels.
- Compatibility with Scikit-Learn's Support Vector Machines (easy plug-in).
- Multithreading.
## Usage
To install the package, execute from the command line
```
pip install string-kernels
```
And then you're all set!
Assuming you have [Scikit-Learn](https://scikit-learn.org/) already installed, you can use Lodhi's string kernel via
```python
from sklearn import svm
from stringkernels.kernels import string_kernel
model = svm.SVC(kernel=string_kernel())
```
and the polynomial string kernel,
```python
from sklearn import svm
from stringkernels.kernels import polynomial_string_kernel
model = svm.SVC(kernel=polynomial_string_kernel())
```
For morer information read the [docs](https://github.com/weekend37/string-kernels/blob/master/doc/docs.md) or take a look at the notebook [example.ipynb](https://github.com/weekend37/string-kernels/blob/master/example.ipynb) for further demonstration of usage.
If you end up using this in your research we kindly ask you to cite us! :)