Hi Cedric,

what you point here is more a current limitation of the
TrainImagesClassifier.

The point is that the TrainImagesClassifier is now a composite application
which pipe all sampling applications which allow a good control over sample
selection but also follow a sampling strategy which was previously
implemented in the application which was not very fliexible (we keep it for
now to avoid to change the application interface).

The strategy by default works well (bound the number of samples the minimum
class) but changing the default strategy does not offer for now the same
control and flexibility as using and chain all sampling applications.

So I would suggest in your case if you want a better control on the way you
select samples to use each sampling application. You can follow this recipe
in the cookbook:

https://www.orfeo-toolbox.org/CookBook/recipes/pbclassif.html#samples-statistics-estimation

You'll be able to do what you want (use a fix number of samples per class
for instance).

What you point also is that we should perhaps make some changes to the
TrainImagesClassifier and expose all the sampling strategies and offer the
flexibility of these applications in a "all in one" application. It would
indeed require to change the interface.

Hope it helps.

Manuel



2017-05-23 12:55 GMT+02:00 CedricL <[email protected]>:

> Hello,
>
> I think it's the same for otb 5.10, but in OTB 5.10.1 I found probably a
> bug in otbcli_TrainImagesClassifier
>
> Indeed even if I say use maximum sampling to 100 it take tha maximum
> available point as shown in the output.
>
> Is it really a bug and if yes what should be the best way to bypass the
> bug ?
>
> Best regards
>
>
> clardeux@clardeux-G551JK:~$ otbcli_TrainImagesClassifier -io.il
> /media/clardeux/CL/livre_QGIS/CotriTSDeforestatioTest/Test2/
> Ewma/S1A_IW_GRDH_1SDV_20151020T093238_20151020T093303_008234_00B979_
> 26C9/S1A_IW_GRDH_1SDV_20151020T093238_20151020T093303_008234_00B979_
> 26C9__Clip_Sig0_Ortho_Clip_SpkLee_W5_NL5_TimeFiltering_
> W7_dB_Clip_EWMA0VVdB_VHdB_HVdB-VVdB.vrt -io.imstat
> /media/clardeux/CL/livre_QGIS/CotriTSDeforestatioTest/Test2/
> OutDeforestation/Probability/S1A_IW_GRDH_1SDV_20151020T093238_
> 20151020T093303_008234_00B979_26C9__Clip_Sig0_Ortho_Clip_
> SpkLee_W5_NL5_TimeFiltering_W7_dB_Clip_EWMA0VVdB_VHdB_HVdB-VVdB_STATS.xml
> -io.out /media/clardeux/CL/livre_QGIS/CotriTSDeforestatioTest/mod.txt -
> sample.mt 100 -sample.mv 100 -sample.bm 1000 -sample.vfn classid
> -classifier rf  -classifier.rf.max 25 -classifier.rf.min 25 -ram 500 -io.vd
> /media/clardeux/CL/livre_QGIS/CotriTSDeforestatioTest/RoiFNFV2.shp
>
>
> 2017 May 23 12:51:13  :  Application.logger  (INFO) Polygon analysis...
> Analyse polygons...: 100% [**************************************************]
> (0.006 seconds)
> 2017 May 23 12:51:13  :  Application.logger  (INFO)
> 2017 May 23 12:51:13  :  Application.logger  (INFO) Elevation management:
> setting default height above ellipsoid to 0 meters
> 2017 May 23 12:51:13  :  Application.logger  (INFO) Reprojecting input
> vectors...
>
> 2017 May 23 12:51:13  :  Application.logger  (INFO) Sampling rates...
> 2017 May 23 12:51:13  :  Application.logger  (INFO)
> 2017 May 23 12:51:13  :  Application.logger  (INFO) Sampling strategy :
> fit the number of samples based on the smallest class
> 2017 May 23 12:51:13  :  Application.logger  (INFO) Sampling rates for
> image 1 :  className  requiredSamples  totalSamples  rate
> 1    31985    100794    0.31733
> 2    31985    31985    1
>
>
> 2017 May 23 12:51:13  :  Application.logger  (INFO) Sample selection...
> Selecting positions with periodic sampler...: 100%
> [**************************************************] (0.2 seconds)
> 2017 May 23 12:51:14  :  Application.logger  (INFO)
> 2017 May 23 12:51:13  :  Application.logger  (INFO) Elevation management:
> setting default height above ellipsoid to 0 meters
> 2017 May 23 12:51:13  :  Application.logger  (INFO) Sampling strategy :
> set number of samples for each class
> 2017 May 23 12:51:13  :  Application.logger  (INFO) Sampling rates :
> className  requiredSamples  totalSamples  rate
> 1    31985    100794    0.31733
> 2    31985    31985    1
>
> 2017 May 23 12:51:13  :  Application.logger  (INFO) Reprojecting input
> vectors...
>
> 2017 May 23 12:51:14  :  Application.logger  (INFO) Sample extraction...
> Extracting sample values...: 100% 
> [**************************************************]
> (0.9 seconds)
> Split samples between training and validation...: 100%
> [**************************************************] (0.7 seconds)
> 2017 May 23 12:51:16  :  Application.logger  (INFO) Model training...
> Training model...: 100% [**************************************************]
> (3 seconds)
> WARNING: In 
> /work/otb/OTB/Modules/Learning/Supervised/include/otbMachineLearningModel.txx,
> line 68
> RandomForestsMachineLearningModel (0x564c6f5db880): 
> MachineLearningModel::PredictAll()
> has been DEPRECATED. Use MachineLearningModel::PredictBatch() instead.
>
> Classify...: 100% [**************************************************] (2
> seconds)
> 2017 May 23 12:51:21  :  Application.logger  (INFO)
> 2017 May 23 12:51:16  :  Application.logger  (INFO) Reading input vector
> file 1/1
> 2017 May 23 12:51:19  :  Application.logger  (INFO) Reading validation
> vector file 1/1
> 2017 May 23 12:51:21  :  Application.logger  (INFO) Predicted list size :
> 31984
> 2017 May 23 12:51:21  :  Application.logger  (INFO)
> ValidationLabeledListSample size : 31984
> 2017 May 23 12:51:21  :  Application.logger  (INFO) training performances
> 2017 May 23 12:51:21  :  Application.logger  (INFO) Confusion matrix (rows
> = reference labels, columns = produced labels):
>       [1] [2]
> [  1] 15487   505
> [  2]  1327 14665
>
> --
> --
> Check the OTB FAQ at
> http://www.orfeo-toolbox.org/FAQ.html
>
> You received this message because you are subscribed to the Google
> Groups "otb-users" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/otb-users?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "otb-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Manuel Grizonnet

-- 
-- 
Check the OTB FAQ at
http://www.orfeo-toolbox.org/FAQ.html

You received this message because you are subscribed to the Google
Groups "otb-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/otb-users?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"otb-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to