parameters:
M = number of samplings
num = maximum size of each sample

if boost_str is set to 1 then boosting of weigths is applied.