SciTeX ML (scitex-ml)
Reproducible classical and deep machine-learning utilities for scientific research.
Full Documentation · uv pip install scitex-ml[all]
Problem and Solution
| # | Problem | Solution |
|---|---|---|
| 1 | Boilerplate around scikit-learn — every paper re-implements Classifier factories, train/eval loops, classification reports, ROC/PR plots. |
Classifier + ClassificationReporter — thin factory over scikit-learn estimators that snaps directly into a reporter for cross-validation aware metrics, confusion matrices, and figure export. |
| 2 | Time-series CV done by hand — researchers re-derive blocking / sliding-window / calendar splitters per project, often with off-by-one bugs. | Time-series CV splitters — TimeSeriesStratifiedSplit, TimeSeriesBlockingSplit, TimeSeriesSlidingWindowSplit, TimeSeriesCalendarSplit ship with consistent APIs and tested edge cases. |
| 3 | Training-loop ergonomics — EarlyStopping, learning-curve logging, optimiser shortcuts, multi-task losses are all glue code that drifts between repos. |
First-class training utilities — EarlyStopping, LearningCurveLogger, MultiTaskLoss, get_optimizer / set_optimizer, vendored Ranger. |
| 4 | Heavy ML deps mixed with LLM SDKs — installing one pulls all of scikit-learn, torch, openai, anthropic. |
Split package — generative-AI lives in scitex-genai; scitex-ml keeps the classical / deep-ML stack and nothing else. |
Installation
pip install scitex-ml # core
pip install scitex-ml[heavy] # + torch / catboost / optuna / pytorch_pretrained_vit
pip install scitex-ml[mcp] # + fastmcp
pip install scitex-ml[all] # everything
Through the umbrella: pip install scitex[ml]. Requires Python ≥ 3.10.
Quick Start
import scitex_ml
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
X, y = load_iris(return_X_y=True)
X_tr, X_te, y_tr, y_te = train_test_split(X, y, random_state=0, stratify=y)
# Classifier — factory over scikit-learn estimators.
clf = scitex_ml.Classifier("LogisticRegression")
clf.fit(X_tr, y_tr)
print(f"test accuracy: {clf.score(X_te, y_te):.3f}")
# ClassificationReporter — metric tracking + figure export.
reporter = scitex_ml.ClassificationReporter(save_dir="./results")
reporter.calc_metrics(y_te, clf.predict(X_te), clf.predict_proba(X_te))
reporter.summarize()
reporter.save()
For a runnable walk-through see examples/01_classification.ipynb.
Demo
A complete classification + reporting walk-through (Iris, train/test
split, Classifier("LogisticRegression"), ClassificationReporter
metric persistence) lives in
examples/01_classification.ipynb.
flowchart LR
Data[load_iris<br/>train_test_split] --> Clf[scitex_ml.Classifier"LogisticRegression"]
Clf -->|fit / score| Pred[y_pred / y_proba]
Pred --> Reporter[scitex_ml.ClassificationReporter]
Reporter -->|calc_metrics| Metrics[bacc · ROC-AUC · Conf-Mat]
Reporter -->|save| Artefacts[results/<br/>metrics.csv · roc.png · pr.png]
A second examples/example_classifier.py runs the same flow as a script
so it can be wired into tests/examples/test_example_classifier.py for
CI smoke coverage.
Architecture
scitex-ml sits in the middle layer of the SciTeX ecosystem:
scitex-python (umbrella)
└── scitex.ml ── thin sys.modules-aliasing shim
└── scitex_ml (this package)
├── classification/ Classifier, ClassificationReporter,
│ time-series CV splitters
├── training/ EarlyStopping, LearningCurveLogger
├── loss/ MultiTaskLoss + regularisers
├── optim/ get_optimizer / set_optimizer + Ranger
├── metrics/ calc_bacc, calc_conf_mat, calc_roc_auc
├── clustering/ PCA + UMAP wrappers
├── feature_extraction/ ViT embeddings
├── feature_selection/ univariate / multivariate
├── plt/ ROC / PR / learning-curve / conf-mat plots
├── sampling/ undersampling helpers
├── sklearn/ scikit-learn integration helpers
└── sk/ sktime compatibility
Cross-package dependencies are minimal: scitex-logging, scitex-io,
scitex-plt, scitex-repro, scitex-types. Heavy deps (torch,
catboost, optuna, pytorch_pretrained_vit) live behind the [heavy]
extra and are gated by _AVAILABLE flags in the source so a pip install scitex-ml install without [heavy] still imports cleanly.
4 Interfaces
Python API ⭐⭐⭐ (primary)
import scitex_ml
# Time-series cross-validation
from scitex_ml.classification import TimeSeriesStratifiedSplit
splitter = TimeSeriesStratifiedSplit(n_splits=5)
# Training utilities
stopper = scitex_ml.EarlyStopping(patience=10, direction="minimize")
logger = scitex_ml.LearningCurveLogger()
# Multi-task loss + optimiser
mtl = scitex_ml.MultiTaskLoss(are_regression=[False, False])
optimizer = scitex_ml.set_optimizer(model, "adam", lr=1e-3)
# Metrics
result = scitex_ml.metrics.calc_bacc(y_true, y_pred)
cm = scitex_ml.metrics.calc_conf_mat(y_true, y_pred)
CLI ⭐ — none
scitex-ml ships no dedicated CLI. ML workflows are composed in Python and run via the umbrella scitex CLI / @scitex.session decorator.
MCP ⭐ — none
No MCP server in this package. The umbrella scitex CLI surfaces ML-adjacent MCP tools (e.g. scitex stats, scitex plt).
Skills ⭐⭐
Skill index for AI agents lives at src/scitex_ml/_skills/scitex-ml/SKILL.md. Sub-skills cover classification, training, loss, optim, clustering, metrics, sampling, feature-selection.
Part of SciTeX
scitex-ml is part of SciTeX. Install via the umbrella with pip install scitex[ml] to use as scitex.ml (Python).
import scitex
scitex.ml.Classifier # same object as scitex_ml.Classifier
scitex.ml.classification.TimeSeriesStratifiedSplit # deep paths resolve via the umbrella shim
scitex.ml delegates to scitex_ml — they share the same API.
The SciTeX system follows the Four Freedoms for Research below, inspired by the Free Software Definition:
Four Freedoms for Research
- The freedom to run your research anywhere — your machine, your terms.
- The freedom to study how every step works — from raw data to final manuscript.
- The freedom to redistribute your workflows, not just your papers.
- The freedom to modify any module and share improvements with the community.
AGPL-3.0 — because we believe research infrastructure deserves the same freedoms as the software it runs on.
Metadata
Release files for scitex-ml 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| scitex_ml-0.2.0.tar.gz | 7.4 MB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| scitex_ml-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.7 MB
Release files / scitex_ml-0.2.0.tar.gz
| Download URL | scitex_ml-0.2.0.tar.gz |
|---|---|
| Size | 7.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9fd7eb047b6b251f7f9e8de20f4d260b09ea704b6d019c11a0c4b9ba8ed56e42
|
|
BLAKE2b-256 checksum How to use checksums |
afc5f0c8979569afe839e1a87ddf2d665323aae0296f1158ef6057e47e4cffaf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 27, 2026.
Transparency logRelease files / scitex_ml-0.2.0-py3-none-any.whl
| Download URL | scitex_ml-0.2.0-py3-none-any.whl |
|---|---|
| Size | 7.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
93b7da9d2d8d469f6e8f926bdf303a64918fd84907fb7fdf0a0aa11cdc5cefde
|
|
BLAKE2b-256 checksum How to use checksums |
9436f1615142061ee3ae8c026b993f064a5ce5442e67059fe0802007706ea504
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 27, 2026.
Transparency logSecurity for scitex-ml 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for scitex_ml-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.