pdstools 4.6.1__tar.gz → 4.6.2__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 (167) hide show
  1. {pdstools-4.6.1 → pdstools-4.6.2}/PKG-INFO +1 -1
  2. {pdstools-4.6.1 → pdstools-4.6.2}/pdstools.egg-info/PKG-INFO +1 -1
  3. {pdstools-4.6.1 → pdstools-4.6.2}/pdstools.egg-info/SOURCES.txt +5 -1
  4. {pdstools-4.6.1 → pdstools-4.6.2}/pyproject.toml +29 -1
  5. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/__init__.py +1 -1
  6. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/adm/ADMDatamart.py +40 -0
  7. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/adm/Aggregates.py +53 -6
  8. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/adm/BinAggregator.py +40 -50
  9. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/adm/Plots.py +274 -2
  10. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/app/decision_analyzer/Home.py +43 -31
  11. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/app/decision_analyzer/da_streamlit_utils.py +198 -24
  12. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/app/decision_analyzer/pages/10_Thresholding_Analysis.py +39 -18
  13. pdstools-4.6.1/python/pdstools/app/decision_analyzer/pages/11_Arbitration_Component_Distribution.py → pdstools-4.6.2/python/pdstools/app/decision_analyzer/pages/11_Arbitration_Distribution.py +26 -3
  14. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/app/decision_analyzer/pages/2_Global_Data_Filters.py +11 -5
  15. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/app/decision_analyzer/pages/3_Overview.py +4 -7
  16. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/app/decision_analyzer/pages/4_Action_Distribution.py +27 -6
  17. pdstools-4.6.2/python/pdstools/app/decision_analyzer/pages/5_Action_Funnel.py +230 -0
  18. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/app/decision_analyzer/pages/6_Global_Sensitivity.py +29 -6
  19. pdstools-4.6.2/python/pdstools/app/decision_analyzer/pages/7_Win_Loss_Analysis.py +316 -0
  20. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/app/decision_analyzer/pages/8_Optionality_Analysis.py +21 -27
  21. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/app/decision_analyzer/pages/9_Offer_Quality_Analysis.py +46 -4
  22. pdstools-4.6.2/python/pdstools/app/impact_analyzer/Home.py +270 -0
  23. pdstools-4.6.2/python/pdstools/app/impact_analyzer/ia_streamlit_utils.py +515 -0
  24. pdstools-4.6.2/python/pdstools/app/impact_analyzer/pages/1_Overall_Summary.py +38 -0
  25. pdstools-4.6.2/python/pdstools/app/impact_analyzer/pages/2_Trend.py +65 -0
  26. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/cli.py +18 -1
  27. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/decision_analyzer/DecisionAnalyzer.py +1043 -209
  28. pdstools-4.6.2/python/pdstools/decision_analyzer/data_read_utils.py +169 -0
  29. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/decision_analyzer/plots.py +319 -122
  30. pdstools-4.6.2/python/pdstools/decision_analyzer/stage_grouping.py +181 -0
  31. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/decision_analyzer/utils.py +236 -138
  32. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/explanations/Aggregate.py +184 -124
  33. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/explanations/ExplanationsUtils.py +14 -7
  34. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/explanations/Plots.py +102 -59
  35. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/explanations/Reports.py +40 -33
  36. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/ih/Aggregates.py +101 -19
  37. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/ih/IH.py +20 -0
  38. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/impactanalyzer/ImpactAnalyzer.py +90 -21
  39. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/resources/prediction_studio/local_model_utils.py +370 -14
  40. pdstools-4.6.2/python/pdstools/infinity/resources/prediction_studio/model_security.py +200 -0
  41. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/pega_io/File.py +414 -63
  42. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/pega_io/__init__.py +2 -0
  43. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/prediction/Prediction.py +12 -4
  44. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/reports/GlobalExplanations/_quarto.yml +3 -3
  45. pdstools-4.6.2/python/pdstools/reports/GlobalExplanations/assets/templates/all_context_content.qmd +41 -0
  46. pdstools-4.6.2/python/pdstools/reports/GlobalExplanations/assets/templates/all_context_header.qmd +24 -0
  47. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/reports/GlobalExplanations/assets/templates/context.qmd +4 -2
  48. pdstools-4.6.2/python/pdstools/reports/GlobalExplanations/assets/templates/getting-started.qmd +36 -0
  49. pdstools-4.6.2/python/pdstools/reports/GlobalExplanations/assets/templates/overview.qmd +48 -0
  50. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/reports/GlobalExplanations/scripts/generate_report.py +88 -32
  51. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/reports/HealthCheck.qmd +231 -276
  52. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/utils/cdh_utils.py +177 -22
  53. pdstools-4.6.2/python/pdstools/utils/color_mapping.py +90 -0
  54. pdstools-4.6.2/python/pdstools/utils/pega_outcomes.py +126 -0
  55. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/utils/report_utils.py +209 -18
  56. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/utils/streamlit_utils.py +35 -3
  57. pdstools-4.6.1/python/pdstools/app/decision_analyzer/pages/5_Action_Funnel.py +0 -212
  58. pdstools-4.6.1/python/pdstools/app/decision_analyzer/pages/7_Win_Loss_Analysis.py +0 -235
  59. pdstools-4.6.1/python/pdstools/app/impact_analyzer/Home.py +0 -151
  60. pdstools-4.6.1/python/pdstools/app/impact_analyzer/ia_streamlit_utils.py +0 -67
  61. pdstools-4.6.1/python/pdstools/app/impact_analyzer/pages/1_Overall_Summary.py +0 -32
  62. pdstools-4.6.1/python/pdstools/app/impact_analyzer/pages/2_Trend.py +0 -42
  63. pdstools-4.6.1/python/pdstools/decision_analyzer/data_read_utils.py +0 -196
  64. pdstools-4.6.1/python/pdstools/reports/GlobalExplanations/assets/templates/all_context_content.qmd +0 -29
  65. pdstools-4.6.1/python/pdstools/reports/GlobalExplanations/assets/templates/all_context_header.qmd +0 -15
  66. pdstools-4.6.1/python/pdstools/reports/GlobalExplanations/assets/templates/getting-started.qmd +0 -20
  67. pdstools-4.6.1/python/pdstools/reports/GlobalExplanations/assets/templates/overview.qmd +0 -34
  68. {pdstools-4.6.1 → pdstools-4.6.2}/LICENSE +0 -0
  69. {pdstools-4.6.1 → pdstools-4.6.2}/README.md +0 -0
  70. {pdstools-4.6.1 → pdstools-4.6.2}/pdstools.egg-info/dependency_links.txt +0 -0
  71. {pdstools-4.6.1 → pdstools-4.6.2}/pdstools.egg-info/entry_points.txt +0 -0
  72. {pdstools-4.6.1 → pdstools-4.6.2}/pdstools.egg-info/requires.txt +0 -0
  73. {pdstools-4.6.1 → pdstools-4.6.2}/pdstools.egg-info/top_level.txt +0 -0
  74. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/adm/ADMTrees.py +0 -0
  75. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/adm/Reports.py +0 -0
  76. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/adm/Schema.py +0 -0
  77. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/adm/__init__.py +0 -0
  78. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/app/__init__.py +0 -0
  79. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/app/assets/pega-logo.svg +0 -0
  80. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/app/decision_analyzer/__init__.py +0 -0
  81. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/app/decision_analyzer/pages/12_About.py +0 -0
  82. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/app/decision_analyzer/pages/__init__.py +0 -0
  83. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/app/health_check/Home.py +0 -0
  84. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/app/health_check/__init__.py +0 -0
  85. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/app/health_check/pages/1_Data_Filters.py +0 -0
  86. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/app/health_check/pages/2_Reports.py +0 -0
  87. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/app/health_check/pages/3_About.py +0 -0
  88. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/app/health_check/pages/__init__.py +0 -0
  89. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/app/impact_analyzer/__init__.py +0 -0
  90. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/app/impact_analyzer/pages/3_About.py +0 -0
  91. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/app/impact_analyzer/pages/__init__.py +0 -0
  92. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/decision_analyzer/__init__.py +0 -0
  93. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/decision_analyzer/column_schema.py +0 -0
  94. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/explanations/Explanations.py +0 -0
  95. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/explanations/FilterWidget.py +0 -0
  96. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/explanations/Preprocess.py +0 -0
  97. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/explanations/__init__.py +0 -0
  98. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/explanations/resources/__init__.py +0 -0
  99. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/explanations/resources/queries/__init__.py +0 -0
  100. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/explanations/resources/queries/create.sql +0 -0
  101. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/explanations/resources/queries/model_contexts.sql +0 -0
  102. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/explanations/resources/queries/numeric.sql +0 -0
  103. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/explanations/resources/queries/numeric_overall.sql +0 -0
  104. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/explanations/resources/queries/symbolic.sql +0 -0
  105. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/explanations/resources/queries/symbolic_overall.sql +0 -0
  106. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/ih/Plots.py +0 -0
  107. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/ih/__init__.py +0 -0
  108. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/impactanalyzer/Plots.py +0 -0
  109. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/impactanalyzer/__init__.py +0 -0
  110. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/__init__.py +0 -0
  111. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/client.py +0 -0
  112. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/internal/__init__.py +0 -0
  113. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/internal/_auth.py +0 -0
  114. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/internal/_base_client.py +0 -0
  115. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/internal/_constants.py +0 -0
  116. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/internal/_exceptions.py +0 -0
  117. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/internal/_pagination.py +0 -0
  118. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/internal/_resource.py +0 -0
  119. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/resources/__init__.py +0 -0
  120. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/resources/knowledge_buddy/__init__.py +0 -0
  121. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/resources/knowledge_buddy/knowledge_buddy.py +0 -0
  122. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/resources/prediction_studio/__init__.py +0 -0
  123. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/resources/prediction_studio/base.py +0 -0
  124. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/resources/prediction_studio/types.py +0 -0
  125. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/resources/prediction_studio/v24_1/__init__.py +0 -0
  126. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/resources/prediction_studio/v24_1/prediction.py +0 -0
  127. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/resources/prediction_studio/v24_1/prediction_studio.py +0 -0
  128. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/resources/prediction_studio/v24_1/repository.py +0 -0
  129. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/resources/prediction_studio/v24_2/__init__.py +0 -0
  130. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/resources/prediction_studio/v24_2/champion_challenger.py +0 -0
  131. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/resources/prediction_studio/v24_2/datamart_export.py +0 -0
  132. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/resources/prediction_studio/v24_2/model.py +0 -0
  133. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/resources/prediction_studio/v24_2/model_upload.py +0 -0
  134. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/resources/prediction_studio/v24_2/prediction.py +0 -0
  135. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/resources/prediction_studio/v24_2/prediction_studio.py +0 -0
  136. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/infinity/resources/prediction_studio/v24_2/repository.py +0 -0
  137. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/pega_io/API.py +0 -0
  138. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/pega_io/Anonymization.py +0 -0
  139. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/pega_io/S3.py +0 -0
  140. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/prediction/__init__.py +0 -0
  141. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/py.typed +0 -0
  142. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/reports/GlobalExplanations/__init__.py +0 -0
  143. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/reports/GlobalExplanations/scripts/__init__.py +0 -0
  144. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/reports/ModelReport.qmd +0 -0
  145. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/reports/__init__.py +0 -0
  146. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/reports/assets/pega-report-overrides.css +0 -0
  147. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/resources/MetricLimits.csv +0 -0
  148. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/resources/__init__.py +0 -0
  149. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/utils/__init__.py +0 -0
  150. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/utils/datasets.py +0 -0
  151. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/utils/errors.py +0 -0
  152. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/utils/metric_limits.py +0 -0
  153. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/utils/namespaces.py +0 -0
  154. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/utils/number_format.py +0 -0
  155. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/utils/pega_template.py +0 -0
  156. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/utils/plot_utils.py +0 -0
  157. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/utils/polars_ext.py +0 -0
  158. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/utils/progress_utils.py +0 -0
  159. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/utils/show_versions.py +0 -0
  160. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/utils/table_definitions.py +0 -0
  161. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/utils/types.py +0 -0
  162. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/valuefinder/Aggregates.py +0 -0
  163. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/valuefinder/Plots.py +0 -0
  164. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/valuefinder/Schema.py +0 -0
  165. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/valuefinder/ValueFinder.py +0 -0
  166. {pdstools-4.6.1 → pdstools-4.6.2}/python/pdstools/valuefinder/__init__.py +0 -0
  167. {pdstools-4.6.1 → pdstools-4.6.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pdstools
3
- Version: 4.6.1
3
+ Version: 4.6.2
4
4
  Summary: Open source tooling that helps Data Scientists to analyze Pega models and conduct impactful analyses.
5
5
  Author-email: Stijn Kas <stijn.kas@pega.com>
6
6
  License: Apache-2.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pdstools
3
- Version: 4.6.1
3
+ Version: 4.6.2
4
4
  Summary: Open source tooling that helps Data Scientists to analyze Pega models and conduct impactful analyses.
5
5
  Author-email: Stijn Kas <stijn.kas@pega.com>
6
6
  License: Apache-2.0
@@ -24,7 +24,7 @@ python/pdstools/app/decision_analyzer/Home.py
24
24
  python/pdstools/app/decision_analyzer/__init__.py
25
25
  python/pdstools/app/decision_analyzer/da_streamlit_utils.py
26
26
  python/pdstools/app/decision_analyzer/pages/10_Thresholding_Analysis.py
27
- python/pdstools/app/decision_analyzer/pages/11_Arbitration_Component_Distribution.py
27
+ python/pdstools/app/decision_analyzer/pages/11_Arbitration_Distribution.py
28
28
  python/pdstools/app/decision_analyzer/pages/12_About.py
29
29
  python/pdstools/app/decision_analyzer/pages/2_Global_Data_Filters.py
30
30
  python/pdstools/app/decision_analyzer/pages/3_Overview.py
@@ -53,6 +53,7 @@ python/pdstools/decision_analyzer/__init__.py
53
53
  python/pdstools/decision_analyzer/column_schema.py
54
54
  python/pdstools/decision_analyzer/data_read_utils.py
55
55
  python/pdstools/decision_analyzer/plots.py
56
+ python/pdstools/decision_analyzer/stage_grouping.py
56
57
  python/pdstools/decision_analyzer/utils.py
57
58
  python/pdstools/explanations/Aggregate.py
58
59
  python/pdstools/explanations/Explanations.py
@@ -92,6 +93,7 @@ python/pdstools/infinity/resources/knowledge_buddy/knowledge_buddy.py
92
93
  python/pdstools/infinity/resources/prediction_studio/__init__.py
93
94
  python/pdstools/infinity/resources/prediction_studio/base.py
94
95
  python/pdstools/infinity/resources/prediction_studio/local_model_utils.py
96
+ python/pdstools/infinity/resources/prediction_studio/model_security.py
95
97
  python/pdstools/infinity/resources/prediction_studio/types.py
96
98
  python/pdstools/infinity/resources/prediction_studio/v24_1/__init__.py
97
99
  python/pdstools/infinity/resources/prediction_studio/v24_1/prediction.py
@@ -129,11 +131,13 @@ python/pdstools/resources/MetricLimits.csv
129
131
  python/pdstools/resources/__init__.py
130
132
  python/pdstools/utils/__init__.py
131
133
  python/pdstools/utils/cdh_utils.py
134
+ python/pdstools/utils/color_mapping.py
132
135
  python/pdstools/utils/datasets.py
133
136
  python/pdstools/utils/errors.py
134
137
  python/pdstools/utils/metric_limits.py
135
138
  python/pdstools/utils/namespaces.py
136
139
  python/pdstools/utils/number_format.py
140
+ python/pdstools/utils/pega_outcomes.py
137
141
  python/pdstools/utils/pega_template.py
138
142
  python/pdstools/utils/plot_utils.py
139
143
  python/pdstools/utils/polars_ext.py
@@ -100,7 +100,35 @@ extend-select = [
100
100
  asyncio_mode = "auto"
101
101
  addopts = "--strict-markers"
102
102
  markers = [
103
- "slow: marks tests as slow (report generation, integration tests)"
103
+ "slow: marks tests as slow (report generation, integration tests)",
104
+ "ui: UI tests requiring a running Streamlit app and Playwright (deselect with '-m \"not ui\"')",
105
+ ]
106
+
107
+ [tool.coverage.run]
108
+ source = ["python/pdstools"]
109
+ omit = [
110
+ "*/tests/*",
111
+ "*/test_*.py",
112
+ "*/__pycache__/*",
113
+ "python/pdstools/app/*", # Streamlit apps (UI code, hard to unit test)
114
+ "python/pdstools/ih/*", # Infinity Hub (legacy/specialized)
115
+ "**/__init__.py", # Init files (minimal logic)
116
+ ]
117
+
118
+ [tool.coverage.report]
119
+ # Minimum coverage required (80%)
120
+ fail_under = 80
121
+ precision = 2
122
+ show_missing = true
123
+ skip_covered = false
124
+ exclude_lines = [
125
+ "pragma: no cover",
126
+ "def __repr__",
127
+ "raise AssertionError",
128
+ "raise NotImplementedError",
129
+ "if __name__ == .__main__.:",
130
+ "if TYPE_CHECKING:",
131
+ "@abstractmethod",
104
132
  ]
105
133
 
106
134
  [tool.mypy]
@@ -1,6 +1,6 @@
1
1
  """Pega Data Scientist Tools Python library"""
2
2
 
3
- __version__ = "4.6.1"
3
+ __version__ = "4.6.2"
4
4
 
5
5
  from pathlib import Path
6
6
 
@@ -754,6 +754,46 @@ class ADMDatamart:
754
754
  .collect()["PredictorCategory"],
755
755
  )
756
756
 
757
+ def get_last_data_for_report(self) -> pl.DataFrame:
758
+ """Get the last snapshot of data formatted for report display.
759
+
760
+ This method provides a standardized view of the most recent model data
761
+ with formatting suitable for Health Check reports and other documents.
762
+ It handles null values, type conversions, and creates useful combined
763
+ columns like "Channel/Direction".
764
+
765
+ Returns
766
+ -------
767
+ pl.DataFrame
768
+ Collected DataFrame with the following transformations applied:
769
+ - Categorical columns cast to strings
770
+ - String and Null columns filled with "NA"
771
+ - SuccessRate and Performance filled with 0 for nulls/NaNs
772
+ - ResponseCount filled with 0 for nulls
773
+ - Channel/Direction combined column created
774
+
775
+ Examples
776
+ --------
777
+ >>> datamart = ADMDatamart.from_ds_export(model_filename="models.csv")
778
+ >>> last_data = datamart.get_last_data_for_report()
779
+ >>> # Use in reports without additional processing
780
+ >>> active_models = last_data.filter(pl.col("ResponseCount") > 1000)
781
+ """
782
+ return (
783
+ self.aggregates.last()
784
+ .with_columns(pl.col(pl.Categorical).cast(pl.Utf8))
785
+ .with_columns(
786
+ [
787
+ pl.col(pl.Utf8).fill_null("NA"),
788
+ pl.col(pl.Null).fill_null("NA"),
789
+ pl.col("SuccessRate").fill_nan(0).fill_null(0),
790
+ pl.col("Performance").fill_nan(0).fill_null(0),
791
+ pl.col("ResponseCount").fill_null(0),
792
+ (pl.concat_str("Channel/Direction".split("/"), separator="/")).alias("Channel/Direction"),
793
+ ]
794
+ )
795
+ ).collect()
796
+
757
797
  # min and max score (sum of log odds) per model, plus some extra summary statistics per model
758
798
  @classmethod
759
799
  def _minMaxScoresPerModel(cls, bin_data: pl.LazyFrame) -> pl.LazyFrame:
@@ -125,6 +125,15 @@ class Aggregates:
125
125
  query,
126
126
  )
