VectorDimensionalityReduction¶
Performs dimensionality reduction of the input vector data according to a model file.
Description¶
This application performs a vector data dimensionality reduction based on a model file produced by the TrainDimensionalityReduction application.
Parameters¶
Name of the input vector data -in vectorfile
Mandatory
The input vector data to reduce.
Statistics file -instat filename [dtype]
An XML file containing mean and standard deviation to center and reduce samples before dimensionality reduction (produced by ComputeImagesStatistics application).
Model file -model filename [dtype]
Mandatory
A model file (produced by the TrainDimensionalityReduction application,
Output vector data file containing the reduced vector -out filename [dtype]
Output vector data file storing sample values (OGR format). If not given, the input vector data file is used. In overwrite mode, the original features will be lost.
Input features to use for reduction -feat string1 string2...
List of field names in the input vector data used as features for reduction.
Output feature -featout [prefix|list]
Default value: prefix
Naming of output features
Prefix
Use a name prefixList
Use a list with all names
Prefix options¶
Feature name prefix -featout.prefix.name string
Default value: reduced_
Name prefix for output features. This prefix is followed by the numeric index of each output feature.
List options¶
Feature name list -featout.list.names string1 string2...
Mandatory
List of field names for the output features which result from the reduction.
Principal component dimension -pcadim int
This optional parameter can be set to reduce the number of eignevectors used in the PCA model file. This parameter can’t be used for other models
Writing mode -mode [overwrite|update]
Default value: overwrite
This parameter determines if the output file is overwritten or updated [overwrite/update]. If an output file name is given, the original file is copied before creating the new features.
Overwrite
Overwrite modeUpdate
Update mode
Examples¶
From the command-line:
otbcli_VectorDimensionalityReduction -in vectorData.shp -instat meanVar.xml -model model.txt -out vectorDataOut.shp -feat perimeter area width
From Python:
import otbApplication
app = otbApplication.Registry.CreateApplication("VectorDimensionalityReduction")
app.SetParameterString("in", "vectorData.shp")
app.SetParameterString("instat", "meanVar.xml")
app.SetParameterString("model", "model.txt")
app.SetParameterString("out", "vectorDataOut.shp")
app.SetParameterStringList("feat", ['perimeter', 'area', 'width'])
app.ExecuteAndWriteOutput()