add libsvm-based implementation