Skip to main content

Crate solow

Crate solow 

Source
Expand description

§Solow

The comprehensive statistics and machine learning stack for Rust. 54 focused crates. Memory safe. Deterministic. Pure Rust.

Linear and generalized linear models, discrete choice, robust regression, time series and state-space models, survival analysis, mixed effects, Bayesian inference, clustering, tree ensembles, support vector machines, neural networks, kernel methods, dimensionality reduction, and change-point detection.

This umbrella crate re-exports the full public API of the workspace behind a single ergonomic prelude. Depend on solow once and you have every module reachable at solow::<module>::*: regression, glm, discrete, stats, tsa, statespace, var, regime, mixed, gee, gam, duration, multivariate, cross_decomposition, covariance, cluster, tree, ensemble, svm, neural, naive_bayes, neighbors, discriminant, decomposition, manifold, kernel_approx, semi_supervised, multi, calibration, gp, cv, metrics, pipeline, feature_selection, preprocessing, text, impute, datasets, bayes, emplike, copula, formula, fit, nonparametric, robust, othermod, distributions, viz, graphics, summary.

§Why Solow

  • Memory safe. #![forbid(unsafe_code)] on every crate.
  • Deterministic. Every stochastic estimator uses a portable MMIX-LCG PRNG. A fixed seed reproduces bit-identical fits across runs, platforms, and CI hosts.
  • Cross-verified. Every deterministic estimator is checked against committed golden reference fixtures on every CI run. Closed-form solvers agree bit-wise to 1e-10.
  • Pure Rust. No system LAPACK. No BLAS. No Python runtime. No C dependencies beyond libc.
  • Single binary. Deploys anywhere Rust runs, including WebAssembly.

§Quick start

use solow::prelude::*;
use ndarray::array;

let y = array![2.5, 3.4, 4.7, 5.1, 6.5];
let x = array![[1.0, 1.0], [1.0, 2.0], [1.0, 3.0], [1.0, 4.0], [1.0, 5.0]];
let res = LinearModel::ols(y, x).unwrap().fit().unwrap();
assert!(res.rsquared > 0.98);

The prelude pulls in the everyday surface: error and numeric types, the formula-driven fit helpers (ols, wls, gls, glm, logit, probit, poisson), the workhorse estimators (LinearModel, Glm, Logit, Svc, RandomForestClassifier, GradientBoostingRegressor, MlpClassifier, KMeans, Dbscan, Pca, Sarimax, Var, and dozens more), the everyday metrics (mean_squared_error, r2_score, accuracy_score, roc_auc_score, log_loss, classification_report, silhouette_score, pairwise_distances), and the cross-validation splitters and helpers (KFold, StratifiedKFold, TimeSeriesSplit, PurgedKFold, cross_val_score, bootstrap_ci).

§Beyond the classical stack

Capabilities that few libraries expose as first-class modules:

  • Change-point detection: pelt (Killick, Fearnhead, Eckley 2012), cusum, binary_segmentation.
  • Volatility: Garch11 with iterated multi-step variance forecast.
  • Extreme value analysis: Gev, Gpd with return_level(T) and peaks-over-threshold fit.
  • Effect sizes: Cohen d, Hedges g, Glass delta, eta squared, omega squared, Cliff delta, Cramer V.
  • Meta-analysis: fixed-effect and DerSimonian-Laird random-effects with Cochran Q, I², τ².
  • Control charts: two-sided CUSUM and EWMA (Roberts 1959) with signed alarm streams.
  • Block bootstrap: moving, circular, and stationary variants for time series.
  • Conformal prediction: SplitConformal, JackknifePlus for distribution-free prediction intervals.

§Correctness

Correctness is the product. Solow ships a multi-layer verification stack.

  • Reference fixtures: every deterministic estimator has a committed golden fixture generated from a well-known reference implementation. A Rust replay test re-checks each fixture on every CI run.
  • NIST StRD certified cases: re-run on every CI. Worst-case certified relative error across the suite is 2.5e-10. Longley (cond ~10¹⁰) matches certified coefficients to ~1e-13 because the QR/SVD path never forms XᵀX.
  • Zero unsafe: #![forbid(unsafe_code)] on every crate.
  • Deterministic PRNG: every stochastic estimator uses a portable MMIX-LCG. A fixed seed produces bit-identical output across runs, platforms, and CI hosts.

Run the full CI locally with cargo test --workspace (1000+ tests).

Re-exports§

pub use solow_bayes as bayes;
pub use solow_calibration as calibration;
pub use solow_cluster as cluster;
pub use solow_copula as copula;
pub use solow_core as core;
pub use solow_covariance as covariance;
pub use solow_cross_decomposition as cross_decomposition;
pub use solow_cv as cv;
pub use solow_datasets as datasets;
pub use solow_decomposition as decomposition;
pub use solow_discrete as discrete;
pub use solow_discriminant as discriminant;
pub use solow_distributions as distributions;
pub use solow_duration as duration;
pub use solow_emplike as emplike;
pub use solow_ensemble as ensemble;
pub use solow_feature_selection as feature_selection;
pub use solow_fit as fit;
pub use solow_formula as formula;
pub use solow_gam as gam;
pub use solow_gee as gee;
pub use solow_glm as glm;
pub use solow_gp as gp;
pub use solow_graphics as graphics;
pub use solow_impute as impute;
pub use solow_kernel_approx as kernel_approx;
pub use solow_linalg as linalg;
pub use solow_manifold as manifold;
pub use solow_metrics as metrics;
pub use solow_mixed as mixed;
pub use solow_multi as multi;
pub use solow_multivariate as multivariate;
pub use solow_naive_bayes as naive_bayes;
pub use solow_neighbors as neighbors;
pub use solow_neural as neural;
pub use solow_nonparametric as nonparametric;
pub use solow_optimize as optimize;
pub use solow_othermod as othermod;
pub use solow_pipeline as pipeline;
pub use solow_preprocessing as preprocessing;
pub use solow_regime as regime;
pub use solow_regression as regression;
pub use solow_robust as robust;
pub use solow_semi_supervised as semi_supervised;
pub use solow_statespace as statespace;
pub use solow_stats as stats;
pub use solow_summary as summary;
pub use solow_svm as svm;
pub use solow_text as text;
pub use solow_tree as tree;
pub use solow_tsa as tsa;
pub use solow_var as var;
pub use solow_viz as viz;
pub use ndarray;

Modules§

prelude
The recommended glob-import for day-to-day use.