diff --git a/Modules/Applications/AppClassification/include/otbTrainSharkKMeans.hxx b/Modules/Applications/AppClassification/include/otbTrainSharkKMeans.hxx index 12641430e54f77625d5912e2d6da7b1f84082f7b..f703503935223509a16118c643c0d523b7dbed27 100644 --- a/Modules/Applications/AppClassification/include/otbTrainSharkKMeans.hxx +++ b/Modules/Applications/AppClassification/include/otbTrainSharkKMeans.hxx @@ -23,6 +23,7 @@ #include "otbLearningApplicationBase.h" #include "otbSharkKMeansMachineLearningModel.h" #include "otbStatisticsXMLFileReader.h" +#include "shark/Models/Normalizer.h" namespace otb { diff --git a/Modules/Learning/Unsupervised/include/otbSharkKMeansMachineLearningModel.h b/Modules/Learning/Unsupervised/include/otbSharkKMeansMachineLearningModel.h index d42e7481948d9b6a8f253604ddf9e7b1a97e206f..4c877a5d50e4d703f8018f8819af3459d0141a04 100644 --- a/Modules/Learning/Unsupervised/include/otbSharkKMeansMachineLearningModel.h +++ b/Modules/Learning/Unsupervised/include/otbSharkKMeansMachineLearningModel.h @@ -48,7 +48,6 @@ #include "shark/Models/Clustering/Centroids.h" #include "shark/Models/Clustering/ClusteringModel.h" #include "shark/Algorithms/KMeans.h" -#include "shark/Algorithms/Trainers/NormalizeComponentsUnitVariance.h" #if defined(__GNUC__) || defined(__clang__) #pragma GCC diagnostic pop @@ -146,9 +145,6 @@ protected: virtual void DoPredictBatch(const InputListSampleType *, const unsigned int &startIndex, const unsigned int &size, TargetListSampleType *, ConfidenceListSampleType * = nullptr, ProbaListSampleType * = nullptr) const override; - template<typename DataType> - shark::Normalizer<> TrainNormalizer(const DataType &data) const; - /** PrintSelf method */ void PrintSelf(std::ostream &os, itk::Indent indent) const override; diff --git a/Modules/Learning/Unsupervised/include/otbSharkKMeansMachineLearningModel.hxx b/Modules/Learning/Unsupervised/include/otbSharkKMeansMachineLearningModel.hxx index ff95c9501a271cbbdd51b63134428f8b00302ea6..f4b69b45927efad0f51b0c5d00b75165177a0938 100644 --- a/Modules/Learning/Unsupervised/include/otbSharkKMeansMachineLearningModel.hxx +++ b/Modules/Learning/Unsupervised/include/otbSharkKMeansMachineLearningModel.hxx @@ -35,7 +35,6 @@ #include "otb_shark.h" #include "otbSharkUtils.h" -#include "shark/Algorithms/Trainers/NormalizeComponentsUnitVariance.h" //normalize #include "shark/Algorithms/KMeans.h" //k-means algorithm #include "shark/Models/Clustering/HardClusteringModel.h" #include "shark/Models/Clustering/SoftClusteringModel.h" @@ -82,18 +81,6 @@ SharkKMeansMachineLearningModel<TInputValue, TOutputValue> m_ClusteringModel = boost::make_shared<ClusteringModelType>( &m_Centroids ); } -template<class TInputValue, class TOutputValue> -template<typename DataType> -shark::Normalizer<> -SharkKMeansMachineLearningModel<TInputValue, TOutputValue> -::TrainNormalizer(const DataType &data) const -{ - shark::Normalizer<> normalizer; - shark::NormalizeComponentsUnitVariance<> normalizingTrainer( true );//zero mean - normalizingTrainer.train( normalizer, data ); - return normalizer; -} - template<class TInputValue, class TOutputValue> typename SharkKMeansMachineLearningModel<TInputValue, TOutputValue> ::TargetSampleType