I'm using rb-libsvm for prediction using
x.each_with_index do |e, i| predictions << model_w2v.predict_probability(e).to_i end
Which returns an array where the first element is the label, and the second is the probabilities of all labels. E.g.
[2.0, [0.0, 0.0, 0.0, 0.0, 0.0]]. The label is different each time, however the probabilities are always zeros. I wonder if it's because the numbers are too small and rounded to 0.0 when converting from c to ruby. Here's the relevant c code:
estimates = rb_ary_new(); for (i = 0; i < model->nr_class; i++) rb_ary_push(estimates, rx_from_double(c_estimates[i]));
How can I mitigate this?