Skip to content

Issue- "BadLayout: Invalid layout of the ARFF file, at line ..." #102

@j00n162

Description

@j00n162

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions