Skip to content

Examples on website does not work with smartcore 0.3.0 #243

@Luosuu

Description

@Luosuu

I'm submitting a

  • bug report.
  • improvement.
  • feature request.

Current Behaviour:

The example provided in the official website does not run properly with the version 0,3,0.

The current document is for version 0.2.0 and the example for SVM:

let y_hat_svm = SVC::fit(&x_train, &y_train, SVCParameters::default().with_c(10.0))
    .and_then(|svm| svm.predict(&x_test))
    .unwrap();

will result in the error:

mismatched types
expected reference `&SVCParameters<f64, u32, DenseMatrix<f64, Vec<u32, Global>>`
found struct `SVCParameter<{float}, _, _, _>` rustc(E0308)

Expected Behaviour:

Error should be removed.

Steps to reproduce:

run the example code directly with smartcore 0.3.0

Snapshot:

Environment:

  • rustc version 1.65.0 (897e37553 2022-11-02)
  • cargo version 1.65.0 (4bc8f24d3 2022-10-20)
  • OS details WSL2 Debian

Do you want to work on this issue?

no

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions