VectorDimensionalityReduction¶
根据模型文件对输入的矢量数据进行降维。
描述¶
此应用程序基于由 TrainDimensionalityReduction 申请。
参数¶
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 prefix - List
Use a list with all names
前缀选项¶
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.
列出选项¶
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 mode - Update
Update mode
实例¶
从命令行执行以下操作:
otbcli_VectorDimensionalityReduction -in vectorData.shp -instat meanVar.xml -model model.txt -out vectorDataOut.shp -feat perimeter area width
来自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()