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

Method fit

src/machine_learning/support_vector_classifier.rs:145–173  ·  view source on GitHub ↗

Fits the SVC with training data # Arguments `observations` - Training feature vectors `classes` - Class labels (should be 1.0 or -1.0) # Errors Returns an error if data is empty or dimensions don't match # 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 mu

(
        &mut self,
        observations: &[Array1<f64>],
        classes: &Array1<f64>,
    )

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 5

test_rbf_kernelFunction · 0.45
test_empty_dataFunction · 0.45

Calls 4

solve_dualMethod · 0.80
calculate_offsetMethod · 0.80
is_emptyMethod · 0.45
lenMethod · 0.45

Tested by 5

test_rbf_kernelFunction · 0.36
test_empty_dataFunction · 0.36