CERM 1.0.0a1__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 (127) hide show
  1. cerm-1.0.0a1/AI_ASSISTANCE.md +20 -0
  2. cerm-1.0.0a1/CHANGELOG.md +38 -0
  3. cerm-1.0.0a1/CITATION.cff +23 -0
  4. cerm-1.0.0a1/CODE_OF_CONDUCT.md +6 -0
  5. cerm-1.0.0a1/CONTRIBUTING.md +34 -0
  6. cerm-1.0.0a1/LICENSE +201 -0
  7. cerm-1.0.0a1/LICENSES/LIBLINEAR-BSD-3-Clause.txt +29 -0
  8. cerm-1.0.0a1/LICENSES/SCIKIT-LEARN-BSD-3-Clause.txt +29 -0
  9. cerm-1.0.0a1/MANIFEST.in +25 -0
  10. cerm-1.0.0a1/PKG-INFO +256 -0
  11. cerm-1.0.0a1/PROVENANCE.md +60 -0
  12. cerm-1.0.0a1/README.md +204 -0
  13. cerm-1.0.0a1/SECURITY.md +36 -0
  14. cerm-1.0.0a1/SUPPORT.md +12 -0
  15. cerm-1.0.0a1/THIRD_PARTY_NOTICES.md +26 -0
  16. cerm-1.0.0a1/docs/advanced_usage.md +231 -0
  17. cerm-1.0.0a1/docs/api_reference.md +210 -0
  18. cerm-1.0.0a1/docs/api_stability.md +42 -0
  19. cerm-1.0.0a1/docs/architecture.md +112 -0
  20. cerm-1.0.0a1/docs/benchmarking.md +44 -0
  21. cerm-1.0.0a1/docs/binary_maturity_audit.md +100 -0
  22. cerm-1.0.0a1/docs/code_provenance.md +11 -0
  23. cerm-1.0.0a1/docs/compatibility.md +54 -0
  24. cerm-1.0.0a1/docs/errors.md +57 -0
  25. cerm-1.0.0a1/docs/fused_regression.md +137 -0
  26. cerm-1.0.0a1/docs/getting_started.md +191 -0
  27. cerm-1.0.0a1/docs/index.md +39 -0
  28. cerm-1.0.0a1/docs/inspection.md +71 -0
  29. cerm-1.0.0a1/docs/installation.md +80 -0
  30. cerm-1.0.0a1/docs/limitations.md +133 -0
  31. cerm-1.0.0a1/docs/parameter_inventory.md +119 -0
  32. cerm-1.0.0a1/docs/parameters.md +217 -0
  33. cerm-1.0.0a1/docs/release_checklist.md +45 -0
  34. cerm-1.0.0a1/docs/roadmap.md +95 -0
  35. cerm-1.0.0a1/docs/security.md +8 -0
  36. cerm-1.0.0a1/docs/tasks.md +163 -0
  37. cerm-1.0.0a1/examples/fused_regression.py +34 -0
  38. cerm-1.0.0a1/examples/gamma_tweedie.py +18 -0
  39. cerm-1.0.0a1/examples/generalized_regression.py +32 -0
  40. cerm-1.0.0a1/examples/hyperparameter_search.py +38 -0
  41. cerm-1.0.0a1/examples/intuitive_parameters.py +23 -0
  42. cerm-1.0.0a1/examples/multi_quantile.py +10 -0
  43. cerm-1.0.0a1/examples/multiclass.py +12 -0
  44. cerm-1.0.0a1/examples/multilabel.py +12 -0
  45. cerm-1.0.0a1/examples/multioutput_regression.py +11 -0
  46. cerm-1.0.0a1/examples/optimize_compile.py +17 -0
  47. cerm-1.0.0a1/examples/poisson_exposure.py +11 -0
  48. cerm-1.0.0a1/examples/quickstart.py +24 -0
  49. cerm-1.0.0a1/examples/regression.py +13 -0
  50. cerm-1.0.0a1/examples/scaling_controls.py +17 -0
  51. cerm-1.0.0a1/examples/search_cv.py +27 -0
  52. cerm-1.0.0a1/examples/typed_dataframe.py +26 -0
  53. cerm-1.0.0a1/examples/weighted_classification.py +8 -0
  54. cerm-1.0.0a1/mkdocs.yml +26 -0
  55. cerm-1.0.0a1/pyproject.toml +131 -0
  56. cerm-1.0.0a1/setup.cfg +4 -0
  57. cerm-1.0.0a1/src/CERM.egg-info/PKG-INFO +256 -0
  58. cerm-1.0.0a1/src/CERM.egg-info/SOURCES.txt +125 -0
  59. cerm-1.0.0a1/src/CERM.egg-info/dependency_links.txt +1 -0
  60. cerm-1.0.0a1/src/CERM.egg-info/requires.txt +29 -0
  61. cerm-1.0.0a1/src/CERM.egg-info/top_level.txt +1 -0
  62. cerm-1.0.0a1/src/cerm/__init__.py +117 -0
  63. cerm-1.0.0a1/src/cerm/_compat/__init__.py +19 -0
  64. cerm-1.0.0a1/src/cerm/_compat/sklearn.py +441 -0
  65. cerm-1.0.0a1/src/cerm/_experimental_undr_geometry.py +431 -0
  66. cerm-1.0.0a1/src/cerm/_internal/__init__.py +1 -0
  67. cerm-1.0.0a1/src/cerm/_internal/cerm_embedding_graph_fusion.py +222 -0
  68. cerm-1.0.0a1/src/cerm/_internal/cerm_embedding_native_codegen.py +103 -0
  69. cerm-1.0.0a1/src/cerm/_internal/cerm_fused_regression.py +1406 -0
  70. cerm-1.0.0a1/src/cerm/_internal/cerm_fused_regression_contracts.py +321 -0
  71. cerm-1.0.0a1/src/cerm/_internal/cerm_fused_regression_native_codegen.py +195 -0
  72. cerm-1.0.0a1/src/cerm/_internal/cerm_fused_regression_semantic.py +965 -0
  73. cerm-1.0.0a1/src/cerm/_internal/cerm_graph_autotune_v2.py +180 -0
  74. cerm-1.0.0a1/src/cerm/_internal/cerm_graph_int16_codegen.py +243 -0
  75. cerm-1.0.0a1/src/cerm/_internal/cerm_graph_native_codegen.py +210 -0
  76. cerm-1.0.0a1/src/cerm/_internal/cerm_graph_native_codegen_v2.py +304 -0
  77. cerm-1.0.0a1/src/cerm/_internal/cerm_graph_optimizer.py +932 -0
  78. cerm-1.0.0a1/src/cerm/_internal/cerm_graph_optimizer_v2.py +771 -0
  79. cerm-1.0.0a1/src/cerm/_internal/cerm_graph_quantization.py +366 -0
  80. cerm-1.0.0a1/src/cerm/_internal/cerm_hierarchical_residual.py +551 -0
  81. cerm-1.0.0a1/src/cerm/_internal/cerm_hierarchical_residual_legacy.py +1818 -0
  82. cerm-1.0.0a1/src/cerm/_internal/cerm_hybrid_native_codegen.py +117 -0
  83. cerm-1.0.0a1/src/cerm/_internal/cerm_hybrid_quotient_block.py +1231 -0
  84. cerm-1.0.0a1/src/cerm/_internal/cerm_multioutput_subspace.py +552 -0
  85. cerm-1.0.0a1/src/cerm/_internal/cerm_native_build.py +67 -0
  86. cerm-1.0.0a1/src/cerm/_internal/cerm_nested_representation.py +287 -0
  87. cerm-1.0.0a1/src/cerm/_internal/cerm_quotient_block.py +583 -0
  88. cerm-1.0.0a1/src/cerm/_internal/cerm_regression_native_codegen.py +210 -0
  89. cerm-1.0.0a1/src/cerm/_internal/cerm_shared_native_codegen.py +351 -0
  90. cerm-1.0.0a1/src/cerm/_internal/cerm_shared_statistics.py +825 -0
  91. cerm-1.0.0a1/src/cerm/_internal/cerm_stable_quotient_block.py +528 -0
  92. cerm-1.0.0a1/src/cerm/_internal/cerm_state_design.py +103 -0
  93. cerm-1.0.0a1/src/cerm/_internal/cerm_training_core_runtime.py +1087 -0
  94. cerm-1.0.0a1/src/cerm/_internal/cerm_typed_quotient_adapters_v4.py +1229 -0
  95. cerm-1.0.0a1/src/cerm/_internal/cerm_weighted_representation.py +456 -0
  96. cerm-1.0.0a1/src/cerm/_internal/native/cerm_training_core.cpp +1577 -0
  97. cerm-1.0.0a1/src/cerm/_show_versions.py +32 -0
  98. cerm-1.0.0a1/src/cerm/_version.py +1 -0
  99. cerm-1.0.0a1/src/cerm/adapters.py +13 -0
  100. cerm-1.0.0a1/src/cerm/adaptive_representation.py +291 -0
  101. cerm-1.0.0a1/src/cerm/calibration.py +230 -0
  102. cerm-1.0.0a1/src/cerm/compiler.py +3 -0
  103. cerm-1.0.0a1/src/cerm/config.py +81 -0
  104. cerm-1.0.0a1/src/cerm/default_regression.py +34 -0
  105. cerm-1.0.0a1/src/cerm/diagnostics.py +167 -0
  106. cerm-1.0.0a1/src/cerm/errors.py +67 -0
  107. cerm-1.0.0a1/src/cerm/estimator.py +1504 -0
  108. cerm-1.0.0a1/src/cerm/experimental_undr_v21.py +2154 -0
  109. cerm-1.0.0a1/src/cerm/fused_regression.py +301 -0
  110. cerm-1.0.0a1/src/cerm/generalized_regression.py +801 -0
  111. cerm-1.0.0a1/src/cerm/inspection.py +331 -0
  112. cerm-1.0.0a1/src/cerm/io.py +172 -0
  113. cerm-1.0.0a1/src/cerm/multioutput.py +380 -0
  114. cerm-1.0.0a1/src/cerm/multioutput_regression.py +578 -0
  115. cerm-1.0.0a1/src/cerm/native_runtime.py +97 -0
  116. cerm-1.0.0a1/src/cerm/objectives.py +381 -0
  117. cerm-1.0.0a1/src/cerm/params.py +431 -0
  118. cerm-1.0.0a1/src/cerm/portable.py +303 -0
  119. cerm-1.0.0a1/src/cerm/program.py +1153 -0
  120. cerm-1.0.0a1/src/cerm/regression.py +2755 -0
  121. cerm-1.0.0a1/src/cerm/resources.py +331 -0
  122. cerm-1.0.0a1/src/cerm/search.py +472 -0
  123. cerm-1.0.0a1/src/cerm/selection.py +209 -0
  124. cerm-1.0.0a1/src/cerm/shared_multitask.py +2057 -0
  125. cerm-1.0.0a1/src/cerm/training_cache.py +482 -0
  126. cerm-1.0.0a1/src/cerm/training_graph.py +888 -0
  127. cerm-1.0.0a1/src/cerm/validation.py +318 -0
