Create regression dataset (from Python code)
Create a regression dataset from Python code and store the result as a pickle file.
Parameters
- Code [string]
Python code specifying the regression dataset.
Default:
from enmapboxprocessing.typing import Number, List, Target, RegressorDump # specify targets and feature names targets: List[Target] = [ Target(name='variable 1', color='#ff0000'), Target(name='variable 2', color='#00ff00') ] 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] ] # specify targets y as 2d-array with shape (samples, targets) y: List[List[float]] = [ [1.1, 1.2], [2.1, 2.2] ]
Outputs
- Output dataset [fileDestination]
Pickle file destination.
Command-line usage
>qgis_process help enmapbox:CreateRegressionDatasetFromPythonCode
:
----------------
Arguments
----------------
code: Code
Default value: from enmapboxprocessing.typing import Number, List, Target, RegressorDump
# specify targets and feature names
targets: List[Target] = [
Target(name='variable 1', color='#ff0000'),
Target(name='variable 2', color='#00ff00')
]
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]
]
# specify targets y as 2d-array with shape (samples, targets)
y: List[List[float]] = [
[1.1, 1.2], [2.1, 2.2]
]
Argument type: string
Acceptable values:
- String value
outputRegressionDataset: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputRegressionDataset: <outputFile>
Output dataset