Changelog¶
All notable changes are recorded here. The format loosely follows Keep a Changelog.
Stability policy¶
While the version is 0.x the public API may change without a deprecation
cycle. From 1.0 onward, public-API changes will follow scikit-learn's
deprecation pattern (utils.deprecated, FutureWarning, a two-release window),
and default-value changes will be documented here.
Unreleased¶
Changed¶
- Lowered the supported Python floor from 3.13 to 3.12
(
requires-python = ">=3.12"); CI now tests 3.12 and 3.13, and lint/type checks target 3.12. Development still happens on 3.13 (.python-version). No API or behaviour change.
Changed (breaking, pre-1.0)¶
- Renamed the fitted attribute
rmsee_tormse_(uncorrected training root mean squared error). The old name implied a degrees-of-freedom-corrected calibration error, which it never computed; no alias is kept (pre-1.0). - Removed
OPLSDA'sprobabilityparameter and its in-sample Platt calibration (predict_proba,raw_score).OPLSDAis now a clean score classifier:decision_functionreturns the raw signed OPLS regression output andpredictits sign. For probabilities, wrap inCalibratedClassifierCV(OPLSDA(...))(cross-fitted, better calibrated). This also removes thepredict/predict_probaboundary inconsistency the in-sample calibrator caused. - Cross-validated selection of
n_orthogonalis now done with scikit-learn'sGridSearchCVdirectly — there is no bespoke selection API.OPLS.n_orthogonalis a plainint; the"auto"option and thecvparameter are removed from bothOPLSandOPLSDA, and theOPLSCVestimator and theselection.select_orthogonalfactory are both removed. UseGridSearchCV(OPLS(...), {"n_orthogonal": [...]}).fit(X, y)and readbest_params_["n_orthogonal"],best_estimator_, andcv_results_["mean_test_score"]. For a parsimony bias, pass arefitcallable (recipe in the README / quickstart). OPLSDACVwill not be added. UseGridSearchCV(OPLSDA(), {"n_orthogonal": [...]}, scoring="roc_auc"), which gives stratified folds for classification.- VIP is now exposed as lazy
OPLS.vip_/OPLS.ortho_vip_properties (and onOPLSDA, delegating to the inner OPLS), following scikit-learn'sfeature_importances_convention — computed on access, not eagerly infit. The publicscikit_opls.inspectionmodule and itsvip(model)/orthogonal_vip(model)functions are removed; the stateless math moved to a private_inspectionmodule. Feature selection is supported viaSelectFromModel(OPLS(), importance_getter="vip_", threshold=1.0)(the VIP > 1 rule), composable in aPipeline/GridSearchCV. predictive_weight(X, Y)now uses the leading left singular vector ofXᵀY, generalising to multivariateY. For single-columnYthe direction is unchanged (up to sign) and single-yOPLS output is bit-for-bit identical.
Added¶
-
O2PLS, a dense two-block O2PLS estimator with X/Y preprocessing, sequential X- and Y-orthogonal filtering, final joint-subspace re-estimation, and bidirectionalpredict/predict_xmethods. The v1 implementation is dense only and exposescoef_filtered_for scaled, X-filtered inputs rather than a raw-spacecoef_alias. -
OPLS.coef_raw_/OPLS.intercept_raw_: linear coefficients on the original raw input feature space, collapsing scaling, the orthogonal filter and the predictive PLS into one map, soX @ coef_raw_.T + intercept_raw_reproducespredict(X). No bare sklearncoef_alias is exposed (it would be the raw-space coefficient, not the engine's filtered-space one). -
OPLS.filter_transform(X)returns the preprocessed, orthogonal-filteredXactually passed to the predictive PLS engine (sopls_.predict(filter_transform(X))matchespredict(X)); useful for diagnostics and downstream modelling. -
Zensical documentation site (
zensical.toml, mkdocstrings, numpy docstring style) with azensical buildCI gate and a GitHub Pages (Actions) deploy workflow. -
OPLSScoresDisplayandSPlotDisplayplotting classes following scikit-learn's Display convention (from_estimator(...),plot(ax=...),ax_/figure_). -
OPLS.get_feature_names_outsoset_output(transform="pandas")yields named predictive-score columns (opls_pred0, …). -
n_jobsonvalidation.permutation_test(runs the independent permutations in parallel; reproducible regardless ofn_jobs). Cross-validatedn_orthogonalselection inheritsn_jobsfromGridSearchCV. -
_orthogonal.orthogonal_filter, a block-agnostic OSC-style deflation primitive shared byopls_filter(and a futureO2PLS). -
Full numpydoc docstrings on all public methods and functions.
-
OPLS.scoredocstring documenting the inheritedRegressorMixinR² score. -
Richer
__sklearn_tags__(target_tags.required,input_tags.sparse=False,non_deterministic=False) with tests asserting the resolved tags. -
ConvergenceWarningwhen the orthogonal filter truncates early. -
Input validation (
check_array,check_consistent_length) and ann_permutationsguard inpermutation_test;check_arrayin the plotting helpers. -
Explicit Ruff rule selection (
E,W,F,I,N,UP,D, numpy docstring convention). -
pytest-covand[tool.coverage]configuration. -
GitHub Actions CI (lint, format, type-check, tests, pre-commit) on Linux, macOS and Windows.
-
CONTRIBUTING.md, a pull-request template, andRELEASING.md.
Changed¶
matplotlibis now an optional dependency, moved to theplotextra (pip install scikit-opls[plot]). Onlyscikit_opls.plottingneeds it and it is imported lazily.OPLSDAuses its fittedLabelEncoderas the single class-label source.- Numerical tests use
sklearn.utils._testing.assert_allclose. - Pinned the pre-commit
ruffrev to the dev-groupruffversion.
0.1.0¶
- Initial release:
OPLSregressor andOPLSDAclassifier with a scikit-learn-compatible API, VIP scores, permutation testing and diagnostic plots.