Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

montanalow
Copy link
Collaborator

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
Copy link
Collaborator

Mec-iS commented Sep 16, 2022

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