tributo-algorithms 0.1.0__tar.gz → 0.2.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 (162) hide show
  1. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/PKG-INFO +155 -3
  2. tributo_algorithms-0.2.0/README.md +362 -0
  3. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/boosting/src/tributo_algorithms_boosting/algorithm.py +125 -20
  4. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/boosting/src/tributo_algorithms_boosting/checkpointing.py +43 -7
  5. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/boosting/src/tributo_algorithms_boosting/contracts.py +61 -7
  6. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/boosting/src/tributo_algorithms_boosting/descriptor.py +1 -1
  7. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/boosting/src/tributo_algorithms_boosting/lightgbm_descriptor.py +1 -1
  8. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/boosting/src/tributo_algorithms_boosting/native.py +51 -8
  9. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/catboost/src/tributo_algorithms_catboost/descriptor.py +1 -1
  10. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-core/src/tributo_algorithms_causal_core/algorithm.py +1 -1
  11. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-core/src/tributo_algorithms_causal_core/descriptor.py +1 -1
  12. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-discovery/src/tributo_algorithms_causal_discovery/algorithm.py +1 -1
  13. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-discovery/src/tributo_algorithms_causal_discovery/descriptor.py +1 -1
  14. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-dowhy/src/tributo_algorithms_causal_dowhy/descriptor.py +1 -1
  15. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-dowhy/src/tributo_algorithms_causal_dowhy/gcm_descriptor.py +1 -1
  16. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-dr/src/tributo_algorithms_causal_dr/descriptor.py +1 -1
  17. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-xlearner/src/tributo_algorithms_causal_xlearner/__init__.py +25 -1
  18. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-xlearner/src/tributo_algorithms_causal_xlearner/algorithm.py +154 -40
  19. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-xlearner/src/tributo_algorithms_causal_xlearner/contracts.py +35 -0
  20. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-xlearner/src/tributo_algorithms_causal_xlearner/descriptor.py +1 -1
  21. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-xlearner/src/tributo_algorithms_causal_xlearner/flavor.py +1 -1
  22. tributo_algorithms-0.2.0/packages/causal-xlearner/src/tributo_algorithms_causal_xlearner/metrics.py +501 -0
  23. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-xlearner/src/tributo_algorithms_causal_xlearner/model.py +8 -2
  24. tributo_algorithms-0.2.0/packages/causal-xlearner/src/tributo_algorithms_causal_xlearner/rct_metrics.py +422 -0
  25. tributo_algorithms-0.2.0/packages/causal-xlearner/src/tributo_algorithms_causal_xlearner/truth_metrics.py +161 -0
  26. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/classical/src/tributo_algorithms_classical/contracts.py +11 -5
  27. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/classical/src/tributo_algorithms_classical/descriptors.py +1 -1
  28. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/classical/src/tributo_algorithms_classical/isolation_forest_descriptor.py +1 -1
  29. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/classical/src/tributo_algorithms_classical/kmeans_descriptor.py +1 -1
  30. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/classical/src/tributo_algorithms_classical/logistic_regression.py +24 -7
  31. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/classical/src/tributo_algorithms_classical/multinomial_nb.py +2 -2
  32. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/classical/src/tributo_algorithms_classical/multinomial_nb_descriptor.py +2 -2
  33. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/classical/src/tributo_algorithms_classical/pca_descriptor.py +1 -1
  34. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/classical/src/tributo_algorithms_classical/sgd_descriptor.py +1 -1
  35. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/graph-pyg/src/tributo_algorithms_graph_pyg/descriptor.py +1 -1
  36. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/multistage-torch/src/tributo_algorithms_multistage_torch/descriptor.py +1 -1
  37. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/multistage-torch/src/tributo_algorithms_multistage_torch/pretrain_descriptor.py +1 -1
  38. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/recsys-torch/src/tributo_algorithms_recsys_torch/descriptor.py +1 -1
  39. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/recsys-torch/src/tributo_algorithms_recsys_torch/jagged_descriptor.py +1 -1
  40. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/representation/src/tributo_algorithms_representation/descriptor.py +1 -1
  41. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/tabular-torch/src/tributo_algorithms_tabular_torch/descriptor.py +1 -1
  42. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/timeseries/src/tributo_algorithms_timeseries/descriptor.py +1 -1
  43. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/timeseries/src/tributo_algorithms_timeseries/rnn_descriptor.py +1 -1
  44. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/transformers-nlp/src/tributo_algorithms_transformers_nlp/descriptor.py +1 -1
  45. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/transformers-nlp/src/tributo_algorithms_transformers_nlp/recipe.py +10 -3
  46. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/pyproject.toml +1 -1
  47. tributo_algorithms-0.2.0/tests/jobs/Dockerfile.xgboost-single-node-smoke +24 -0
  48. tributo_algorithms-0.2.0/tests/jobs/Dockerfile.xlearner-single-node-smoke +26 -0
  49. tributo_algorithms-0.2.0/tests/jobs/run_xgboost_single_node_smoke.sh +96 -0
  50. tributo_algorithms-0.2.0/tests/jobs/run_xlearner_single_node_smoke.sh +207 -0
  51. tributo_algorithms-0.2.0/tests/jobs/xgboost-single-node-smoke.env +7 -0
  52. tributo_algorithms-0.2.0/tests/jobs/xgboost_single_node_smoke.py +250 -0
  53. tributo_algorithms-0.2.0/tests/jobs/xlearner-single-node-smoke.env +6 -0
  54. tributo_algorithms-0.2.0/tests/jobs/xlearner_evaluation_checks.py +89 -0
  55. tributo_algorithms-0.2.0/tests/jobs/xlearner_single_node_smoke.py +540 -0
  56. tributo_algorithms-0.2.0/tests/test_causal_xlearner_algorithm.py +773 -0
  57. tributo_algorithms-0.2.0/tests/test_causal_xlearner_rct_metrics.py +290 -0
  58. tributo_algorithms-0.2.0/tests/test_causal_xlearner_truth_metrics.py +169 -0
  59. tributo_algorithms-0.2.0/tests/test_ci_release_contract.py +352 -0
  60. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_classical_algorithms.py +89 -0
  61. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_transformer_algorithm.py +57 -0
  62. tributo_algorithms-0.2.0/tests/test_transformer_ddp.py +153 -0
  63. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_xgboost_checkpointing.py +52 -9
  64. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_xgboost_training.py +248 -5
  65. tributo_algorithms-0.2.0/tests/test_xgboost_validation.py +900 -0
  66. tributo_algorithms-0.1.0/README.md +0 -210
  67. tributo_algorithms-0.1.0/tests/test_causal_xlearner_algorithm.py +0 -238
  68. tributo_algorithms-0.1.0/tests/test_ci_release_contract.py +0 -204
  69. tributo_algorithms-0.1.0/tests/test_xgboost_validation.py +0 -431
  70. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/.gitignore +0 -0
  71. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/LICENSE +0 -0
  72. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/boosting/src/tributo_algorithms_boosting/__init__.py +0 -0
  73. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/boosting/src/tributo_algorithms_boosting/data_config.py +0 -0
  74. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/boosting/src/tributo_algorithms_boosting/lightgbm.py +0 -0
  75. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/boosting/src/tributo_algorithms_boosting/lightgbm_contracts.py +0 -0
  76. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/boosting/src/tributo_algorithms_boosting/stages.py +0 -0
  77. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/catboost/src/tributo_algorithms_catboost/__init__.py +0 -0
  78. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/catboost/src/tributo_algorithms_catboost/algorithm.py +0 -0
  79. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/catboost/src/tributo_algorithms_catboost/contracts.py +0 -0
  80. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/catboost/src/tributo_algorithms_catboost/exporter.py +0 -0
  81. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/catboost/src/tributo_algorithms_catboost/flavor.py +0 -0
  82. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-core/src/tributo_algorithms_causal_core/__init__.py +0 -0
  83. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-core/src/tributo_algorithms_causal_core/contracts.py +0 -0
  84. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-core/src/tributo_algorithms_causal_core/exporter.py +0 -0
  85. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-discovery/src/tributo_algorithms_causal_discovery/__init__.py +0 -0
  86. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-discovery/src/tributo_algorithms_causal_discovery/contracts.py +0 -0
  87. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-discovery/src/tributo_algorithms_causal_discovery/exporter.py +0 -0
  88. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-dowhy/src/tributo_algorithms_causal_dowhy/__init__.py +0 -0
  89. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-dowhy/src/tributo_algorithms_causal_dowhy/algorithm.py +0 -0
  90. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-dowhy/src/tributo_algorithms_causal_dowhy/contracts.py +0 -0
  91. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-dowhy/src/tributo_algorithms_causal_dowhy/exporter.py +0 -0
  92. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-dowhy/src/tributo_algorithms_causal_dowhy/gcm.py +0 -0
  93. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-dr/src/tributo_algorithms_causal_dr/__init__.py +0 -0
  94. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-dr/src/tributo_algorithms_causal_dr/algorithm.py +0 -0
  95. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-dr/src/tributo_algorithms_causal_dr/contracts.py +0 -0
  96. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/causal-xlearner/src/tributo_algorithms_causal_xlearner/exporter.py +0 -0
  97. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/classical/src/tributo_algorithms_classical/__init__.py +0 -0
  98. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/classical/src/tributo_algorithms_classical/exporter.py +0 -0
  99. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/classical/src/tributo_algorithms_classical/isolation_forest.py +0 -0
  100. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/classical/src/tributo_algorithms_classical/kmeans.py +0 -0
  101. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/classical/src/tributo_algorithms_classical/linear_regression.py +0 -0
  102. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/classical/src/tributo_algorithms_classical/models.py +0 -0
  103. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/classical/src/tributo_algorithms_classical/pca.py +0 -0
  104. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/classical/src/tributo_algorithms_classical/random_forest.py +0 -0
  105. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/classical/src/tributo_algorithms_classical/sgd.py +0 -0
  106. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/classical/src/tributo_algorithms_classical/sgd_contracts.py +0 -0
  107. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/classical/src/tributo_algorithms_classical/unsupervised_contracts.py +0 -0
  108. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/classical/src/tributo_algorithms_classical/unsupervised_exporter.py +0 -0
  109. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/classical/src/tributo_algorithms_classical/unsupervised_models.py +0 -0
  110. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/graph-pyg/src/tributo_algorithms_graph_pyg/__init__.py +0 -0
  111. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/graph-pyg/src/tributo_algorithms_graph_pyg/algorithm.py +0 -0
  112. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/graph-pyg/src/tributo_algorithms_graph_pyg/contracts.py +0 -0
  113. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/multistage-torch/src/tributo_algorithms_multistage_torch/__init__.py +0 -0
  114. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/multistage-torch/src/tributo_algorithms_multistage_torch/algorithm.py +0 -0
  115. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/multistage-torch/src/tributo_algorithms_multistage_torch/contracts.py +0 -0
  116. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/multistage-torch/src/tributo_algorithms_multistage_torch/pretrain.py +0 -0
  117. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/recsys-torch/src/tributo_algorithms_recsys_torch/__init__.py +0 -0
  118. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/recsys-torch/src/tributo_algorithms_recsys_torch/contracts.py +0 -0
  119. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/recsys-torch/src/tributo_algorithms_recsys_torch/jagged.py +0 -0
  120. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/recsys-torch/src/tributo_algorithms_recsys_torch/recipe.py +0 -0
  121. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/representation/src/tributo_algorithms_representation/__init__.py +0 -0
  122. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/representation/src/tributo_algorithms_representation/contracts.py +0 -0
  123. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/representation/src/tributo_algorithms_representation/recipe.py +0 -0
  124. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/tabular-torch/src/tributo_algorithms_tabular_torch/__init__.py +0 -0
  125. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/tabular-torch/src/tributo_algorithms_tabular_torch/contracts.py +0 -0
  126. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/tabular-torch/src/tributo_algorithms_tabular_torch/priors.py +0 -0
  127. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/tabular-torch/src/tributo_algorithms_tabular_torch/pu_metrics.py +0 -0
  128. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/tabular-torch/src/tributo_algorithms_tabular_torch/pu_reducer.py +0 -0
  129. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/tabular-torch/src/tributo_algorithms_tabular_torch/recipe.py +0 -0
  130. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/timeseries/src/tributo_algorithms_timeseries/__init__.py +0 -0
  131. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/timeseries/src/tributo_algorithms_timeseries/contracts.py +0 -0
  132. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/timeseries/src/tributo_algorithms_timeseries/recipe.py +0 -0
  133. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/timeseries/src/tributo_algorithms_timeseries/rnn_contracts.py +0 -0
  134. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/timeseries/src/tributo_algorithms_timeseries/rnn_recipe.py +0 -0
  135. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/transformers-nlp/src/tributo_algorithms_transformers_nlp/__init__.py +0 -0
  136. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/packages/transformers-nlp/src/tributo_algorithms_transformers_nlp/contracts.py +0 -0
  137. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/scripts/resolve_release_package.py +0 -0
  138. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/scripts/verify_installed_distribution.py +0 -0
  139. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/jobs/xgboost_worker_gate.py +0 -0
  140. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_boosting_algorithm.py +0 -0
  141. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_catboost_algorithm.py +0 -0
  142. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_causal_core_algorithm.py +0 -0
  143. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_causal_discovery_algorithm.py +0 -0
  144. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_causal_dowhy_algorithm.py +0 -0
  145. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_causal_dr_algorithm.py +0 -0
  146. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_causal_gcm_algorithm.py +0 -0
  147. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_classical_new_algorithms.py +0 -0
  148. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_classical_unsupervised.py +0 -0
  149. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_graph_pyg_algorithm.py +0 -0
  150. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_jagged_recsys_algorithm.py +0 -0
  151. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_lightgbm_algorithm.py +0 -0
  152. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_multistage_torch_algorithm.py +0 -0
  153. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_package_conformance.py +0 -0
  154. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_pretrain_finetune_algorithm.py +0 -0
  155. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_pu_metrics.py +0 -0
  156. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_pu_priors.py +0 -0
  157. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_recsys_torch_algorithm.py +0 -0
  158. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_representation_algorithm.py +0 -0
  159. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_tabular_torch_algorithms.py +0 -0
  160. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_timeseries_algorithm.py +0 -0
  161. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_timeseries_rnn.py +0 -0
  162. {tributo_algorithms-0.1.0 → tributo_algorithms-0.2.0}/tests/test_torch_contract_identity.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tributo-algorithms
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: Official algorithm implementations and optional dependency extras for Tributo
5
5
  Author: Tributo Contributors
