sklears-cross-decomposition

Crates.iosklears-cross-decomposition
lib.rssklears-cross-decomposition
version0.1.0-beta.1
created_at2025-10-13 15:03:08.310166+00
updated_at2026-01-01 21:36:48.97094+00
descriptionCross decomposition algorithms (PLS, CCA)
homepagehttps://github.com/cool-japan/sklears
repositoryhttps://github.com/cool-japan/sklears
max_upload_size
id1880641
size1,899,103
KitaSan (cool-japan)

documentation

README

sklears-cross-decomposition

Crates.io Documentation License Minimum Rust Version

Latest release: 0.1.0-beta.1 (January 1, 2026). See the workspace release notes for highlights and upgrade guidance.

Overview

sklears-cross-decomposition offers Partial Least Squares (PLS) regressors/classifiers, Canonical Correlation Analysis (CCA), and related cross-decomposition utilities. The APIs mirror scikit-learn 1.5, while Rust-native optimizations deliver consistent performance gains.

Key Features

  • PLS Family: PLSRegression, PLSCanonical, PLSRegressionCV, and sparse extensions.
  • CCA & Variants: Dense and sparse canonical correlation, along with GPU-accelerated solvers.
  • Model Selection Integration: Works seamlessly with sklears pipelines, grid search, and feature engineering crates.
  • Robust Numerics: Regularization, deflation strategies, and whitening controls ensure stability on real-world datasets.

Quick Start

use sklears_cross_decomposition::PLSRegression;
use scirs2_core::ndarray::{array, Array2};

let x: Array2<f64> = array![
    [0.0, 1.0, 2.0],
    [1.0, 2.0, 3.0],
    [2.0, 3.0, 4.0],
];
let y: Array2<f64> = array![
    [1.0, 0.0],
    [2.0, 1.0],
    [3.0, 2.0],
];

let pls = PLSRegression::builder()
    .n_components(2)
    .scale(true)
    .max_iter(500)
    .tol(1e-6)
    .build();

let fitted = pls.fit(&x, &y)?;
let y_pred = fitted.predict(&x)?;

Status

  • Fully validated by the 11,292 passing workspace tests bundled with 0.1.0-beta.1.
  • Benchmarks show 8–20× speedups versus scikit-learn for large PLS problems.
  • Upcoming enhancements (incremental fit, streaming CCA) tracked in TODO.md.
Commit count: 0

cargo fmt