Discussion about regression
Recent discussions have focused on the addition of regression in iota2.
Issue #79 has been open for a long time with several leads, from OTB to scikit learn.
In order to best target the work to be done and guide design choices, this document has been written. Source as org file is available for edits.
Beyond the addition of the regression, this issue may be an opportunity to refactor certain parts of the code.
OTB pure solution
In OTB current version all the tools needed to perform regressions are available. Four main applications:
- VectorRegression, TrainVectorRegression for processing vector files.
- ImageRegression, TrainImageRegression to process raster.
These applications require the same parameters as their classification equivalents.
They also accept a statistics file that allows the normalization of sample values before regression learning and during prediction.
A fast implementation could be achieved, using only OTB applications. Looking at the attached document, the modifications are minor, the main part of the work to be done being the validation part.
In a pure OTB case, regression would be a parameter to differentiate regression and classification. This parameter would be used here to replace the learning of a classifier by the learning of regression. And here for the prediction part.
The use of statistics for normalize samples is already operational.
As stated in the document, carrying out the validation is an open question, on how to do it, when to do it and from which data (final map or previously extracted validation samples).
Most complete solution
As explained in #79, scikit learn proposes several tools for regression. Now, iota2 has the tools for scale large data sets to scikit learn in-memory constraint. Then, it is possible to add parameters for achieves regression using scikit learn, by adding configuration file parameters and adding scikit regression to ML lib.
The most interesting features in scikit learn is about the standardization of predicted values (cf #79).
Expected features
Produce regression on zonal statistics:
This can be achieved by extracting all the pixel intersecting the reference data file. By using the unique ID, it is possible to compute the zonal statistics. This solution works only if the result expected is a regression for the provided polygon.
The OBIA approach [#185 (closed)] could work using a vector file (like RPG) as input segmentation. By this way, adding regression tools from OTB will be as fast as for the pixel regression.
About metrics:
Scikit-learn proposes some metrics. Which one between them should be added:
-
Explained variance score -
Max Error -
Mean Absolute Error -
Mean Squared Error -
Mean squared logarithmic error -
Mean absolute percentage error -
Median absolute error -
R² score, the coefficient of determination
Also between them, which ones must appears in the final report. This metrics should be computed by regions ? Or all tiles in a same time ?