Skip to content

chore(#398): remove dead svm/search and model_selection/hyper_tuning modules - #430

Closed
Mec-iS wants to merge 132 commits into
release-v0.4.8from
development
Closed

chore(#398): remove dead svm/search and model_selection/hyper_tuning modules#430
Mec-iS wants to merge 132 commits into
release-v0.4.8from
development

Conversation

@Mec-iS

@Mec-iS Mec-iS commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #398. Part of the staged coverage plan #391.

Removes two module trees that have been unreachable dead code since before v0.5.0:

Deleted files

  • src/svm/search/mod.rs
  • src/svm/search/svc_params.rs — 100% commented-out code referencing the obsolete LinearKernel {} API
  • src/svm/search/svr_params.rs — live but unreachable; was never compiled due to the mod search; declaration state
  • src/model_selection/hyper_tuning/mod.rs
  • src/model_selection/hyper_tuning/grid_search.rs — WIP GridSearchCV with CrossValidationResult<T> signature mismatch vs current non-generic CrossValidationResult

Updated files

  • src/svm/mod.rs — removed pub mod search; and its stale comment
  • src/model_selection/mod.rs — removed // TODO: fix this module comment block and the commented-out hyper_tuning declarations

Preserved for posterity

All deleted code is archived in issue #429 with notes on what would need to change to revive it. Maintainers can decide there whether to implement a proper GridSearchCV + SVC/SVR grid search going forward.

Comparison with v0.5.5

Both deleted trees were identical between v0.5.5 and development — no active development was happening on them.

dependabot-preview Bot and others added 30 commits November 8, 2022 11:29
* build(deps): update nalgebra requirement from 0.23.0 to 0.26.2

Updates the requirements on [nalgebra](https://github.com/dimforge/nalgebra) to permit the latest version.
- [Release notes](https://github.com/dimforge/nalgebra/releases)
- [Changelog](https://github.com/dimforge/nalgebra/blob/dev/CHANGELOG.md)
- [Commits](dimforge/nalgebra@v0.23.0...v0.26.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* fix: updates for nalgebre

* test: explicitly call pow_mut from BaseVector since now it conflicts with nalgebra implementation

* Don't be strict with dependencies

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Luis Moreno <morenol@users.noreply.github.com>
Updates the requirements on [nalgebra](https://github.com/dimforge/nalgebra) to permit the latest version.
- [Release notes](https://github.com/dimforge/nalgebra/releases)
- [Changelog](https://github.com/dimforge/nalgebra/blob/dev/CHANGELOG.md)
- [Commits](dimforge/nalgebra@v0.23.0...v0.31.0)

---
updated-dependencies:
- dependency-name: nalgebra
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Luis Moreno <morenol@users.noreply.github.com>
* initial fastpair implementation
* FastPair initial implementation
* implement fastpair
* Add random test
* Add bench for fastpair
* Refactor with constructor for FastPair
* Add serialization for PairwiseDistance
* Add fp_bench feature for fastpair bench
* Add example

* Move to top

* Add imports to example

* Fix imports
* docs: Fix typo in doc for categorical transformer.
* feat: Add option to take a column from Matrix.
I created the method `Matrix::take_column` that uses the `Matrix::take`-interface to extract a single column from a matrix. I need that feature in the implementation of  `StandardScaler`.
* feat: Add `StandardScaler`.
Authored-by: titoeb <timtoebrock@googlemail.com>
* Derive `serde::Serialize` and `serde::Deserialize` for
  `StandardScaler`.
* Add relevant unit test.

Signed-off-by: Christos Katsakioris <ckatsak@gmail.com>

Signed-off-by: Christos Katsakioris <ckatsak@gmail.com>
* Update criterion requirement from 0.3 to 0.4

Updates the requirements on [criterion](https://github.com/bheisler/criterion.rs) to permit the latest version.
- [Release notes](https://github.com/bheisler/criterion.rs/releases)
- [Changelog](https://github.com/bheisler/criterion.rs/blob/master/CHANGELOG.md)
- [Commits](bheisler/criterion.rs@0.3.0...0.4.0)

---
updated-dependencies:
- dependency-name: criterion
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix criterion

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Luis Moreno <morenol@users.noreply.github.com>
* handle multiclass precision/recall
* grid search draft
* hyperparam search for linear estimators
* feat: Add interface to build `Matrix` from rows.
* feat: Add option to derive `RealNumber` from string.
To construct a `Matrix` from csv, and therefore from string, I need to be able to deserialize a generic `RealNumber` from string.
* feat: Implement `Matrix::read_csv`.
…#160)

* fix: fix compilation warnings when running only with default features
Co-authored-by: Luis Moreno <morenol@users.noreply.github.com>
#159)

* feat: allocate first and then proceed to create matrix from Vec of RowVectors
* grid search draft

* hyperparam search for linear estimators

* grid search for ensembles

* support grid search for more algos

* grid search for unsupervised algos

* minor cleanup
* Provide better output in flaky tests

* feat: add seed parameter to multiple algorithms

* Update changelog

Co-authored-by: Luis Moreno <morenol@users.noreply.github.com>
* add seed param to search params

* make default params available to serde

* lints

* create defaults for enums

* lint
* feat: expose hyper tuning module in model_selection

* Move to a folder

Co-authored-by: Luis Moreno <morenol@users.noreply.github.com>
Co-authored-by: Luis Moreno <morenol@users.noreply.github.com>
Mec-iS and others added 29 commits July 28, 2026 13:33
* docs: document Cargo.toml features (Fixes #68)

Add serde-style comments describing each optional feature so users can
see what serde, ndarray-bindings, datasets, std_rand, and js enable
without reading the source.

* Update Cargo.toml

---------

Co-authored-by: Lorenzo <tunedconsulting@gmail.com>
bincode has been abandoned and its final 3.0.0 release is a poison pill
whose entire source is `compile_error!("https://xkcd.com/2347/")`, which
breaks any project Dependabot bumps to it.

bincode was a dev-dependency only, used for serde round-trip assertions in
six model tests. Swap it for postcard: actively maintained, no_std + alloc,
wasm-friendly, and a pure serde format so the migration is mechanical.

The SVM tests stay on serde_json. postcard is not self-describing and so
cannot deserialize the `typetag::serde` trait objects those models use.
Keeping both formats is deliberate: JSON alone would silently accept
`#[serde(flatten)]`/`untagged` additions that break every binary format
users actually persist models with.

Closes #377
…#399) (#400)

* add to .gitignore

* ci(coverage): include doctests and add strict --fail-under 44 gate (#399)

Stage 0 of #391: foundational coverage tooling.

- coverage.yml: install cargo-tarpaulin with --locked; run both Tests and
  Doctests run-types; enforce --fail-under 44 (current baseline 44.03%);
  upload codecov report with if: always() so it still uploads when the gate
  trips.
- .gitignore: ignore coverage artifacts (*.profraw, lcov.info, cobertura.xml,
  tarpaulin-report.*) so local cargo-tarpaulin runs don't pollute the tree.
- CHANGELOG: note the CI/coverage change.

Verified locally: cargo fmt --check, cargo clippy --all-features
-Drust-2018-idioms -Dwarnings, and cargo test --all-features (444 unit +
68 doctests) all pass. The end-to-end coverage % is reproducible on CI
(Linux x86_64 / ptrace engine); macOS uses the LLVM engine which has a
known profraw-merge bug unrelated to these flags.

* chore: bump version to 0.6.0 for stage 0 (#399)

Bump minor version so Stage 0 (#399, the coverage tooling change) can
ship as a release boundary. Move the stage 0 changelog entry into a new
[0.6.0] section.
* test(stage-1): fill untested modules + revive serde tests (#392)

Stage 1 of #391. +29 tests (444 -> 473 unit), all gates green.

New tests for previously-untested substantive files:
- linalg/traits/high_order.rs: implement the TODO mod tests covering all
  4 ab() transpose-flag branches, non-square inputs, and matmul/transpose
  equivalence.
- linear/lasso_optimizer.rs: direct tests for InteriorPointOptimizer
  (new() builds ata with correct shape; lambda->0 recovers least squares).
- error/mod.rs: tests for all 6 Failed constructors, all 8 FailedError
  variants, both Display impls, both PartialEq impls, Error trait impl.
- rand_custom.rs: seeded-RNG determinism and None-seed usability.

Revived 6 commented-out serde round-trip tests (migrated serde_json ->
postcard, the post-#390 backend) for LinearRegression, RidgeRegression,
Lasso, ElasticNet, PCA, SVD.

Renamed two copy-paste-misnamed tests:
- dataset::diabetes::boston_dataset -> diabetes_dataset
- algorithm::sort::quick_sort::with_capacity -> quick_argsort

Bump version 0.6.0 -> 0.6.1.

* review(405): address PR feedback — std_rand test, comments, CHANGELOG

- rand_custom.rs: add std_rand_none_seed_uses_os_entropy test gated
  #[cfg(feature = "std_rand")] to cover the StdRg/OS-entropy branch
  of get_rng_impl(None) — closes the std_rand scope gap from #392.
- rand_custom.rs: add inline comment on none_seed_returns_usable_rng
  explaining the #[cfg(not(wasm32))] exclusion (OS entropy unavailable
  on bare wasm).
- high_order.rs: fix ab_true_true comment to (B·A)^T referencing the
  (AB)^T = B^T A^T identity, clarifying ab(true,true) semantics.
- CHANGELOG: note the silent SVD serde-test fix (f32 -> f64 type).
* chore(edition): port to Rust 2024 + declare MSRV 1.85 (#401)

A (#402): edition 2021 -> 2024. cargo fix --edition made no auto-edits;
the only behavioral-adjacent change is approximate_eq rewritten to the
2024-safe tail-expr drop-order form (bind owned intermediate before the
borrowing iterator) -- numerical logic unchanged.

B (#403): #[allow] -> #[expect] where the lint still fires under
--all-features; #[allow] retained where the lint does not fire (avoids
unfulfilled_lint_expectations).

C (#404): declare rust-version = "1.85" in Cargo.toml and add an msrv
CI job that builds with dtolnay/rust-toolchain@1.85.0 to verify the
claim. Added [lints.rust] unexpected_cfgs check-cfg table for
cfg(coverage, coverage_nightly) and cfg(tarpaulin).

Also:
- AGENTS.md: document edition-2024 invariants (no RPIT, explicit
  dyn Trait + 'a, tail-expr drop-order, lint-suppression policy, unsafe
  stance) and the 'preserve bespoke numerical-system logic and
  performance' constraint for non-behavioral refactors.
- svm/svc.rs: drop two redundant let-and-return tails surfaced by the
  2024 clippy::let_and_return lint.
- preprocessing/categorical.rs: keep nested-if (annotated
  #[allow(clippy::collapsible_if)]) because collapsing to a let-chain
  needs let-chains, unstable until 1.88 -- incompatible with MSRV 1.85.
- cargo fmt normalization across the tree.

D (#368, unsafe -> split_at_mut) is deferred to its own PR per the
'preserve numerical logic' constraint.

Verified: fmt=0, clippy --all-features -Drust-2018-idioms
-Drust-2024-compatibility -Dwarnings=0, test --all-features=0 (474 unit
+ 68+3 doctests), cargo +1.85.0 build --all-features=0.

Bump 0.6.1 -> 0.6.2.

* docs(README): align with edition 2024 port and current version

- Install pin: ^0.5.3 -> ^0.6 (current is 0.6.2).
- Quick-start example: fix .unwrap -> .unwrap() (was a real typo that
  would not compile as a doctest).
- Roadmap: 'Move to Rust 2021 edition' -> 'Move to Rust 2024 edition
  (MSRV 1.85)'.
- Contributing: note MSRV 1.85 / edition 2024 alongside 'stable Rust'.
- Replace stale 'v0.4 API' prose references with version-agnostic
  'smartcore API' wording to stop the version label going stale again.

* review(406): drop TZ placeholders, simplify approximate_eq

Per PR #406 review feedback:
- ci.yml: remove the unfilled TZ template placeholders from all three
  jobs (broken template artifact; Rust builds don't depend on TZ).
- arrays.rs::approximate_eq: drop the redundant let result = ...; result
  + the #[expect(clippy::let_and_return)] — under edition 2024 the drop
  order changed so the simpler
  form compiles cleanly (no E0597, no clippy warning). Numerical logic
  unchanged.
…plit_first_mut (#368) (#408)

* refactor(matrix): replace unsafe raw-pointer iterator_mut with safe split_first_mut (#368)

Closes #368 (tech-debt: replace unsafe raw-pointer iterator_mut in
DenseMatrix with safe split_at_mut approach).

Replace the 4 remaining unsafe {} blocks in
linalg/basic/matrix.rs::iterator_mut (DenseMatrix) and
DenseMatrixMutView::iter_mut with a shared safe helper
ordered_iter_mut that uses split_first_mut to extract disjoint
mutable references at the desired traversal offsets.

The traversal order and offset formula are identical to the previous
raw-pointer implementation (ptr.add(offset)); only the borrow-proving
mechanism changed. This eliminates unsafe from library code entirely.

Fast path (axis matches storage order): values.iter_mut().take(n) —
zero overhead, no allocation.

Cross-axis path (transposed traversal order): extract n refs at the
desired offsets via split_first_mut in sorted-offset order, reorder
into yield order. Introduces a Vec<Option<&mut T>> allocation. The
numerical logic is unchanged; benchmarks to quantify this are tracked
in #407.

Verified: fmt=0, clippy --all-features -Drust-2018-idioms
-Drust-2024-compatibility -Dwarnings=0, test --all-features=0 (474
unit + 68+3 doctests), cargo +1.85.0 build --all-features=0 (MSRV).

Bump 0.6.2 -> 0.6.3.

* style: apply cargo fmt to ordered_iter_mut helper (#368)

Fixes CI fmt-check failure: rustfmt wanted the closure and chain
wrapped differently. Standard cargo fmt --all normalization.
Add .github/workflows/release-bench.yml that triggers on release.published.
It checks out smartcore-benches into a sibling directory and patches its
Cargo.toml via [patch.crates-io] to use the local smartcore checkout (the
release commit), then runs criterion + iai-callgrind benchmarks. Results
are uploaded as artifacts. No cross-repo dispatch or PAT needed.
* test(stage-2): add proptest + linalg edge cases (#393)

Stage 2 of #391. +14 tests (474 -> 488 unit), all gates green.

Added proptest = "1.5" dev-dependency and property-based invariant
tests + edge cases across linalg, sort, and distance:

- linalg/basic/arrays.rs (5 proptest + 5 edge):
  - transpose involution (A^T)^T == A
  - matmul with identity A*I == A
  - matmul associativity (AB)C ≈ A(BC) (approximate for FP)
  - (AB)^T == B^T * A^T
  - reshape preserves element count
  - 1x1 matmul, row×col matmul, shape-mismatch panic,
    reshape-incompatible panic, 1xN transpose

- algorithm/sort/quick_sort.rs (1 proptest):
  - quick_argsort produces a valid permutation (indices unique,
    non-decreasing in perm order)

- metrics/distance/euclidian.rs (3 proptest):
  - d(a,a) == 0, symmetry d(a,b)==d(b,a),
    triangle inequality d(a,c) <= d(a,b)+d(b,c)

Bump 0.6.3 -> 0.6.4.

* fix(410): gate proptest to non-wasm targets + address review feedback

Fix wasm32 build failure: proptest pulls in wait-timeout (Unix syscalls
unavailable on wasm32). Move proptest to a target-specific dev-dependency
block [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] and
add #[cfg(not(target_arch = "wasm32"))] to all proptest test functions.

Review feedback (PR #410 comment):
- proptest_matmul_transpose_identity: switch from exact prop_assert_eq!
  to approximate comparison (1e-10) — FP accumulation can exceed exact
  PartialEq, which could cause spurious CI failures under future matmul
  implementation changes.
- arb_small_matrix: widen input range from 0.0..100.0 to -50.0..50.0 to
  include negative values for stronger coverage.
- associativity comment: fix typo 'matmils' -> 'matmuls'.
- quick_argsort_is_valid_permutation: remove unreachable n==0 guard
  (min length is 1, so the guard was dead code).

Verified: fmt=0, clippy=0 (with -2024-compatibility), test=0 (488 unit
+ 68+3 doctests), wasm32 build --all-features=0.
…orkspace conflict (#411)

The previous release-bench.yml checked out smartcore-benches *inside*
the smartcore directory (path: smartcore-benches). Since smartcore's
Cargo.toml has [workspace], cargo auto-detected it and tried to treat
benches as a workspace member, causing 'current package believes it's
in a workspace when it's not'.

Fix: checkout benches to ../smartcore-benches (outside the smartcore
tree entirely) and adjust the patch path to ../smartcore. This keeps
the two crates as independent Cargo projects with only the
[patch.crates-io] override linking them.
`GaussianNB` declared `TX: Number + RealNumber + RealNumber` in four
places (the struct and its Display, SupervisedEstimator and Predictor
impls). The repeated bound is a no-op, so this is purely cosmetic.

rustfmt collapses the now-shorter generic lists onto one line.
….6.5 (#394) (#425)

Adds edge-case and known-answer parity tests for:
- src/linear: linear_regression, logistic_regression, ridge_regression, lasso, elastic_net
- src/svm: svc, svr
- src/tree: decision_tree_classifier, decision_tree_regressor
- src/naive_bayes: bernoulli, categorical, gaussian, multinomial
- src/neighbors: knn_classifier, knn_regressor
- src/ensemble: random_forest_classifier, random_forest_regressor
- src/cluster: dbscan, kmeans
- src/decomposition: pca, svd

Version bumped: 0.6.4 -> 0.6.5
Adds edge-case and boundary tests for:
- src/metrics/: accuracy, precision, recall, f1, auc, r2, mae, mse
- src/metrics/cluster_hcv.rs + cluster_helpers.rs: contingency edge cases
- src/metrics/distance/: euclidian, manhattan, minkowski, hamming, mahalanobis
- PairwiseDistance: symmetry and struct field checks
Adds serde round-trip, datasets loader/generator, ndarray-bindings parity,
and wasm annotation audit tests.
Tracking issues: #396 / #391.
… (#428)

* fix(tests): Stage 6 integration tests + patch version bump 0.6.5 -> 0.6.6 (#397)

Adds a top-level tests/ directory with end-to-end workflow integration tests
for every estimator family. Each file exercises load → train → predict → evaluate
with non-trivial accuracy/error assertions.

Files added:
  tests/linear_workflow.rs
  tests/tree_workflow.rs
  tests/ensemble_workflow.rs
  tests/svm_workflow.rs
  tests/naive_bayes_workflow.rs
  tests/neighbors_workflow.rs
  tests/cluster_workflow.rs
  tests/decomposition_workflow.rs
  tests/preprocessing_workflow.rs
  tests/model_selection_workflow.rs

Also bumps Cargo.toml version 0.6.5 → 0.6.6 (patch).
Tracking issue: #397 / #391.

* fix(lint): clean up unused imports, dead code and wasm32 compile errors in integration tests

- linear_workflow.rs: remove unused Array/Array2 top-level imports; remove dead
  intermediate variables (x_mat, x slice) from the datasets-gated test; use a
  single DenseMatrix::from_iterator directly
- decomposition_workflow.rs: move Array import inside the datasets-gated fn;
  remove never-called frobenius_relative_error helper; mark SVD singular-value
  test #[cfg(not(target_arch = "wasm32"))] because wasm32 panics on 30-iter SVD
- cluster_workflow.rs: remove unused Array import from kmeans_generated_blobs;
  fix `ds.data.iter().copied() as _` cast that doesn't compile — use explicit
  `.map(|v| v)` instead
- model_selection_workflow.rs: remove `use smartcore::metrics::accuracy` (the
  function does not exist at that path); replace with a local closure passed
  inline to cross_validate matching the expected fn-pointer signature
- All other files: no changes needed (already clean)

* fix linting

* fix(tests): correct module paths and API usage in naive_bayes and preprocessing tests

naive_bayes_workflow.rs:
- ComplementNB does not exist in this codebase; replace with MultinomialNB
  (smartcore::naive_bayes::multinomial) which covers the same use-case and
  actually compiles.

preprocessing_workflow.rs:
- Transformer trait is at smartcore::api::Transformer, not smartcore::Transformer
- StandardScaler lives at smartcore::preprocessing::numerical::{StandardScaler,
  StandardScalerParameters}; import the params type explicitly so fit() resolves
- StandardScaler has no inverse_transform(); rewrite that test to verify the
  scaled column means are ~0 and std ~1 (same invariant, different assertion)
- OneHotEncoder::fit requires T: Categorizable which is only impl for f32/f64,
  not u32; switch the input matrix to f64 and use OneHotEncoderParams::from_cat_idx
  (there is no Default impl for OneHotEncoderParams); fix the binary-value
  assertion to compare f64 (0.0/1.0) instead of u32

* fix linting

* fix(tests): correct DBSCAN API usage and bring UnsupervisedEstimator into scope

cluster_workflow.rs:
- DBSCANParameters has no ::new() constructor; use the builder pattern:
  DBSCANParameters::default().with_min_samples(2).with_eps(0.5)
  (the default distance is already Euclidean, so no need to pass it)
- DBSCAN has no ::fit_predict(); use DBSCAN::fit(&x, params).and_then(|m| m.predict(&x))
- Annotate `labels` as Vec<i32>: DBSCAN assigns noise=0, clusters start at 1,
  and the KMeans labels need Vec<usize> annotation to satisfy HashSet<usize>
- Drop the unused Distances import from dbscan_inline_workflow

preprocessing_workflow.rs:
- StandardScaler::fit is provided by the UnsupervisedEstimator trait;
  add `use smartcore::api::UnsupervisedEstimator` inside each test fn so
  the method resolves correctly

* fix linting

* fix(tests): correct SVM and NaiveBayes API usage

svm_workflow.rs:
- Kernels::rbf() takes 0 arguments (gamma is fixed internally); remove the float arg
- SVC::fit and SVR::fit take params by reference; pass &params
- SVC predict returns Vec<f64> not Vec<i32>; change y to Vec<f64> and
  compare preds/y as f64 throughout

naive_bayes_workflow.rs:
- CategoricalNB<T> requires T: Unsigned; f64 does not satisfy this.
  Switch x matrix to DenseMatrix<u32> and y to Vec<u32>.
- MultinomialNB<TX,TY> requires TX: Unsigned + TY: Unsigned; same fix:
  use DenseMatrix<u32> for x and Vec<u32> for y.

* fix linting

* fix(tests): correct remaining API issues in decomposition and tree tests

decomposition_workflow.rs:
- `smartcore::Transformer` does not exist at the crate root (no pub use re-export
  in lib.rs); change all 3 occurrences to `smartcore::api::Transformer`
- PCA::fit is provided by UnsupervisedEstimator trait; add
  `use smartcore::api::UnsupervisedEstimator` alongside Transformer in each
  PCA test so the method resolves
- Remove unused `use smartcore::linalg::basic::arrays::Array` from
  pca_iris_reduce_workflow (Array is not called anywhere in that fn)

tree_workflow.rs:
- Remove unused `use smartcore::linalg::basic::arrays::Array` from
  decision_tree_classifier_iris_workflow

* fix(tests): SVC labels must be i32 (TY: Ord); fix decomposition Array trait import

svm_workflow.rs:
- SVC<TX, TY> requires TY: Number + Ord; f64 does not implement Ord.
  Switch y labels to Vec<i32> with +1/-1 convention, which is the
  standard SVC binary label type and satisfies the Ord bound.
  Update accuracy_f64 -> accuracy_i32 helper accordingly.

decomposition_workflow.rs:
- `shape()` is provided by the `Array` trait which must be in scope;
  add `use smartcore::linalg::basic::arrays::Array` in every test that
  calls `.shape()` on a DenseMatrix.
- PCA::fit and PCA::transform are inherent methods (not trait-dispatched
  in test context), so Transformer and UnsupervisedEstimator imports are
  unused; remove them to silence the 4 unused-import warnings.

* fix linting

* fix(tests): correct cross_validate API, Array2 trait imports, and Array::is_empty

model_selection_workflow.rs:
- CrossValidationParameters does not exist; use KFold::default().with_n_splits()
- cross_validate() takes an estimator instance via ::new(), not a fn pointer like ::fit
- score must be passed as &score_fn (reference), not by value
- is_empty() comes from the Array trait; add `use smartcore::linalg::basic::arrays::Array`
- from_iterator() comes from Array2 trait; add `use smartcore::linalg::basic::arrays::Array2`
  in the datasets-gated test

cluster_workflow.rs:
- from_iterator() requires Array2 trait in scope; add the import in the datasets test

neighbors_workflow.rs:
- same Array2 import needed for from_iterator in the datasets test

* fix linting

* fix(tests): SVC predict returns Vec<f64>; compare via cast from i32 labels

* fix(tests): import SupervisedEstimator trait to bring ::new() into scope

* fix linting

* fix(tests): chain .with_gamma() on Kernels::rbf() — gamma is required

* fix(tests): add Array2 import in pca_iris_reduce_workflow for from_iterator

* fix(tests): add wasm_bindgen_test attr to all integration tests + fix Array2 import in ensemble_workflow

* fix linting

* fix(tests): add wasm_bindgen_test attr + Array2 import to tree/linear/naive_bayes/preprocessing workflow tests

* fix linting

* fix(tests): replace make_blobs flaky exact-eq assertions with deterministic fixtures in lr_fit_predict_multiclass and lr_fit_predict_binary

* fix linting
@Mec-iS Mec-iS closed this Aug 10, 2026
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.