Convert to "sparse data set" (for LibSVM)

Hello!

Is there a convinient way to convert data to so called "sparse data set", which is an input for LibSVM program? Ie to get something like:

-1 3:1 11:1 14:1 19:1 39:1 42:1 55:1 64:1 67:1 73:1 75:1 76:1 80:1 83:1 -1 3:1 6:1 17:1 27:1 35:1 40:1 57:1 63:1 69:1 73:1 74:1 76:1 81:1 103:1 -1 4:1 6:1 15:1 21:1 35:1 40:1 57:1 63:1 67:1 73:1 74:1 77:1 80:1 83:1 -1 5:1 6:1 15:1 22:1 36:1 41:1 47:1 66:1 67:1 72:1 74:1 76:1 80:1 83:1 -1 2:1 6:1 16:1 22:1 36:1 40:1 54:1 63:1 67:1 73:1 75:1 76:1 80:1 83:1

(according to LibSVM faq: http://www.csie.ntu.edu.tw/~cjlin/libsvm/faq.html#/Q3:_Data_preparation)

best wishes,

Filip

I tried something similar for the Weka Nodes but as far as I know, KNIME is unable to process sparse data.

The Weka integration (currently 3.6 is supported) in KNIME only works on standard data types, such as int, double and strings. However, KNIME supports bit vectors. See the distance package with all its nodes as well as the Bitvector Generator node. Hope this helps.