kunaldahiya / pyxclib

Tools for multi-label classification problems.
MIT License
126 stars 36 forks source link

"zero_based" not explicitly set in read_data function when calling load_svmlight_file #10

Closed nilesh2797 closed 3 years ago

nilesh2797 commented 3 years ago

https://github.com/kunaldahiya/pyxclib/blob/e4f53c27321dd7374827013051a27083d23ded93/xclib/data/data_utils.py#L262

when calling load_svmlight_file(f, n_features=num_feat, multilabel=True) in read_data(filename, header=True, dtype='float32', zero_based=True), zero_based flag is not explicitly set so when there is no 0 index in the file load_svmlight_file function thinks that the file is not zero_based and offsets all the indices by 1 (by default zero_based is set to auto in load_svmlight_file).

I think load_svmlight_file(f, n_features=num_feat, multilabel=True, zero_based=zero_based) should fix this.