File: examples_pksvm.dox

package info (click to toggle)
pktools 2.6.7.6%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 9,040 kB
  • sloc: cpp: 33,451; xml: 10,955; python: 1,601; makefile: 142; sh: 58; ansic: 24
file content (19 lines) | stat: -rw-r--r-- 1,337 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
\section examples_pksvm Examples of pksvm

Classify input image input.tif with a support vector machine. A training sample that is provided as an OGR vector dataset. It contains all features (same dimensionality as input.tif) in its fields (please check \ref pkextract "pkextract" on how to obtain such a file from a "clean" vector file containing locations only). A two-fold cross validation (cv) is performed (output on screen). The parameters cost and gamma of the support vector machine are set to 1000 and 0.1 respectively. A colourtable (a five column text file: image value, RED, GREEN, BLUE, ALPHA) has also been provided.

\code
pksvm -i input.tif -t training.sqlite -o output.tif -cv 2 -ct colourtable.txt -cc 1000 -g 0.1
\endcode

Classification using bootstrap aggregation. The training sample is randomly split in three subsamples (33% of the original sample each).

\code
pksvm -i input.tif -t training.sqlite -o output.tif -bs 33 -bag 3
\endcode

Classification using prior probabilities for each class. The priors are automatically normalized. The order in which the options -p are provide should respect the alphanumeric order of the class names (class 10 comes before 2...)

\code
pksvm -i input.tif -t training.sqlite -o output.tif -p 1 -p 1 -p 1 -p 1 -p 1 -p 1 -p 1 -p 1 -p 1 -p 1 -p 1 -p 0.2 -p 1 -p 1 -p 1
\endcode