---
name: "pkoptsvm"
section: "1"
platform: "linux"
package: "pktools"
version: "2.6.7.6+ds-6+b3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/pkoptsvm"
---

# pkoptsvm(1)

program to optimize parameters for SVM classification

## NAME

pkoptsvm - program to optimize parameters for SVM classification

## SYNOPSIS

FC**pkoptsvm**F\[0\]  FC**-t**F\[0\] *training* \[*options*\] \[*advanced options*\]

## DESCRIPTION

**pkoptsvm**  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 (FC**-i**F\[0\]) is provided, it is used for the accuracy assessment. If not, the accuracy assessment is based on a cross validation (FC**-cv**F\[0\]) of the training sample.

The optimization routine uses a grid search. The initial and final values of the parameters can be set with FC**-cc**F\[0\] startvalue FC**-cc**F\[0\] endvalue and FC**-g**F\[0\] startvalue FC**-g**F\[0\] endvalue for cost and gamma respectively. The search uses a multiplicative step for iterating the parameters (set with the options FC**-stepcc**F\[0\] and FC**-stepg**F\[0\]). 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

- FC**-t**F\[0\] *filename*, FC**--training**F\[0\] *filename*

  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).

- FC**-i**F\[0\] *filename*, FC**--input**F\[0\] *filename*

  input test vector file

- FC**-cc**F\[0\] *startvalue* FC**-cc**F\[0\] *endvalue*, FC**--ccost**F\[0\] *startvalue* FC**--ccost**F\[0\] *endvalue*

  min and max boundaries the parameter C of C-SVC, epsilon-SVR, and nu-SVR (optional: initial value)

- FC**-g**F\[0\] *startvalue* FC**-g**F\[0\] *endvalue*, FC**--gamma**F\[0\] *startvalue* FC**--gamma**F\[0\] *endvalue*

  min max boundaries for gamma in kernel function (optional: initial value)

- FC**-step**F\[0\] *stepsize*, FC**--step**F\[0\] *stepsize*

  multiplicative step for ccost and gamma in GRID search

- FC**-v**F\[0\] *level*, FC**--verbose**F\[0\] *level*

  use 1 to output intermediate results for plotting

Advanced options

- FC**-tln**F\[0\] *layer*, FC**--tln**F\[0\] *layer*

  training layer name(s)

- FC**-label**F\[0\] *attribute*, FC**--label**F\[0\] *attribute*

  identifier for class label in training vector file. (default: label)

- FC**-bal**F\[0\] *size*, FC**--balance**F\[0\] *size*

  balance the input data to this number of samples for each class (default: 0)

- FC**-random**F\[0\], FC**--random**F\[0\]

  in case of balance, randomize input data

- FC**-min**F\[0\] *number*, FC**--min**F\[0\] *number*

  if number of training pixels is less then min, do not take this class into account

- FC**-b**F\[0\] *band*, FC**--band**F\[0\] *band*

  band index (starting from 0, either use band option or use start to end)

- FC**-sband**F\[0\] *band*, FC**--startband**F\[0\] *band*

  start band sequence number

- FC**-eband**F\[0\] *band*, FC**--endband**F\[0\] *band*

  end band sequence number

- FC**-offset**F\[0\] *value*, FC**--offset**F\[0\] *value*

  offset value for each spectral band input features: FCrefl\[band\]=(DN\[band\]-offset\[band\])/scale\[band\]F\[0\]

- FC**-scale**F\[0\] *value*, FC**--scale**F\[0\] *value*

  scale value for each spectral band input features: FCrefl=(DN\[band\]-offset\[band\])/scale\[band\]F\[0\] (use FC0F\[0\] if scale min and max in each band to FC-1.0F\[0\] and FC1.0F\[0\])

- FC**-svmt**F\[0\] *type*, FC**--svmtype**F\[0\] *type*

  type of SVM (C\_SVC, nu\_SVC,one\_class, epsilon\_SVR, nu\_SVR)

- FC**-kt**F\[0\] *type*, FC**--kerneltype**F\[0\] *type*

  type of kernel function (linear,polynomial,radial,sigmoid)

- FC**-kd**F\[0\] *value*, FC**--kd**F\[0\] *value*

  degree in kernel function

- FC**-c0**F\[0\] *value*, FC**--coef0**F\[0\] *value*

  coef0 in kernel function

- FC**-nu**F\[0\] *value*, FC**--nu**F\[0\] *value*

  the parameter nu of nu-SVC, one-class SVM, and nu-SVR

- FC**-eloss**F\[0\] *value*, FC**--eloss**F\[0\] *value*

  the epsilon in loss function of epsilon-SVR

- FC**-cache**F\[0\] *number*, FC**--cache**F\[0\] *number*

  cache memory size in MB (default: 100)

- FC**-etol**F\[0\] *value*, FC**--etol**F\[0\] *value*

  the tolerance of termination criterion (default: 0.001)

- FC**-shrink**F\[0\], FC**--shrink**F\[0\]

  whether to use the shrinking heuristics

- FC**-cv**F\[0\] *value*, FC**--cv**F\[0\] *value*

  n-fold cross validation mode (default: 0)

- FC**-cf**F\[0\], FC**--cf**F\[0\]

  use Overall Accuracy instead of kappa

- FC**-maxit**F\[0\] *number*, FC**--maxit**F\[0\] *number*

  maximum number of iterations

- FC**-tol**F\[0\] *value*, FC**--tolerance**F\[0\] *value*

  relative tolerance for stopping criterion (default: 0.0001)

- FC**-a**F\[0\] *value*, FC**--algorithm**F\[0\] *value*

  GRID, or any optimization algorithm from http://ab-initio.mit.edu/wiki/index.php/NLopt\_Algorithms

- FC**-c**F\[0\] *name*, FC**--class**F\[0\] *name*

  list of class names.

- FC**-r**F\[0\] *value*, FC**--reclass**F\[0\] *value*

  list of class values (use same order as in FC**--class**F\[0\] option).