@@ -0,0 +1,20 @@
1
+ # AI assistance
2
+
3
+ CERM was developed with substantial assistance from OpenAI's ChatGPT.
4
+
5
+ The human maintainer, Taishi Kawahara, determined the research direction,
6
+ statistical architecture, experiments, acceptance criteria, public API, and
7
+ release decisions. Generated code and text were reviewed, tested, modified, or
8
+ rejected before inclusion.
9
+
10
+ AI assistance does not imply endorsement, authorship, or maintenance by OpenAI.
11
+ OpenAI is not a copyright holder or project contributor.
12
+
13
+ CERM does not intentionally include third-party source code except where it is
14
+ explicitly identified in `THIRD_PARTY_NOTICES.md`. Before the initial public
15
+ release, the source tree was reviewed for embedded license notices, distinctive
16
+ public-code matches, and similarity to installed versions of NumPy, SciPy,
17
+ pandas, scikit-learn, joblib, XGBoost, LightGBM, and CatBoost. No high-confidence
18
+ third-party code match was identified. Automated review cannot prove the absence
19
+ of every possible similarity, so future reports will be investigated and
20
+ corrected when necessary.
@@ -0,0 +1,38 @@
1
+ # Changelog
2
+
3
+ ## 1.0.0a1
4
+
5
+ Initial public repository snapshot for CERM 1.0.0a1. PyPI publication is a separate release step.
6
+
7
+ - Publish the distribution as `CERM` while keeping the Python import package `cerm`.
8
+ - Use the canonical GitHub repository `Tk-visionary/CERM` and PyPI Trusted Publishing.
9
+ - License the public release under the Apache License 2.0 (`Apache-2.0`).
10
+ - Provide scikit-learn-compatible classification, regression, generalized regression,
11
+ multilabel, and multi-output estimator surfaces.
12
+ - Make fused residual V2 the ordinary top-level `CERMRegressor` implementation after
13
+ maturing its typed-input, sample-weight, semantic-export, portable, and native-runtime
14
+ contracts. Preserve the former finite-state Ridge regressor explicitly as
15
+ `CERMRidgeRegressor`; keep `CERMFusedRegressor` as a compatibility name for the fused
16
+ family.
17
+ - Keep the default fused regression capacity separate from Ridge-only parameter
18
+ vocabulary instead of adding an ambiguous `regression_strategy` switch.
19
+ - Expose finite-state model inspection through model summaries and structure tables.
20
+ - Keep semantic fitting, optimized prediction, export, and native compilation as
21
+ explicit separate stages.
22
+ - Keep research-scale experiments, OpenML audits, preregistrations, and external
23
+ benchmark tooling in a separate research workspace so the library repository stays
24
+ focused on package code, tests, documentation, examples, and release engineering.
25
+ - Keep unpromoted research mechanisms explicit and opt-in; promoted fused regression V2
26
+ is the intentional exception reflected in the ordinary regression estimator.
27
+ - Ship the cleaned public documentation, release metadata, multi-platform CI,
28
+ estimator checks, wheel/sdist verification, and installed-wheel smoke tests.
29
+ - Preserve the pre-public CERM development and reconstruction record privately for
30
+ provenance and audit, while starting the public repository from a clean snapshot.
31
+
32
+ ## Pre-public development history
33
+
34
+ Versions before `1.0.0a1` were internal research and release-preparation builds and
35
+ were not part of the public PyPI release line. Their detailed changelog, restoration
36
+ record, benchmark notes, patches, and research workspace are retained privately for
37
+ provenance and audit rather than published as part of the clean public repository
38
+ history.
@@ -0,0 +1,23 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use CERM in research, please cite this software."
3
+ title: "CERM"
4
+ type: software
5
+ authors:
6
+ - family-names: "Kawahara"
7
+ given-names: "Taishi"
8
+ version: "1.0.0a1"
9
+ license: "Apache-2.0"
10
+ repository-code: "https://github.com/Tk-visionary/CERM"
11
+ url: "https://github.com/Tk-visionary/CERM"
12
+ abstract: >-
13
+ CERM is an experimental compiler-aware finite-state learner for tabular
14
+ classification and regression, with auditable semantic programs, independent
15
+ multi-output bundles, and separate training and inference optimizations.
16
+ keywords:
17
+ - tabular machine learning
18
+ - classification
19
+ - regression
20
+ - multilabel classification
21
+ - finite-state models
22
+ - model compilation
23
+ - scikit-learn
@@ -0,0 +1,6 @@
1
+ # Code of conduct
2
+
3
+ Participants must communicate respectfully, focus criticism on technical work,
4
+ avoid harassment and discrimination, protect confidential information, and
5
+ respect security-reporting procedures. Maintainers may remove contributions or
6
+ restrict participation when conduct threatens a safe and productive project.
@@ -0,0 +1,34 @@
1
+ # Contributing
2
+
3
+ CERM is distributed under the Apache License 2.0. Contributions are welcome.
4
+
5
+ For local development:
6
+
7
+ ```bash
8
+ python -m pip install -e ".[test]"
9
+ python -m pytest
10
+ PYTHONPATH=src python scripts/run_estimator_checks.py
11
+ python scripts/check_package.py
12
+ python scripts/check_runtime_dependencies.py
13
+ ```
14
+
15
+ ## Contribution expectations
16
+
17
+ Changes to statistical behavior must include task-level tests and must state
18
+ whether they are an exact rewrite, a bounded-exact search change, or an
19
+ approximation. Changes to optimized or native backends must compare predictions
20
+ against the semantic backend.
21
+
22
+ Public API changes require a changelog entry and, after the API stabilizes, a
23
+ deprecation path. New private scikit-learn access is allowed only inside
24
+ `cerm._compat` and must have a public fallback.
25
+
26
+ Contributors must not submit code copied from a source whose license is
27
+ incompatible or unknown. Any adapted third-party code must retain required
28
+ copyright and license notices and must be recorded in
29
+ `THIRD_PARTY_NOTICES.md`. AI-assisted contributions must be reviewed and tested
30
+ by the human contributor before submission.
31
+
32
+ Unless explicitly stated otherwise, contributions intentionally submitted for
33
+ inclusion in CERM are provided under the Apache License 2.0, consistent with
34
+ Section 5 of that license.
cerm-1.0.0a1/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,29 @@
1
+ Copyright (c) 2007-2023 The LIBLINEAR Project.
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions
6
+ are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright
9
+ notice, this list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright
12
+ notice, this list of conditions and the following disclaimer in the
13
+ documentation and/or other materials provided with the distribution.
14
+
15
+ 3. Neither name of copyright holders nor the names of its contributors
16
+ may be used to endorse or promote products derived from this software
17
+ without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
23
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2007-2026 The scikit-learn developers.
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ * Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ * Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ * Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,25 @@
1
+ include README.md
2
+ include CHANGELOG.md
3
+ include LICENSE
4
+ include SECURITY.md
5
+ include SUPPORT.md
6
+ include CONTRIBUTING.md
7
+ include CODE_OF_CONDUCT.md
8
+ include THIRD_PARTY_NOTICES.md
9
+ include AI_ASSISTANCE.md
10
+ include PROVENANCE.md
11
+ include CITATION.cff
12
+ include mkdocs.yml
13
+ recursive-include docs *.md
14
+ recursive-include examples *.py
15
+ recursive-include src/cerm/_internal/native *.cpp
16
+ prune .github
17
+ prune tests
18
+ prune scripts
19
+ prune benchmarks
20
+ prune undr
21
+ prune dist
22
+ prune build
23
+ global-exclude *.py[cod]
24
+ global-exclude __pycache__
25
+ global-exclude .DS_Store
cerm-1.0.0a1/PKG-INFO ADDED
@@ -0,0 +1,256 @@
1
+ Metadata-Version: 2.4
2
+ Name: CERM
3
+ Version: 1.0.0a1
4
+ Summary: Compiler-oriented finite-state models for tabular classification and regression
5
+ Author: Taishi Kawahara
6
+ Maintainer: Taishi Kawahara
7
+ License-Expression: Apache-2.0
8
+ Project-URL: Homepage, https://github.com/Tk-visionary/CERM
9
+ Project-URL: Documentation, https://github.com/Tk-visionary/CERM/tree/main/docs
10
+ Project-URL: Repository, https://github.com/Tk-visionary/CERM
11
+ Project-URL: Issues, https://github.com/Tk-visionary/CERM/issues
12
+ Project-URL: Changelog, https://github.com/Tk-visionary/CERM/blob/main/CHANGELOG.md
13
+ Keywords: tabular-data,classification,regression,multilabel-classification,finite-state-models,scikit-learn,model-compilation
14
+ Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
+ Requires-Python: <3.14,>=3.10
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ License-File: THIRD_PARTY_NOTICES.md
27
+ License-File: LICENSES/LIBLINEAR-BSD-3-Clause.txt
28
+ License-File: LICENSES/SCIKIT-LEARN-BSD-3-Clause.txt
29
+ Requires-Dist: numpy<3,>=1.24
30
+ Requires-Dist: scipy<2,>=1.10
31
+ Requires-Dist: pandas<4,>=2.0
32
+ Requires-Dist: scikit-learn<2.0,>=1.6
33
+ Requires-Dist: joblib<2,>=1.3
34
+ Requires-Dist: threadpoolctl<4,>=3.1
35
+ Provides-Extra: test
36
+ Requires-Dist: pytest<10,>=8; extra == "test"
37
+ Requires-Dist: pytest-cov<8,>=5; extra == "test"
38
+ Requires-Dist: packaging<27,>=23; extra == "test"
39
+ Requires-Dist: tomli<3,>=2; python_version < "3.11" and extra == "test"
40
+ Provides-Extra: dev
41
+ Requires-Dist: pytest<10,>=8; extra == "dev"
42
+ Requires-Dist: pytest-cov<8,>=5; extra == "dev"
43
+ Requires-Dist: ruff<1,>=0.5; extra == "dev"
44
+ Requires-Dist: build<2,>=1.2; extra == "dev"
45
+ Requires-Dist: twine<8,>=5; extra == "dev"
46
+ Requires-Dist: packaging<27,>=23; extra == "dev"
47
+ Requires-Dist: tomli<3,>=2; python_version < "3.11" and extra == "dev"
48
+ Provides-Extra: docs
49
+ Requires-Dist: mkdocs<2,>=1.6; extra == "docs"
50
+ Requires-Dist: mkdocs-material<10,>=9.5; extra == "docs"
51
+ Dynamic: license-file
52
+
53
+ # CERM
54
+
55
+ [![CI](https://github.com/Tk-visionary/CERM/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/Tk-visionary/CERM/actions/workflows/ci.yml)
56
+ [![Python](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-3776AB?logo=python&logoColor=white)](https://www.python.org/)
57
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](./LICENSE)
58
+ [![scikit-learn](https://img.shields.io/badge/scikit--learn-compatible-F7931E?logo=scikitlearn&logoColor=white)](https://scikit-learn.org/)
59
+ [![Status](https://img.shields.io/badge/status-alpha-orange)](docs/api_stability.md)
60
+
61
+ [Documentation](docs/index.md) |
62
+ [Getting Started](docs/getting_started.md) |
63
+ [API Reference](docs/api_reference.md) |
64
+ [Changelog](CHANGELOG.md)
65
+
66
+ **Compiler-oriented finite-state models for tabular classification and regression.**
67
+
68
+ CERM is an experimental, scikit-learn-compatible learning library for dense
69
+ tabular data. It learns explicit finite-state main and interaction effects, then
70
+ keeps statistical fitting separate from prediction-program optimization and
71
+ native deployment. The design emphasizes **compact**, **auditable**, and
72
+ **deployable** tabular models without hiding the learned program behind a large
73
+ ensemble.
74
+
75
+ > **Alpha.** CERM is suitable for experimentation and independent evaluation.
76
+ > Sparse matrices, GPU training, and out-of-core training are not currently
77
+ > supported. Experimental APIs may change before a stable release.
78
+
79
+ ## Highlights
80
+
81
+ - **Familiar API.** Classification and regression estimators follow the normal
82
+ scikit-learn `fit`, `predict`, and `predict_proba` workflow.
83
+ - **Fused regression by default.** `CERMRegressor` uses fused residual V2: a
84
+ finite-state mean baseline plus gated residual-distribution correction. The
85
+ previous finite-state Ridge estimator is retained as `CERMRidgeRegressor`.
86
+ - **Explicit finite-state structure.** Main effects and interactions can be
87
+ inspected directly instead of being distributed across a large tree ensemble.
88
+ - **Compiler-oriented deployment.** Training, prediction optimization, export,
89
+ and native compilation are separate stages.
90
+ - **Auditable behavior.** Resolved parameters, fit diagnostics, feature tables,
91
+ interaction tables, and model summaries are available through public
92
+ inspection helpers where the fitted representation has that structure.
93
+ - **Research is separated from releases.** Experimental studies, OpenML audits,
94
+ preregistrations, and external benchmark protocols are maintained separately
95
+ from the installable library. Research artifacts will be published separately.
96
+
97
+ ## Installation
98
+
99
+ The PyPI distribution name is `CERM`; the Python import name is `cerm`.
100
+ After the first public release is visible on PyPI:
101
+
102
+ ```bash
103
+ python -m pip install CERM
104
+ ```
105
+
106
+ For an unreleased source checkout:
107
+
108
+ ```bash
109
+ git clone https://github.com/Tk-visionary/CERM.git
110
+ cd CERM
111
+ python -m pip install -e .
112
+ ```
113
+
114
+ For development and tests:
115
+
116
+ ```bash
117
+ python -m pip install -e ".[test]"
118
+ python -m pytest
119
+ ```
120
+
121
+ ## Quick start
122
+
123
+ ```python
124
+ from sklearn.datasets import load_breast_cancer
125
+ from sklearn.metrics import log_loss
126
+ from sklearn.model_selection import train_test_split
127
+
128
+ from cerm import CERMClassifier, model_summary
129
+
130
+ X, y = load_breast_cancer(return_X_y=True, as_frame=True)
131
+ X_train, X_test, y_train, y_test = train_test_split(
132
+ X, y, test_size=0.25, stratify=y, random_state=42
133
+ )
134
+
135
+ model = CERMClassifier(random_state=42).fit(X_train, y_train)
136
+ probability = model.predict_proba(X_test)[:, 1]
137
+
138
+ print("log loss:", log_loss(y_test, probability))
139
+ print(model_summary(model))
140
+ ```
141
+
142
+ For pandas DataFrames, non-numeric columns are categorical by default and the
143
+ fitted input schema is retained. Reordered prediction columns are restored to
144
+ the fitted order; missing or unexpected columns fail explicitly.
145
+
146
+ ## Estimators
147
+
148
+ ```python
149
+ from cerm import (
150
+ CERMClassifier,
151
+ CERMRegressor,
152
+ CERMRidgeRegressor,
153
+ CERMGeneralizedRegressor,
154
+ CERMMultiLabelClassifier,
155
+ CERMMultiOutputRegressor,
156
+ )
157
+ ```
158
+
159
+ `CERMClassifier` supports binary and multiclass classification.
160
+
161
+ `CERMRegressor` is the ordinary regression estimator and now uses fused residual
162
+ V2. Its validated default capacity is `max_features=24`,
163
+ `max_interaction_features=12`, and `max_pairs=4`. The fused procedure contains a
164
+ finite-state mean baseline and may select `current_mean`, `fused`, or the
165
+ small-sample raw fused correction according to its fitted gate.
166
+
167
+ `CERMRidgeRegressor` preserves the previous `CERMRegressor` finite-state Ridge
168
+ implementation and its historical parameter vocabulary. `CERMFusedRegressor`
169
+ remains available as a compatibility name for code that explicitly opted into
170
+ fused V2 before it became the default.
171
+
172
+ `CERMGeneralizedRegressor` exposes generalized objectives such as quantile and
173
+ count-family losses. Multilabel and multi-output targets use dedicated
174
+ estimators. See [task support](docs/tasks.md).
175
+
176
+ ## Parameters
177
+
178
+ Estimator families intentionally do not share a fake universal HPO vocabulary.
179
+ Use `get_tunable_params(model)` for the active estimator.
180
+
181
+ For default fused regression:
182
+
183
+ ```python
184
+ from cerm import CERMRegressor
185
+
186
+ model = CERMRegressor(
187
+ n_bins=10,
188
+ max_bins=16,
189
+ max_features=24,
190
+ max_interaction_features=12,
191
+ max_pairs=4,
192
+ random_state=42,
193
+ )
194
+ ```
195
+
196
+ For classification and historical Ridge regression, direct finite-state controls
197
+ include `max_bins`, `max_features`, `max_interaction_features`,
198
+ `max_interactions`, `interaction_order`, `reg_lambda`, `subsample`, and
199
+ `colsample` where supported. Human-language aliases remain compatibility
200
+ controls for those historical surfaces.
201
+
202
+ Use `get_tunable_params(model)` for the HPO-oriented view,
203
+ `get_search_params(model)` for search-family choices, `get_resource_params(model)`
204
+ for execution limits, and `get_convenience_params(model)` for the compatibility
205
+ alias view. See [parameters](docs/parameters.md).
206
+
207
+ ## Inspect what CERM fitted
208
+
209
+ ```python
210
+ from cerm import inspect_model, feature_table, interaction_table, structure_table
211
+
212
+ inspection = inspect_model(model)
213
+ features = feature_table(model)
214
+ interactions = interaction_table(model)
215
+ structure = structure_table(model)
216
+ ```
217
+
218
+ For compact logs, use `model_summary(model)`. Fused regression reports its engine,
219
+ selected branch, and public capacity through `fit_diagnostics_`; historical
220
+ finite-state estimators additionally expose their explicit selected structure.
221
+ See [model inspection](docs/inspection.md).
222
+
223
+ ## Save, export, and deploy
224
+
225
+ Python persistence:
226
+
227
+ ```python
228
+ path = model.save("cerm_model.joblib")
229
+ ```
230
+
231
+ Versioned CERM export:
232
+
233
+ ```python
234
+ manifest = model.export("cerm_export")
235
+ ```
236
+
237
+ `CERMRegressor.compile_native(...)` uses the fused native lowering.
238
+ `CERMRidgeRegressor` keeps the previous Ridge semantic/native contracts.
239
+ Prediction optimization and native compilation remain separate from statistical
240
+ training, so deployment rewrites do not silently reselect the fitted model. See
241
+ [advanced usage](docs/advanced_usage.md) and
242
+ [compatibility](docs/compatibility.md).
243
+
244
+ ## Documentation
245
+
246
+ - [Getting started](docs/getting_started.md)
247
+ - [API reference](docs/api_reference.md)
248
+ - [Default regression / fused V2](docs/fused_regression.md)
249
+ - [Model inspection](docs/inspection.md)
250
+ - [Validation errors](docs/errors.md)
251
+ - [Installation](docs/installation.md)
252
+ - [Parameters](docs/parameters.md)
253
+ - [Task support](docs/tasks.md)
254
+ - [Advanced usage](docs/advanced_usage.md)
255
+ - [Architecture](docs/architecture.md)
256
+ - [Limitations](docs/limitations.md)