liblinear-java icon indicating copy to clipboard operation
liblinear-java copied to clipboard

NullPointerException when using sparse data to train Model

Open AlexandreLabadie opened this issue 4 years ago • 1 comments

Hello everyone,

I am currently working on a project that use your library to train classification models, I build a Problem object with sparse feature vectors (following some of your examples) and when I start the training with such Problem object I get NPE from the train method occurring when it browse through feature vectors. When looking at your code I can see you browse through features in a "for each" way, but when I follow the exception using debugging tools, I see a "for i=0 to n" logic, that will obviously lead to point toward a null feature in a sparse feature vector.

I have Mac os X 11.2.3 and I use oracle jdk 11.0.6.

AlexandreLabadie avatar Apr 27 '21 05:04 AlexandreLabadie

Could you provide a minimal test case which reproduces the NPE?

bwaldvogel avatar Sep 12 '22 10:09 bwaldvogel