A comprehensive library for machine learning and numerical computing. The library provides a set of tools for linear algebra, numerical computing, optimization, and enables a generic, powerful yet still efficient approach to machine learning.
smartcore::svm::svc only works with 2 classes [-1, 1]
Expected Behaviour:
we should support n number of classes. Use Iris dataset as example. See this intro blogpost
use crate::dataset::iris::load_dataset as iris_load;
// Load Iris dataset
let iris_dataset = iris_load();
// Turn Iris dataset into NxM matrix
// Input data
let x: DenseMatrix<f32> = DenseMatrix::new(
iris_dataset.num_samples, // num rows
iris_dataset.num_features, // num columns
iris_dataset.data, // data as Vec
false, // column_major
);
// These are our target class labels
let y: Vec<u32> = iris_dataset.target;
let y_hat = SVC::fit(
&x,
&y,
&SVCParameters::default()
.with_c(1.0)
.with_kernel(&Kernels::rbf().with_gamma(0.7)),
)
.and_then(|lr| lr.predict(&x))
.unwrap();
println!("{:?}", &y_hat);
I'm submitting a
Current Behaviour:
smartcore::svm::svc
only works with 2 classes[-1, 1]
Expected Behaviour:
we should support n number of classes. Use Iris dataset as example. See this intro blogpost