pkoptsvm(1)
π pkoptsvm β like, the manual page π
okay bestie, gather round, because this is pkoptsvm(1) and she is that girl. she's the little utility that finds the β¨perfectβ¨ parameters for your SVM classification, and honestly? she ate. let's get into it.
πΈ NAME πΈ
pkoptsvm β a whole program that optimizes parameters for SVM classification π
π SYNOPSIS π
pkoptsvm -t training [options] [advanced options]
that's it. that's the whole entrance. she's lowkey minimal.
π¦ DESCRIPTION π¦
so here's the tea, bestie: the support vector machine depends on several parameters. and like, ideally, you'd optimize these parameters for each classification problem, because every dataset is a different vibe and deserves its own glow-up. π
in case of a radial basis kernel function, two important parameters are {cost} and {gamma}. and that's literally the whole point of pkoptsvm β she can optimize these two parameters based on an accuracy assessment (the Kappa value). π
if you provide an input test set (-i), that's what gets used for the accuracy assessment. and if you don't? no worries, she just bases it on a cross validation (-cv) of the training sample instead. either way, we're getting a number. periodt.
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).
now here's the iconic strategy that people use all the time: define a relatively large multiplicative step first (e.g 10) to get an initial estimate for both parameters. then β once you have that rough little estimate β you optimize it by defining a smaller step (>1) with constrained start and end values for the parameters cost and gamma. it's giving coarse-to-fine, it's giving strategy, it's giving main character energy. π§
β¨ OPTIONS β¨
-t filename,--training 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).-i filename,--input filenameβ input test vector file-cc startvalue -cc endvalue,--ccost startvalue --ccost endvalueβ min and max boundaries the parameter C of C-SVC, epsilon-SVR, and nu-SVR (optional: initial value)-g startvalue -g endvalue,--gamma startvalue --gamma endvalueβ min max boundaries for gamma in kernel function (optional: initial value)-step stepsize,--step stepsizeβ multiplicative step for ccost and gamma in GRID search-v level,--verbose levelβ use1to output intermediate results for plotting π
π Advanced options π
-tln layer,--tln layerβ training layer name(s)-label attribute,--label attributeβ identifier for class label in training vector file. (default:label)-bal size,--balance sizeβ balance the input data to this number of samples for each class (default:0)-random,--randomβ in case of balance, randomize input data-min number,--min numberβ if number of training pixels is less then min, do not take this class into account-b band,--band bandβ band index (starting from0, either use band option or use start to end)-sband band,--startband bandβ start band sequence number-eband band,--endband bandβ end band sequence number-offset value,--offset valueβ offset value for each spectral band input features:refl[band]=(DN[band]-offset[band])/scale[band]-scale value,--scale valueβ scale value for each spectral band input features:refl=(DN[band]-offset[band])/scale[band](use0if scale min and max in each band to-1.0and1.0)-svmt type,--svmtype typeβ type of SVM (C_SVC,nu_SVC,one_class,epsilon_SVR,nu_SVR)-kt type,--kerneltype typeβ type of kernel function (linear,polynomial,radial,sigmoid)-kd value,--kd valueβ degree in kernel function-c0 value,--coef0 valueβ coef0 in kernel function-nu value,--nu valueβ the parameter nu of nu-SVC, one-class SVM, and nu-SVR-eloss value,--eloss valueβ the epsilon in loss function of epsilon-SVR-cache number,--cache numberβ cache memory size in MB (default:100)-etol value,--etol valueβ the tolerance of termination criterion (default:0.001)-shrink,--shrinkβ whether to use the shrinking heuristics-cv value,--cv valueβ n-fold cross validation mode (default:0)-cf,--cfβ use Overall Accuracy instead of kappa-maxit number,--maxit numberβ maximum number of iterations-tol value,--tolerance valueβ relative tolerance for stopping criterion (default:0.0001)-a value,--algorithm valueβGRID, or any optimization algorithm fromhttp://ab-initio.mit.edu/wiki/index.php/NLopt_Algorithms-c name,--class nameβ list of class names.-r value,--reclass valueβ list of class values (use same order as in--classoption).
no cap bestie, that's every single flag. don't skip the advanced ones, they're lowkey the whole personality π«Ά
and that's the page!! mwah π this one was dated 01 January 2025, and yeah she lives in section 1 of the manual β pkoptsvm(1), forever iconic, no notes. go optimize something gorgeous, bestie πβ¨
π¦ where this page comes from
- ubuntu questing: pktools 2.6.7.6+ds-6build4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms