open-tabular-priors 0.1.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.
@@ -0,0 +1,5 @@
1
+ .venv/
2
+ __pycache__/
3
+ .pytest_cache/
4
+ dist/
5
+ /latex/
@@ -0,0 +1,287 @@
1
+ EUROPEAN UNION PUBLIC LICENCE v. 1.2
2
+ EUPL © the European Union 2007, 2016
3
+
4
+ This European Union Public Licence (the ‘EUPL’) applies to the Work (as defined
5
+ below) which is provided under the terms of this Licence. Any use of the Work,
6
+ other than as authorised under this Licence is prohibited (to the extent such
7
+ use is covered by a right of the copyright holder of the Work).
8
+
9
+ The Work is provided under the terms of this Licence when the Licensor (as
10
+ defined below) has placed the following notice immediately following the
11
+ copyright notice for the Work:
12
+
13
+ Licensed under the EUPL
14
+
15
+ or has expressed by any other means his willingness to license under the EUPL.
16
+
17
+ 1. Definitions
18
+
19
+ In this Licence, the following terms have the following meaning:
20
+
21
+ - ‘The Licence’: this Licence.
22
+
23
+ - ‘The Original Work’: the work or software distributed or communicated by the
24
+ Licensor under this Licence, available as Source Code and also as Executable
25
+ Code as the case may be.
26
+
27
+ - ‘Derivative Works’: the works or software that could be created by the
28
+ Licensee, based upon the Original Work or modifications thereof. This Licence
29
+ does not define the extent of modification or dependence on the Original Work
30
+ required in order to classify a work as a Derivative Work; this extent is
31
+ determined by copyright law applicable in the country mentioned in Article 15.
32
+
33
+ - ‘The Work’: the Original Work or its Derivative Works.
34
+
35
+ - ‘The Source Code’: the human-readable form of the Work which is the most
36
+ convenient for people to study and modify.
37
+
38
+ - ‘The Executable Code’: any code which has generally been compiled and which is
39
+ meant to be interpreted by a computer as a program.
40
+
41
+ - ‘The Licensor’: the natural or legal person that distributes or communicates
42
+ the Work under the Licence.
43
+
44
+ - ‘Contributor(s)’: any natural or legal person who modifies the Work under the
45
+ Licence, or otherwise contributes to the creation of a Derivative Work.
46
+
47
+ - ‘The Licensee’ or ‘You’: any natural or legal person who makes any usage of
48
+ the Work under the terms of the Licence.
49
+
50
+ - ‘Distribution’ or ‘Communication’: any act of selling, giving, lending,
51
+ renting, distributing, communicating, transmitting, or otherwise making
52
+ available, online or offline, copies of the Work or providing access to its
53
+ essential functionalities at the disposal of any other natural or legal
54
+ person.
55
+
56
+ 2. Scope of the rights granted by the Licence
57
+
58
+ The Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
59
+ sublicensable licence to do the following, for the duration of copyright vested
60
+ in the Original Work:
61
+
62
+ - use the Work in any circumstance and for all usage,
63
+ - reproduce the Work,
64
+ - modify the Work, and make Derivative Works based upon the Work,
65
+ - communicate to the public, including the right to make available or display
66
+ the Work or copies thereof to the public and perform publicly, as the case may
67
+ be, the Work,
68
+ - distribute the Work or copies thereof,
69
+ - lend and rent the Work or copies thereof,
70
+ - sublicense rights in the Work or copies thereof.
71
+
72
+ Those rights can be exercised on any media, supports and formats, whether now
73
+ known or later invented, as far as the applicable law permits so.
74
+
75
+ In the countries where moral rights apply, the Licensor waives his right to
76
+ exercise his moral right to the extent allowed by law in order to make effective
77
+ the licence of the economic rights here above listed.
78
+
79
+ The Licensor grants to the Licensee royalty-free, non-exclusive usage rights to
80
+ any patents held by the Licensor, to the extent necessary to make use of the
81
+ rights granted on the Work under this Licence.
82
+
83
+ 3. Communication of the Source Code
84
+
85
+ The Licensor may provide the Work either in its Source Code form, or as
86
+ Executable Code. If the Work is provided as Executable Code, the Licensor
87
+ provides in addition a machine-readable copy of the Source Code of the Work
88
+ along with each copy of the Work that the Licensor distributes or indicates, in
89
+ a notice following the copyright notice attached to the Work, a repository where
90
+ the Source Code is easily and freely accessible for as long as the Licensor
91
+ continues to distribute or communicate the Work.
92
+
93
+ 4. Limitations on copyright
94
+
95
+ Nothing in this Licence is intended to deprive the Licensee of the benefits from
96
+ any exception or limitation to the exclusive rights of the rights owners in the
97
+ Work, of the exhaustion of those rights or of other applicable limitations
98
+ thereto.
99
+
100
+ 5. Obligations of the Licensee
101
+
102
+ The grant of the rights mentioned above is subject to some restrictions and
103
+ obligations imposed on the Licensee. Those obligations are the following:
104
+
105
+ Attribution right: The Licensee shall keep intact all copyright, patent or
106
+ trademarks notices and all notices that refer to the Licence and to the
107
+ disclaimer of warranties. The Licensee must include a copy of such notices and a
108
+ copy of the Licence with every copy of the Work he/she distributes or
109
+ communicates. The Licensee must cause any Derivative Work to carry prominent
110
+ notices stating that the Work has been modified and the date of modification.
111
+
112
+ Copyleft clause: If the Licensee distributes or communicates copies of the
113
+ Original Works or Derivative Works, this Distribution or Communication will be
114
+ done under the terms of this Licence or of a later version of this Licence
115
+ unless the Original Work is expressly distributed only under this version of the
116
+ Licence — for example by communicating ‘EUPL v. 1.2 only’. The Licensee
117
+ (becoming Licensor) cannot offer or impose any additional terms or conditions on
118
+ the Work or Derivative Work that alter or restrict the terms of the Licence.
119
+
120
+ Compatibility clause: If the Licensee Distributes or Communicates Derivative
121
+ Works or copies thereof based upon both the Work and another work licensed under
122
+ a Compatible Licence, this Distribution or Communication can be done under the
123
+ terms of this Compatible Licence. For the sake of this clause, ‘Compatible
124
+ Licence’ refers to the licences listed in the appendix attached to this Licence.
125
+ Should the Licensee's obligations under the Compatible Licence conflict with
126
+ his/her obligations under this Licence, the obligations of the Compatible
127
+ Licence shall prevail.
128
+
129
+ Provision of Source Code: When distributing or communicating copies of the Work,
130
+ the Licensee will provide a machine-readable copy of the Source Code or indicate
131
+ a repository where this Source will be easily and freely available for as long
132
+ as the Licensee continues to distribute or communicate the Work.
133
+
134
+ Legal Protection: This Licence does not grant permission to use the trade names,
135
+ trademarks, service marks, or names of the Licensor, except as required for
136
+ reasonable and customary use in describing the origin of the Work and
137
+ reproducing the content of the copyright notice.
138
+
139
+ 6. Chain of Authorship
140
+
141
+ The original Licensor warrants that the copyright in the Original Work granted
142
+ hereunder is owned by him/her or licensed to him/her and that he/she has the
143
+ power and authority to grant the Licence.
144
+
145
+ Each Contributor warrants that the copyright in the modifications he/she brings
146
+ to the Work are owned by him/her or licensed to him/her and that he/she has the
147
+ power and authority to grant the Licence.
148
+
149
+ Each time You accept the Licence, the original Licensor and subsequent
150
+ Contributors grant You a licence to their contributions to the Work, under the
151
+ terms of this Licence.
152
+
153
+ 7. Disclaimer of Warranty
154
+
155
+ The Work is a work in progress, which is continuously improved by numerous
156
+ Contributors. It is not a finished work and may therefore contain defects or
157
+ ‘bugs’ inherent to this type of development.
158
+
159
+ For the above reason, the Work is provided under the Licence on an ‘as is’ basis
160
+ and without warranties of any kind concerning the Work, including without
161
+ limitation merchantability, fitness for a particular purpose, absence of defects
162
+ or errors, accuracy, non-infringement of intellectual property rights other than
163
+ copyright as stated in Article 6 of this Licence.
164
+
165
+ This disclaimer of warranty is an essential part of the Licence and a condition
166
+ for the grant of any rights to the Work.
167
+
168
+ 8. Disclaimer of Liability
169
+
170
+ Except in the cases of wilful misconduct or damages directly caused to natural
171
+ persons, the Licensor will in no event be liable for any direct or indirect,
172
+ material or moral, damages of any kind, arising out of the Licence or of the use
173
+ of the Work, including without limitation, damages for loss of goodwill, work
174
+ stoppage, computer failure or malfunction, loss of data or any commercial
175
+ damage, even if the Licensor has been advised of the possibility of such damage.
176
+ However, the Licensor will be liable under statutory product liability laws as
177
+ far such laws apply to the Work.
178
+
179
+ 9. Additional agreements
180
+
181
+ While distributing the Work, You may choose to conclude an additional agreement,
182
+ defining obligations or services consistent with this Licence. However, if
183
+ accepting obligations, You may act only on your own behalf and on your sole
184
+ responsibility, not on behalf of the original Licensor or any other Contributor,
185
+ and only if You agree to indemnify, defend, and hold each Contributor harmless
186
+ for any liability incurred by, or claims asserted against such Contributor by
187
+ the fact You have accepted any warranty or additional liability.
188
+
189
+ 10. Acceptance of the Licence
190
+
191
+ The provisions of this Licence can be accepted by clicking on an icon ‘I agree’
192
+ placed under the bottom of a window displaying the text of this Licence or by
193
+ affirming consent in any other similar way, in accordance with the rules of
194
+ applicable law. Clicking on that icon indicates your clear and irrevocable
195
+ acceptance of this Licence and all of its terms and conditions.
196
+
197
+ Similarly, you irrevocably accept this Licence and all of its terms and
198
+ conditions by exercising any rights granted to You by Article 2 of this Licence,
199
+ such as the use of the Work, the creation by You of a Derivative Work or the
200
+ Distribution or Communication by You of the Work or copies thereof.
201
+
202
+ 11. Information to the public
203
+
204
+ In case of any Distribution or Communication of the Work by means of electronic
205
+ communication by You (for example, by offering to download the Work from a
206
+ remote location) the distribution channel or media (for example, a website) must
207
+ at least provide to the public the information requested by the applicable law
208
+ regarding the Licensor, the Licence and the way it may be accessible, concluded,
209
+ stored and reproduced by the Licensee.
210
+
211
+ 12. Termination of the Licence
212
+
213
+ The Licence and the rights granted hereunder will terminate automatically upon
214
+ any breach by the Licensee of the terms of the Licence.
215
+
216
+ Such a termination will not terminate the licences of any person who has
217
+ received the Work from the Licensee under the Licence, provided such persons
218
+ remain in full compliance with the Licence.
219
+
220
+ 13. Miscellaneous
221
+
222
+ Without prejudice of Article 9 above, the Licence represents the complete
223
+ agreement between the Parties as to the Work.
224
+
225
+ If any provision of the Licence is invalid or unenforceable under applicable
226
+ law, this will not affect the validity or enforceability of the Licence as a
227
+ whole. Such provision will be construed or reformed so as necessary to make it
228
+ valid and enforceable.
229
+
230
+ The European Commission may publish other linguistic versions or new versions of
231
+ this Licence or updated versions of the Appendix, so far this is required and
232
+ reasonable, without reducing the scope of the rights granted by the Licence. New
233
+ versions of the Licence will be published with a unique version number.
234
+
235
+ All linguistic versions of this Licence, approved by the European Commission,
236
+ have identical value. Parties can take advantage of the linguistic version of
237
+ their choice.
238
+
239
+ 14. Jurisdiction
240
+
241
+ Without prejudice to specific agreement between parties,
242
+
243
+ - any litigation resulting from the interpretation of this License, arising
244
+ between the European Union institutions, bodies, offices or agencies, as a
245
+ Licensor, and any Licensee, will be subject to the jurisdiction of the Court
246
+ of Justice of the European Union, as laid down in article 272 of the Treaty on
247
+ the Functioning of the European Union,
248
+
249
+ - any litigation arising between other parties and resulting from the
250
+ interpretation of this License, will be subject to the exclusive jurisdiction
251
+ of the competent court where the Licensor resides or conducts its primary
252
+ business.
253
+
254
+ 15. Applicable Law
255
+
256
+ Without prejudice to specific agreement between parties,
257
+
258
+ - this Licence shall be governed by the law of the European Union Member State
259
+ where the Licensor has his seat, resides or has his registered office,
260
+
261
+ - this licence shall be governed by Belgian law if the Licensor has no seat,
262
+ residence or registered office inside a European Union Member State.
263
+
264
+ Appendix
265
+
266
+ ‘Compatible Licences’ according to Article 5 EUPL are:
267
+
268
+ - GNU General Public License (GPL) v. 2, v. 3
269
+ - GNU Affero General Public License (AGPL) v. 3
270
+ - Open Software License (OSL) v. 2.1, v. 3.0
271
+ - Eclipse Public License (EPL) v. 1.0
272
+ - CeCILL v. 2.0, v. 2.1
273
+ - Mozilla Public Licence (MPL) v. 2
274
+ - GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3
275
+ - Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) for
276
+ works other than software
277
+ - European Union Public Licence (EUPL) v. 1.1, v. 1.2
278
+ - Québec Free and Open-Source Licence — Reciprocity (LiLiQ-R) or Strong
279
+ Reciprocity (LiLiQ-R+).
280
+
281
+ The European Commission may update this Appendix to later versions of the above
282
+ licences without producing a new version of the EUPL, as long as they provide
283
+ the rights granted in Article 2 of this Licence and protect the covered Source
284
+ Code from exclusive appropriation.
285
+
286
+ All other changes or additions to this Appendix require the production of a new
287
+ EUPL version.
@@ -0,0 +1,117 @@
1
+ Metadata-Version: 2.5
2
+ Name: open-tabular-priors
3
+ Version: 0.1.0
4
+ Summary: Composable synthetic priors for supervised tabular learning
5
+ License-Expression: EUPL-1.2
6
+ License-File: LICENSE
7
+ Requires-Python: >=3.11
8
+ Requires-Dist: numpy>=2.0
9
+ Provides-Extra: torch
10
+ Requires-Dist: torch>=2.5; extra == 'torch'
11
+ Description-Content-Type: text/markdown
12
+
13
+ # Open Tabular Priors
14
+
15
+ ![A causal graph and a distribution generate a table](logo.svg)
16
+
17
+ Generate reproducible synthetic classification and regression episodes for
18
+ tabular in-context learning with NumPy or PyTorch.
19
+
20
+ ## Install from PyPI
21
+
22
+ We recommend installing Open Tabular Priors from PyPI. Use Python 3.11 or later.
23
+
24
+ ```sh
25
+ python -m pip install open-tabular-priors
26
+ ```
27
+
28
+ For the PyTorch loader, install the `torch` extra.
29
+
30
+ ```sh
31
+ python -m pip install "open-tabular-priors[torch]"
32
+ ```
33
+
34
+ ## Quickstart
35
+
36
+ ```python
37
+ from open_tabular_priors import TrainingConfig, sample_episode
38
+
39
+ config = TrainingConfig(
40
+ n_rows=120,
41
+ n_features=8,
42
+ n_classes=2,
43
+ feature_types=("continuous",),
44
+ width_modes=("direct",),
45
+ class_logit_scale=1.2,
46
+ )
47
+ episode = sample_episode(config, seed=1729, index=0)
48
+ print(episode.X_context.shape, episode.X_query.shape)
49
+ ```
50
+
51
+ Change `index` for another draw from the same seeded stream. Set
52
+ `n_classes=0` for regression.
53
+
54
+ ## Training in stages
55
+
56
+ Start with narrow binary episodes, then give the same model a mix of narrow
57
+ and wider episodes. Keep the model and optimizer state across stages.
58
+
59
+ ```python
60
+ from dataclasses import replace
61
+
62
+ from open_tabular_priors import TrainingConfig, TrainingMixture
63
+ from open_tabular_priors.torch import make_dataloader
64
+
65
+ simple = TrainingConfig(
66
+ n_rows=120, n_features=8, n_classes=2,
67
+ feature_types=("continuous",), width_modes=("direct",),
68
+ class_logit_scale=1.2,
69
+ )
70
+ wider = replace(simple, n_features=(16, 32), width_modes=("wide",),
71
+ wide_base_features=8)
72
+ stages = (simple, TrainingMixture((simple, wider), (1, 1)))
73
+
74
+
75
+ def scheduled_batches(seed=1729):
76
+ episodes_per_stage = 256
77
+ for stage, prior in enumerate(stages):
78
+ yield from make_dataloader(
79
+ prior, seed=seed, count=episodes_per_stage, batch_size=8,
80
+ start_index=stage * episodes_per_stage,
81
+ )
82
+
83
+
84
+ batch = next(iter(scheduled_batches()))
85
+ ```
86
+
87
+ Pass `scheduled_batches()` to your training loop to consume both stages.
88
+ See the [prior recipes and training guide](docs/priors.md) for weighted mixes,
89
+ batching and more complex episodes.
90
+
91
+ ## Evaluation
92
+
93
+ ![Training on the reference dumps versus our narrow prior. The narrow prior leads nanoTabPFN on NLL and AUROC. The ICL dump leads both models on macro-F1.](docs/reference-dump-comparison.png)
94
+
95
+ Points show means over three seeds and 30 binary TabArena-Lite development
96
+ tasks. Bars span the lowest and highest seed means.
97
+ All three training sources use 150 rows and five numerical features.
98
+ The narrow prior is the diverse 50/50 SCM/MLP mix.
99
+
100
+ ## References
101
+
102
+ - Qu, J., Holzmüller, D., Varoquaux, G., and Le Morvan, M. (2025).
103
+ *TabICL: A Tabular Foundation Model for In-Context Learning on Large Data.*
104
+ ICML 2025, PMLR 267, 50817–50847.
105
+ [Paper](https://proceedings.mlr.press/v267/qu25d.html) ·
106
+ [TabICL v1 prior source](https://github.com/soda-inria/tabicl/blob/v0.1.3/src/tabicl/prior/dataset.py)
107
+ - Qu, J., Hudovernik, V., Jurkovič, M., et al. (2026).
108
+ *NVIDIA Kumo Tabular: Pushing the Accuracy–Efficiency Frontier for Tabular
109
+ Prediction.* arXiv:2611.23001.
110
+ [Report and prior details](https://arxiv.org/html/2611.23001v1#A1)
111
+ - Hog, J., Mallik, N., Adriaensen, S., et al. (2026).
112
+ *Towards Reliable Scaling Laws for Tabular Foundation Models.*
113
+ arXiv:2611.24214. [Paper](https://arxiv.org/abs/2611.24214)
114
+
115
+ ## License
116
+
117
+ Licensed under the [European Union Public Licence 1.2](LICENSE).
@@ -0,0 +1,105 @@
1
+ # Open Tabular Priors
2
+
3
+ ![A causal graph and a distribution generate a table](logo.svg)
4
+
5
+ Generate reproducible synthetic classification and regression episodes for
6
+ tabular in-context learning with NumPy or PyTorch.
7
+
8
+ ## Install from PyPI
9
+
10
+ We recommend installing Open Tabular Priors from PyPI. Use Python 3.11 or later.
11
+
12
+ ```sh
13
+ python -m pip install open-tabular-priors
14
+ ```
15
+
16
+ For the PyTorch loader, install the `torch` extra.
17
+
18
+ ```sh
19
+ python -m pip install "open-tabular-priors[torch]"
20
+ ```
21
+
22
+ ## Quickstart
23
+
24
+ ```python
25
+ from open_tabular_priors import TrainingConfig, sample_episode
26
+
27
+ config = TrainingConfig(
28
+ n_rows=120,
29
+ n_features=8,
30
+ n_classes=2,
31
+ feature_types=("continuous",),
32
+ width_modes=("direct",),
33
+ class_logit_scale=1.2,
34
+ )
35
+ episode = sample_episode(config, seed=1729, index=0)
36
+ print(episode.X_context.shape, episode.X_query.shape)
37
+ ```
38
+
39
+ Change `index` for another draw from the same seeded stream. Set
40
+ `n_classes=0` for regression.
41
+
42
+ ## Training in stages
43
+
44
+ Start with narrow binary episodes, then give the same model a mix of narrow
45
+ and wider episodes. Keep the model and optimizer state across stages.
46
+
47
+ ```python
48
+ from dataclasses import replace
49
+
50
+ from open_tabular_priors import TrainingConfig, TrainingMixture
51
+ from open_tabular_priors.torch import make_dataloader
52
+
53
+ simple = TrainingConfig(
54
+ n_rows=120, n_features=8, n_classes=2,
55
+ feature_types=("continuous",), width_modes=("direct",),
56
+ class_logit_scale=1.2,
57
+ )
58
+ wider = replace(simple, n_features=(16, 32), width_modes=("wide",),
59
+ wide_base_features=8)
60
+ stages = (simple, TrainingMixture((simple, wider), (1, 1)))
61
+
62
+
63
+ def scheduled_batches(seed=1729):
64
+ episodes_per_stage = 256
65
+ for stage, prior in enumerate(stages):
66
+ yield from make_dataloader(
67
+ prior, seed=seed, count=episodes_per_stage, batch_size=8,
68
+ start_index=stage * episodes_per_stage,
69
+ )
70
+
71
+
72
+ batch = next(iter(scheduled_batches()))
73
+ ```
74
+
75
+ Pass `scheduled_batches()` to your training loop to consume both stages.
76
+ See the [prior recipes and training guide](docs/priors.md) for weighted mixes,
77
+ batching and more complex episodes.
78
+
79
+ ## Evaluation
80
+
81
+ ![Training on the reference dumps versus our narrow prior. The narrow prior leads nanoTabPFN on NLL and AUROC. The ICL dump leads both models on macro-F1.](docs/reference-dump-comparison.png)
82
+
83
+ Points show means over three seeds and 30 binary TabArena-Lite development
84
+ tasks. Bars span the lowest and highest seed means.
85
+ All three training sources use 150 rows and five numerical features.
86
+ The narrow prior is the diverse 50/50 SCM/MLP mix.
87
+
88
+ ## References
89
+
90
+ - Qu, J., Holzmüller, D., Varoquaux, G., and Le Morvan, M. (2025).
91
+ *TabICL: A Tabular Foundation Model for In-Context Learning on Large Data.*
92
+ ICML 2025, PMLR 267, 50817–50847.
93
+ [Paper](https://proceedings.mlr.press/v267/qu25d.html) ·
94
+ [TabICL v1 prior source](https://github.com/soda-inria/tabicl/blob/v0.1.3/src/tabicl/prior/dataset.py)
95
+ - Qu, J., Hudovernik, V., Jurkovič, M., et al. (2026).
96
+ *NVIDIA Kumo Tabular: Pushing the Accuracy–Efficiency Frontier for Tabular
97
+ Prediction.* arXiv:2611.23001.
98
+ [Report and prior details](https://arxiv.org/html/2611.23001v1#A1)
99
+ - Hog, J., Mallik, N., Adriaensen, S., et al. (2026).
100
+ *Towards Reliable Scaling Laws for Tabular Foundation Models.*
101
+ arXiv:2611.24214. [Paper](https://arxiv.org/abs/2611.24214)
102
+
103
+ ## License
104
+
105
+ Licensed under the [European Union Public Licence 1.2](LICENSE).
@@ -0,0 +1,94 @@
1
+ # Prior recipes and training
2
+
3
+ ## Episodes and batching
4
+
5
+ `TrainingConfig` controls table size, feature types, class count, and the
6
+ generator. Each episode contains context and query inputs and labels, plus a
7
+ categorical column mask. Classification context contains every class in the
8
+ episode. A small or imbalanced query can contain just one class. Missing values
9
+ are represented by NaN. Use `n_classes=0` for regression.
10
+
11
+ `sample_episode(config, seed=1729, index=0)` replays a draw for the same config,
12
+ seed and index. The PyTorch loader returns lists of episodes by default. Set
13
+ `padded=True` to receive tensors with context, query and feature masks. Use
14
+ `start_index` to give each stage or epoch a fresh range of episode indices.
15
+ The model's initialization and optimizer randomness use a separate seed.
16
+
17
+ ## Recipes and schedules
18
+
19
+ A `TrainingMixture` selects a complete recipe for each episode using relative
20
+ weights. Use it to tie size, labels and feature types together within a recipe.
21
+ For example, the second recipe below adds sparse binary columns around an
22
+ eight-feature donor table.
23
+
24
+ ```python
25
+ from dataclasses import replace
26
+
27
+ from open_tabular_priors import TrainingConfig, TrainingMixture, sample_episode
28
+
29
+ narrow = TrainingConfig(
30
+ n_rows=(96, 128), n_features=8, n_classes=2,
31
+ feature_types=("continuous",), width_modes=("direct",),
32
+ class_logit_scale=1.2, binary_label_strength=(2.0, 8.0),
33
+ )
34
+ sparse = replace(
35
+ narrow, n_features=(32, 64), width_modes=("wide",), wide_base_features=8,
36
+ wide_numerical_mode="binary", wide_zero_fraction=0.85,
37
+ )
38
+ prior = TrainingMixture((narrow, sparse), (3, 1))
39
+ episode = sample_episode(prior, seed=1729, index=3)
40
+ ```
41
+
42
+ `wide_numerical_mode="zero_inflated"` adds nonnegative, log-transformed
43
+ measurements with a configurable fraction of zeros. Dense numerical projections
44
+ are the default for wide mode.
45
+
46
+ For a schedule, change the mixture between stages and keep the optimizer
47
+ running. One sequence is narrow-only, then a 3:1 mix of narrow and wider tables,
48
+ then a 1:1 mix. To test whether order helps, compare that schedule with a fixed
49
+ mixture containing the same overall proportions. Keep the label law, model,
50
+ and training budget fixed, and log the realized recipe counts for each run.
51
+
52
+ ## Compose a generator
53
+
54
+ Pass a callable as `TrainingConfig(scm=...)` or `TrainingConfig(neural=...)`.
55
+ For one table, call `sample(prior, Task(n_rows, n_features, n_classes), seed=1729)`.
56
+ Custom generators should respect `Task.numeric_features_only`. Built-in
57
+ generators use seeded tie-breaking to keep every requested class when a score
58
+ has too few distinct values for quantile labels.
59
+
60
+ ```python
61
+ from open_tabular_priors import AugmentedPrior, GraphSCMPrior, Mixture, SCMPrior
62
+
63
+ neural_tree = Mixture((SCMPrior("neural"), SCMPrior("tree")), (0.7, 0.3))
64
+
65
+ augmented_graph = AugmentedPrior(
66
+ GraphSCMPrior(
67
+ n_nodes=(2, 32),
68
+ channels=(1, 32),
69
+ categorical_fraction=(0, 0),
70
+ measurement_probability=0.10,
71
+ target_node_features=(0, 3),
72
+ ),
73
+ block_probability=0.30,
74
+ relabel_probability=0.10,
75
+ coarsen_probability=0.10,
76
+ shuffle_columns=True,
77
+ )
78
+ ```
79
+
80
+ The neural/tree mixture draws on TabICL v1. The augmented graph draws on
81
+ Kumo Tabular's noisy measurements, correlated feature blocks and post-processing.
82
+ With `TrainingConfig`, use its feature-type and missing-rate settings to
83
+ control the episode schema and apply missingness after widening.
84
+
85
+ `Observation` adds measurement noise, proxies or missing values. `WidePrior`
86
+ adds projections while preserving the base table's labels.
87
+ `FunctionalSCMPrior` defines how observed features affect the target.
88
+ Use `tree_count` for a sum of shallow tree scores and `distractor_weights`
89
+ for independent noise, correlated null blocks and noisy copies of informative
90
+ features. Grouped and temporal splits can introduce covariate shift or target
91
+ drift. For stochastic multiclass episodes, `multiclass_label_strength`
92
+ controls how strongly probabilities depend on the latent score. NumPy episodes
93
+ expose the query probabilities, and the coverage adjustment applies to
94
+ context labels only.
@@ -0,0 +1,35 @@
1
+ # Releasing to PyPI
2
+
3
+ ## First release
4
+
5
+ 1. Put the [release workflow](../.github/workflows/release.yml) on GitHub's
6
+ default branch.
7
+ 2. In your [PyPI publishing settings](https://pypi.org/manage/account/publishing/),
8
+ add a pending GitHub Actions Trusted Publisher with these values.
9
+
10
+ | Field | Value |
11
+ |---|---|
12
+ | PyPI project name | `open-tabular-priors` |
13
+ | GitHub owner | `not-a-feature` |
14
+ | Repository name | `open-tabular-priors` |
15
+ | Workflow filename | `release.yml` |
16
+ | Environment name | `pypi` |
17
+
18
+ 3. Publish a GitHub Release tagged `v0.1.0` from the commit that contains the
19
+ workflow. The first successful upload creates the PyPI project.
20
+
21
+ PyPI serves the source distribution and wheel publicly. To make the GitHub
22
+ README, figures and linked docs available to PyPI users, provide a public copy
23
+ of the repository or those assets.
24
+
25
+ ## Later releases
26
+
27
+ Update `project.version` in `pyproject.toml` and run `uv lock`. Commit and push
28
+ both files, then publish a GitHub Release with the matching tag, for example
29
+ `v0.1.1`. Use a new version for each upload.
30
+
31
+ Each published GitHub Release builds a wheel and source distribution, checks
32
+ their metadata, and uploads both through Trusted Publishing. Draft releases
33
+ and tag pushes leave publishing pending until the GitHub Release is published.
34
+
35
+ See [PyPI’s Trusted Publisher setup guide](https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc/).