You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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);
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: