causilo 1.0.2__tar.gz → 1.5.0__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 (183) hide show
  1. {causilo-1.0.2 → causilo-1.5.0}/MANIFEST.in +1 -0
  2. causilo-1.5.0/PKG-INFO +127 -0
  3. causilo-1.5.0/README.md +91 -0
  4. causilo-1.5.0/docs/assets/benchmark-overview.png +0 -0
  5. causilo-1.5.0/docs/assets/causilo-banner-compact.png +0 -0
  6. causilo-1.5.0/docs/assets/causilo-banner.png +0 -0
  7. causilo-1.5.0/docs/assets/causilo-logo.png +0 -0
  8. causilo-1.5.0/docs/benchmarks/README.md +20 -0
  9. causilo-1.5.0/docs/checkpoints.md +55 -0
  10. causilo-1.5.0/docs/inference.md +325 -0
  11. causilo-1.5.0/examples/_model_options.py +10 -0
  12. causilo-1.5.0/examples/batched_prediction.py +30 -0
  13. {causilo-1.0.2 → causilo-1.5.0}/examples/cached_prediction.py +4 -1
  14. {causilo-1.0.2 → causilo-1.5.0}/examples/classification.py +4 -1
  15. {causilo-1.0.2 → causilo-1.5.0}/examples/regression.py +4 -1
  16. {causilo-1.0.2 → causilo-1.5.0}/examples/save_restore.py +7 -5
  17. {causilo-1.0.2 → causilo-1.5.0}/pyproject.toml +7 -4
  18. {causilo-1.0.2 → causilo-1.5.0}/src/causilo/__init__.py +2 -2
  19. causilo-1.5.0/src/causilo/batch.py +71 -0
  20. causilo-1.5.0/src/causilo/checkpoint_io.py +36 -0
  21. causilo-1.5.0/src/causilo/estimators.py +397 -0
  22. causilo-1.5.0/src/causilo/model_selection.py +110 -0
  23. causilo-1.5.0/src/causilo/serialization.py +154 -0
  24. causilo-1.5.0/src/causilo/v1_0/__init__.py +1 -0
  25. causilo-1.5.0/src/causilo/v1_0/batch.py +22 -0
  26. causilo-1.5.0/src/causilo/v1_0/checkpoints.py +60 -0
  27. {causilo-1.0.2/src/causilo → causilo-1.5.0/src/causilo/v1_0}/data/dataset.py +18 -3
  28. {causilo-1.0.2/src/causilo → causilo-1.5.0/src/causilo/v1_0}/data/encoding.py +6 -7
  29. causilo-1.5.0/src/causilo/v1_0/data/frequency.py +127 -0
  30. causilo-1.5.0/src/causilo/v1_0/data/normalization.py +264 -0
  31. {causilo-1.0.2/src/causilo → causilo-1.5.0/src/causilo/v1_0}/ecoc.py +46 -29
  32. {causilo-1.0.2/src/causilo → causilo-1.5.0/src/causilo/v1_0}/engine.py +67 -84
  33. causilo-1.5.0/src/causilo/v1_0/execution/batched.py +221 -0
  34. causilo-1.5.0/src/causilo/v1_0/execution/cached.py +94 -0
  35. {causilo-1.0.2/src/causilo → causilo-1.5.0/src/causilo/v1_0}/execution/chunks.py +27 -11
  36. {causilo-1.0.2/src/causilo → causilo-1.5.0/src/causilo/v1_0}/execution/direct.py +61 -87
  37. {causilo-1.0.2/src/causilo → causilo-1.5.0/src/causilo/v1_0}/execution/memory.py +22 -0
  38. {causilo-1.0.2/src/causilo → causilo-1.5.0/src/causilo/v1_0}/execution/recompute.py +22 -17
  39. {causilo-1.0.2/src/causilo → causilo-1.5.0/src/causilo/v1_0}/execution/runner.py +77 -22
  40. {causilo-1.0.2/src/causilo → causilo-1.5.0/src/causilo/v1_0}/model.py +1 -1
  41. causilo-1.5.0/src/causilo/v1_0/nn/cache.py +51 -0
  42. {causilo-1.0.2/src/causilo → causilo-1.5.0/src/causilo/v1_0}/nn/column.py +14 -7
  43. {causilo-1.0.2/src/causilo → causilo-1.5.0/src/causilo/v1_0}/nn/layers/attention.py +38 -10
  44. {causilo-1.0.2/src/causilo → causilo-1.5.0/src/causilo/v1_0}/nn/layers/scaling.py +9 -3
  45. {causilo-1.0.2/src/causilo → causilo-1.5.0/src/causilo/v1_0}/nn/prediction.py +9 -7
  46. {causilo-1.0.2/src/causilo → causilo-1.5.0/src/causilo/v1_0}/nn/row.py +17 -10
  47. causilo-1.5.0/src/causilo/v1_0/outputs.py +42 -0
  48. causilo-1.5.0/src/causilo/v1_0/prediction.py +84 -0
  49. {causilo-1.0.2/src/causilo → causilo-1.5.0/src/causilo/v1_0}/quantiles.py +0 -11
  50. causilo-1.5.0/src/causilo/v1_0/runtime.py +38 -0
  51. {causilo-1.0.2/src/causilo → causilo-1.5.0/src/causilo/v1_0}/serialization.py +39 -60
  52. causilo-1.5.0/src/causilo/v1_5/__init__.py +1 -0
  53. causilo-1.5.0/src/causilo/v1_5/batch.py +9 -0
  54. causilo-1.5.0/src/causilo/v1_5/checkpoints.py +55 -0
  55. causilo-1.5.0/src/causilo/v1_5/data/__init__.py +1 -0
  56. causilo-1.5.0/src/causilo/v1_5/data/categorical.py +217 -0
  57. causilo-1.5.0/src/causilo/v1_5/data/columns.py +123 -0
  58. causilo-1.5.0/src/causilo/v1_5/data/context_sampling.py +66 -0
  59. causilo-1.5.0/src/causilo/v1_5/data/dataset.py +243 -0
  60. causilo-1.5.0/src/causilo/v1_5/data/encoding.py +169 -0
  61. causilo-1.5.0/src/causilo/v1_5/data/ensemble.py +108 -0
  62. causilo-1.5.0/src/causilo/v1_5/data/feature_views.py +198 -0
  63. causilo-1.5.0/src/causilo/v1_5/data/frequency.py +40 -0
  64. causilo-1.5.0/src/causilo/v1_5/data/normalization.py +103 -0
  65. causilo-1.5.0/src/causilo/v1_5/data/schema.py +66 -0
  66. causilo-1.5.0/src/causilo/v1_5/data/target.py +26 -0
  67. causilo-1.5.0/src/causilo/v1_5/engine.py +177 -0
  68. causilo-1.5.0/src/causilo/v1_5/execution/__init__.py +5 -0
  69. causilo-1.5.0/src/causilo/v1_5/execution/cache.py +82 -0
  70. causilo-1.5.0/src/causilo/v1_5/execution/chunks.py +235 -0
  71. causilo-1.5.0/src/causilo/v1_5/execution/column.py +135 -0
  72. causilo-1.5.0/src/causilo/v1_5/execution/device_mean.py +82 -0
  73. causilo-1.5.0/src/causilo/v1_5/execution/direct.py +481 -0
  74. causilo-1.5.0/src/causilo/v1_5/execution/fit.py +157 -0
  75. causilo-1.5.0/src/causilo/v1_5/execution/memory.py +303 -0
  76. causilo-1.5.0/src/causilo/v1_5/execution/outputs.py +108 -0
  77. causilo-1.5.0/src/causilo/v1_5/execution/parallel.py +194 -0
  78. causilo-1.5.0/src/causilo/v1_5/execution/precision.py +40 -0
  79. causilo-1.5.0/src/causilo/v1_5/execution/prediction.py +162 -0
  80. causilo-1.5.0/src/causilo/v1_5/execution/predictor.py +98 -0
  81. causilo-1.5.0/src/causilo/v1_5/execution/quantiles.py +56 -0
  82. causilo-1.5.0/src/causilo/v1_5/execution/recompute.py +472 -0
  83. causilo-1.5.0/src/causilo/v1_5/execution/row.py +37 -0
  84. causilo-1.5.0/src/causilo/v1_5/execution/runner.py +235 -0
  85. causilo-1.5.0/src/causilo/v1_5/execution/sampled.py +132 -0
  86. causilo-1.5.0/src/causilo/v1_5/execution/serialization.py +80 -0
  87. causilo-1.5.0/src/causilo/v1_5/execution/transfers.py +128 -0
  88. causilo-1.5.0/src/causilo/v1_5/kernels/__init__.py +5 -0
  89. causilo-1.5.0/src/causilo/v1_5/kernels/triton/__init__.py +1 -0
  90. causilo-1.5.0/src/causilo/v1_5/kernels/triton/cls_attention.py +105 -0
  91. causilo-1.5.0/src/causilo/v1_5/kernels/triton/cls_readout.py +110 -0
  92. causilo-1.5.0/src/causilo/v1_5/kernels/triton/head_normalization.py +64 -0
  93. causilo-1.5.0/src/causilo/v1_5/kernels/triton/query_gain.py +48 -0
  94. causilo-1.5.0/src/causilo/v1_5/kernels/triton/regression_mean.py +44 -0
  95. causilo-1.5.0/src/causilo/v1_5/kernels/triton/residual_normalization.py +77 -0
  96. causilo-1.5.0/src/causilo/v1_5/kernels/triton/swiglu.py +24 -0
  97. causilo-1.5.0/src/causilo/v1_5/nn/__init__.py +1 -0
  98. causilo-1.5.0/src/causilo/v1_5/nn/cache.py +41 -0
  99. causilo-1.5.0/src/causilo/v1_5/nn/checkpoint.py +37 -0
  100. causilo-1.5.0/src/causilo/v1_5/nn/column.py +71 -0
  101. causilo-1.5.0/src/causilo/v1_5/nn/ecdf.py +90 -0
  102. causilo-1.5.0/src/causilo/v1_5/nn/embeddings.py +68 -0
  103. causilo-1.5.0/src/causilo/v1_5/nn/frequency.py +25 -0
  104. causilo-1.5.0/src/causilo/v1_5/nn/layers/__init__.py +1 -0
  105. causilo-1.5.0/src/causilo/v1_5/nn/layers/attention.py +170 -0
  106. causilo-1.5.0/src/causilo/v1_5/nn/layers/feedforward.py +56 -0
  107. causilo-1.5.0/src/causilo/v1_5/nn/layers/functional.py +119 -0
  108. causilo-1.5.0/src/causilo/v1_5/nn/layers/normalization.py +62 -0
  109. causilo-1.5.0/src/causilo/v1_5/nn/layers/scaling.py +85 -0
  110. causilo-1.5.0/src/causilo/v1_5/nn/model.py +21 -0
  111. causilo-1.5.0/src/causilo/v1_5/nn/model_config.py +40 -0
  112. causilo-1.5.0/src/causilo/v1_5/nn/prediction.py +81 -0
  113. causilo-1.5.0/src/causilo/v1_5/nn/row.py +108 -0
  114. causilo-1.5.0/src/causilo/v1_5/runtime.py +25 -0
  115. causilo-1.5.0/src/causilo/v1_5/serialization.py +59 -0
  116. causilo-1.5.0/src/causilo/validation.py +22 -0
  117. causilo-1.5.0/src/causilo.egg-info/PKG-INFO +127 -0
  118. causilo-1.5.0/src/causilo.egg-info/SOURCES.txt +170 -0
  119. causilo-1.5.0/tests/api/test_batched_api.py +379 -0
  120. causilo-1.5.0/tests/api/test_checkpoints.py +390 -0
  121. causilo-1.5.0/tests/api/test_context_persistence.py +160 -0
  122. causilo-1.5.0/tests/api/test_logits.py +268 -0
  123. causilo-1.0.2/tests/test_fitted_contract.py → causilo-1.5.0/tests/api/test_pretrained_context.py +92 -56
  124. {causilo-1.0.2/tests → causilo-1.5.0/tests/api}/test_quantiles.py +33 -22
  125. causilo-1.5.0/tests/conftest.py +113 -0
  126. causilo-1.5.0/tests/execution/test_batch_scheduler.py +157 -0
  127. causilo-1.5.0/tests/execution/test_batched_runner.py +137 -0
  128. causilo-1.5.0/tests/execution/test_context_transfers.py +194 -0
  129. causilo-1.5.0/tests/execution/test_device_mean.py +82 -0
  130. {causilo-1.0.2/tests → causilo-1.5.0/tests/execution}/test_embedding.py +2 -3
  131. causilo-1.5.0/tests/execution/test_host_cache_reuse.py +153 -0
  132. causilo-1.5.0/tests/execution/test_inference_cache.py +356 -0
  133. causilo-1.5.0/tests/execution/test_inference_memory.py +245 -0
  134. causilo-1.5.0/tests/execution/test_inference_precision.py +238 -0
  135. {causilo-1.0.2/tests → causilo-1.5.0/tests/execution}/test_memory.py +3 -3
  136. causilo-1.5.0/tests/execution/test_multi_device_inference.py +372 -0
  137. {causilo-1.0.2/tests → causilo-1.5.0/tests/execution}/test_partitioning.py +34 -5
  138. causilo-1.5.0/tests/execution/test_query_replay.py +177 -0
  139. causilo-1.5.0/tests/execution/test_query_scaling.py +95 -0
  140. {causilo-1.0.2/tests → causilo-1.5.0/tests/execution}/test_recompute.py +63 -79
  141. {causilo-1.0.2/tests → causilo-1.5.0/tests/execution}/test_row.py +4 -8
  142. causilo-1.5.0/tests/execution/test_sampled_retries.py +71 -0
  143. {causilo-1.0.2 → causilo-1.5.0}/tests/helpers/restore_probe.py +2 -2
  144. causilo-1.5.0/tests/preprocessing/test_categorical_features.py +138 -0
  145. causilo-1.5.0/tests/preprocessing/test_context_sampling.py +300 -0
  146. causilo-1.0.2/tests/test_ecoc.py → causilo-1.5.0/tests/preprocessing/test_ecoc_codec.py +2 -2
  147. causilo-1.5.0/tests/preprocessing/test_ensemble_views.py +221 -0
  148. causilo-1.5.0/tests/preprocessing/test_feature_views.py +212 -0
  149. causilo-1.5.0/tests/preprocessing/test_input_precision.py +93 -0
  150. causilo-1.5.0/tests/preprocessing/test_input_schema.py +107 -0
  151. causilo-1.5.0/tests/preprocessing/test_many_class_context.py +192 -0
  152. causilo-1.5.0/tests/preprocessing/test_numeric_preprocessing.py +45 -0
  153. causilo-1.0.2/tests/test_normalization.py → causilo-1.5.0/tests/preprocessing/test_power_normalization.py +6 -6
  154. causilo-1.5.0/tests/weights/test_frequency_attention.py +211 -0
  155. causilo-1.5.0/tests/weights/test_frequency_integration.py +124 -0
  156. causilo-1.5.0/tests/weights/test_frequency_normalization.py +158 -0
  157. causilo-1.5.0/tests/weights/test_frequency_preparation.py +182 -0
  158. causilo-1.5.0/tests/weights/test_frequency_pretrained.py +61 -0
  159. causilo-1.5.0/tests/weights/test_frequency_weights.py +195 -0
  160. causilo-1.0.2/PKG-INFO +0 -154
  161. causilo-1.0.2/README.md +0 -121
  162. causilo-1.0.2/src/causilo/checkpoints.py +0 -54
  163. causilo-1.0.2/src/causilo/data/normalization.py +0 -161
  164. causilo-1.0.2/src/causilo/estimators.py +0 -186
  165. causilo-1.0.2/src/causilo/execution/cached.py +0 -87
  166. causilo-1.0.2/src/causilo/nn/cache.py +0 -28
  167. causilo-1.0.2/src/causilo.egg-info/PKG-INFO +0 -154
  168. causilo-1.0.2/src/causilo.egg-info/SOURCES.txt +0 -56
  169. causilo-1.0.2/tests/test_input_precision.py +0 -93
  170. causilo-1.0.2/tests/test_inputs.py +0 -86
  171. {causilo-1.0.2 → causilo-1.5.0}/LICENSE +0 -0
  172. {causilo-1.0.2 → causilo-1.5.0}/setup.cfg +0 -0
  173. {causilo-1.0.2/src/causilo → causilo-1.5.0/src/causilo/v1_0}/data/__init__.py +0 -0
  174. {causilo-1.0.2/src/causilo → causilo-1.5.0/src/causilo/v1_0}/data/ensemble.py +0 -0
  175. {causilo-1.0.2/src/causilo → causilo-1.5.0/src/causilo/v1_0}/execution/__init__.py +0 -0
  176. {causilo-1.0.2/src/causilo → causilo-1.5.0/src/causilo/v1_0}/execution/precision.py +0 -0
  177. {causilo-1.0.2/src/causilo → causilo-1.5.0/src/causilo/v1_0}/nn/__init__.py +0 -0
  178. {causilo-1.0.2/src/causilo → causilo-1.5.0/src/causilo/v1_0}/nn/embeddings.py +0 -0
  179. {causilo-1.0.2/src/causilo → causilo-1.5.0/src/causilo/v1_0}/nn/layers/__init__.py +0 -0
  180. {causilo-1.0.2/src/causilo → causilo-1.5.0/src/causilo/v1_0}/nn/layers/feedforward.py +0 -0
  181. {causilo-1.0.2 → causilo-1.5.0}/src/causilo.egg-info/dependency_links.txt +0 -0
  182. {causilo-1.0.2 → causilo-1.5.0}/src/causilo.egg-info/requires.txt +0 -0
  183. {causilo-1.0.2 → causilo-1.5.0}/src/causilo.egg-info/top_level.txt +0 -0
