Skip to content

SVC crashes on a test dataset with non default C#157

Closed
montanalow wants to merge 1 commit into
smartcorelib:developmentfrom
postgresml:montana/svc
Closed

SVC crashes on a test dataset with non default C#157
montanalow wants to merge 1 commit into
smartcorelib:developmentfrom
postgresml:montana/svc

Conversation

@montanalow

Copy link
Copy Markdown
Contributor

This test passes with a default C parameter of 1.0, but crashes on 0.0 or 10.0 at different places. It also passes with non default C values on trivial datasets, so it's an issue only exposed at larger scales.

@Mec-iS

Mec-iS commented Sep 16, 2022

Copy link
Copy Markdown
Collaborator

this should be in a issue if we follow with the strategy proposed by #154 (comment)

EDIT: I put here the failing test

   #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
    #[test]
    fn svc_fit_predict_c() {
        let breast_cancer = crate::dataset::breast_cancer::load_dataset();
        let y = breast_cancer.target;
        let x = DenseMatrix::from_array(
            breast_cancer.num_samples,
            breast_cancer.num_features,
            &breast_cancer.data,
        );

        let y_hat = SVC::fit(
            &x,
            &y,
            SVCParameters::default()
                .with_c(10.0)
                .with_kernel(Kernels::linear()),
        )
        .and_then(|lr| lr.predict(&x))
        .unwrap();

        assert!(accuracy(&y_hat, &y) >= 0.9);
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants