scikit-learn/scikit-learn — Issue #479: Program crash on data loaded by load_svmlight_file 
Author: fannix
Created: 2011-12-19 12:15:02+00:00
State: open

I load the dataset with load_svmlight_file()

Xc, yc = load_svmlight_file("../ch.vec", ch_feature)

and then fit it with

nb = MultinomialNB()
nb.fit(Xc, yc)

And then the program crashed and no exception and warning message is displayed.

This problem is caused by off-by-one error. My feature index starts from 1, while load_svmlight_file() requires the index to start from 0. However, this exception behavior is quite confusing and very hard to debug.