svm-train(1)

πŸ’– svm-train β€” the girlies are TRAINING πŸ’–

okay so bestie, welcome to svm-train(1) from the User Manuals section, and yes this is the one that makes the magic model file happen ✨


✨ NAME ✨

svm-train β€” train one or more SVM instance(s) on a given data set to produce a model file πŸŽ€


🌸 SYNOPSIS 🌸

svm-train [-s svm_type ] [ -t kernel_type ] [ -d degree ] [ -g gamma ] [
-r coef0 ] [ -c cost ] [ -n nu ] [ -p epsilon ] [ -m cachesize ] [ -e
epsilon ] [ -h shrinking ] [ -b probability_estimates ] ] [ -wi weight ]
[ -v n ] [ -q ]

training_set_file [ model_file ]

no fr, that's the whole vibe of it πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so svm-train trains a Support Vector Machine to learn the data you point it at in the training_set_file, and then it produces a model_file to save the results of the learning optimization 🧚

that model is literally your main character moment β€” you can use it later with svm_predict(1) or with other LIBSVM enabled software. slay πŸ”₯


πŸ‘‘ OPTIONS πŸ‘‘

  • -s svm_type β€” svm_type defaults to 0 and can be any value between 0 and 4, like this:
    • 0 β€” C-SVC
    • 1 β€” nu-SVC
    • 2 β€” one-class SVM
    • 3 β€” epsilon-SVR
    • 4 β€” nu-SVR
  • -t kernel_type β€” kernel_type defaults to 2 (Radial Basis Function (RBF) kernel) and can be any value between 0 and 4, as follows:
    • 0 β€” linear: u.v
    • 1 β€” polynomial: (gamma*u.v + coef0)^degree
    • 2 β€” radial basis function: exp(-gamma*|u-v|^2)
    • 3 β€” sigmoid: tanh(gamma*u.v + coef0)
    • 4 β€” precomputed kernel (kernel values in training_set_file) --
  • -d degree β€” sets the degree of the kernel function, defaulting to 3 ⭐
  • -g gamma β€” adjusts the gamma in the kernel function (default 1/k) 🌈
  • -r coef0 β€” sets the coef0 (constant offset) in the kernel function (default 0) πŸ’œ
  • -c cost β€” sets the parameter C ( cost ) of C-SVC, epsilon-SVR, and nu-SVR (default 1) πŸ’°
  • -n nu β€” sets the parameter nu of nu-SVC, one-class SVM, and nu-SVR (default 0.5) πŸŽ€
  • -p epsilon β€” set the epsilon in the loss function of epsilon-SVR (default 0.1) πŸ“
  • -m cachesize β€” set the cache memory size to cachesize in MB (default 100) 🧠
  • -e epsilon β€” set the tolerance of termination criterion to epsilon (default 0.001) ⏱️
  • -h shrinking β€” whether to use the shrinking heuristics, 0 or 1 (default 1) πŸͺ„
  • -b probability-estimates β€” probability_estimates is a binary value indicating whether to calculate probability estimates when training the SVC or SVR model. values are 0 or 1 and defaults to 0 for speed 🏎️
  • -wi weight β€” set the parameter C (cost) of class i to weight*C, for C-SVC (default 1) βš–οΈ
  • -v n β€” set n for n -fold cross validation mode πŸ”
  • -q β€” quiet mode; suppress messages to stdout 🀫

πŸ“ FILES πŸ“

training_set_file must be prepared in the following simple sparse training vector format:

<label> <index1>:<value1> <index2>:<value2> . . .

 .

 .

 .

there is one sample per line πŸ“ each sample consists of a target value (label or regression target) followed by a sparse representation of the input vector. all unmentioned coordinates are assumed to be 0 🫢

for classification, <label> is an integer indicating the class label (multi-class is supported) πŸ’– for regression, <label> is the target value which can be any real number πŸ“ˆ for one-class SVM, it's not used so can be any number πŸ€·β™€οΈ

except using precomputed kernels (explained in another section), <index>:<value> gives a feature (attribute) value. <index> is an integer starting from 1 and <value> is a real number.

ok so this part is IMPORTANT bestie: indices must be in an ASCENDING order. do not come at it out of order, it will not eat πŸ’€

🌿 ENVIRONMENT 🌿

No environment variables. that's it, nothing to set up, we love a low-maintenance queen πŸ’…


πŸ” DIAGNOSTICS πŸ”

None documented; see Vapnik et al. πŸ“š


πŸ’€ BUGS πŸ’€

Please report bugs to the Debian BTS. πŸ›


🫢 AUTHOR 🫢

Chih-Chung Chang, Chih-Jen Lin <cjlin@csie.ntu.edu.tw>, Chen-Tse Tsai <ctse.tsai@gmail.com> (packaging) β€” icons, all of them πŸ‘‘


🌈 SEE ALSO 🌈

svm-predict(1), svm-scale(1) β€” go read those next, iykyk ✨


and that's the whole page bestie!! this one comes from the Linux corner of the world, dated MAY 2006 β€” yeah she's a classic, an OG, and she still serves πŸŽ€πŸ’– no cap, go train something iconic, periodt βœ¨πŸ¦‹πŸŒΈ