Commit ac574321 authored by Guillaume Pasero's avatar Guillaume Pasero

BUG: maximum train and validation sizes were not correctly handled

parent 6943826f
...@@ -336,17 +336,20 @@ void DoExecute() ITK_OVERRIDE ...@@ -336,17 +336,20 @@ void DoExecute() ITK_OVERRIDE
// only fmt will be used for both training and validation samples // only fmt will be used for both training and validation samples
// So we try to compute the total number of samples given input // So we try to compute the total number of samples given input
// parameters mt, mv and vtr. // parameters mt, mv and vtr.
if (mt > -1 && mv > -1) if (mt > -1 && vtr < 0.99999)
{
fmt = mt + mv;
}
if (mt > -1 && mv <= -1 && vtr < 0.99999)
{ {
fmt = static_cast<long>((double) mt / (1.0 - vtr)); fmt = static_cast<long>((double) mt / (1.0 - vtr));
} }
if (mt <= -1 && mv > -1 && vtr > 0.00001) if (mv > -1 && vtr > 0.00001)
{ {
fmt = static_cast<long>((double) mv / vtr); if (fmt > -1 )
{
fmt = std::min(fmt, static_cast<long>((double) mv / vtr));
}
else
{
fmt = static_cast<long>((double) mv / vtr);
}
} }
} }
} }
......
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