6
6
  License: Apache-2.0
@@ -228,8 +228,18 @@ For validation-driven model selection, include these fields in the existing
228
228
  }
229
229
  ```
230
230
 
231
- Early stopping requires validation, one explicit `model.eval_metric` string,
232
- positive integer patience, and an explicit boolean `training.maximize`.
231
+ Early stopping requires validation, explicit `model.eval_metric` strings,
232
+ positive integer patience, and an explicit boolean `training.maximize`. With
233
+ multiple evaluation metrics, set `training.selection_metric` to the metric
234
+ that controls early stopping and best-model selection. For example, use
235
+ `"eval_metric": ["logloss", "auc"]` and `"selection_metric": "logloss"`
236
+ to select by validation logloss while also reporting AUC. A single metric does
237
+ not require `selection_metric` and may contain parameters such as `error@0.5`.
238
+ When evaluating multiple metrics, the selected metric cannot contain `@`;
239
+ choose a non-parameterized metric or run the parameterized metric alone.
240
+ If XGBoost reports multiple values under the same metric name in one round,
241
+ training rejects the configuration. XGBoost may also deduplicate metrics before
242
+ reporting them; in that case only its reported result is available.
233
243
  Patience may exceed the round limit. The native XGBoost callback selects the
234
244
  best prefix even when the round limit is reached before patience expires.
235
245
  Linear Boosters cannot export this selected prefix. A provided validation
@@ -252,6 +262,50 @@ For H&M, use validation logloss for stopping. XGBoost's distributed AUC is an
252
262
  Compute AP, ROC-AUC, and Lift over the complete held-out predictions and labels
253
263
  in the calling application.
254
264
 
265
+ ## XGBoost checkpoint evaluation before Bundle export
266
+
267
+ Formal XGBoost training can optionally call trusted application code after the
268
+ selected checkpoint has been validated and before its Bundle is published. Set
269
+ `output.checkpoint_evaluation` alongside `output.bundle_uri`:
270
+
271
+ ```json
272
+ {
273
+ "output": {
274
+ "bundle_uri": "/models/example",
275
+ "checkpoint_evaluation": {
276
+ "callback": "my_application.evaluation:evaluate_checkpoint",
277
+ "options": {"evaluation_data_uri": "/data/holdout.parquet"}
278
+ }
279
+ }
280
+ }
281
+ ```
282
+
283
+ The referenced function must be importable in the Ray Job execution environment.
284
+ It receives an independent XGBoost `Booster` as its first argument and keyword
285
+ arguments `feature_names` (an ordered tuple) and `options` (a JSON object).
286
+ The application supplies and reads its own evaluation data. Return a mapping
287
+ from nonempty metric names to finite Python `int` or `float` values; the values
288
+ are available as `result.execution.metrics["checkpoint_evaluation"]`. Callback errors,
289
+ an unavailable reference, or invalid metrics fail the run before publication.
290
+ Omitting the configuration retains the existing export behavior. The callback
291
+ is trusted code with the Ray Job's permissions; do not put credentials in options.
292
+ This evaluates the checkpoint model, not a converted ONNX artifact. Tune
293
+ fit-only trials do not run Bundle export or this callback.
294
+
295
+ ## XGBoost inference feature order
296
+
297
+ When training feature names are available, the ONNX artifact records their
298
+ order in `feature_names` metadata. The `XGBoostONNXPredictor` can discover them
299
+ and select batch columns in training order. Explicit feature names take
300
+ precedence and must use that same order.
301
+
302
+ Formal `InferenceRequest` callers must provide their ordered table columns in
303
+ the tensor input binding. The binding order must match training; the tensor
304
+ signature specifies its shape, not the names or order of the table columns.
305
+ Raw ONNX and serving tensor inputs likewise require values in training order.
306
+ For older models without feature metadata, supply the ordered names explicitly;
307
+ the direct raw-model predictor otherwise falls back to batch column order.
308
+
255
309
  ## XGBoost periodic checkpoints and same-run recovery
256
310
 
257
311
  Enable periodic saving and a finite Worker failure allowance in the existing
@@ -302,6 +356,12 @@ XGBoost consumes replayable Ray Train shards in batches of at most 65,536 rows.
302
356
  The existing Core Framework Native and multi-stage entry points share this
303
357
  Worker loop; Core continues to manage execution and Bundle delivery.
304
358
 
359
+ PR CI also runs a small single-node Ray Jobs smoke for the installed aggregate
360
+ Wheel. Its pinned Python/Core/Ray profile is recorded in
361
+ `tests/jobs/xgboost-single-node-smoke.env`. The smoke checks the
362
+ end-to-end training and Bundle inference path; it does not validate cross-node
363
+ execution. The manual Gate below remains the cross-node validation harness.
364
+
305
365
  The Gate targets a two-node Docker Ray 2.59.0 cluster with the same fixed
306
366
  Tributo Core 1.2.0 and algorithm Wheels installed on every node, together with the
307
367
  `boosting` extra. Use a shared directory mounted at the same absolute path on
@@ -326,3 +386,95 @@ Final receipts are matched to the last successful group. It preserves
326
386
  `result.json`, failure events, receipts, and model outputs
327
387
  under that directory. This targeted Gate does not certify other runtime images
328
388
  or execution profiles.
389
+
390
+ ## X-Learner held-out effect evaluation
391
+
392
+ `evaluate_cate_predictions` and `evaluate_rct_predictions` are public, model-independent functions exported by `tributo_algorithms_causal_xlearner`. They consume predictions from an already trained Bundle and do not train, read files, start Ray, or publish a model. Prediction and truth/observation IDs must be unique and cover exactly the same cohort.
393
+
394
+ For binary-outcome randomized experiments, use the known constant treatment-assignment probability and a policy fixed before looking at the test outcomes:
395
+
396
+ ```python
397
+ from tributo_algorithms_causal_xlearner import evaluate_rct_predictions
398
+
399
+ report = evaluate_rct_predictions(
400
+ prediction_ids=prediction_ids,
401
+ cate_predictions=predicted_cate,
402
+ observation_ids=observation_ids,
403
+ treatment=observed_treatment,
404
+ outcome=observed_visit,
405
+ assignment_probability=0.5,
406
+ experiment_id="hillstrom-womens-email-vs-no-email",
407
+ policy_coverage=0.2,
408
+ n_bins=10,
409
+ confidence_level=0.95,
410
+ n_bootstrap=200,
411
+ seed=7,
412
+ )
413
+ ```
414
+
415
+ Declaring an experiment ID does not verify randomization. Do not substitute learned propensity scores or apply this RCT interpretation to observational ACIC assignments. Dataset selection, treatment direction, and the source's randomization design remain the caller's responsibility.
416
+
417
+ The `rct-ipw-v1` result contains cohort counts, metric definitions and units, uplift bins, curve data, policy values, and intervals. With known probability `p`, the contribution is `T*Y/p - (1-T)*Y/(1-p)`. Sort by decreasing predicted CATE and ascending sample ID; the cumulative curve at rank `k` is the sum of its first `k` contributions divided by the full cohort size. `auuc_ipw` integrates every rank, including the origin, against coverage. `qini_ipw` integrates the signed difference from the line joining the origin and full-cohort endpoint. Both are unnormalized outcome-probability areas. Zero and negative gain are valid; no division by net gain occurs. The IPW endpoint and the unweighted treatment/control mean difference are reported separately and need not coincide.
418
+
419
+ Exactly one of `policy_coverage` and `policy_threshold` is required. Coverage chooses `floor(n * coverage)` customers with ID tie-breaking; thresholds choose CATE greater than or equal to the threshold. Values use inverse-probability weighting and compare with no treatment, all treatment, and random treatment at the policy's realized coverage. Customer bootstrap preserves treatment-arm counts and the original policy actions; it never refits, reranks, or selects a new policy. Percentile intervals cover ATE and policy statistics; bins have separate within-bin, within-arm intervals when each arm has at least two observations. Insufficient bins remain present with an explicit status and null interval. There are no simultaneous curve/area intervals or training-uncertainty claims.
420
+
421
+ The public RCT function accepts at most 100,000 rows, 100 bins, and 1,000 bootstrap resamples (minimum two). It requires at least two observations per arm, consistent string or integer ID types, finite scores, binary treatment and outcomes, and valid probabilities. It rejects bad rows rather than silently dropping them. Results are JSON-serializable; applications may render the returned curves without implementing metric mathematics.
422
+
423
+ Training retains separate descriptive OOF diagnostics under `xlearner-oof-normalized-v1`. Their `qini`/`auuc` use an empirical arm ratio and a binary reference normalization, not the held-out IPW definitions; `metric_status` identifies zero-normalizer legacy fallbacks. The full-cohort endpoint and AUUC denominator use the same gain computed from arm-level outcome totals; a tolerance of eight ULPs at the arm-total scale treats cancellation residuals as zero without a fixed absolute cutoff. The `normalization` object reports the unrounded `full_cohort_gain` and `zero_tolerance`; zero gain retains the numeric AUUC fallback 0.5 with `undefined_zero_normalizer` status, rather than presenting that fallback as a valid estimate. These diagnostics do not establish randomization or validate observational causal effects. Model output names, the CATE formula, response/uplift quadrant labels and codes, native flavor, and ONNX contract remain compatible with the mainline implementation. The final Bundle uses a five-stage refit on the full training input; held-out effect validation remains separate from OOF diagnostics.
424
+
425
+ PR CI runs the installed aggregate Wheel through a single-node Ray Jobs smoke
426
+ using a deterministic truth-known fixture. The smoke exercises X-Learner fit,
427
+ loads its Bundle through the batch prediction capability, and reports
428
+ unnormalized root PEHE and absolute population ATE error on a held-out cohort.
429
+ The same Job calls the public RCT evaluator on a separate binary experiment fixture and checks the ordered OOF scan against shuffled input and 1/3/7 physical-block layouts, including repeated keys. These checks run in the Docker Ray Job, without an opt-in skipped local-Ray test. They do not claim validation on the Hillstrom data itself.
430
+
431
+ The manual ACIC 2016 Gate uses a prepared CSV or Parquet file that is not
432
+ committed to the repository. It must contain unique `sample_id`, binary
433
+ `treatment`, factual `outcome`, expected potential-outcome means `mu0` and
434
+ `mu1`, and at least three numeric feature columns named contiguously `x0`,
435
+ `x1`, ... . The file must not contain extra columns: unmapped fields are
436
+ rejected so potential-outcome truth cannot accidentally become a feature.
437
+ Categorical covariates must be encoded numerically before preparation. The
438
+ result's `schema_mapping` records the canonical columns in the prepared file;
439
+ it does not infer the original ACIC column names or categorical encoding. Keep
440
+ those preparation details with the local dataset provenance. The Gate verifies
441
+ the checksum of the exact prepared file, separates training rows from held-out
442
+ rows with the recorded seed, and excludes `mu0` and `mu1` from training input.
443
+
444
+ For a manual run, use one fixed ACIC setting and replication, then record the
445
+ source, setting, replication, schema mapping, split seed, and prepared-file
446
+ SHA-256 in the result. The reported metrics are project-local unnormalized
447
+ root PEHE in outcome units and population ATE error over the held-out cohort;
448
+ they do not reproduce the ACIC competition's normalized PEHE or SATT scoring.
449
+ The dataset source is the [ACIC 2016 competition page](https://jenniferhill7.wixsite.com/acic-2016/competition).
450
+
451
+ With the pinned Docker/Ray profile available, run the manual Gate as follows:
452
+
453
+ ```bash
454
+ uv lock --check
455
+ uv build --no-sources
456
+ uv export \
457
+ --locked \
458
+ --extra causal-xlearner \
459
+ --no-dev \
460
+ --no-emit-project \
461
+ --no-annotate \
462
+ --output-file dist/xlearner-smoke-requirements.txt
463
+
464
+ XLEARNER_ACIC_DATA_FILE=/path/to/acic-setting-replication.parquet \
465
+ XLEARNER_ACIC_DATA_SHA256="replace-with-prepared-file-sha256" \
466
+ XLEARNER_ACIC_SETTING_ID=1 \
467
+ XLEARNER_ACIC_REPLICATION=1 \
468
+ XLEARNER_ACIC_SPLIT_SEED=7 \
469
+ bash tests/jobs/run_xlearner_single_node_smoke.sh
470
+ ```
471
+
472
+ The Gate uses Tributo Core 1.2.0, Ray 2.59.0, Python 3.12, and the
473
+ digest-pinned Ray image in `tests/jobs/xlearner-single-node-smoke.env`. It
474
+ records the runtime, dataset checksum, Bundle identity, metrics, and logs, then
475
+ removes only its own container and custom image. The result validates a
476
+ single-node path and does not claim online-serving or multi-node support.
477
+ For a local manual run, pull the pinned base image through the configured
478
+ registry mirror, tag it with the value of `RAY_LOCAL_TAG` in the profile, and
479
+ ensure its repository digest matches the profile. The runner verifies the
480
+ digest and does not pull the base image from the default registry.
@@ -0,0 +1,362 @@
1
+ # Tributo Official Algorithms
2
+
3
+ This repository publishes one Python distribution, `tributo-algorithms`. The
4
+ Wheel contains all official algorithm descriptors and plugins; optional extras
5
+ install the runtime dependencies for each algorithm domain. Third-party
6
+ algorithms use the same public contracts and entry-point path.
7
+
8
+ Tributo Core owns Ray execution, resource allocation, retries, input leases,
9
+ checkpoint transport, evidence, Tune, Bundle publication, and inference. This
10
+ distribution owns algorithm mathematics, framework-native hooks, executable
11
+ contracts, and algorithm-specific delivery plugins.
12
+
13
+ | Extra | Algorithms and roles |
14
+ | --- | --- |
15
+ | `classical` | Random Forest, Extra Trees, Logistic/Linear Regression, MultinomialNB, PCA, KMeans, synchronous SGD, Isolation Forest |
16
+ | `boosting` | Ray Train XGBoost and LightGBM, ONNX/UBJ export, native flavor |
17
+ | `tabular-torch` | DNN, nnPU/uPU, PU prior and metric utilities |
18
+ | `timeseries` | Temporal convolution, LSTM, and GRU classification |
19
+ | `catboost` | Conditional distributed CatBoost ensemble |
20
+ | `representation` | Distributed tabular autoencoder |
21
+ | `transformers-nlp` | Pre-tokenized Transformer classification |
22
+ | `graph-pyg` | GraphSAGE and relational R-GCN |
23
+ | `recsys-torch` | Two-Tower and Jagged EmbeddingBag with All-to-All routing |
24
+ | `multistage-torch` | Distillation and pretrain-to-finetune |
25
+ | `causal-core` | Difference-in-means, DML, and IV |
26
+ | `causal-discovery` | Distributed PC stability discovery |
27
+ | `causal-dr` | Doubly robust/AIPW estimation |
28
+ | `causal-xlearner` | Five-stage X-Learner and batch CATE flavor |
29
+ | `causal-dowhy` | DoWhy estimation/refutation and GCM root-cause analysis |
30
+
31
+ Install only the domain dependencies you need:
32
+
33
+ ```bash
34
+ pip install "tributo-algorithms[classical]"
35
+ pip install "tributo-algorithms[causal-xlearner]"
36
+ ```
37
+
38
+ Use `tributo-algorithms[all]` to install every domain extra. The base
39
+ distribution registers all descriptors, so discovery remains available
40
+ without importing the optional algorithm frameworks. Selecting an algorithm
41
+ requires installing its corresponding extra.
42
+
43
+ The `graph-pyg` extra currently supports Torch `>=2.5,<2.14`; `all` follows
44
+ the same range. PyG's module import uses TorchScript APIs deprecated in Torch
45
+ 2.14. Other Torch extras retain their own dependency ranges.
46
+
47
+ ## Core compatibility
48
+
49
+ The distribution and domain extras require Tributo Core `>=1.2` without an
50
+ upper version bound. The XGBoost descriptor also requires `>=1.2` for optional
51
+ input routing; other descriptors retain their own minimum versions. Versions
52
+ below 1.2 are outside this distribution's declared compatibility range.
53
+ An open upper bound does not certify future Core
54
+ releases; execution support is established by the Gate for its exact Core
55
+ version, algorithm Wheel, and runtime image. Lock those versions in consuming
56
+ projects for reproducible deployments.
57
+
58
+ ## macOS arm64 with Python 3.12
59
+
60
+ DoWhy 0.14 requires SciPy `<=1.15.3` on Python 3.12. The SciPy 1.15.3 macOS 14
61
+ Wheel fails dynamic loader validation on affected macOS versions. The official
62
+ macOS 12 Wheel of the same version works on these systems. The project's uv
63
+ source configuration selects this Wheel for macOS arm64 with Python 3.12 and
64
+ records its hash in `uv.lock`.
65
+
66
+ For pip installations of `causal-dowhy` or `all` on this platform, install that
67
+ official SciPy Wheel before the algorithm extra:
68
+
69
+ ```bash
70
+ python -m pip install "https://files.pythonhosted.org/packages/7b/7e/f30be3d03de07f25dc0ec926d1681fed5c732d759ac8f51079708c79e680/scipy-1.15.3-cp312-cp312-macosx_12_0_arm64.whl#sha256=185cd3d6d05ca4b44a8f1595af87f9c372bb6acf9c808e99aa3e9aa03bd98cf6"
71
+ python -m pip install "tributo-algorithms[causal-dowhy]"
72
+ ```
73
+
74
+ ## Development
75
+
76
+ ```bash
77
+ uv sync --locked --extra all --group dev
78
+ uv run ruff format --check .
79
+ uv run ruff check .
80
+ uv run mypy packages
81
+ uv run pytest tests
82
+ uv build --no-sources
83
+ ```
84
+
85
+ Release the aggregate distribution with a single
86
+ `tributo-algorithms-v<semver>` tag. CI builds one Wheel and source distribution,
87
+ publishes the same checksummed files to TestPyPI, verifies the installed
88
+ metadata, then publishes those files to PyPI.
89
+
90
+ ## XGBoost validation and early stopping
91
+
92
+ XGBoost accepts a required `train` binding and an optional `validation` binding
93
+ through `InputBindingSet`, with `train` as the primary role. Both inputs must
94
+ declare the same ordered features and label column and provide compatible
95
+ numeric schemas. Validation rows are evaluated separately and never enter the
96
+ training gradient matrix. Both roles use lossless partitioning and report
97
+ their own `input_rows` counts for Core validation.
98
+
99
+ For validation-driven model selection, include these fields in the existing
100
+ `algorithm_config` (alongside its `data`, `ray`, and `output` configuration):
101
+
102
+ ```json
103
+ {
104
+ "model": {"objective": "binary:logistic", "eval_metric": "logloss"},
105
+ "training": {
106
+ "num_rounds": 1000,
107
+ "early_stopping_rounds": 20,
108
+ "maximize": false
109
+ }
110
+ }
111
+ ```
112
+
113
+ Early stopping requires validation, explicit `model.eval_metric` strings,
114
+ positive integer patience, and an explicit boolean `training.maximize`. With
115
+ multiple evaluation metrics, set `training.selection_metric` to the metric
116
+ that controls early stopping and best-model selection. For example, use
117
+ `"eval_metric": ["logloss", "auc"]` and `"selection_metric": "logloss"`
118
+ to select by validation logloss while also reporting AUC. A single metric does
119
+ not require `selection_metric` and may contain parameters such as `error@0.5`.
120
+ When evaluating multiple metrics, the selected metric cannot contain `@`;
121
+ choose a non-parameterized metric or run the parameterized metric alone.
122
+ If XGBoost reports multiple values under the same metric name in one round,
123
+ training rejects the configuration. XGBoost may also deduplicate metrics before
124
+ reporting them; in that case only its reported result is available.
125
+ Patience may exceed the round limit. The native XGBoost callback selects the
126
+ best prefix even when the round limit is reached before patience expires.
127
+ Linear Boosters cannot export this selected prefix. A provided validation
128
+ shard must be non-empty on every Worker, matching the current train-shard
129
+ restriction. Invalid inputs or non-finite selection scores fail training.
130
+
131
+ Omit early-stopping fields to preserve fixed-round training. Validation can
132
+ still be provided for evaluation; train-only requests remain supported.
133
+ Execution metrics distinguish `training_rounds` (executed rounds) from
134
+ `model_rounds` (rounds in the exported model). Early-stopped fits additionally
135
+ return zero-based `best_iteration`, `best_score`, `selection_metric`, and
136
+ `maximize`. The `train-*` and `validation-*` metrics describe the last executed
137
+ round; `best_score` describes the selected round. Both ONNX and native UBJ
138
+ artifacts contain the selected model and a digest-checked
139
+ `training_metadata.json` sidecar. Best-model selection does
140
+ not depend on a consumer supplying an iteration range at prediction time.
141
+
142
+ For H&M, use validation logloss for stopping. XGBoost's distributed AUC is an
143
+ [approximation](https://xgboost.readthedocs.io/en/stable/parameter.html#learning-task-parameters).
144
+ Compute AP, ROC-AUC, and Lift over the complete held-out predictions and labels
145
+ in the calling application.
146
+
147
+ ## XGBoost checkpoint evaluation before Bundle export
148
+
149
+ Formal XGBoost training can optionally call trusted application code after the
150
+ selected checkpoint has been validated and before its Bundle is published. Set
151
+ `output.checkpoint_evaluation` alongside `output.bundle_uri`:
152
+
153
+ ```json
154
+ {
155
+ "output": {
156
+ "bundle_uri": "/models/example",
157
+ "checkpoint_evaluation": {
158
+ "callback": "my_application.evaluation:evaluate_checkpoint",
159
+ "options": {"evaluation_data_uri": "/data/holdout.parquet"}
160
+ }
161
+ }
162
+ }
163
+ ```
164
+
165
+ The referenced function must be importable in the Ray Job execution environment.
166
+ It receives an independent XGBoost `Booster` as its first argument and keyword
167
+ arguments `feature_names` (an ordered tuple) and `options` (a JSON object).
168
+ The application supplies and reads its own evaluation data. Return a mapping
169
+ from nonempty metric names to finite Python `int` or `float` values; the values
170
+ are available as `result.execution.metrics["checkpoint_evaluation"]`. Callback errors,
171
+ an unavailable reference, or invalid metrics fail the run before publication.
172
+ Omitting the configuration retains the existing export behavior. The callback
173
+ is trusted code with the Ray Job's permissions; do not put credentials in options.
174
+ This evaluates the checkpoint model, not a converted ONNX artifact. Tune
175
+ fit-only trials do not run Bundle export or this callback.
176
+
177
+ ## XGBoost inference feature order
178
+
179
+ When training feature names are available, the ONNX artifact records their
180
+ order in `feature_names` metadata. The `XGBoostONNXPredictor` can discover them
181
+ and select batch columns in training order. Explicit feature names take
182
+ precedence and must use that same order.
183
+
184
+ Formal `InferenceRequest` callers must provide their ordered table columns in
185
+ the tensor input binding. The binding order must match training; the tensor
186
+ signature specifies its shape, not the names or order of the table columns.
187
+ Raw ONNX and serving tensor inputs likewise require values in training order.
188
+ For older models without feature metadata, supply the ordered names explicitly;
189
+ the direct raw-model predictor otherwise falls back to batch column order.
190
+
191
+ ## XGBoost periodic checkpoints and same-run recovery
192
+
193
+ Enable periodic saving and a finite Worker failure allowance in the existing
194
+ configuration:
195
+
196
+ ```json
197
+ {
198
+ "training": {"num_rounds": 20, "checkpoint_interval_rounds": 10},
199
+ "ray": {"storage_path": "/shared/checkpoints", "max_failures": 1}
200
+ }
201
+ ```
202
+
203
+ Both fields default to zero. Values must be non-negative integers; booleans
204
+ and infinite retry budgets are rejected. A positive `max_failures` requires
205
+ a positive checkpoint interval. Saving without retries is allowed. Ray Train
206
+ V2 owns checkpoint transport and Worker group restarts; every trainer invocation
207
+ has a unique storage name. All nodes must access the same durable storage path.
208
+ Recovery requires `gbtree`, fixed Worker count/environment, and frozen inputs.
209
+ The exercised baseline is Ray 2.59.0 with XGBoost 3.4.1 and Core 1.2.0.
210
+
211
+ `num_rounds` remains the total target: restoring round 10 with a target of 20
212
+ adds at most 10 rounds. Checkpoints retain the full training Booster, ordered
213
+ features, invocation/plan identity, environment versions, file digests, and
214
+ early-stopping score history. Native early stopping replays that history to
215
+ retain best score and patience progress. A checkpoint that has reached the
216
+ round limit or stopped early adds no further rounds. Corrupt or incompatible
217
+ state fails explicitly, without silently restarting from zero. A failure before
218
+ the first checkpoint may restart from zero within the configured allowance.
219
+
220
+ The latest recovery state and selected inference model are separate. Only a
221
+ final checkpoint can be exported; both Bundle formats contain the selected
222
+ model. Metrics include `resumed_from_round` and `attempt_training_rounds`, whose
223
+ sum equals `training_rounds`. Final Worker receipts contain only the successful
224
+ group's input counts and newly executed rounds, including zero for terminal
225
+ recovery. Failed attempts do not contribute to coverage evidence.
226
+
227
+ This supports Worker process failures within one `fit()`. Cross-run
228
+ `runtime.resume_from`, Driver/Controller or cluster disaster recovery, elastic
229
+ Worker counts, and Tune are outside this feature. The public stage-runner API
230
+ is unchanged and keeps recovery disabled. Input identity checks do not detect
231
+ changed contents behind the same mutable URI. UBJ continuation does not promise
232
+ bitwise equivalence for random sampling, GPU training, or changed data shards;
233
+ the Gate uses deterministic CPU histogram training without sampling.
234
+
235
+ ## XGBoost Worker Gate
236
+
237
+ XGBoost consumes replayable Ray Train shards in batches of at most 65,536 rows.
238
+ The existing Core Framework Native and multi-stage entry points share this
239
+ Worker loop; Core continues to manage execution and Bundle delivery.
240
+
241
+ PR CI also runs a small single-node Ray Jobs smoke for the installed aggregate
242
+ Wheel. Its pinned Python/Core/Ray profile is recorded in
243
+ `tests/jobs/xgboost-single-node-smoke.env`. The smoke checks the
244
+ end-to-end training and Bundle inference path; it does not validate cross-node
245
+ execution. The manual Gate below remains the cross-node validation harness.
246
+
247
+ The Gate targets a two-node Docker Ray 2.59.0 cluster with the same fixed
248
+ Tributo Core 1.2.0 and algorithm Wheels installed on every node, together with the
249
+ `boosting` extra. Use a shared directory mounted at the same absolute path on
250
+ both nodes. Submit from this repository through Ray Jobs:
251
+
252
+ ```bash
253
+ ray job submit --address "$RAY_DASHBOARD_URL" --working-dir . \
254
+ -- python tests/jobs/xgboost_worker_gate.py --root "$GATE_SHARED_ROOT"
255
+ ```
256
+
257
+ `GATE_SHARED_ROOT` must name a new directory. The job checks the Core execution
258
+ path and `XGBoostStageRunner` with two Workers on different nodes, 131,075 input
259
+ train rows, 131,077 validation rows, synchronized model digests, train-only
260
+ and validation fits, early stopping, selected-model reload, and ONNX/native
261
+ Bundle artifacts. A separate bounded routing fixture verifies row identities
262
+ for both input roles, and an empty validation case must fail without publishing
263
+ a Bundle. Recovery cases inject real Worker exits after the controller confirms
264
+ checkpoint persistence: 10-to-20-round continuation, interruption during
265
+ patience, further improvement up to the round cap, final-checkpoint recovery
266
+ with no new rounds, finite retry exhaustion, and invocation/checkpoint isolation.
267
+ Final receipts are matched to the last successful group. It preserves
268
+ `result.json`, failure events, receipts, and model outputs
269
+ under that directory. This targeted Gate does not certify other runtime images
270
+ or execution profiles.
271
+
272
+ ## X-Learner held-out effect evaluation
273
+
274
+ `evaluate_cate_predictions` and `evaluate_rct_predictions` are public, model-independent functions exported by `tributo_algorithms_causal_xlearner`. They consume predictions from an already trained Bundle and do not train, read files, start Ray, or publish a model. Prediction and truth/observation IDs must be unique and cover exactly the same cohort.
275
+
276
+ For binary-outcome randomized experiments, use the known constant treatment-assignment probability and a policy fixed before looking at the test outcomes:
277
+
278
+ ```python
279
+ from tributo_algorithms_causal_xlearner import evaluate_rct_predictions
280
+
281
+ report = evaluate_rct_predictions(
282
+ prediction_ids=prediction_ids,
283
+ cate_predictions=predicted_cate,
284
+ observation_ids=observation_ids,
285
+ treatment=observed_treatment,
286
+ outcome=observed_visit,
287
+ assignment_probability=0.5,
288
+ experiment_id="hillstrom-womens-email-vs-no-email",
289
+ policy_coverage=0.2,
290
+ n_bins=10,
291
+ confidence_level=0.95,
292
+ n_bootstrap=200,
293
+ seed=7,
294
+ )
295
+ ```
296
+
297
+ Declaring an experiment ID does not verify randomization. Do not substitute learned propensity scores or apply this RCT interpretation to observational ACIC assignments. Dataset selection, treatment direction, and the source's randomization design remain the caller's responsibility.
298
+
299
+ The `rct-ipw-v1` result contains cohort counts, metric definitions and units, uplift bins, curve data, policy values, and intervals. With known probability `p`, the contribution is `T*Y/p - (1-T)*Y/(1-p)`. Sort by decreasing predicted CATE and ascending sample ID; the cumulative curve at rank `k` is the sum of its first `k` contributions divided by the full cohort size. `auuc_ipw` integrates every rank, including the origin, against coverage. `qini_ipw` integrates the signed difference from the line joining the origin and full-cohort endpoint. Both are unnormalized outcome-probability areas. Zero and negative gain are valid; no division by net gain occurs. The IPW endpoint and the unweighted treatment/control mean difference are reported separately and need not coincide.
300
+
301
+ Exactly one of `policy_coverage` and `policy_threshold` is required. Coverage chooses `floor(n * coverage)` customers with ID tie-breaking; thresholds choose CATE greater than or equal to the threshold. Values use inverse-probability weighting and compare with no treatment, all treatment, and random treatment at the policy's realized coverage. Customer bootstrap preserves treatment-arm counts and the original policy actions; it never refits, reranks, or selects a new policy. Percentile intervals cover ATE and policy statistics; bins have separate within-bin, within-arm intervals when each arm has at least two observations. Insufficient bins remain present with an explicit status and null interval. There are no simultaneous curve/area intervals or training-uncertainty claims.
302
+
303
+ The public RCT function accepts at most 100,000 rows, 100 bins, and 1,000 bootstrap resamples (minimum two). It requires at least two observations per arm, consistent string or integer ID types, finite scores, binary treatment and outcomes, and valid probabilities. It rejects bad rows rather than silently dropping them. Results are JSON-serializable; applications may render the returned curves without implementing metric mathematics.
304
+
305
+ Training retains separate descriptive OOF diagnostics under `xlearner-oof-normalized-v1`. Their `qini`/`auuc` use an empirical arm ratio and a binary reference normalization, not the held-out IPW definitions; `metric_status` identifies zero-normalizer legacy fallbacks. The full-cohort endpoint and AUUC denominator use the same gain computed from arm-level outcome totals; a tolerance of eight ULPs at the arm-total scale treats cancellation residuals as zero without a fixed absolute cutoff. The `normalization` object reports the unrounded `full_cohort_gain` and `zero_tolerance`; zero gain retains the numeric AUUC fallback 0.5 with `undefined_zero_normalizer` status, rather than presenting that fallback as a valid estimate. These diagnostics do not establish randomization or validate observational causal effects. Model output names, the CATE formula, response/uplift quadrant labels and codes, native flavor, and ONNX contract remain compatible with the mainline implementation. The final Bundle uses a five-stage refit on the full training input; held-out effect validation remains separate from OOF diagnostics.
306
+
307
+ PR CI runs the installed aggregate Wheel through a single-node Ray Jobs smoke
308
+ using a deterministic truth-known fixture. The smoke exercises X-Learner fit,
309
+ loads its Bundle through the batch prediction capability, and reports
310
+ unnormalized root PEHE and absolute population ATE error on a held-out cohort.
311
+ The same Job calls the public RCT evaluator on a separate binary experiment fixture and checks the ordered OOF scan against shuffled input and 1/3/7 physical-block layouts, including repeated keys. These checks run in the Docker Ray Job, without an opt-in skipped local-Ray test. They do not claim validation on the Hillstrom data itself.
312
+
313
+ The manual ACIC 2016 Gate uses a prepared CSV or Parquet file that is not
314
+ committed to the repository. It must contain unique `sample_id`, binary
315
+ `treatment`, factual `outcome`, expected potential-outcome means `mu0` and
316
+ `mu1`, and at least three numeric feature columns named contiguously `x0`,
317
+ `x1`, ... . The file must not contain extra columns: unmapped fields are
318
+ rejected so potential-outcome truth cannot accidentally become a feature.
319
+ Categorical covariates must be encoded numerically before preparation. The
320
+ result's `schema_mapping` records the canonical columns in the prepared file;
321
+ it does not infer the original ACIC column names or categorical encoding. Keep
322
+ those preparation details with the local dataset provenance. The Gate verifies
323
+ the checksum of the exact prepared file, separates training rows from held-out
324
+ rows with the recorded seed, and excludes `mu0` and `mu1` from training input.
325
+
326
+ For a manual run, use one fixed ACIC setting and replication, then record the
327
+ source, setting, replication, schema mapping, split seed, and prepared-file
328
+ SHA-256 in the result. The reported metrics are project-local unnormalized
329
+ root PEHE in outcome units and population ATE error over the held-out cohort;
330
+ they do not reproduce the ACIC competition's normalized PEHE or SATT scoring.
331
+ The dataset source is the [ACIC 2016 competition page](https://jenniferhill7.wixsite.com/acic-2016/competition).
332
+
333
+ With the pinned Docker/Ray profile available, run the manual Gate as follows:
334
+
335
+ ```bash
336
+ uv lock --check
337
+ uv build --no-sources
338
+ uv export \
339
+ --locked \
340
+ --extra causal-xlearner \
341
+ --no-dev \
342
+ --no-emit-project \
343
+ --no-annotate \
344
+ --output-file dist/xlearner-smoke-requirements.txt
345
+
346
+ XLEARNER_ACIC_DATA_FILE=/path/to/acic-setting-replication.parquet \
347
+ XLEARNER_ACIC_DATA_SHA256="replace-with-prepared-file-sha256" \
348
+ XLEARNER_ACIC_SETTING_ID=1 \
349
+ XLEARNER_ACIC_REPLICATION=1 \
350
+ XLEARNER_ACIC_SPLIT_SEED=7 \
351
+ bash tests/jobs/run_xlearner_single_node_smoke.sh
352
+ ```
353
+
354
+ The Gate uses Tributo Core 1.2.0, Ray 2.59.0, Python 3.12, and the
355
+ digest-pinned Ray image in `tests/jobs/xlearner-single-node-smoke.env`. It
356
+ records the runtime, dataset checksum, Bundle identity, metrics, and logs, then
357
+ removes only its own container and custom image. The result validates a
358
+ single-node path and does not claim online-serving or multi-node support.
359
+ For a local manual run, pull the pinned base image through the configured
360
+ registry mirror, tag it with the value of `RAY_LOCAL_TAG` in the profile, and
361
+ ensure its repository digest matches the profile. The runner verifies the
362
+ digest and does not pull the base image from the default registry.