pub fn sparse_predict(&self, feature_vec: &[(i32, f64)]) -> f64 {
        let svm_nodes: Vec<SvmNode> = feature_vec
            .iter()
            .map(|&(i, c)| SvmNode { index: i, value: c })
            .collect();
        let c_model: *const sys::CSVMModel = self.c_model;
        let c_vec: *const SvmNode = svm_nodes.as_ptr();
        unsafe {
            sys::svm_predict(c_model, c_vec) as f64
        }
    }
/// Do classification or regression on a test sparse vector x given a model.
///
/// For a classification model, the predicted class for x is returned. For a regression model,
/// the function value of x calculated using the model is returned. For an one-class model, +1
/// or -1 is returned.
Do classification or regression on a test sparse vector x given a model.
For a classification model, the predicted class for x is returned. For a regression model,
the function value of x calculated using the model is returned. For an one-class model, +1
or -1 is returned.
Do classification or regression on a test sparse vector x given a model . For a classification model the predicted class for x is returned . For a regression model the function value of x calculated using the model is returned . For an one - class model + 1 or - 1 is returned .
pub fn sparse_predict(&self, feature_vec: &[(i32, f64)]) -> f64 {
        let svm_nodes: Vec<SvmNode> = feature_vec
            .iter()
            .map(|&(i, c)| SvmNode { index: i, value: c })
            .collect();
        let c_model: *const sys::CSVMModel = self.c_model;
        let c_vec: *const SvmNode = svm_nodes.as_ptr();
        unsafe {
            sys::svm_predict(c_model, c_vec) as f64
        }
    }
pub fn sparse_predict ( & self , feature_vec : & [ ( i32 , f64 ) ] ) -> f64 { let svm_nodes : Vec < SvmNode > = feature_vec . iter ( ) . map ( | & ( i , c ) | SvmNode { index : i , value : c } ) . collect ( ) ; let c_model : * const sys :: CSVMModel = self . c_model ; let c_vec : * const SvmNode = svm_nodes . as_ptr ( ) ; unsafe { sys :: svm_predict ( c_model , c_vec ) as f64 } }
Do classification or regression on a test sparse vector x given a model.
Do classification or regression on a test sparse vector x given a model .
&self
feature_vec
&[(i32, f64)]
&self
feature_vec
&[(i32, f64)]