melite 0.1.11__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. melite-0.1.11/.gitignore +21 -0
  2. melite-0.1.11/CHANGELOG.md +343 -0
  3. melite-0.1.11/CITATION.cff +37 -0
  4. melite-0.1.11/COPYING +674 -0
  5. melite-0.1.11/COPYING.LESSER +165 -0
  6. melite-0.1.11/LICENSE +8 -0
  7. melite-0.1.11/PKG-INFO +267 -0
  8. melite-0.1.11/README.md +229 -0
  9. melite-0.1.11/environment.yml +0 -0
  10. melite-0.1.11/examples/example_config.toml +27 -0
  11. melite-0.1.11/examples/generate_sample_data.py +50 -0
  12. melite-0.1.11/melite/__init__.py +34 -0
  13. melite-0.1.11/melite/cli.py +174 -0
  14. melite-0.1.11/melite/config.py +263 -0
  15. melite-0.1.11/melite/config_default.toml +25 -0
  16. melite-0.1.11/melite/export_best_model.py +290 -0
  17. melite-0.1.11/melite/load_dataset.py +142 -0
  18. melite-0.1.11/melite/main.py +167 -0
  19. melite-0.1.11/melite/model_training.py +233 -0
  20. melite-0.1.11/melite/plot_metrics.py +111 -0
  21. melite-0.1.11/melite/predict.py +119 -0
  22. melite-0.1.11/melite/result_manager.py +128 -0
  23. melite-0.1.11/melite/version.py +21 -0
  24. melite-0.1.11/pyproject.toml +114 -0
  25. melite-0.1.11/tests/__init__.py +0 -0
  26. melite-0.1.11/tests/conftest.py +156 -0
  27. melite-0.1.11/tests/test_cli.py +129 -0
  28. melite-0.1.11/tests/test_config.py +80 -0
  29. melite-0.1.11/tests/test_examples.py +93 -0
  30. melite-0.1.11/tests/test_export.py +76 -0
  31. melite-0.1.11/tests/test_load_dataset.py +70 -0
  32. melite-0.1.11/tests/test_plot_metrics.py +47 -0
  33. melite-0.1.11/tests/test_predict.py +75 -0
  34. melite-0.1.11/tests/test_public_api.py +53 -0
  35. melite-0.1.11/tests/test_result_manager.py +91 -0
  36. melite-0.1.11/tests/test_version.py +37 -0
