VectorDimensionalityReduction - Vector Dimensionality Reduction ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Performs dimensionality reduction of the input vector data according to a model file. Detailed description -------------------- This application performs a vector data dimensionality reduction based on a model file produced by the TrainDimensionalityReduction application. Parameters ---------- This section describes in details the parameters available for this application. Table [#]_ presents a summary of these parameters and the parameters keys to be used in command-line and programming languages. Application key is *VectorDimensionalityReduction* . .. [#] Table: Parameters table for Vector Dimensionality Reduction. +-------------------+-----------------------------------------------------+--------------------------+ |Parameter Key |Parameter Name |Parameter Type | +===================+=====================================================+==========================+ |in |Name of the input vector data |Input vector data | +-------------------+-----------------------------------------------------+--------------------------+ |instat |Statistics file |Input File name | +-------------------+-----------------------------------------------------+--------------------------+ |model |Model file |Input File name | +-------------------+-----------------------------------------------------+--------------------------+ |out |Output vector data file containing the reduced vector|Output File name | +-------------------+-----------------------------------------------------+--------------------------+ |feat |Input features to use for reduction. |List | +-------------------+-----------------------------------------------------+--------------------------+ |featout |Output feature |Choices | +-------------------+-----------------------------------------------------+--------------------------+ |featout prefix |Prefix | *Choice* | +-------------------+-----------------------------------------------------+--------------------------+ |featout list |List | *Choice* | +-------------------+-----------------------------------------------------+--------------------------+ |featout.prefix.name|Feature name prefix |String | +-------------------+-----------------------------------------------------+--------------------------+ |featout.list.names |Feature name list |String list | +-------------------+-----------------------------------------------------+--------------------------+ |pcadim |Principal component dimension |Int | +-------------------+-----------------------------------------------------+--------------------------+ |mode |Writing mode |Choices | +-------------------+-----------------------------------------------------+--------------------------+ |mode overwrite |Overwrite | *Choice* | +-------------------+-----------------------------------------------------+--------------------------+ |mode update |Update | *Choice* | +-------------------+-----------------------------------------------------+--------------------------+ |inxml |Load otb application from xml file |XML input parameters file | +-------------------+-----------------------------------------------------+--------------------------+ |outxml |Save otb application to xml file |XML output parameters file| +-------------------+-----------------------------------------------------+--------------------------+ **Name of the input vector data**: The input vector data to reduce. **Statistics file**: A XML file containing mean and standard deviation to center and reduce samples before dimensionality reduction (produced by ComputeImagesStatistics application). **Model file**: A model file (produced by the TrainDimensionalityReduction application,. **Output vector data file containing the reduced vector**: 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.**: List of field names in the input vector data used as features for reduction. **Output feature**: Naming of output features. Available choices are: - **Prefix**: Use a name prefix. * **Feature name prefix**: Name prefix for output features. This prefix is followed by the numeric index of each output feature. - **List**: Use a list with all names. * **Feature name list**: List of field names for the output features which result from the reduction. **Principal component dimension**: 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**: 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. Available choices are: - **Overwrite**: Overwrite mode. - **Update**: Update mode. **Load otb application from xml file**: Load otb application from xml file. **Save otb application to xml file**: Save otb application to xml file. Example ------- To run this example in command-line, use the following: :: otbcli_VectorDimensionalityReduction -in vectorData.shp -instat meanVar.xml -model model.txt -out vectorDataOut.shp -feat perimeter area width To run this example from Python, use the following code snippet: :: #!/usr/bin/python # Import the otb applications package import otbApplication # The following line creates an instance of the VectorDimensionalityReduction application VectorDimensionalityReduction = otbApplication.Registry.CreateApplication("VectorDimensionalityReduction") # The following lines set all the application parameters: VectorDimensionalityReduction.SetParameterString("in", "vectorData.shp") VectorDimensionalityReduction.SetParameterString("instat", "meanVar.xml") VectorDimensionalityReduction.SetParameterString("model", "model.txt") VectorDimensionalityReduction.SetParameterString("out", "vectorDataOut.shp") # The following line execute the application VectorDimensionalityReduction.ExecuteAndWriteOutput() Limitations ~~~~~~~~~~~ None Authors ~~~~~~~ This application has been written by OTB-Team. See Also ~~~~~~~~ These additional resources can be useful for further information: | TrainDimensionalityReduction