We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
Thank you for your comment. Where can I get a generator?
Sorry, I was responding to the first version of this issue which complained that the output of loading was a Generator.
If your data is not a sparse ARFF, attempting COO return type will raise a BadLayout. Instead, load it dense, then convert to sparse.
No branches or pull requests
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.
The text was updated successfully, but these errors were encountered: