google-code-export / wnd-charm

Automatically exported from code.google.com/p/wnd-charm
1 stars 1 forks source link

wndchrm produces unexpected results when testing with a small number of features #25

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Tarball with files to reproduce uploaded to 
/iicbu/LabStuff/issue25_barfs_on_small_num_features.tar.gz

With the given dataset, testing with -f0.05 or less will yield NaNs for the 
marginal probabilities. With -f0.06, there are NaNs in some but not all 
marginal probabilities. Using -f0.07 will clear the NaNs

Now would be a good time to add a new switch -F to specify the actualy number 
of features to use, rather than having to discover how many features will be 
included when specifying some fraction.

Original issue reported on code.google.com by christop...@nih.gov on 21 Mar 2011 at 7:31

GoogleCodeExporter commented 9 years ago
Fixed - problem was that with a low number of features the sum of the distances 
to the training samples fell bellow FLT_EPSILON.  Changed the minimum distance 
to DBL_EPSILON in classify2().

Note that this causes a segfault in linux because classify2() returns -1 as the 
most probable class, which causes an array access at index -1.  Put an 
additional check in ClassifyImage(), which sets the predicted class to 0 
(unknown) if the classifier returns < 1.

Original comment by i...@cathilya.org on 22 Mar 2011 at 3:53