How can I use Subsequence String Kernel (SSK) [Lodhi 2002] to train a SVM (Support Vector Machine) in Python?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
Recently, the String Subsequence Kernel (SSK) [Lodhi. et. al., 2002] has been added to Shogun Machine Learning toolbox and is made available for using in all modular interfaces including Python. You can find a working example of using this kernel for a DNA classification problem here using LibSVM.
For future reference, the name of the Kernel in the current version of Shogun (3.2.0) is StringSubsequenceKernel.
Source: https://code.google.com/p/shogun-toolbox/source/browse/src/shogun/kernel/string/StringSubsequenceKernel.h
This is an update to gcedo's answer to work with the current version of shogun (Shogun 6.1.3).
Working example:
I have come to a solution using the Shogun Library. You have to install it from the commit 0891f5a38bcb as later revisions would mistakenly remove the needed classes.
This is a working example: