pub struct SvmModel {
pub param: SvmParameter,
pub nr_class: usize,
pub sv: Vec<Vec<SvmNode>>,
pub sv_coef: Vec<Vec<f64>>,
pub rho: Vec<f64>,
pub prob_a: Vec<f64>,
pub prob_b: Vec<f64>,
pub prob_density_marks: Vec<f64>,
pub sv_indices: Vec<usize>,
pub label: Vec<i32>,
pub n_sv: Vec<usize>,
}Expand description
A trained SVM model.
Produced by training, or loaded from a LIBSVM model file.
Fields§
§param: SvmParameterParameters used during training.
nr_class: usizeNumber of classes (2 for binary, >2 for multiclass, 2 for regression).
sv: Vec<Vec<SvmNode>>Support vectors (sparse feature vectors).
sv_coef: Vec<Vec<f64>>Support vector coefficients. For k classes, this is a
(k-1) × num_sv matrix stored as Vec<Vec<f64>>.
rho: Vec<f64>Bias terms (rho). One per class pair: k*(k-1)/2 values.
prob_a: Vec<f64>Pairwise probability parameter A (Platt scaling). Empty if not trained with probability estimates.
prob_b: Vec<f64>Pairwise probability parameter B (Platt scaling). Empty if not trained with probability estimates.
prob_density_marks: Vec<f64>Probability density marks (for one-class SVM).
sv_indices: Vec<usize>Original indices of support vectors in the training set (1-based).
label: Vec<i32>Class labels (in the order used internally).
n_sv: Vec<usize>Number of support vectors per class.