| pktools 2.6.7 Processing Kernel for geospatial data

pkoptsvm

program to optimize parameters for support vector machine classifier pksvm

## SYNOPSIS

`Usage: pkoptsvm -t training`

``

`Options: [-cc startvalue -cc endvalue] [-g startvalue -g endvalue] [-stepcc stepsize] [-stepg stepsize]`

`Advanced options:`

# Description

The support vector machine depends on several parameters. Ideally, these parameters should be optimized for each classification problem. In case of a radial basis kernel function, two important parameters are {cost} and {gamma}. The utility pkoptsvm can optimize these two parameters, based on an accuracy assessment (the Kappa value). If an input test set (-i) is provided, it is used for the accuracy assessment. If not, the accuracy assessment is based on a cross validation (-cv) of the training sample.

The optimization routine uses a grid search. The initial and final values of the parameters can be set with -cc startvalue -cc endvalue and -g startvalue -g endvalue for cost and gamma respectively. The search uses a multiplicative step for iterating the parameters (set with the options -stepcc and -stepg). An often used approach is to define a relatively large multiplicative step first (e.g 10) to obtain an initial estimate for both parameters. The estimate can then be optimized by defining a smaller step (>1) with constrained start and end values for the parameters cost and gamma.

# Options

- use either `-short` or `--long` options (both `--long=value` and `--long value` are supported)
- short option `-h` shows basic options only, long option `--help` shows all options

  short | long | type | default | description
  --- | --- | --- | --- | ---
  t | training | std::string |  | training vector file. A single vector file contains all training features (must be set as: b0, b1, b2,...) for all classes (class numbers identified by label option).
  cc | ccost | float | 1 | min and max boundaries the parameter C of C-SVC, epsilon-SVR, and nu-SVR (optional: initial value)
  g | gamma | float | 0 | min max boundaries for gamma in kernel function (optional: initial value)
  stepcc | stepcc | double | 2 | multiplicative step for ccost in GRID search
  stepg | stepg | double | 2 | multiplicative step for gamma in GRID search
  i | input | std::string |  | input test vector file
  tln | tln | std::string |  | training layer name(s)
  label | label | std::string | label | identifier for class label in training vector file.
  bal | balance | unsigned int | 0 | balance the input data to this number of samples for each class
  random | random | bool | true | in case of balance, randomize input data
  min | min | int | 0 | if number of training pixels is less then min, do not take this class into account
  b | band | unsigned short |  | band index (starting from 0, either use band option or use start to end)
  sband | startband | unsigned short |  | Start band sequence number
  eband | endband | unsigned short |  | End band sequence number
  offset | offset | double | 0 | offset value for each spectral band input features: refl[band]=(DN[band]-offset[band])/scale[band]
  scale | scale | double | 0 | scale value for each spectral band input features: refl=(DN[band]-offset[band])/scale[band] (use 0 if scale min and max in each band to -1.0 and 1.0)
  svmt | svmtype | std::string | C_SVC | type of SVM (C_SVC, nu_SVC,one_class, epsilon_SVR, nu_SVR)
  kt | kerneltype | std::string | radial | type of kernel function (linear,polynomial,radial,sigmoid)
  kd | kd | unsigned short | 3 | degree in kernel function
  c0 | coef0 | float | 0 | coef0 in kernel function
  nu | nu | float | 0.5 | the parameter nu of nu-SVC, one-class SVM, and nu-SVR
  eloss | eloss | float | 0.1 | the epsilon in loss function of epsilon-SVR
  cache | cache | int | 100 | cache memory size in MB
  etol | etol | float | 0.001 | the tolerance of termination criterion
  shrink | shrink | bool | false | whether to use the shrinking heuristics
  pe | probest | bool | true | whether to train a SVC or SVR model for probability estimates
  cv | cv | unsigned short | 2 | n-fold cross validation mode
  cf | cf | bool | false | use Overall Accuracy instead of kappa
  maxit | maxit | unsigned int | 500 | maximum number of iterations
  tol | tolerance | double | 0.0001 | relative tolerance for stopping criterion
  c | class | std::string |  | list of class names.
  r | reclass | short |  | list of class values (use same order as in class opt).

Usage: pkoptsvm -t training