127
127
  unique_predictors = df.select(pl.col("PredictorName").unique()).collect()["PredictorName"]
128
+
129
+ # Handle case where there are no predictors
130
+ if len(unique_predictors) == 0:
131
+ if isinstance(by, str):
132
+ by_name = by
133
+ else:
134
+ by_name = by.meta.output_name()
135
+ return pl.LazyFrame({by_name: []})
136
+
128
137
  if isinstance(by, str):
129
138
  by_col = pl.col(by)
130
139
  by_name = by
@@ -132,6 +141,8 @@ class Aggregates:
132
141
  by_col = by
133
142
  by_name = by.meta.output_name()
134
143
  action_predictor = by_col.meta.root_names() + ["PredictorName"]
144
+
145
+ # Filter out null values in the grouping column to avoid transpose errors
135
146
  q = (
136
147
  (
137
148
  df.filter(pl.col("ResponseCount") > 0)
@@ -147,7 +158,10 @@ class Aggregates:
147
158
  ),
148
159
  )
149
160
  )
150
- .group_by(by_col)
161
+ # Materialize the by_col expression first, then filter nulls
162
+ .with_columns(by_col)
163
+ .filter(pl.col(by_name).is_not_null())
164
+ .group_by(by_name) # Use by_name since by_col is now materialized
151
165
  .agg(
152
166
  [
153
167
  (
@@ -554,6 +568,7 @@ class Aggregates:
554
568
  every: str | None = None,
555
569
  custom_channels: dict[str, str] | None = None,
556
570
  debug: bool = False,
571
+ format_flags: bool = False,
557
572
  ) -> pl.LazyFrame:
558
573
  """Summarize ADM models per channel
559
574
 
@@ -571,8 +586,15 @@ class Aggregates:
571
586
  Optional additional grouping by time period. Format string as in polars.Expr.dt.truncate (https://docs.pola.rs/api/python/stable/reference/expressions/api/polars.Expr.dt.truncate.html), for example "1mo", "1w", "1d" for calendar month, week day. Defaults to None.
572
587
  custom_channels : dict[str, str], optional
573
588
  Optional dictionary mapping custom channel names to standard channel groups. Defaults to None.
574
- debug : bool, optional
575
- If True, enables debug mode for additional logging or outputs. Defaults to False.
589
+ debug : bool, default False
590
+ If True, include diagnostic columns (ResponseCount, Positives) in output.
591
+ If False, these intermediate calculation columns are dropped from the results.
592
+
593
+ This parameter affects the return value structure, not logging output.
594
+ For debug logging, use logging.basicConfig(level=logging.DEBUG).
595
+ format_flags : bool, default False
596
+ If True, format boolean flag columns (usesNBAD, usesAGB) as "Yes"/"No"/"?" strings
597
+ for display in reports. If False, keeps original boolean/null values.
576
598
 
577
599
  Returns
578
600
  -------
@@ -668,7 +690,7 @@ class Aggregates:
668
690
  .explode(["Channel", "Direction", "OmniChannel"])
669
691
  )
670
692
 
671
- return (
693
+ result = (
672
694
  summary_by_channel.drop(["AllActions"])
673
695
  .join(
674
696
  omni_channel_summary,
@@ -689,6 +711,27 @@ class Aggregates:
689
711
  .with_columns(pl.col("OmniChannel").cast(pl.Float64))
690
712
  )
691
713
 
714
+ # Format boolean flags as strings if requested
715
+ if format_flags:
716
+ result = result.with_columns(
717
+ [
718
+ pl.when(pl.col("usesNBAD").is_null())
719
+ .then(pl.lit("?"))
720
+ .when(pl.col("usesNBAD"))
721
+ .then(pl.lit("Yes"))
722
+ .otherwise(pl.lit("No"))
723
+ .alias("NBAD"),
724
+ pl.when(pl.col("usesAGB").is_null())
725
+ .then(pl.lit("?"))
726
+ .when(pl.col("usesAGB"))
727
+ .then(pl.lit("Yes"))
728
+ .otherwise(pl.lit("No"))
729
+ .alias("AGB"),
730
+ ]
731
+ )
732
+
733
+ return result
734
+
692
735
  def summary_by_configuration(self) -> pl.LazyFrame:
693
736
  """Generates a summary of the ADM model configurations.
694
737
 
@@ -919,8 +962,12 @@ class Aggregates:
919
962
  Number of days to use for the summary period or an explicit timedelta. If None (default) uses the whole period. Can't be given if start and end date are also given.
920
963
  every : str, optional
921
964
  Optional additional grouping by time period. Format string as in polars.Expr.dt.truncate (https://docs.pola.rs/api/python/stable/reference/expressions/api/polars.Expr.dt.truncate.html), for example "1mo", "1w", "1d" for calendar month, week day. Defaults to None.
922
- debug : bool, optional
923
- If True, enables debug mode for additional logging or outputs. Defaults to False.
965
+ debug : bool, default False
966
+ If True, include diagnostic columns (ResponseCount, Positives) in output.
967
+ If False, these intermediate calculation columns are dropped from the results.
968
+
969
+ This parameter affects the return value structure, not logging output.
970
+ For debug logging, use logging.basicConfig(level=logging.DEBUG).
924
971
 
925
972
  Returns
926
973
  -------
@@ -44,7 +44,6 @@ class BinAggregator(LazyNamespace):
44
44
  aggregation: str | None = None,
45
45
  as_numeric: bool | None = None,
46
46
  return_df: bool = False,
47
- verbose: bool = False,
48
47
  ) -> pl.DataFrame | Figure:
49
48
  """Roll up a predictor across all the models defined when creating the class.
50
49
 
@@ -90,8 +89,6 @@ class BinAggregator(LazyNamespace):
90
89
  which means the type is taken from the first predictor in the data.
91
90
  return_df : bool, optional
92
91
  Return the underlying binning instead of a plot.
93
- verbose : bool, optional
94
- Show detailed debug information while executing, by default False
95
92
 
96
93
  Returns
97
94
  -------
@@ -100,6 +97,13 @@ class BinAggregator(LazyNamespace):
100
97
  to True, it returns the actual binning with the lift aggregated over
101
98
  all the models, optionally per predictor and per set of models.
102
99
 
100
+ Notes
101
+ -----
102
+ Enable debug logging to see processing progress:
103
+
104
+ >>> import logging
105
+ >>> logging.basicConfig(level=logging.DEBUG)
106
+
103
107
  """
104
108
  if not isinstance(predictors, list):
105
109
  predictors = [predictors]
@@ -151,12 +155,11 @@ class BinAggregator(LazyNamespace):
151
155
  .to_list()
152
156
  )
153
157
  for topic in all_topics:
154
- if verbose:
155
- print(f"Topic: {topic}, predictor: {predictor}")
156
- if is_numeric:
157
- print(empty_numeric_binning)
158
- else:
159
- print(f"Symbols: {', '.join(symbol_list or [])}")
158
+ logger.debug(f"Topic: {topic}, predictor: {predictor}")
159
+ if is_numeric:
160
+ logger.debug(str(empty_numeric_binning))
161
+ else:
162
+ logger.debug(f"Symbols: {', '.join(symbol_list or [])}")
160
163
 
161
164
  if aggregation is None:
162
165
  ids = (
@@ -179,14 +182,12 @@ class BinAggregator(LazyNamespace):
179
182
  predictor,
180
183
  ids,
181
184
  empty_numeric_binning.clone(), # type: ignore[union-attr]
182
- verbose=verbose,
183
185
  )
184
186
  else:
185
187
  cum_binning = self.accumulate_sym_binnings(
186
188
  predictor,
187
189
  ids,
188
190
  symbol_list,
189
- verbose=verbose,
190
191
  )
191
192
 
192
193
  cum_binning = cum_binning.with_columns(
@@ -208,45 +209,39 @@ class BinAggregator(LazyNamespace):
208
209
  predictor,
209
210
  modelids,
210
211
  target_binning,
211
- verbose=False,
212
212
  ) -> pl.DataFrame:
213
213
  for id in modelids:
214
- if verbose:
215
- print(f"Model ID: {id}")
214
+ logger.debug(f"Model ID: {id}")
216
215
  source_binning = self.get_source_numbinning(predictor, id)
217
216
 
218
217
  # TODO consider quick escape if all of source binning is empty (sum of BinResponses)
219
218
 
220
- if verbose:
221
- print(source_binning)
219
+ logger.debug(str(source_binning))
222
220
 
223
- # fig = self.plot_binning_attribution(source_binning, target_binning)
224
- # fig.update_layout(title=f"{predictor}, model={id}")
225
- # fig.show()
221
+ # fig = self.plot_binning_attribution(source_binning, target_binning)
222
+ # fig.update_layout(title=f"{predictor}, model={id}")
223
+ # fig.show()
226
224
 
227
225
  target_binning = self.combine_two_numbinnings(
228
226
  source_binning,
229
227
  target_binning,
230
- verbose=verbose,
231
228
  )
232
229
 
233
- if verbose:
234
- print(target_binning)
235
-
236
- # fig = self.plot_lift_binning(target_binning)
237
- # fig.update_layout(width=800, height=300, showlegend=False)
238
- # fig.show()
239
-
240
- if verbose:
241
- print(target_binning)
230
+ logger.debug(str(target_binning))
242
231
 
243
232
  # fig = self.plot_lift_binning(target_binning)
244
- # fig.update_layout(
245
- # width=800,
246
- # height=300,
247
- # )
233
+ # fig.update_layout(width=800, height=300, showlegend=False)
248
234
  # fig.show()
249
235
 
236
+ logger.debug(str(target_binning))
237
+
238
+ # fig = self.plot_lift_binning(target_binning)
239
+ # fig.update_layout(
240
+ # width=800,
241
+ # height=300,
242
+ # )
243
+ # fig.show()
244
+
250
245
  return target_binning
251
246
 
252
247
  def create_symbol_list(
@@ -279,7 +274,6 @@ class BinAggregator(LazyNamespace):
279
274
  predictor,
280
275
  modelids,
281
276
  symbollist,
282
- verbose=False,
283
277
  ) -> pl.DataFrame:
284
278
  # All the bins for the given predictor, for the given models
285
279
  symbins = (
@@ -311,9 +305,8 @@ class BinAggregator(LazyNamespace):
311
305
  on="Symbol",
312
306
  ).sort("ModelID") # just for debugging/transparency
313
307
 
314
- if verbose:
315
- print("Pivot table:")
316
- print(symbins_pivot)
308
+ logger.debug("Pivot table:")
309
+ logger.debug(str(symbins_pivot))
317
310
 
318
311
  # Add columns for symbols that may be missing completely (must-have symbols not present in the models)
319
312
  symbins_pivot = symbins_pivot.with_columns(
@@ -329,9 +322,8 @@ class BinAggregator(LazyNamespace):
329
322
  ],
330
323
  )