@@ -0,0 +1,21 @@
1
+ __pycache__/
2
+ .venv/
3
+ .vscode/
4
+ .env
5
+ data/
6
+ output/
7
+ raw/
8
+ tests_output.txt
9
+ *.npy
10
+ *.npz
11
+ *.py[cod]
12
+ *.pkl
13
+ *.joblib
14
+
15
+ tests_output.txt
16
+
17
+ site/
18
+
19
+ .pytest_tmp
20
+
21
+ dist/
@@ -0,0 +1,343 @@
1
+ # Changelog
2
+
3
+ All notable changes to MELITE will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ---
9
+
10
+ ## [0.1.11] - 2026-05-26
11
+
12
+ ### Changed
13
+ - Prepared documentation and package metadata for the first PyPI publication as
14
+ `melite`.
15
+ - Updated release metadata to use final version `0.1.11` instead of development
16
+ or previous release references.
17
+ - Clarified that MELITE is tabular at the modeling level: learning algorithms
18
+ consume numeric `X` and `y` arrays that may come from PCA, UMAP, fingerprints,
19
+ descriptors, clinical variables, experimental measurements, industrial
20
+ features, or manually selected numeric features.
21
+ - Clarified that the current dataset orchestration still reflects MELITE's
22
+ PCA/UMAP origin and uses concepts such as reduction type and level.
23
+ - Documented generalized `[datasets.*]` definitions as a future direction, not
24
+ current behavior.
25
+
26
+ ### Notes
27
+ - No functional behavior changes were made to training, model selection,
28
+ cross-validation, export, prediction, dataset loading, or CLI commands.
29
+
30
+ ---
31
+
32
+ ## [0.1.10] - 2026-05-25
33
+
34
+ ### Changed
35
+ - Renamed the project identity from MOSAIC to MELITE.
36
+ - Renamed the Python import package from `mosaic` to `melite`.
37
+ - Renamed the CLI command from `mosaic` to `melite`.
38
+ - Renamed the PyPI distribution target from `mosaic-tabular` to `melite`.
39
+ - Updated repository, documentation, CI, and publishing metadata for
40
+ `NanoBiostructuresRG/melite`.
41
+ - Updated public API imports to remain the same symbols under `melite`.
42
+ - Updated result report headers to use MELITE branding and current CLI commands.
43
+
44
+ ### Fixed
45
+ - Replaced the duplicated SVC RBF `C = 0.02` grid value with `C = 0.2`.
46
+
47
+ ### Validation
48
+ - `python -m pytest tests/ -v --basetemp=.review_pytest_tmp -o cache_dir=.review_pytest_cache` — 82 passed, 1 warning, 0 failed.
49
+ - `melite --help`, `melite run --help`, `melite export --help`, and `melite --version` — passed.
50
+ - Public API smoke test — `OK: 0.1.10`.
51
+ - `python -m build` — `melite-0.1.10.tar.gz` and `.whl` built successfully.
52
+ - `python -m twine check dist/*` — PASSED.
53
+ - `mkdocs build --strict` — build succeeded with no errors.
54
+ - Wheel includes `melite/`, `melite/config_default.toml`, metadata, and license files.
55
+ - Sdist inspected; local virtual environments, caches, generated review/docs
56
+ artifacts, build folders, raw/data/output folders, egg-info, `.pkl`, and
57
+ `.joblib` artifacts were not present.
58
+
59
+ ---
60
+
61
+ ## [0.1.9] - 2026-05-25
62
+
63
+ ### Added
64
+ - Added dedicated MkDocs pages for installation, quick start, CLI reference,
65
+ configuration, and release notes.
66
+ - Added a home-page workflow diagram:
67
+ `X / y -> mosaic run -> results.csv -> mosaic export -> .pkl -> predict()`.
68
+ - Added a "MOSAIC does / does not" scope table to clarify project boundaries.
69
+
70
+ ### Changed
71
+ - Reworked `docs/index.md` into a concise project overview with links to the
72
+ dedicated documentation pages.
73
+ - Updated `mkdocs.yml` navigation to expose the expanded documentation set.
74
+ - Updated `README.md` for `dev/v0.1.9`, test-suite status, live documentation
75
+ links, and planned PyPI publication as `mosaic-tabular`.
76
+ - Bumped version to `0.1.9` in `version.py` and `CITATION.cff`.
77
+
78
+ ### Validation
79
+ - `mkdocs build --strict` — build succeeded with no errors.
80
+ - `pytest tests/ -v` — 82 passed, 1 warning, 0 failed.
81
+ - `python -m build` — `mosaic_tabular-0.1.9.tar.gz` and `.whl` built successfully.
82
+ - `python -m twine check dist/*` — PASSED.
83
+ - `mosaic --version` -> `MOSAIC 0.1.9`.
84
+ - Wheel and sdist contents inspected; local virtual environments, caches,
85
+ generated review artifacts, build folders, raw/data/output folders,
86
+ egg-info, `.pkl`, and `.joblib` artifacts were not present.
87
+
88
+ ---
89
+
90
+ ## [0.1.8] - 2026-05-25
91
+
92
+ ### Added
93
+ - Added `.github/workflows/publish-to-pypi.yml` — manual PyPI publish workflow
94
+ triggered via `workflow_dispatch`. Validates tag format, verifies package
95
+ version matches tag, builds wheel and sdist, checks distributions, and
96
+ publishes via trusted publishing (OIDC, no API token required).
97
+ - Added `dist/` to `.gitignore`.
98
+
99
+ ### Changed
100
+ - Renamed PyPI package from `mosaic-ml` to `mosaic-tabular` in `pyproject.toml`.
101
+ - Updated `description` in `pyproject.toml` to:
102
+ `"Tabular classification benchmarking toolkit for model selection, repeated
103
+ stratified cross-validation, final model export, and artifact-based inference."`
104
+ - Updated `docs/api.md` to include `predict` in the public API reference.
105
+ - Updated `docs/index.md`: version badge, pre-stable note, four-card panel,
106
+ `predict` tab in Python API examples, `predict` in public API table.
107
+ - Updated `docs/stylesheets/extra.css`: added `.ms-grid--four` layout class.
108
+ - Updated `README.md`: corrected all references from `mosaic-ml` to
109
+ `mosaic-tabular`, replaced "inference" with "artifact-based inference"
110
+ throughout, updated roadmap and notes.
111
+ - Bumped version to `0.1.8` in `version.py` and `CITATION.cff`.
112
+
113
+ ### Validation
114
+ - `python -m build` — `mosaic_tabular-0.1.8.tar.gz` and `.whl` built successfully.
115
+ - `python -m twine check dist/*` — PASSED.
116
+ - `mkdocs build --strict` — build succeeded with no errors.
117
+ - `pytest tests/ -v` — 80 passed, 1 warning, 0 failed.
118
+ - `mosaic --version` → `MOSAIC 0.1.8`.
119
+
120
+ ---
121
+
122
+ ## [0.1.7] - 2026-05-25
123
+
124
+ ### Added
125
+ - Added `mosaic/predict.py` — inference module exposing `predict()` as a stable
126
+ public API symbol. Loads a `.pkl` artifact, returns predictions and class
127
+ probabilities for a new feature matrix.
128
+ - Added `predict` to `mosaic/__init__.py` and `__all__`.
129
+ - Added `.github/workflows/ci.yml` — CI workflow: tests on Python 3.11 and 3.12,
130
+ public import boundary check, wheel and sdist smoke installs, docs build.
131
+ - Added `.github/workflows/docs.yml` — deploys MkDocs site to GitHub Pages on
132
+ push to `main`.
133
+ - Added synthetic example dataset under `examples/`:
134
+ - `sample_labels.npy` — 100 binary labels, balanced classes.
135
+ - `sample_PCA70.npz` — 100×37 feature matrix with `X` and `y` keys.
136
+ - `example_config.toml` — TOML config pointing to example files.
137
+ - `generate_sample_data.py` — reproducible generation script (seed=42).
138
+ - Added `tests/test_predict.py` — 11 tests for the inference module.
139
+ - Added `tests/test_examples.py` — 11 tests for example dataset integrity.
140
+ - Added `tmp_model` fixture to `tests/conftest.py` — trained SVC saved as `.pkl`.
141
+ - Added `.pytest_tmp` to `.gitignore`.
142
+
143
+ ### Changed
144
+ - Updated `tests/test_public_api.py` — added `predict` import and `__all__` tests.
145
+ Total test count: **80 tests**.
146
+ - Rewrote `README.md` combining outside-in user perspective with full developer
147
+ documentation.
148
+ - Updated `mosaic/__init__.py` public API docstring to include `predict`.
149
+ - Bumped version to `0.1.7` in `version.py` and `CITATION.cff`.
150
+
151
+ ### Validation
152
+ - `pytest tests/ -v` — 80 passed, 1 warning, 0 failed.
153
+ - `mosaic run --smoke --config examples/example_config.toml` — completed successfully.
154
+ - `predict()` returns correct shapes for predictions and probabilities.
155
+ - CI workflow passes on Python 3.11 and 3.12 (GitHub Actions).
156
+ - `mkdocs build --strict` — build succeeded.
157
+
158
+ ---
159
+
160
+ ## [0.1.6] - 2026-05-23
161
+
162
+ ### Added
163
+ - Added NumPy-style docstrings to all 10 modules: `__init__.py`, `version.py`,
164
+ `config.py`, `load_dataset.py`, `result_manager.py`, `plot_metrics.py`,
165
+ `model_training.py`, `export_best_model.py`, `main.py`, and `cli.py`.
166
+ - Added MkDocs documentation site with `mkdocs-material` theme:
167
+ - `mkdocs.yml` — site configuration with MOSAIC steel-blue + amber palette.
168
+ - `docs/index.md` — home page with hero section, quick start, and Python API examples.
169
+ - `docs/api.md` — API Reference generated from docstrings via `mkdocstrings`.
170
+ - `docs/changelog.md` — changelog page (includes `CHANGELOG.md`).
171
+ - `docs/stylesheets/extra.css` — custom MOSAIC theme styles.
172
+
173
+ ### Changed
174
+ - Bumped version to `0.1.6` in `version.py` and `CITATION.cff`.
175
+
176
+ ### Validation
177
+ - `pytest tests/ -v` — 57 passed, 1 warning, 0 failed.
178
+ - `mkdocs build --strict` — build succeeded with no errors.
179
+ - `mkdocs serve` — site renders correctly locally.
180
+ - `python -c "help(mosaic.Config)"` — docstring visible.
181
+
182
+ ---
183
+
184
+ ## [0.1.5] - 2026-05-23
185
+
186
+ ### Added
187
+ - Defined stable public API in `mosaic/__init__.py`: `Config`, `load_dataset`,
188
+ `ResultManager`, `plot_cv_distributions`, and `__version__` are now importable
189
+ directly from `mosaic`.
190
+ - Added `__all__` to all modules: `config.py`, `load_dataset.py`,
191
+ `result_manager.py`, `plot_metrics.py`, `model_training.py`,
192
+ `export_best_model.py`, and `cli.py`.
193
+ - Added `tests/test_version.py` — 6 tests for version metadata.
194
+ - Added `tests/test_public_api.py` — 7 tests for public API imports and `__all__`.
195
+ - Added `tests/test_plot_metrics.py` — 5 tests for PNG output and directory creation.
196
+ - Added `tests/test_cli.py` — 8 tests for CLI help and version output.
197
+ - Added `pytest` to `environment.yml`.
198
+
199
+ ### Changed
200
+ - `mosaic/__init__.py` now exposes the stable public API with explicit imports
201
+ and `__all__`. Users can do `from mosaic import Config, load_dataset`.
202
+ - Bumped version to `0.1.5` in `version.py` and `CITATION.cff`.
203
+
204
+ ### Validation
205
+ - `pytest tests/ -v` — 57 passed, 1 warning (expected Agg backend warning), 0 failed.
206
+ - `from mosaic import Config, load_dataset, ResultManager, plot_cv_distributions, __version__` ✓
207
+ - `mosaic.__all__` contains exactly the 5 expected public symbols ✓
208
+ - CLI help and version tests pass via subprocess ✓
209
+
210
+ ---
211
+
212
+ ## [0.1.4] - 2026-05-22
213
+
214
+ ### Added
215
+ - Added formal `pytest` suite under `tests/` with 31 tests covering
216
+ `Config`, `load_dataset`, `ResultManager`, and `Finalizer`.
217
+ - Added `tests/conftest.py` with shared synthetic fixtures: labels, valid/invalid
218
+ `.npz` files, minimal `results.csv`, and a base `Config` instance.
219
+ - Added `tests_output.txt` to `.gitignore`.
220
+
221
+ ### Fixed
222
+ - Removed redundant `print()` progress calls from `main.py`; all progress now
223
+ goes through `logger.*` only. Smoke banner remains as `print()` (user-facing UI).
224
+ - Changed smoke-mode `logger.warning()` to `logger.info()` in `main.py` to avoid
225
+ spurious output when `--verbose` is not passed.
226
+ - Removed `logging.basicConfig(level=logging.INFO)` from `load_dataset.py` —
227
+ module-level `basicConfig` was overriding the package logger configuration.
228
+ - Improved error message for missing `.npz` file: now includes full expected path
229
+ and an actionable hint.
230
+ - Improved error message for missing `X` key in `.npz`: now raises `ValueError`
231
+ with filename and list of available keys.
232
+ - Improved label mismatch error: now includes both array shapes and differing
233
+ element count.
234
+ - Added guard in `Finalizer.__init__` for missing `results.csv`: raises
235
+ `FileNotFoundError` with path and actionable hint before attempting to read.
236
+ - Bumped version to `0.1.4` in `version.py` and `CITATION.cff`.
237
+
238
+ ### Validation
239
+ - `pytest tests/ -v` — 31 passed, 0 failed.
240
+ - `mosaic run --smoke` — silent output (smoke banner only, no logger noise).
241
+ - `mosaic run --smoke --verbose` — clean INFO logs, no duplicates.
242
+ - `mosaic export --row 0` (missing CSV) — descriptive `FileNotFoundError`.
243
+
244
+ ---
245
+
246
+ ## [0.1.3] - 2026-05-22
247
+
248
+ ### Added
249
+ - Added `pyproject.toml` with `hatchling` build backend and `[project.scripts]`
250
+ entry point: `mosaic = "mosaic.cli:main"`. Package is now installable via
251
+ `pip install -e .`.
252
+ - Added unified CLI `mosaic/cli.py` with subcommands `mosaic run` and
253
+ `mosaic export`, replacing the two separate entry points.
254
+ - Added global CLI flags: `--verbose` (INFO-level logging), `--config PATH`
255
+ (user TOML override), `--version`.
256
+ - Added `mosaic/config_default.toml` with externalized configuration: paths,
257
+ reduction types, levels, random state, CV settings, and active models.
258
+ - Added `Config.setup()` method to separate filesystem side effects from object
259
+ instantiation, enabling safe use in tests.
260
+ - Added `ResultManager.write_csv()` method, consolidating all file I/O under
261
+ `ResultManager`.
262
+ - Added `smoke` column to `results.csv` to mark runs generated in smoke mode.
263
+ - Added smoke-mode export guard: `mosaic export` blocks export of smoke results
264
+ with exit code 1. Use `mosaic export --force` to override with a visible
265
+ warning.
266
+ - Added package-level `NullHandler` logger in `mosaic/__init__.py`.
267
+
268
+ ### Changed
269
+ - `Config` now reads `config_default.toml` as the base configuration.
270
+ - `Config.__init__` no longer creates directories or sets random seeds.
271
+ - `Config.PARAM_GRID` is now built by `_build_param_grid()`.
272
+ - `main.py` now iterates over `config.REDUCTION_TYPES` instead of a hardcoded list.
273
+ - `main.py` delegates CSV writing to `ResultManager.write_csv()`.
274
+ - CLI logic centralized in `mosaic/cli.py`.
275
+ - Bumped version to `0.1.3` in `version.py` and `CITATION.cff`.
276
+
277
+ ### Validation
278
+ - `pip install -e .` succeeded in `mosaic_env`.
279
+ - `mosaic --help`, `mosaic run --help`, `mosaic export --help` verified.
280
+ - `mosaic --version` returns `MOSAIC 0.1.3`.
281
+ - `mosaic run --smoke --verbose` completed full PCA + UMAP run with INFO logging.
282
+ - `mosaic export --row 0 --force` exported with warning, `.pkl` artifact created.
283
+
284
+ ---
285
+
286
+ ## [0.1.2] - 2026-05-22
287
+
288
+ ### Changed
289
+ - Moved all source modules into a `mosaic/` package directory.
290
+ - Updated all intra-package imports to use the `mosaic.*` namespace.
291
+ - `result_manager.py` now reads `__version__` from `mosaic.version`.
292
+ - Updated `README.md` to reflect the `mosaic/` package structure.
293
+
294
+ ### Fixed
295
+ - Bumped version string in `version.py` to `0.1.2`.
296
+
297
+ ### Added
298
+ - Added `--smoke` flag to `mosaic.main` for lightweight benchmarking.
299
+ - Added `argparse` CLI to `mosaic.main` with `--smoke` flag and `--help` support.
300
+
301
+ ### Validation
302
+ - Python syntax validation passed for all modules under `mosaic/`.
303
+ - Dataset loading smoke test passed: PCA70 labels and features loaded correctly.
304
+ - SVC, Random Forest and XGBoost smoke tests passed; scores match v0.1.1 baseline.
305
+ - PNG figure generation smoke test passed.
306
+
307
+ ---
308
+
309
+ ## [0.1.1] - 2025-05-22
310
+
311
+ ### Changed
312
+ - Rewrote `README.md` to reflect the current pre-stable repository workflow.
313
+ - Changed project license from MIT to GNU LGPL v3.0 or later.
314
+ - Added GNU license files: `COPYING` and `COPYING.LESSER`.
315
+ - Added SPDX license metadata: `LGPL-3.0-or-later`.
316
+
317
+ ### Fixed
318
+ - Added validation to ensure embedded `.npz` labels match `raw/labels.npy`.
319
+ - Ensured plot output directories are created automatically before saving figures.
320
+
321
+ ### Added
322
+ - Added `version.py` with centralized project version metadata.
323
+ - Added `CITATION.cff` for software citation metadata.
324
+ - Added non-interactive model export support with `python export_best_model.py --row <index>`.
325
+
326
+ ### Validation
327
+ - Python syntax validation passed.
328
+ - PCA70 dataset loading passed.
329
+ - Export CLI help validation passed.
330
+ - Minimal SVC, Random Forest and XGBoost smoke tests passed in `mosaic_env`.
331
+
332
+ ---
333
+
334
+ ## [0.1.0] - 2025-05-22
335
+
336
+ ### Added
337
+ - Initial corrected pre-stable version of MOSAIC.
338
+ - Tabular classification benchmarking with PCA/UMAP reduced datasets.
339
+ - Grid search support for SVC, Random Forest and XGBoost.
340
+ - Repeated Stratified K-Fold evaluation.
341
+ - TXT/CSV result export.
342
+ - Final model export as `.pkl`.
343
+ - Three-panel metric plotting for F1, Accuracy and AUC-ROC.
@@ -0,0 +1,37 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use this software, please cite it as below."
3
+ type: software
4
+ title: "MELITE: Multi-model Evaluation and Learning for Inference-ready Tabular Experiments"
5
+ version: "0.1.11"
6
+ date-released: "2026-05-26"
7
+ authors:
8
+ - family-names: "Contreras-Torres"
9
+ given-names: "Flavio F."
10
+ orcid: "https://orcid.org/0000-0003-2375-131X"
11
+ affiliation: "Tecnologico de Monterrey"
12
+ - family-names: "Murrieta"
13
+ given-names: "Ana C."
14
+ orcid: "https://orcid.org/0000-0002-7619-8880"
15
+ affiliation: "Tecnologico de Monterrey"
16
+ repository-code: "https://github.com/NanoBiostructuresRG/melite"
17
+ license: "LGPL-3.0-or-later"
18
+ abstract: >-
19
+ MELITE is a pre-stable Python toolkit for tabular classification benchmarking,
20
+ model selection, repeated stratified cross-validation, final model export,
21
+ and artifact-based inference.
22
+ It operates at the tabular modeling level by consuming numeric feature
23
+ matrices and labels, benchmarks SVC, Random Forest and XGBoost classifiers,
24
+ evaluates model configurations with repeated stratified cross-validation,
25
+ exports tabular performance summaries, and supports final model retraining
26
+ and serialization as reusable model artifacts.
27
+ keywords:
28
+ - machine learning
29
+ - tabular classification
30
+ - model benchmarking
31
+ - cross-validation
32
+ - PCA
33
+ - UMAP
34
+ - SVC
35
+ - random forest
36
+ - XGBoost
37
+ - cheminformatics