diff --git a/Data/Baseline/OTB-Applications/Files/apTvClDTVectorRegression.dbf b/Data/Baseline/OTB-Applications/Files/apTvClDTVectorRegression.dbf new file mode 100644 index 0000000000000000000000000000000000000000..c4e492c38298593c82f29b64ec345ab3229e04de --- /dev/null +++ b/Data/Baseline/OTB-Applications/Files/apTvClDTVectorRegression.dbf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:912188a42bffa8bd35328354cf2a53006298283885ceb1889b4822a8c21c2f9b +size 343940 diff --git a/Data/Baseline/OTB-Applications/Files/apTvClDTVectorRegression.prj b/Data/Baseline/OTB-Applications/Files/apTvClDTVectorRegression.prj new file mode 100644 index 0000000000000000000000000000000000000000..da98376fa44ea626ab3c6ca1debe4660482e548b --- /dev/null +++ b/Data/Baseline/OTB-Applications/Files/apTvClDTVectorRegression.prj @@ -0,0 +1 @@ +PROJCS["WGS_1984_UTM_Zone_31N",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["Meter",1]] \ No newline at end of file diff --git a/Data/Baseline/OTB-Applications/Files/apTvClDTVectorRegression.shp b/Data/Baseline/OTB-Applications/Files/apTvClDTVectorRegression.shp new file mode 100644 index 0000000000000000000000000000000000000000..bb850bca2f977f9a7d80c3e8a2b5003ffc3ae822 --- /dev/null +++ b/Data/Baseline/OTB-Applications/Files/apTvClDTVectorRegression.shp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5f17b630a4b9a681d571f6075373d9937f4ae4b31cd158d9cec1efb9804938d +size 33280 diff --git a/Data/Baseline/OTB-Applications/Files/apTvClDTVectorRegression.shx b/Data/Baseline/OTB-Applications/Files/apTvClDTVectorRegression.shx new file mode 100644 index 0000000000000000000000000000000000000000..49a9782c4706a20891ee09a336b7c23dca2ed65b --- /dev/null +++ b/Data/Baseline/OTB-Applications/Files/apTvClDTVectorRegression.shx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:51449568ded65b75b2b1e85c82b73091d20bc87b281294bede45521c78af6bb2 +size 9580 diff --git a/Data/Baseline/OTB-Applications/Files/apTvClModelRegression.dt b/Data/Baseline/OTB-Applications/Files/apTvClModelRegression.dt new file mode 100644 index 0000000000000000000000000000000000000000..79128526d96956901b8ea56188952df62ab33bce --- /dev/null +++ b/Data/Baseline/OTB-Applications/Files/apTvClModelRegression.dt @@ -0,0 +1,97 @@ +%YAML:1.0 +my_tree: !!opencv-ml-tree + is_classifier: 0 + var_all: 4 + var_count: 4 + ord_var_count: 4 + cat_var_count: 0 + training_params: + use_surrogates: 1 + regression_accuracy: 9.9999997764825821e-03 + max_depth: 25 + min_sample_count: 10 + cross_validation_folds: 10 + use_1se_rule: 1 + truncate_pruned_tree: 1 + var_type: [ 0, 0, 0, 0 ] + best_tree_idx: 0 + nodes: + - + depth: 0 + sample_count: 1185 + value: 2.1434599156118144e+00 + Tn: 3 + complexity: 2 + alpha: 1.0428486268774041e+03 + node_risk: 1.3156118143459917e+03 + tree_risk: 1.5363497199794813e+02 + tree_error: 2.2322315115631071e+01 + splits: + - { var:3, quality:6.5841166992187500e+03, + le:2.3381726074218750e+02 } + - + depth: 1 + sample_count: 593 + value: 1.1635750421585160e+00 + Tn: 2 + complexity: 1 + alpha: 7.2124429620364594e+01 + node_risk: 8.9133220910623891e+01 + tree_risk: 7.4075046904315172e+01 + tree_error: 1.5094741436662460e+01 + splits: + - { var:3, quality:8.8817205810546875e+02, + le:1.6510346984863281e+02 } + - + depth: 2 + sample_count: 500 + value: 1. + Tn: 2147483647 + complexity: 1 + alpha: 0. + node_risk: 0. + tree_risk: 0. + tree_error: 0. + - + depth: 2 + sample_count: 93 + value: 2.0430107526881720e+00 + Tn: 0 + complexity: 1 + alpha: 1.9506172839505780e+00 + node_risk: 3.8279569892472978e+00 + tree_risk: 1.9506172839505780e+00 + tree_error: 1.9085505258344853e+00 + - + depth: 1 + sample_count: 592 + value: 3.1250000000000000e+00 + Tn: 1 + complexity: 1 + alpha: 7.0738339190549596e+01 + node_risk: 8.6750000000000000e+01 + tree_risk: 7.9559925093632955e+01 + tree_error: 7.2275736789686107e+00 + splits: + - { var:1, quality:5.8572387695312500e+03, + le:3.6126699829101562e+02 } + - + depth: 2 + sample_count: 507 + value: 2.9783037475345169e+00 + Tn: 2147483647 + complexity: 1 + alpha: 0. + node_risk: 1.0761341222879309e+01 + tree_risk: 8.8215859030833599e+00 + tree_error: 1.9415329232083423e+00 + - + depth: 2 + sample_count: 85 + value: 4. + Tn: 2147483647 + complexity: 1 + alpha: 0. + node_risk: 0. + tree_risk: 0. + tree_error: 0. diff --git a/Modules/Applications/AppClassification/include/otbVectorPrediction.hxx b/Modules/Applications/AppClassification/include/otbVectorPrediction.hxx index 04510eabd950aa3c79ad3e6d7982a1dd338870b2..f6edbf2a360f92fa516119f8e7995b614530a4f6 100644 --- a/Modules/Applications/AppClassification/include/otbVectorPrediction.hxx +++ b/Modules/Applications/AppClassification/include/otbVectorPrediction.hxx @@ -21,6 +21,8 @@ #ifndef otbVectorPrediction_hxx #define otbVectorPrediction_hxx +#include "otbVectorPrediction.h" + namespace otb { namespace Wrapper diff --git a/Modules/Applications/AppClassification/test/CMakeLists.txt b/Modules/Applications/AppClassification/test/CMakeLists.txt index 607867c1936a594cbdbe1ed3ff8fdb382efb529e..5bc7d22f24cd23690f5c13a3b9461bab2583d2d0 100644 --- a/Modules/Applications/AppClassification/test/CMakeLists.txt +++ b/Modules/Applications/AppClassification/test/CMakeLists.txt @@ -721,6 +721,20 @@ if(OTB_USE_OPENCV) ${TEMP}/apTvClSVMLabeledVector.shp) endif() +#----------- VectorRegression TESTS ---------------- +if(OTB_USE_OPENCV) + otb_test_application(NAME apTvClDTVectorRegression + APP VectorRegression + OPTIONS -in ${INPUTDATA}/Classification/apTvClSampleExtractionOut.sqlite + -model ${OTBAPP_BASELINE_FILES}/apTvClModelRegression.dt + -out ${TEMP}/apTvClDTVectorRegression.shp + -feat value_0 value_1 value_2 value_3 + -cfield predicted + VALID --compare-ogr 0.0 + ${OTBAPP_BASELINE_FILES}/apTvClDTVectorRegression.shp + ${TEMP}/apTvClDTVectorRegression.shp) +endif() + #----------- ComputeImagesStatistics TESTS ---------------- otb_test_application(NAME apTvClComputeImagesStatisticsQB1 APP ComputeImagesStatistics