ListSampleGenerator is not random
Mantis Issue 421, reported by jmalik, assigned to jguinet, created: 2011-11-03
in GenerateData, there is a call to m_RandomGenerator->SetSeed(1234);
Removing this line will probably make a lot of tests fail.
1320330992 - jguinetthis note poses the problem of random generation
what policy to adopt with tests which depends on random generation ? For example : apTvClTrainSVMImagesClassifierQB456 test
fails on MacOS arch due to non initialized seed on random generation in otbsvm library
1320336742 - christopTwo points:
-
To fix the randomness, we can follow http://hg.orfeo-toolbox.org/OTB/file/73c7566c5ad5/Code/BasicFilters/otbRandomPointSetSource.h with a SetSeed method and set it to 1234 in the tests.
-
Now the number of samples we have for each class is approximately the number we asked for, but not exactly. We can't simply stop the selection as it was done before: the selection would be biases. There are algorithm such as Random sampling with a reservoir, JS Vitter that enable to do that cleanly.
1320338235 - julienmThe problem is that now we want to test the application where we don't have access to the filter explicitely.
To avoid adding new seed parameters to the applications,