Commit ff6fea99 authored by Ludovic Hussonnois's avatar Ludovic Hussonnois

REFAC: Change TrainVectorBase function name and move DoInit code section

parent 874f73ea
......@@ -52,6 +52,16 @@ public:
protected:
void DoInit()
{
SetName( "TrainVectorClassifier" );
SetDescription( "Train a classifier based on labeled geometries and a list of features to consider." );
SetDocName( "Train Vector Classifier" );
SetDocLongDescription( "This application trains a classifier based on "
"labeled geometries and a list of features to consider for classification." );
SetDocLimitations( " " );
SetDocAuthors( "OTB Team" );
SetDocSeeAlso( " " );
Superclass::DoInit();
}
......
......@@ -173,7 +173,7 @@ protected:
* Otherwise mean is set to 0 and standard deviation to 1 for each Features.
* \param nbFeatures
*/
ShiftScaleParameters ComputeStatistics(unsigned int nbFeatures);
ShiftScaleParameters GetStatistics(unsigned int nbFeatures);
SamplesWithLabel m_TrainingSamplesWithLabel;
SamplesWithLabel m_ClassificationSamplesWithLabel;
......
......@@ -29,16 +29,6 @@ namespace Wrapper
void TrainVectorBase::DoInit()
{
SetName( "TrainVectorClassifier" );
SetDescription( "Train a classifier based on labeled geometries and a list of features to consider." );
SetDocName( "Train Vector Classifier" );
SetDocLongDescription( "This application trains a classifier based on "
"labeled geometries and a list of features to consider for classification." );
SetDocLimitations( " " );
SetDocAuthors( "OTB Team" );
SetDocSeeAlso( " " );
// Common Parameters for all Learning Application
AddParameter( ParameterType_Group, "io", "Input and output data" );
SetParameterDescription( "io", "This group of parameters allows setting input and output data." );
......@@ -149,7 +139,7 @@ void TrainVectorBase::DoExecute()
otbAppLogFATAL( << "No features have been selected to train the classifier on!" );
}
ShiftScaleParameters measurement = ComputeStatistics( m_FeaturesInfo.m_NbFeatures );
ShiftScaleParameters measurement = GetStatistics( m_FeaturesInfo.m_NbFeatures );
ExtractAllSamples( measurement );
this->Train( m_TrainingSamplesWithLabel.listSample, m_TrainingSamplesWithLabel.labeledListSample, GetParameterString( "io.out" ) );
......@@ -202,7 +192,7 @@ TrainVectorBase::ExtractClassificationSamplesWithLabel(const ShiftScaleParameter
TrainVectorBase::ShiftScaleParameters
TrainVectorBase::ComputeStatistics(unsigned int nbFeatures)
TrainVectorBase::GetStatistics(unsigned int nbFeatures)
{
ShiftScaleParameters measurement = ShiftScaleParameters();
if( HasValue( "io.stats" ) && IsParameterEnabled( "io.stats" ) )
......
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