@@ -1,4 +1,5 @@
1
1
  include LICENSE README.md pyproject.toml
2
+ recursive-include docs *.md *.png
2
3
  recursive-include src *.py
3
4
  recursive-include tests *.py
4
5
  recursive-include examples *.py
causilo-1.5.0/PKG-INFO ADDED
@@ -0,0 +1,127 @@
1
+ Metadata-Version: 2.4
2
+ Name: causilo
3
+ Version: 1.5.0
4
+ Summary: Tabular classification and regression with a scikit-learn API
5
+ Author-email: "Nums AI Inc." <contact@nums.world>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Repository, https://github.com/nums-ai/causilo
8
+ Project-URL: Issues, https://github.com/nums-ai/causilo/issues
9
+ Project-URL: Models, https://huggingface.co/nums-ai/causilo-1.5
10
+ Classifier: Programming Language :: Python :: 3.10
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Classifier: Operating System :: POSIX :: Linux
16
+ Classifier: Operating System :: MacOS :: MacOS X
17
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
18
+ Requires-Python: <3.15,>=3.10
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: torch>=2.13
22
+ Requires-Dist: numpy
23
+ Requires-Dist: pandas
24
+ Requires-Dist: scipy
25
+ Requires-Dist: scikit-learn>=1.6
26
+ Requires-Dist: safetensors>=0.8
27
+ Requires-Dist: huggingface-hub>=0.28
28
+ Requires-Dist: psutil
29
+ Provides-Extra: dev
30
+ Requires-Dist: pytest>=8; extra == "dev"
31
+ Requires-Dist: ruff; extra == "dev"
32
+ Requires-Dist: build; extra == "dev"
33
+ Requires-Dist: twine; extra == "dev"
34
+ Requires-Dist: joblib; extra == "dev"
35
+ Dynamic: license-file
36
+
37
+ <h1 align="center">
38
+ <picture>
39
+ <source media="(max-width: 640px)" srcset="https://raw.githubusercontent.com/nums-ai/causilo/main/docs/assets/causilo-banner-compact.png">
40
+ <img src="https://raw.githubusercontent.com/nums-ai/causilo/main/docs/assets/causilo-banner.png" alt="Causilo 1.5. A New Standard for Prediction." width="100%">
41
+ </picture>
42
+ </h1>
43
+
44
+ <p align="center">Tabular classification and regression with a scikit-learn API.</p>
45
+
46
+ <p align="center">
47
+ <a href="https://pypi.org/project/causilo/"><img src="https://img.shields.io/pypi/v/causilo?label=PyPI&amp;color=brightgreen&amp;style=flat" alt="Causilo package version on PyPI"></a>
48
+ <a href="#documentation"><img src="https://img.shields.io/badge/Docs-Python-blue?style=flat" alt="Causilo Python documentation"></a>
49
+ <a href="https://arxiv.org/abs/2609.22866"><img src="https://img.shields.io/badge/Technical%20report-arXiv-913f47?style=flat" alt="Causilo Technical Report on arXiv"></a>
50
+ <br>
51
+ <a href="#license"><img src="https://img.shields.io/badge/License-Code%20%2F%20weights-646b73?style=flat" alt="Code and model weights licenses"></a>
52
+ <a href="https://nums.world/"><img src="https://img.shields.io/badge/Nums%20AI-Website-283442?style=flat" alt="Nums AI website"></a>
53
+ <a href="#installation"><img src="https://img.shields.io/badge/Python-3.10%E2%80%933.14-646b73?style=flat" alt="Python 3.10–3.14"></a>
54
+ <a href="#installation"><img src="https://img.shields.io/badge/PyTorch-2.13%2B-646b73?style=flat" alt="PyTorch 2.13 or newer"></a>
55
+ </p>
56
+
57
+ ## Quick start
58
+
59
+ ### Installation
60
+
61
+ Install [Causilo 1.5 from PyPI](https://pypi.org/project/causilo/1.5.0/).
62
+
63
+ ```sh
64
+ python -m pip install causilo==1.5.0
65
+ ```
66
+
67
+ The first `fit` downloads the [public Causilo 1.5 checkpoint](https://huggingface.co/nums-ai/causilo-1.5) for the estimator's task. No Hugging Face account is required.
68
+
69
+ ### Classification
70
+
71
+ ```python
72
+ from causilo import CausiloClassifier
73
+
74
+ clf = CausiloClassifier()
75
+ clf.fit(X_train, y_train)
76
+ labels = clf.predict(X_test)
77
+ ```
78
+
79
+ ### Regression
80
+
81
+ ```python
82
+ from causilo import CausiloRegressor
83
+
84
+ reg = CausiloRegressor()
85
+ reg.fit(X_train, y_train)
86
+ predictions = reg.predict(X_test)
87
+ ```
88
+
89
+ **Causilo 1.5** uses the full training context by default. Set `mode="light"`
90
+ on either estimator for **Causilo 1.5 (Light)**. To sample from larger tables,
91
+ set `max_context=200_000`. Set `model_version="1.0"` to use **Causilo 1.0**.
92
+
93
+ `fit` prepares preprocessing and an inference context from your labeled table. `predict` uses that context with fixed model weights.
94
+
95
+ ## Benchmarks
96
+
97
+ ![Benchmark Elo across ten benchmarks on the left and the TabArena speed–quality frontiers on the right. Gray shows official peers and purple adds Causilo.](https://raw.githubusercontent.com/nums-ai/causilo/main/docs/assets/benchmark-overview.png)
98
+
99
+ Both frontiers use one Elo fit across all 816 official splits, with 112 official models and four Causilo settings. The chart shows the ten official peers with published timings. Causilo times were measured on RTX PRO 6000 with KV cache off. Peer totals are estimated from published per-dataset timings and use the peers’ own cache settings. The table’s TabArena scores compare Default and Light together.
100
+
101
+ [Pareto data](https://huggingface.co/nums-ai/causilo-1.5/blob/4ca2275bae85014a19422e8c18fcf8f24c5c14e1/benchmarks/tabarena/pareto-comparison.csv) · [Detailed results and evaluation protocols](https://huggingface.co/nums-ai/causilo-1.5/blob/4ca2275bae85014a19422e8c18fcf8f24c5c14e1/benchmarks/README.md)
102
+
103
+ ## Documentation
104
+
105
+ [Python inference](https://github.com/nums-ai/causilo/blob/main/docs/inference.md) · [Checkpoints](https://github.com/nums-ai/causilo/blob/main/docs/checkpoints.md) · [Examples](https://github.com/nums-ai/causilo/blob/main/examples/)
106
+
107
+ ## License
108
+
109
+ Code is licensed under [Apache-2.0](https://github.com/nums-ai/causilo/blob/main/LICENSE).
110
+
111
+ Causilo 1.5 weights are licensed under the [Nums AI Model License](https://huggingface.co/nums-ai/causilo-1.5/blob/4ca2275bae85014a19422e8c18fcf8f24c5c14e1/LICENSE).
112
+
113
+ ## Citation
114
+
115
+ If you use Causilo in research, please cite:
116
+
117
+ ```bibtex
118
+ @misc{cho2026causilotechnicalreport,
119
+ title={Causilo Technical Report},
120
+ author={Minyong Cho and Minho Jeong and Dooho Lee and Jinmo Lee and Jaemin Yoo},
121
+ year={2026},
122
+ eprint={2609.22866},
123
+ archivePrefix={arXiv},
124
+ primaryClass={cs.LG},
125
+ url={https://arxiv.org/abs/2609.22866},
126
+ }
127
+ ```
@@ -0,0 +1,91 @@
1
+ <h1 align="center">
2
+ <picture>
3
+ <source media="(max-width: 640px)" srcset="https://raw.githubusercontent.com/nums-ai/causilo/main/docs/assets/causilo-banner-compact.png">
4
+ <img src="https://raw.githubusercontent.com/nums-ai/causilo/main/docs/assets/causilo-banner.png" alt="Causilo 1.5. A New Standard for Prediction." width="100%">
5
+ </picture>
6
+ </h1>
7
+
8
+ <p align="center">Tabular classification and regression with a scikit-learn API.</p>
9
+
10
+ <p align="center">
11
+ <a href="https://pypi.org/project/causilo/"><img src="https://img.shields.io/pypi/v/causilo?label=PyPI&amp;color=brightgreen&amp;style=flat" alt="Causilo package version on PyPI"></a>
12
+ <a href="#documentation"><img src="https://img.shields.io/badge/Docs-Python-blue?style=flat" alt="Causilo Python documentation"></a>
13
+ <a href="https://arxiv.org/abs/2609.22866"><img src="https://img.shields.io/badge/Technical%20report-arXiv-913f47?style=flat" alt="Causilo Technical Report on arXiv"></a>
14
+ <br>
15
+ <a href="#license"><img src="https://img.shields.io/badge/License-Code%20%2F%20weights-646b73?style=flat" alt="Code and model weights licenses"></a>
16
+ <a href="https://nums.world/"><img src="https://img.shields.io/badge/Nums%20AI-Website-283442?style=flat" alt="Nums AI website"></a>
17
+ <a href="#installation"><img src="https://img.shields.io/badge/Python-3.10%E2%80%933.14-646b73?style=flat" alt="Python 3.10–3.14"></a>
18
+ <a href="#installation"><img src="https://img.shields.io/badge/PyTorch-2.13%2B-646b73?style=flat" alt="PyTorch 2.13 or newer"></a>
19
+ </p>
20
+
21
+ ## Quick start
22
+
23
+ ### Installation
24
+
25
+ Install [Causilo 1.5 from PyPI](https://pypi.org/project/causilo/1.5.0/).
26
+
27
+ ```sh
28
+ python -m pip install causilo==1.5.0
29
+ ```
30
+
31
+ The first `fit` downloads the [public Causilo 1.5 checkpoint](https://huggingface.co/nums-ai/causilo-1.5) for the estimator's task. No Hugging Face account is required.
32
+
33
+ ### Classification
34
+
35
+ ```python
36
+ from causilo import CausiloClassifier
37
+
38
+ clf = CausiloClassifier()
39
+ clf.fit(X_train, y_train)
40
+ labels = clf.predict(X_test)
41
+ ```
42
+
43
+ ### Regression
44
+
45
+ ```python
46
+ from causilo import CausiloRegressor
47
+
48
+ reg = CausiloRegressor()
49
+ reg.fit(X_train, y_train)
50
+ predictions = reg.predict(X_test)
51
+ ```
52
+
53
+ **Causilo 1.5** uses the full training context by default. Set `mode="light"`
54
+ on either estimator for **Causilo 1.5 (Light)**. To sample from larger tables,
55
+ set `max_context=200_000`. Set `model_version="1.0"` to use **Causilo 1.0**.
56
+
57
+ `fit` prepares preprocessing and an inference context from your labeled table. `predict` uses that context with fixed model weights.
58
+
59
+ ## Benchmarks
60
+
61
+ ![Benchmark Elo across ten benchmarks on the left and the TabArena speed–quality frontiers on the right. Gray shows official peers and purple adds Causilo.](https://raw.githubusercontent.com/nums-ai/causilo/main/docs/assets/benchmark-overview.png)
62
+
63
+ Both frontiers use one Elo fit across all 816 official splits, with 112 official models and four Causilo settings. The chart shows the ten official peers with published timings. Causilo times were measured on RTX PRO 6000 with KV cache off. Peer totals are estimated from published per-dataset timings and use the peers’ own cache settings. The table’s TabArena scores compare Default and Light together.
64
+
65
+ [Pareto data](https://huggingface.co/nums-ai/causilo-1.5/blob/4ca2275bae85014a19422e8c18fcf8f24c5c14e1/benchmarks/tabarena/pareto-comparison.csv) · [Detailed results and evaluation protocols](https://huggingface.co/nums-ai/causilo-1.5/blob/4ca2275bae85014a19422e8c18fcf8f24c5c14e1/benchmarks/README.md)
66
+
67
+ ## Documentation
68
+
69
+ [Python inference](https://github.com/nums-ai/causilo/blob/main/docs/inference.md) · [Checkpoints](https://github.com/nums-ai/causilo/blob/main/docs/checkpoints.md) · [Examples](https://github.com/nums-ai/causilo/blob/main/examples/)
70
+
71
+ ## License
72
+
73
+ Code is licensed under [Apache-2.0](https://github.com/nums-ai/causilo/blob/main/LICENSE).
74
+
75
+ Causilo 1.5 weights are licensed under the [Nums AI Model License](https://huggingface.co/nums-ai/causilo-1.5/blob/4ca2275bae85014a19422e8c18fcf8f24c5c14e1/LICENSE).
76
+
77
+ ## Citation
78
+
79
+ If you use Causilo in research, please cite:
80
+
81
+ ```bibtex
82
+ @misc{cho2026causilotechnicalreport,
83
+ title={Causilo Technical Report},
84
+ author={Minyong Cho and Minho Jeong and Dooho Lee and Jinmo Lee and Jaemin Yoo},
85
+ year={2026},
86
+ eprint={2609.22866},
87
+ archivePrefix={arXiv},
88
+ primaryClass={cs.LG},
89
+ url={https://arxiv.org/abs/2609.22866},
90
+ }
91
+ ```
@@ -0,0 +1,20 @@
1
+ # Causilo 1.5 benchmarks
2
+
3
+ [Detailed results and evaluation protocols](https://huggingface.co/nums-ai/causilo-1.5/blob/4ca2275bae85014a19422e8c18fcf8f24c5c14e1/benchmarks/README.md) · [Checkpoints](../checkpoints.md)
4
+
5
+ Each entry shows overall rank and Elo. The benchmark links contain dataset scores, split results, and full leaderboards.
6
+
7
+ | Benchmark | 1.5 | 1.5 (Light) |
8
+ | --- | ---: | ---: |
9
+ | [TabArena](https://huggingface.co/nums-ai/causilo-1.5/tree/4ca2275bae85014a19422e8c18fcf8f24c5c14e1/benchmarks/tabarena) | #1 · 2,037.1 | #3 · 1,976.8 |
10
+ | [BeyondArena Core2K](https://huggingface.co/nums-ai/causilo-1.5/tree/4ca2275bae85014a19422e8c18fcf8f24c5c14e1/benchmarks/beyondarena) | #1 · 1,446.4 | #3 · 1,390.4 |
11
+ | [ScoringBench](https://huggingface.co/nums-ai/causilo-1.5/tree/4ca2275bae85014a19422e8c18fcf8f24c5c14e1/benchmarks/scoringbench) | #1 · 2,284.0 | #3 · 2,205.9 |
12
+ | [MulTaBench Image](https://huggingface.co/nums-ai/causilo-1.5/tree/4ca2275bae85014a19422e8c18fcf8f24c5c14e1/benchmarks/multabench-image) | #1 · 1,883.0 | #2 · 1,840.4 |
13
+ | [MulTaBench Text](https://huggingface.co/nums-ai/causilo-1.5/tree/4ca2275bae85014a19422e8c18fcf8f24c5c14e1/benchmarks/multabench-text) | #1 · 1,820.7 | #3 · 1,786.1 |
14
+ | [RamanBench](https://huggingface.co/nums-ai/causilo-1.5/tree/4ca2275bae85014a19422e8c18fcf8f24c5c14e1/benchmarks/ramanbench) | #1 · 1,570.4 | #2 · 1,540.4 |
15
+ | [STRABLE](https://huggingface.co/nums-ai/causilo-1.5/tree/4ca2275bae85014a19422e8c18fcf8f24c5c14e1/benchmarks/strable) | #1 · 1,878.8 | #2 · 1,825.4 |
16
+ | [TabBench-Bio](https://huggingface.co/nums-ai/causilo-1.5/tree/4ca2275bae85014a19422e8c18fcf8f24c5c14e1/benchmarks/tabbench-bio) | #1 · 1,250.0 | #3 · 1,229.0 |
17
+ | [TabBioMed](https://huggingface.co/nums-ai/causilo-1.5/tree/4ca2275bae85014a19422e8c18fcf8f24c5c14e1/benchmarks/tabbiomed) | #1 · 1,524.2 | #2 · 1,497.7 |
18
+ | [TALENT](https://huggingface.co/nums-ai/causilo-1.5/tree/4ca2275bae85014a19422e8c18fcf8f24c5c14e1/benchmarks/talent) | #1 · 1,982.4 | #3 · 1,930.9 |
19
+
20
+ [TabArena timings](https://huggingface.co/nums-ai/causilo-1.5/blob/4ca2275bae85014a19422e8c18fcf8f24c5c14e1/benchmarks/tabarena/timing.csv) · [Evaluated checkpoints](https://huggingface.co/nums-ai/causilo-1.5/blob/4ca2275bae85014a19422e8c18fcf8f24c5c14e1/benchmarks/README.md#checkpoints-and-inference)
@@ -0,0 +1,55 @@
1
+ # Checkpoints
2
+
3
+ `model_version` selects the hosted checkpoint for the estimator's task.
4
+ Both weights and configuration are pinned to the revision in this table.
5
+
6
+ | Model | Task | Hugging Face revision | Files | Access |
7
+ | --- | --- | --- | --- | --- |
8
+ | 1.5 (default) | Classification | [4ca2275](https://huggingface.co/nums-ai/causilo-1.5/tree/4ca2275bae85014a19422e8c18fcf8f24c5c14e1/classifier) | `classifier/` | Public |
9
+ | 1.5 (default) | Regression | [4ca2275](https://huggingface.co/nums-ai/causilo-1.5/tree/4ca2275bae85014a19422e8c18fcf8f24c5c14e1/regressor) | `regressor/` | Public |
10
+ | 1.0 | Classification | [94f2bd9](https://huggingface.co/nums-ai/causilo/tree/94f2bd91db0737d4da59f347910662905ecb5a09/classifier) | `classifier/` | Public |
11
+ | 1.0 | Regression | [94f2bd9](https://huggingface.co/nums-ai/causilo/tree/94f2bd91db0737d4da59f347910662905ecb5a09/regressor) | `regressor/` | Public |
12
+
13
+ The default and Light modes use the same checkpoint for each task.
14
+
15
+ ## Model licenses
16
+
17
+ - **Causilo 1.0** classifier and regressor weights are covered by the
18
+ [license included in the original Causilo 1.0 release](https://huggingface.co/nums-ai/causilo/resolve/94f2bd91db0737d4da59f347910662905ecb5a09/LICENSE).
19
+ - **Causilo 1.5 Classifier** and **Causilo 1.5 Regressor** weights are covered by
20
+ the [Nums AI Model License](https://huggingface.co/nums-ai/causilo-1.5/blob/4ca2275bae85014a19422e8c18fcf8f24c5c14e1/LICENSE).
21
+
22
+ ## Download and load
23
+
24
+ The first fit downloads and caches the files for the estimator's task. The
25
+ checkpoints are public and do not require signing in. Construction and
26
+ scikit-learn cloning defer weight loading until fit.
27
+
28
+ For a manual download, use the revision listed for your task. Keep `config.json`
29
+ beside `model.safetensors` and pass the directory or weights file as
30
+ `checkpoint_path`. Download both files from the same revision. The package
31
+ checks that the weights match the configuration and prediction task before
32
+ loading the model.
33
+
34
+ ```python
35
+ from causilo import CausiloClassifier, CausiloRegressor
36
+
37
+ regressor = CausiloRegressor(checkpoint_path="checkpoints/regressor")
38
+ classifier = CausiloClassifier(checkpoint_path="checkpoints/classifier", mode="light")
39
+ ```
40
+
41
+ The 1.5 `config.json` identifies the architecture, checkpoint format,
42
+ configuration version, task and model dimensions. Its exact file bytes are
43
+ bound to `model.safetensors` through the `config_sha256` metadata field.
44
+
45
+ ## File checksums
46
+
47
+ SHA-256 for the release files at the pinned revisions above. The
48
+ [benchmark details](benchmarks/README.md) record the checksums used for evaluation.
49
+
50
+ | Checkpoint | `config.json` | `model.safetensors` |
51
+ | --- | --- | --- |
52
+ | 1.5 classification | `900b2bbbab73ae8e681bab2e418ce8a38143785706e092505b691544cea68764` | `b378d856b0d4cf894426b5d2023db186c44b5e0d1b9261046ccb1f433bc99bf2` |
53
+ | 1.5 regression | `489670f1c479fa4aa49e77cf1080ae9f8899cad1ecf9dac3215dca77f243da97` | `0f4e40f1ca671dd5d85cbb159e7e638606274f02bc73cdf861265a10fedbf3be` |
54
+ | 1.0 classification | `89aa44afe34233013f5c38a7dd89f233d26d18585096fcf32dec250abd48b77d` | `2fe50487b33ef6b4ed65d1dab1e48888b86f9ed604317a4b596fea4dd462b7f6` |
55
+ | 1.0 regression | `af78b2d23ac28534ab6c16f75d8d2d2f4dc38ca45c643d70a6324320847480a7` | `9a4197d7c1060d187c19b62d4d83c74ce986c1f3911825576eb58c2ae4f0057d` |
@@ -0,0 +1,325 @@
1
+ # Inference details
2
+
3
+ The classifier and regressor use Causilo 1.5 by default. Choose
4
+ `mode="light"` for one ensemble member or `mode="default"` for eight, which
5
+ is also the behavior when both options are omitted. Both modes work with
6
+ `model_version="1.0"`.
7
+
8
+ To set an explicit ensemble size, pass `n_estimators`. Passing both `mode`
9
+ and `n_estimators` with non-None values raises a `ValueError` at fit time.
10
+
11
+ See [checkpoints](checkpoints.md) for the weights, revisions, and access
12
+ instructions for each task and model version.
13
+
14
+ `fit(X, y)` prepares preprocessing and the inference context from the labeled
15
+ rows in `X` and `y`. When enabled, it also prepares the context cache.
16
+ `predict(X)` applies the fitted preprocessing and uses the fixed checkpoint
17
+ to make predictions for query rows.
18
+
19
+ ## Context size
20
+
21
+ Both modes of Causilo 1.5 use all eligible context rows by default
22
+ (`max_context=None`). Set a positive integer to cap the number of rows per
23
+ estimator. Sampling can reduce memory use and runtime on large tables.
24
+
25
+ ```python
26
+ classifier = CausiloClassifier(max_context=200_000)
27
+ ```
28
+
29
+ Tables at or below the cap use all eligible rows. For larger tables, each estimator
30
+ draws its own rows without replacement during `fit`. Feature types, retained
31
+ columns, and their order come from all eligible rows. Category mappings,
32
+ frequency values, and normalization are fitted on each estimator’s selected
33
+ rows. A fixed `random_state` reproduces the draws. Classification
34
+ keeps every observed class, so the cap must be at least the number of classes.
35
+ Many-class ECOC code rows share one sampled context. All predictions reuse
36
+ the rows selected during fit. When `sample_count` is supplied, only positive-count
37
+ rows are eligible and each selected row keeps its original count. The cap
38
+ has no effect on Causilo 1.0.
39
+
40
+ ## Input columns
41
+
42
+ With 1.5, fit and predict with the same unique DataFrame column labels. Query
43
+ columns can be reordered because prediction aligns them by name. With 1.0,
44
+ use the same names in the same order. Array queries use the fitted column
45
+ positions. In object arrays, a column with numeric values and optional missing
46
+ cells is treated as numeric. Strings and booleans can still be categorical
47
+ features in the same array.
48
+
49
+ With 1.0, encode datetime and duration columns before fitting. With 1.5, encode
50
+ datetime, duration, period, complex, and other unsupported column types as
51
+ numeric or categorical features before fitting or predicting.
52
+
53
+ In 1.5, the labeled context determines how categorical features are encoded.
54
+ An unseen numeric category between two observed numeric levels is encoded by
55
+ linearly interpolating their codes. Any frequency feature uses the same weights.
56
+ Missing values, unseen text categories, and numeric categories outside the observed
57
+ range keep their usual encoding. Keep feature types consistent between fit and prediction.
58
+
59
+ ## Feature preprocessing
60
+
61
+ Causilo 1.5 classification and regression use the same feature views.
62
+
63
+ | `n_estimators` | Feature views |
64
+ | --- | --- |
65
+ | 1 (Light) | Base |
66
+ | 2 | Base, Robust |
67
+ | 3 | Base × 2, Robust |
68
+ | 4 | Base × 2, Robust × 2 |
69
+ | 5 | Base × 3, Robust × 2 |
70
+ | 8 | Base × 4, Robust × 2, Rank-Gaussian × 2 |
71
+
72
+ Base and Robust start with standardization fitted on observed context cells.
73
+ Robust then applies median and interquartile scaling with a soft limit.
74
+ Rank-Gaussian uses the Causilo 1.0 Rank2Gaussian transform. It temporarily
75
+ fills missing context cells with their feature mean, fits mid-ranks on the
76
+ encoded values, then standardizes the Gaussian scores. All three views use
77
+ context-fitted `arcsinh` tail compression and preserve missing values.
78
+
79
+ When the number of distinct member permutations limits a fit, the shared
80
+ recipe scales the view counts to the fitted ensemble size.
81
+ Regression trims one value from each end for every four fitted members.
82
+
83
+ ## Classification outputs
84
+
85
+ For a fitted `CausiloClassifier`, choose the prediction method for the output
86
+ you need:
87
+
88
+ | Method | Output | Shape |
89
+ | --- | --- | --- |
90
+ | `predict(X)` | Predicted class labels | `(n_samples,)` |
91
+ | `predict_proba(X)` | Class probabilities | `(n_samples, n_classes)` |
92
+ | `predict_logits(X)` | Combined logits before softmax | `(n_samples, n_classes)` |
93
+
94
+ ```python
95
+ labels = classifier.predict(X_test)
96
+ probabilities = classifier.predict_proba(X_test)
97
+ logits = classifier.predict_logits(X_test)
98
+ ```
99
+
100
+ All three methods return NumPy arrays. Probability and logit columns follow
101
+ `classes_`, with two columns for binary classification. Applying
102
+ `scipy.special.softmax(logits, axis=1)` matches `predict_proba(X_test)`.
103
+
104
+ The 1.5 ensemble aligns each member's logits to the fitted class order first.
105
+ For each row and class, it averages the logits of all fitted members.
106
+
107
+ `predict_logits` supports single-table fits within the checkpoint's native
108
+ class limit (10 for the hosted checkpoints). Beyond that limit, use
109
+ `predict_proba` or `predict` for the fitted many-class classifier.
110
+
111
+ For 1.5, contexts with up to ten classes use the configured ensemble. With
112
+ more than ten, the classifier uses error-correcting output codes (ECOC).
113
+ Each code row runs one estimator, including with the default `n_estimators=8`.
114
+ Code rows run on the first selected device. In 1.0, each code row uses the
115
+ configured ensemble.
116
+
117
+ ## Regression outputs
118
+
119
+ For `CausiloRegressor`, choose the prediction output with `output_type`:
120
+
121
+ | `output_type` | Output | Shape |
122
+ | --- | --- | --- |
123
+ | `"mean"` (default) | Mean prediction | `(n_samples,)` |
124
+ | `"median"` | Ensemble's 0.5 quantile | `(n_samples,)` |
125
+ | `"quantiles"` | Quantiles at the requested probabilities | `(n_samples, n_quantiles)` |
126
+ | `"raw"` | All native quantiles | `(n_samples, n_native_quantiles)` |
127
+
128
+ ```python
129
+ mean = regressor.predict(X_test)
130
+ median = regressor.predict(X_test, output_type="median")
131
+ quantiles = regressor.predict(
132
+ X_test, output_type="quantiles", quantiles=[0.05, 0.5, 0.95]
133
+ )
134
+ ```
135
+
136
+ Quantile prediction preserves the order and duplicates in the requested list.
137
+ A single probability still returns a two-dimensional array. Probabilities
138
+ must be finite and strictly between 0 and 1. Both versions interpolate
139
+ linearly between native quantiles. Beyond either end, the two nearest native
140
+ quantiles determine the slope in log-probability space. Extreme probabilities
141
+ can produce large values.
142
+
143
+ `predict(X, output_type="raw")` returns the combined quantiles at the
144
+ checkpoint's native levels. The hosted models have 999 levels. Use
145
+ `output_type="quantiles"` to choose the probabilities.
146
+
147
+ 1.5 centers and scales targets in float64 before conversion for the model
148
+ and returns float64 predictions in the original target units.
149
+
150
+ The 1.5 ensemble restores each member's target orientation before averaging.
151
+ At each quantile, the ensemble drops one prediction from each end for every
152
+ four fitted members. E4 averages the middle two predictions, E5 the middle
153
+ three, and E8 the middle four. When trimming is applied,
154
+ the mean prediction integrates this quantile distribution with endpoints that
155
+ include the fitted target range. Ensembles with fewer than four members
156
+ average all available predictions.
157
+
158
+ ## Independent table batches
159
+
160
+ Use `fit_batched` with nonempty string IDs to share model weights across
161
+ independent tables. Row counts, feature schemas, and class sets can differ.
162
+
163
+ ```python
164
+ regressor.fit_batched({
165
+ "sales": (X_train_sales, y_train_sales),
166
+ "price": (X_train_price, y_train_price),
167
+ })
168
+ predictions = regressor.predict_batched({
169
+ "sales": X_test_sales, # mean output
170
+ "price": {"X": X_test_price, "output_type": "quantiles", "quantiles": [0.1, 0.5, 0.9]},
171
+ })
172
+ ```
173
+
174
+ Regression output options follow [Regression outputs](#regression-outputs)
175
+ and can differ by table; passing `X` alone returns mean predictions.
176
+
177
+ For classification, use `predict_batched({id: X})` for labels or
178
+ `predict_proba_batched({id: X})` for probabilities. Probability columns follow
179
+ `classes_batched_[id]`.
180
+
181
+ Query any subset of fitted IDs; results preserve query ID order. Each query
182
+ must match its fitted schema and contain at least one row. An empty mapping
183
+ returns `{}`.
184
+
185
+ 1.0 can group compatible members from different tables into one model call.
186
+ 1.5 processes tables in order and batches ensemble members within each table.
187
+ The same batch can therefore have different throughput and peak memory use
188
+ across the two versions.
189
+
190
+ Constructor options apply to all tables. Both `fit` and `fit_batched` replace
191
+ the previous fit; a failed refit leaves the estimator unfitted. Use the
192
+ prediction methods matching the fitted mode.
193
+
194
+ See the runnable [batch example](../examples/batched_prediction.py).
195
+
196
+ ## Precision and reproducibility
197
+
198
+ CUDA inference uses mixed precision. CPU and MPS use FP32. Use the same inputs,
199
+ `n_estimators`, and an integer `random_state` to reproduce the ensemble
200
+ selection and ECOC codebook. 1.0 requires an integer seed. In 1.5,
201
+ `random_state=None` leaves both unseeded. The number of 1.5 ensemble members
202
+ is limited by the available distinct views of the features and targets.
203
+ Floating-point results can vary with execution device and batch shape.
204
+
205
+ ## Memory use
206
+
207
+ Causilo can reduce execution batches or split query rows when memory is tight.
208
+ Each query still uses the fitted context and ensemble. Large contexts can
209
+ exceed device memory.
210
+
211
+ On Linux, 1.5 sizes host allocations using both available RAM and the memory
212
+ limit of the process's cgroup. If a shared query batch exceeds host memory,
213
+ 1.5 retries it with fewer rows. On multiple GPUs, a device allocation failure
214
+ retries the affected GPU's work.
215
+
216
+ 1.0 uses one execution device. For 1.5, pass an ordered CUDA device list to
217
+ distribute ensemble members. One estimator uses the first device. Set
218
+ `device_memory_budget_bytes` to guide batch sizing on each GPU. Allow
219
+ additional memory for model weights and tensors already on the device.
220
+
221
+ ```python
222
+ model = CausiloRegressor(
223
+ n_estimators=8,
224
+ device=["cuda:0", "cuda:1"],
225
+ device_memory_budget_bytes={"cuda:0": 64 * 1024**3, "cuda:1": 48 * 1024**3},
226
+ )
227
+ ```
228
+
229
+ Use `use_kv_cache=True` to reuse the context across repeated predictions.
230
+ Cache memory grows with the context, ensemble size, and number of fitted
231
+ tables. 1.0 stores the cache on the execution device. On CUDA, 1.5 can also
232
+ use host memory for caches when device memory is limited. Fitting a large
233
+ cache can pin part of the available host RAM to overlap transfers with GPU
234
+ work. Each GPU can stage two layers at a time and share a layer's keys and
235
+ values across query chunks for its ensemble members. This also applies when
236
+ the fitted context uses row frequencies supplied through `sample_count`.
237
+
238
+ With `use_kv_cache=False`, the memory-bounded path can reuse each member's
239
+ context encoding and sorted feature values within a prediction call. A change
240
+ in tile size can reuse the encoding if it fits the current device budget.
241
+ For classification with more than ten classes, 1.5 can process several query
242
+ chunks with one codebook row's context at a time. Temporary state is released
243
+ when the call returns.
244
+
245
+ In 1.0, `retain_preprocessing=False` keeps the encoded training table and rebuilds
246
+ normalized copies as needed. In 1.5, the default stores one float32 table
247
+ for each fitted view. Setting it
248
+ to `False` stores the encoded float64 table and applies the fitted transforms
249
+ when the context is needed.
250
+
251
+ ## Restoring a fitted estimator
252
+
253
+ Save the fitted context with `save_context()` and select the execution device
254
+ when you load it. By default, the loader uses `device="auto"` on the current host.
255
+ You can also pass `device_memory_budget_bytes` for selected 1.5 CUDA devices.
256
+
257
+ ```python
258
+ classifier.save_context("context.pkl")
259
+ restored = CausiloClassifier.load_context("context.pkl", device="cpu")
260
+ labels = restored.predict(X_test)
261
+ ```
262
+
263
+ The saved context includes batch IDs, preprocessing, and optional attention
264
+ caches. Restore uses the checkpoint that produced the fitted context. Changes
265
+ to `model_version` or `checkpoint_path` apply at the next `fit()`. 1.5 may
266
+ rebuild the cache when restoring on a different device.
267
+
268
+ Load fitted-state files from trusted sources with matching Causilo and
269
+ dependency versions. Refit from the original training data to replace an earlier
270
+ saved fit. Python pickle and joblib round trips of the estimator use the device
271
+ and memory settings in the saved estimator parameters.
272
+
273
+ ## Local checkpoints
274
+
275
+ Pass `checkpoint_path` with the weights file or directory described in
276
+ [Download and load](checkpoints.md#download-and-load). The local configuration
277
+ selects the runtime.
278
+
279
+ A saved fitted estimator records the absolute local path and a digest of the
280
+ configuration and weights. Restoration requires the same files at that path and
281
+ rejects changed contents before reusing fitted context or attention caches.
282
+ The absolute path is used when restoring from another working directory.
283
+
284
+ Changing `checkpoint_path` with `set_params` takes effect on the next fit. Until
285
+ then, prediction and saved fitted state use the previously loaded weights. Keep
286
+ local checkpoint files unchanged while using a fitted estimator; to load updated
287
+ weights at the same path, construct a new estimator. Relocating the files for
288
+ restoration is not supported by this interface.
289
+
290
+ ## Aggregated observations and repetition counts
291
+
292
+ Both estimators accept optional `sample_count` in `fit`. Each entry is an
293
+ **integer repetition count**: a row with count 30 represents 30 identical
294
+ observations with the same features and target. Counts are not loss weights or
295
+ arbitrary importance scores. Omitting them keeps the usual `fit(X, y)` behavior.
296
+ `fit_batched` does not accept counts.
297
+
298
+ For binomial data, represent each group by a success row and a failure row:
299
+
300
+ ```python
301
+ import numpy as np
302
+ from causilo import CausiloClassifier
303
+
304
+ # X_group contains one feature row per group; successes and trials are counts.
305
+ # This indexing works for a NumPy feature table.
306
+ rows = np.repeat(np.arange(len(X_group)), 2)
307
+ X = X_group[rows]
308
+ y = np.tile([1, 0], len(X_group))
309
+ counts = np.column_stack([successes, trials - successes]).ravel()
310
+
311
+ classifier = CausiloClassifier(model_version="1.0").fit(X, y, sample_count=counts)
312
+ p_success = classifier.predict_proba(X_test)[:, list(classifier.classes_).index(1)]
313
+ ```
314
+
315
+ For a DataFrame, use `X_group.iloc[rows]` to preserve column names and types.
316
+ This creates at most two rows per group, regardless of its trial count. Different
317
+ observations can only be combined when their features **and target** are identical;
318
+ the estimator does not automatically group rows. Success proportions alone do
319
+ not recover the individual observations when features vary within a group.
320
+
321
+ Counts must be finite nonnegative integers, one per input row, with a positive
322
+ sum no larger than `2**53`. Integer-valued floats are accepted. Zero-count rows
323
+ are skipped when fitting. Both versions store one row per supplied observation
324
+ with a positive count. Results can differ from explicit repetition because of
325
+ floating-point rounding. Saved estimators retain their row counts.
@@ -0,0 +1,10 @@
1
+ import argparse
2
+
3
+
4
+ def model_options(description):
5
+ parser = argparse.ArgumentParser(description=description)
6
+ parser.add_argument(
7
+ "--model-version", choices=("1.0", "1.5"), default=argparse.SUPPRESS,
8
+ help="Defaults to Causilo 1.5. Select 1.0 to use the public checkpoints.",
9
+ )
10
+ return vars(parser.parse_args())