- 
                Notifications
    You must be signed in to change notification settings 
- Fork 87
Open
Labels
good first issueGood for newcomersGood for newcomers
Milestone
Description
I'm submitting a
- feature request.
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
        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);
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers