Classification workflow

The classification workflow combines classifier fitting, map prediction and accuracy assessment.

Usage:

  1. Start the algorithm from the Processing Toolbox panel.

  2. Select a training dataset or create one by clicking the processing algorithm icon and choosing one of the options.

    ../../../../_images/class_workflow_interface_1.png
  3. Select a classifier from the drop down menu and adjust its parameters if needed.

    ../../../../_images/class_workflow_interface_2.png
  4. Select the raster to process and click run.

    ../../../../_images/class_workflow_interface_3.png

Live Demonstration:


Parameters

Training dataset [file]

Training dataset pickle file used for fitting the classifier.

Classifier [string]

Scikit-Learn Python code specifying a classifier.

Raster layer with features [raster]

A raster layer used for prediction.

Match classifier features and raster bands by name [boolean]

Whether to match raster bands and classifier features by name. Default: False

Number of cross-validation folds [number]

The number of folds (n>=2) used for assessing cross-validation performance. If not specified, simple training performance is assessed. If set to a value of 1, out-of-bag (OOB) performance is assessed. Note that OOB estimates are only supported by some classifiers, e.g. the Random Forest Classifier. Default: 10

Open output report in webbrowser after running algorithm [boolean]

Whether to open the output report in the web browser. Default: True

Outputs

Output classifier [fileDestination]

Pickle file destination.

Output classification layer [rasterDestination]

Raster file destination.

Output class probability layer [rasterDestination]

Raster file destination.

Output classifier performance report [fileDestination]

Report file destination.

Output classification accuracy and area report [fileDestination]

Report file destination.

Command-line usage

>qgis_process help enmapbox:classificationworkflow:

----------------
Arguments
----------------

dataset: Training dataset
    Argument type:    file
    Acceptable values:
        - Path to a file
classifier: Classifier
    Argument type:    string
    Acceptable values:
        - String value
        - field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field
        - expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression
raster: Raster layer with features (optional)
    Argument type:    raster
    Acceptable values:
        - Path to a raster layer
matchByName: Match classifier features and raster bands by name (optional)
    Default value:    false
    Argument type:    boolean
    Acceptable values:
        - 1 for true/yes
        - 0 for false/no
        - field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field
        - expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression
nfold: Number of cross-validation folds (optional)
    Default value:    10
    Argument type:    number
    Acceptable values:
        - A numeric value
        - field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field
        - expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression
openReport: Open output report in webbrowser after running algorithm (optional)
    Default value:    true
    Argument type:    boolean
    Acceptable values:
        - 1 for true/yes
        - 0 for false/no
        - field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field
        - expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression
outputClassifier: Output classifier
    Argument type:    fileDestination
    Acceptable values:
        - Path for new file
outputClassification: Output classification layer (optional)
    Argument type:    rasterDestination
    Acceptable values:
        - Path for new raster layer
outputProbability: Output class probability layer (optional)
    Argument type:    rasterDestination
    Acceptable values:
        - Path for new raster layer
outputClassifierPerformance: Output classifier performance report (optional)
    Argument type:    fileDestination
    Acceptable values:
        - Path for new file
outputClassificationAccuracy: Output classification accuracy and area report (optional)
    Argument type:    fileDestination
    Acceptable values:
        - Path for new file

----------------
Outputs
----------------

outputClassifier: <outputFile>
    Output classifier
outputClassification: <outputRaster>
    Output classification layer
outputProbability: <outputRaster>
    Output class probability layer
outputClassifierPerformance: <outputHtml>
    Output classifier performance report
outputClassificationAccuracy: <outputHtml>
    Output classification accuracy and area report