331
324
 
332
- if verbose:
333
- print("Pivot table with additional columns and residuals filled in:")
334
- print(symbins_pivot)
325
+ logger.debug("Pivot table with additional columns and residuals filled in:")
326
+ logger.debug(str(symbins_pivot))
335
327
 
336
328
  # melt the pivot back to long form, but now all symbols are present for all models
337
329
  molten = symbins_pivot.unpivot(
@@ -613,7 +605,6 @@ class BinAggregator(LazyNamespace):
613
605
  self,
614
606
  source: pl.DataFrame,
615
607
  target: pl.DataFrame,
616
- verbose=False,
617
608
  ) -> pl.DataFrame:
618
609
  class Interval:
619
610
  def __init__(self, lo, hi):
@@ -648,15 +639,14 @@ class BinAggregator(LazyNamespace):
648
639
  target[target_index, "BinResponses"] = target_binresponses + source_fraction * source_binresponses
649
640
  target[target_index, "BinCoverage"] = target_total_attribution + target_attribution
650
641
 
651
- if verbose:
652
- print(
653
- f"Attribution from {source[source_index, 'ModelID']}:{source[source_index, 'BinIndex']} {Interval(source_lo, source_hi)} to {target[target_index, 'BinIndex']} {Interval(target_lo, target_hi)}: lift attribution={target_attribution} response attribution={source_fraction}",
654
- )
655
- # print(
656
- # f"(({target_total_attribution} * {target_lift}) + ({target_attribution} * {source_lift})) / ({target_total_attribution} + {target_attribution}) = {target[target_index, 'Lift']}"
657
- # )
658
- elif verbose:
659
- print(
642
+ logger.debug(
643
+ f"Attribution from {source[source_index, 'ModelID']}:{source[source_index, 'BinIndex']} {Interval(source_lo, source_hi)} to {target[target_index, 'BinIndex']} {Interval(target_lo, target_hi)}: lift attribution={target_attribution} response attribution={source_fraction}",
644
+ )
645
+ # logger.debug(
646
+ # f"(({target_total_attribution} * {target_lift}) + ({target_attribution} * {source_lift})) / ({target_total_attribution} + {target_attribution}) = {target[target_index, 'Lift']}"
647
+ # )
648
+ else:
649
+ logger.debug(
660
650
  f"Attribution from {source[source_index, 'ModelID']}:{source[source_index, 'BinIndex']} {Interval(source_lo, source_hi)} to {target[target_index, 'BinIndex']} {Interval(target_lo, target_hi)}: None",
661
651
  )
662
652