In-sample optimization with F-score via 5-fold cross-validation with a training dataset. A range of costs (C’s, penalties) and γ’s in the RBF kernel (proportional to a default value in LIBSVM) defines a grid where the optimal parameter pair, i.e. the pair that maximizes the F-score, is chosen. In this example, the pair of C = 21 and γ = 22 was selected (maximum F-score = 0.93). The SVM is trained using the optimal pair of parameters with the training dataset, and then evaluated on an untouched test dataset.