From 7fbb2b4c48c371d54be37754bf6ac49494e923a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= <cedric.traizet@c-s.fr> Date: Tue, 23 Apr 2019 17:41:09 +0200 Subject: [PATCH] ENH: use float as label type for regression --- .../AppClassification/app/otbTrainVectorRegression.cxx | 4 ++-- .../AppClassification/include/otbTrainVectorBase.hxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Modules/Applications/AppClassification/app/otbTrainVectorRegression.cxx b/Modules/Applications/AppClassification/app/otbTrainVectorRegression.cxx index 91ec818be1..ac784a433a 100644 --- a/Modules/Applications/AppClassification/app/otbTrainVectorRegression.cxx +++ b/Modules/Applications/AppClassification/app/otbTrainVectorRegression.cxx @@ -25,11 +25,11 @@ namespace otb namespace Wrapper { -class TrainVectorRegression : public TrainVectorBase<float, int> +class TrainVectorRegression : public TrainVectorBase<float, float> { public: typedef TrainVectorRegression Self; - typedef TrainVectorBase<float, int> Superclass; + typedef TrainVectorBase<float, float> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Modules/Applications/AppClassification/include/otbTrainVectorBase.hxx b/Modules/Applications/AppClassification/include/otbTrainVectorBase.hxx index 447608d0c5..1ca5375528 100644 --- a/Modules/Applications/AppClassification/include/otbTrainVectorBase.hxx +++ b/Modules/Applications/AppClassification/include/otbTrainVectorBase.hxx @@ -306,9 +306,9 @@ TrainVectorBase<TInputValue, TOutputValue> input->PushBack( mv ); if(cFieldIndex>=0 && ogr::Field(feature,cFieldIndex).HasBeenSet()) - target->PushBack( feature.ogr().GetFieldAsInteger( cFieldIndex ) ); + target->PushBack( feature.ogr().GetFieldAsDouble( cFieldIndex ) ); else - target->PushBack( 0 ); + target->PushBack( 0. ); feature = layer.ogr().GetNextFeature(); goesOn = feature.addr() != 0; -- GitLab