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.
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)
inread_data(filename, header=True, dtype='float32', zero_based=True)
,zero_based
flag is not explicitly set so when there is no0
index in the fileload_svmlight_file
function thinks that the file is notzero_based
and offsets all the indices by 1 (by defaultzero_based
is set toauto
inload_svmlight_file
).I think
load_svmlight_file(f, n_features=num_feat, multilabel=True, zero_based=zero_based)
should fix this.