MCPcopy Create free account
hub / github.com/TheAlgorithms/Rust / predict

Method predict

src/machine_learning/support_vector_classifier.rs:313–326  ·  view source on GitHub ↗

Predicts the class of a new observation # Arguments `observation` - Feature vector to classify # Returns The predicted class (1.0 or -1.0) # Example ``` use ndarray::array; use the_algorithms_rust::machine_learning::{SVC, Kernel}; let observations = vec![array![0.0, 1.0], array![1.0, 0.0]]; let classes = array![1.0, -1.0]; let mut svc = SVC::new(Kernel::Linear, f64::INFINITY).unwrap(); svc.fit

(&self, observation: &Array1<f64>)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls 2

kernel_functionMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected