Closed adishavit closed 3 years ago
So, apparently the right function is getVarCount()
.
However, it is strange that predict()
does not fail when there is a mismatch.
Specifically, my example, I trained ml::Boost
to classify vectors of size 5547
but it doesn't fail when called mistakenly with smaller samples like 1323
. Silent success is horrible.
I added a safety line: e.g. assert(classifier->getVarCount() == sample.cols);
@alalek this can be closed, as my PR addressed this issue.
I'm loading an ML trained model from a file.
I noticed that when calling
predict()
with an input sample of the wrong size, the function does not (necessarily) fail! Apparently there is no internal checking that the input is of the right size that matches the one expected by the loaded model!I want to verify that when I'm calling
predict()
, my input sample is of the correct size.How can I do that?
I cannot seem to find such a method to provide this info.