Hello,
I tried to convert regular arff file format to sparse arff format through liac-arff.
I used the code below:
import arff
fp = open('est1.arff')
data = arff.load(fp)
X = arff.dumps(data)
from scipy import sparse
decoder = arff.ArffDecoder()
d = decoder.decode(X, encode_nominal=True, return_type=arff.COO)
data = d['data'][0]
row = d['data'][1]
col = d['data'][2]
matrix = sparse.coo_matrix((data, (row, col)), shape=(max(row)+1, max(col)+1))
However, it did not work, and the comment in console was "BadLayout: Invalid layout of the ARFF file, at line ..."
I am not sure what the problem is. Would you please help me to solve this issue?
Thank you.