Skip to content
Snippets Groups Projects
Commit 95be5429 authored by Manuel Grizonnet's avatar Manuel Grizonnet
Browse files

BUG: clear temporary validation filename when validation ratio is set to 0

parent 9bff5f85
No related branches found
No related tags found
No related merge requests found
...@@ -118,19 +118,20 @@ public: ...@@ -118,19 +118,20 @@ public:
ComputePolygonStatistics( imageList, validationVectorFileList, fileNames.polyStatValidOutputs ); ComputePolygonStatistics( imageList, validationVectorFileList, fileNames.polyStatValidOutputs );
ComputeSamplingRate( fileNames.polyStatValidOutputs, fileNames.rateValidOut, rates.fmv ); ComputeSamplingRate( fileNames.polyStatValidOutputs, fileNames.rateValidOut, rates.fmv );
SelectAndExtractValidationSamples( fileNames, imageList, validationVectorFileList ); SelectAndExtractValidationSamples( fileNames, imageList, validationVectorFileList );
// if( HasInputVector ) // if input vector is provided the sampleTrainOutputs is the previously extracted sampleOutputs
fileNames.sampleTrainOutputs = fileNames.sampleOutputs; fileNames.sampleTrainOutputs = fileNames.sampleOutputs;
} }
else if(GetParameterFloat("sample.vtr") != 0.0)// Split training data to validation else if(GetParameterFloat("sample.vtr") != 0.0)// Split training data to validation
{ {
// if( !HasInputVector ) // Compute one class statistics and sampling rate for the generated vector.
// ComputePolygonStatistics( imageList, fileNames.sampleOutputs, fileNames.polyStatTrainOutputs );
// ComputeSamplingRate( fileNames.polyStatTrainOutputs, fileNames.rateTrainOut, rates.fmt );
SplitTrainingToValidationSamples( fileNames, imageList ); SplitTrainingToValidationSamples( fileNames, imageList );
} }
else // nothing to do, except update fileNames else // Update sampleTrainOutputs and clear sampleValidOutputs
{ {
fileNames.sampleTrainOutputs = fileNames.sampleOutputs; fileNames.sampleTrainOutputs = fileNames.sampleOutputs;
// Corner case where no dedicated validation set is provided and split ratio is set to 0 (all samples for training)
// In this case SampleValidOutputs should be cleared
fileNames.sampleValidOutputs.clear();
} }
} }
......
...@@ -234,7 +234,6 @@ protected: ...@@ -234,7 +234,6 @@ protected:
sampleTrainOutputs.push_back( outModel + "_samplesTrain_" + strIndex + ".shp" ); sampleTrainOutputs.push_back( outModel + "_samplesTrain_" + strIndex + ".shp" );
sampleValidOutputs.push_back( outModel + "_samplesValid_" + strIndex + ".shp" ); sampleValidOutputs.push_back( outModel + "_samplesValid_" + strIndex + ".shp" );
} }
} }
void clear() void clear()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment