Commit 9c7b2910 authored by Marina Bertolino's avatar Marina Bertolino

ENH: init rand parameter in internal app

parent 2e60d975
......@@ -186,12 +186,7 @@ void ClassKMeansBase::SelectAndExtractSamples(std::string statisticsFileName,
GetInternalApplication("select")->SetParameterInt("strategy.constant.nb", NBSamples, false);
if( IsParameterEnabled("rand"))
{
GetInternalApplication("select")->SetParameterInt("rand", GetParameterInt("rand"), false);
} else {
//default value
GetInternalApplication("select")->SetParameterInt("rand", 121212, false);
}
// select sample positions
ExecuteInternal("select");
......@@ -235,6 +230,9 @@ void ClassKMeansBase::TrainKMModel(FloatVectorImageType *image,
GetInternalApplication("training")->SetParameterInt("classifier.sharkkm.k",
GetParameterInt("nc"), false);
if( IsParameterEnabled("rand"))
GetInternalApplication("training")->SetParameterInt("rand", GetParameterInt("rand"), false);
GetInternalApplication("training")->SetParameterString("io.out", modelFileName, false);
ExecuteInternal( "training" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment