Create unsupervised dataset (from Python code)

Create an unsupervised dataset from Python code and store the result as a pickle file.

Usage:

  1. Open the algorithm from the processing toolbox.

  2. Modify the python script to match your needs, then click run.

    ../../../../_images/cluspython.png
  3. The output classification dataset will be listed under Models in your Data Sources panel.

Parameters

Code [string]

Python code specifying the unsupervised dataset.

Default:

from enmapboxprocessing.typing import Number, List

# specify feature names
features: List[str] = ['Feature 1', 'Feature 2', 'Feature 3']

# specify features X as 2d-array with shape (samples, features)
X: List[List[Number]] = [
    [1, 2, 3],
    [4, 5, 6]
]

Outputs

Output dataset [fileDestination]

Pickle file destination.

Command-line usage

>qgis_process help enmapbox:CreateUnsupervisedDatasetFromPythonCode:

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

code: Code
    Default value:  from enmapboxprocessing.typing import Number, List

# specify feature names
features: List[str] = ['Feature 1', 'Feature 2', 'Feature 3']

# specify features X as 2d-array with shape (samples, features)
X: List[List[Number]] = [
    [1, 2, 3],
    [4, 5, 6]
]

    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
outputUnsupervisedDataset: Output dataset
    Argument type:  fileDestination
    Acceptable values:
            - Path for new file

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

outputUnsupervisedDataset: <outputFile>
    Output dataset