Request for Changes-88: Contingency Table

From OTBWiki
Jump to: navigation, search

[Request for Changes - 88] Contingency Table

Status

  • Author: Ludovic Hussonnois
  • Submitted on 13.03.2017
  • Proposed target release 6.0
  • Contingency Table
  • Status: merged

Summary

Add a contingency table calculator for unsupervised classification.

Rationale

Since unsupervised classifier are introduce, contingency table provide an alternative to confusion matrix which give some information about classification results with a validation dataset.

Implementation details

Classes and files

Add a new contingency table calculator which simply count class occurrences for two samples set. Compute() function take iterators and can compute contingency table for image or listSample iterators.

A       Modules/Learning/Unsupervised/include/otbContingencyTable.h
A       Modules/Learning/Unsupervised/include/otbContingencyTableCalculator.h
A       Modules/Learning/Unsupervised/include/otbContingencyTableCalculator.txx

Applications

otbTrainVectorClassification and ComputeConfusionMatrix applications are updated.


otbTrainVectorClassifier:

  • It has been extended to provide the contingency table if the selected classifier is unsupervised.
  • io.confmatout now output csv contingency table if classifier is unsupervised.

otbComputeConfusionMatrix:

  • The output (contingency table or confusion matrix) can be selected with an option (-format confusionmatrix / contingencytable).
  • The confusion matrix is the default output and acts as before without changes. Otherwise the contingency table is output.

The difference is that for the same inputs, output can differs since label named is ignored (no matching of identical labels) for the contingency table.

M       Modules/Applications/AppClassification/app/otbComputeConfusionMatrix.cxx
M       Modules/Applications/AppClassification/app/otbTrainVectorClassification.cxx

Tests

Added new tests for contingency table calculator.

M       Modules/Applications/AppClassification/test/CMakeLists.txt
M       Modules/Learning/Unsupervised/test/CMakeLists.txt
A       Modules/Learning/Unsupervised/test/otbContingencyTableCalculatorTest.cxx
M       Modules/Learning/Unsupervised/test/otbUnsupervisedTestDriver.cxx