pdstools 4.7.0__tar.gz → 4.7.1__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 (156) hide show
  1. {pdstools-4.7.0 → pdstools-4.7.1}/PKG-INFO +3 -3
  2. {pdstools-4.7.0 → pdstools-4.7.1}/pdstools.egg-info/PKG-INFO +3 -3
  3. {pdstools-4.7.0 → pdstools-4.7.1}/pdstools.egg-info/requires.txt +2 -2
  4. {pdstools-4.7.0 → pdstools-4.7.1}/pyproject.toml +7 -2
  5. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/__init__.py +1 -1
  6. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/adm/Plots.py +56 -1
  7. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/explanations/Aggregate.py +53 -49
  8. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/explanations/ExplanationsUtils.py +45 -0
  9. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/explanations/Plots.py +59 -70
  10. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/explanations/Reports.py +12 -9
  11. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/reports/HealthCheck.qmd +18 -3
  12. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/reports/ModelReport.qmd +1 -1
  13. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/utils/cdh_utils.py +2 -2
  14. {pdstools-4.7.0 → pdstools-4.7.1}/LICENSE +0 -0
  15. {pdstools-4.7.0 → pdstools-4.7.1}/README.md +0 -0
  16. {pdstools-4.7.0 → pdstools-4.7.1}/pdstools.egg-info/SOURCES.txt +0 -0
  17. {pdstools-4.7.0 → pdstools-4.7.1}/pdstools.egg-info/dependency_links.txt +0 -0
  18. {pdstools-4.7.0 → pdstools-4.7.1}/pdstools.egg-info/entry_points.txt +0 -0
  19. {pdstools-4.7.0 → pdstools-4.7.1}/pdstools.egg-info/top_level.txt +0 -0
  20. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/adm/ADMDatamart.py +0 -0
  21. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/adm/ADMTrees.py +0 -0
  22. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/adm/Aggregates.py +0 -0
  23. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/adm/BinAggregator.py +0 -0
  24. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/adm/Reports.py +0 -0
  25. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/adm/Schema.py +0 -0
  26. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/adm/__init__.py +0 -0
  27. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/__init__.py +0 -0
  28. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/assets/pega-logo.svg +0 -0
  29. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/decision_analyzer/Home.py +0 -0
  30. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/decision_analyzer/__init__.py +0 -0
  31. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/decision_analyzer/da_streamlit_utils.py +0 -0
  32. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/decision_analyzer/pages/10_Arbitration_Distribution.py +0 -0
  33. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/decision_analyzer/pages/11_Single_Decision.py +0 -0
  34. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/decision_analyzer/pages/12_About.py +0 -0
  35. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/decision_analyzer/pages/2_Overview.py +0 -0
  36. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/decision_analyzer/pages/3_Action_Distribution.py +0 -0
  37. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/decision_analyzer/pages/4_Action_Funnel.py +0 -0
  38. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/decision_analyzer/pages/5_Global_Sensitivity.py +0 -0
  39. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/decision_analyzer/pages/6_Win_Loss_Analysis.py +0 -0
  40. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/decision_analyzer/pages/7_Optionality_Analysis.py +0 -0
  41. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/decision_analyzer/pages/8_Offer_Quality_Analysis.py +0 -0
  42. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/decision_analyzer/pages/9_Thresholding_Analysis.py +0 -0
  43. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/decision_analyzer/pages/__init__.py +0 -0
  44. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/health_check/Home.py +0 -0
  45. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/health_check/__init__.py +0 -0
  46. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/health_check/pages/1_Data_Filters.py +0 -0
  47. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/health_check/pages/2_Reports.py +0 -0
  48. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/health_check/pages/3_About.py +0 -0
  49. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/health_check/pages/__init__.py +0 -0
  50. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/impact_analyzer/Home.py +0 -0
  51. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/impact_analyzer/__init__.py +0 -0
  52. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/impact_analyzer/ia_streamlit_utils.py +0 -0
  53. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/impact_analyzer/pages/1_Overall_Summary.py +0 -0
  54. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/impact_analyzer/pages/2_Trend.py +0 -0
  55. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/impact_analyzer/pages/3_About.py +0 -0
  56. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/app/impact_analyzer/pages/__init__.py +0 -0
  57. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/cli.py +0 -0
  58. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/decision_analyzer/DecisionAnalyzer.py +0 -0
  59. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/decision_analyzer/__init__.py +0 -0
  60. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/decision_analyzer/column_schema.py +0 -0
  61. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/decision_analyzer/data_read_utils.py +0 -0
  62. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/decision_analyzer/plots.py +0 -0
  63. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/decision_analyzer/stage_grouping.py +0 -0
  64. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/decision_analyzer/utils.py +0 -0
  65. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/explanations/Explanations.py +0 -0
  66. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/explanations/FilterWidget.py +0 -0
  67. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/explanations/Preprocess.py +0 -0
  68. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/explanations/__init__.py +0 -0
  69. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/explanations/resources/__init__.py +0 -0
  70. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/explanations/resources/queries/__init__.py +0 -0
  71. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/explanations/resources/queries/create.sql +0 -0
  72. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/explanations/resources/queries/model_contexts.sql +0 -0
  73. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/explanations/resources/queries/numeric.sql +0 -0
  74. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/explanations/resources/queries/numeric_overall.sql +0 -0
  75. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/explanations/resources/queries/symbolic.sql +0 -0
  76. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/explanations/resources/queries/symbolic_overall.sql +0 -0
  77. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/ih/Aggregates.py +0 -0
  78. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/ih/IH.py +0 -0
  79. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/ih/Plots.py +0 -0
  80. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/ih/__init__.py +0 -0
  81. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/impactanalyzer/ImpactAnalyzer.py +0 -0
  82. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/impactanalyzer/Plots.py +0 -0
  83. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/impactanalyzer/__init__.py +0 -0
  84. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/__init__.py +0 -0
  85. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/client.py +0 -0
  86. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/internal/__init__.py +0 -0
  87. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/internal/_auth.py +0 -0
  88. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/internal/_base_client.py +0 -0
  89. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/internal/_constants.py +0 -0
  90. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/internal/_exceptions.py +0 -0
  91. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/internal/_pagination.py +0 -0
  92. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/internal/_resource.py +0 -0
  93. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/resources/__init__.py +0 -0
  94. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/resources/knowledge_buddy/__init__.py +0 -0
  95. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/resources/knowledge_buddy/knowledge_buddy.py +0 -0
  96. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/resources/prediction_studio/__init__.py +0 -0
  97. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/resources/prediction_studio/base.py +0 -0
  98. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/resources/prediction_studio/local_model_utils.py +0 -0
  99. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/resources/prediction_studio/model_security.py +0 -0
  100. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/resources/prediction_studio/types.py +0 -0
  101. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/resources/prediction_studio/v24_1/__init__.py +0 -0
  102. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/resources/prediction_studio/v24_1/prediction.py +0 -0
  103. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/resources/prediction_studio/v24_1/prediction_studio.py +0 -0
  104. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/resources/prediction_studio/v24_1/repository.py +0 -0
  105. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/resources/prediction_studio/v24_2/__init__.py +0 -0
  106. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/resources/prediction_studio/v24_2/champion_challenger.py +0 -0
  107. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/resources/prediction_studio/v24_2/datamart_export.py +0 -0
  108. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/resources/prediction_studio/v24_2/model.py +0 -0
  109. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/resources/prediction_studio/v24_2/model_upload.py +0 -0
  110. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/resources/prediction_studio/v24_2/prediction.py +0 -0
  111. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/resources/prediction_studio/v24_2/prediction_studio.py +0 -0
  112. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/infinity/resources/prediction_studio/v24_2/repository.py +0 -0
  113. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/pega_io/API.py +0 -0
  114. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/pega_io/Anonymization.py +0 -0
  115. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/pega_io/File.py +0 -0
  116. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/pega_io/S3.py +0 -0
  117. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/pega_io/__init__.py +0 -0
  118. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/prediction/Prediction.py +0 -0
  119. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/prediction/__init__.py +0 -0
  120. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/py.typed +0 -0
  121. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/reports/GlobalExplanations/__init__.py +0 -0
  122. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/reports/GlobalExplanations/_quarto.yml +0 -0
  123. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/reports/GlobalExplanations/assets/templates/all_context_content.qmd +0 -0
  124. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/reports/GlobalExplanations/assets/templates/all_context_header.qmd +0 -0
  125. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/reports/GlobalExplanations/assets/templates/context.qmd +0 -0
  126. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/reports/GlobalExplanations/assets/templates/getting-started.qmd +0 -0
  127. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/reports/GlobalExplanations/assets/templates/overview.qmd +0 -0
  128. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/reports/GlobalExplanations/scripts/__init__.py +0 -0
  129. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/reports/GlobalExplanations/scripts/generate_report.py +0 -0
  130. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/reports/__init__.py +0 -0
  131. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/reports/assets/pega-report-overrides.css +0 -0
  132. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/resources/MetricLimits.csv +0 -0
  133. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/resources/__init__.py +0 -0
  134. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/utils/__init__.py +0 -0
  135. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/utils/color_mapping.py +0 -0
  136. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/utils/datasets.py +0 -0
  137. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/utils/errors.py +0 -0
  138. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/utils/metric_limits.py +0 -0
  139. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/utils/namespaces.py +0 -0
  140. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/utils/number_format.py +0 -0
  141. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/utils/pega_outcomes.py +0 -0
  142. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/utils/pega_template.py +0 -0
  143. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/utils/plot_utils.py +0 -0
  144. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/utils/polars_ext.py +0 -0
  145. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/utils/progress_utils.py +0 -0
  146. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/utils/report_utils.py +0 -0
  147. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/utils/show_versions.py +0 -0
  148. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/utils/streamlit_utils.py +0 -0
  149. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/utils/table_definitions.py +0 -0
  150. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/utils/types.py +0 -0
  151. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/valuefinder/Aggregates.py +0 -0
  152. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/valuefinder/Plots.py +0 -0
  153. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/valuefinder/Schema.py +0 -0
  154. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/valuefinder/ValueFinder.py +0 -0
  155. {pdstools-4.7.0 → pdstools-4.7.1}/python/pdstools/valuefinder/__init__.py +0 -0
  156. {pdstools-4.7.0 → pdstools-4.7.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pdstools
3
- Version: 4.7.0
3
+ Version: 4.7.1
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
@@ -15,7 +15,7 @@ Classifier: Programming Language :: Python :: 3
15
15
  Requires-Python: <3.14,>=3.10
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
- Requires-Dist: polars!=1.35.1,<=1.36.1,>=1.30
18
+ Requires-Dist: polars!=1.35.1,<=1.39.3,>=1.30
19
19
  Requires-Dist: typing_extensions
20
20
  Provides-Extra: adm
21
21
  Requires-Dist: plotly[express]>=6.0; extra == "adm"
@@ -45,7 +45,7 @@ Requires-Dist: ipywidgets; extra == "explanations"
45
45
  Provides-Extra: app
46
46
  Requires-Dist: pdstools[healthcheck]; extra == "app"
47
47
  Requires-Dist: streamlit>=1.45; extra == "app"
48
- Requires-Dist: polars[rt64]!=1.35.1,<=1.36.1,>=1.30; extra == "app"
48
+ Requires-Dist: polars[rt64]!=1.35.1,<=1.39.3,>=1.30; extra == "app"
49
49
  Requires-Dist: humanize>=4.0.0; extra == "app"
50
50
  Provides-Extra: onnx
51
51
  Requires-Dist: scikit-learn>=1.6.1; extra == "onnx"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pdstools
3
- Version: 4.7.0
3
+ Version: 4.7.1
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
@@ -15,7 +15,7 @@ Classifier: Programming Language :: Python :: 3
15
15
  Requires-Python: <3.14,>=3.10
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
- Requires-Dist: polars!=1.35.1,<=1.36.1,>=1.30
18
+ Requires-Dist: polars!=1.35.1,<=1.39.3,>=1.30
19
19
  Requires-Dist: typing_extensions
20
20
  Provides-Extra: adm
21
21
  Requires-Dist: plotly[express]>=6.0; extra == "adm"
@@ -45,7 +45,7 @@ Requires-Dist: ipywidgets; extra == "explanations"
45
45
  Provides-Extra: app
46
46
  Requires-Dist: pdstools[healthcheck]; extra == "app"
47
47
  Requires-Dist: streamlit>=1.45; extra == "app"
48
- Requires-Dist: polars[rt64]!=1.35.1,<=1.36.1,>=1.30; extra == "app"
48
+ Requires-Dist: polars[rt64]!=1.35.1,<=1.39.3,>=1.30; extra == "app"
49
49
  Requires-Dist: humanize>=4.0.0; extra == "app"
50
50
  Provides-Extra: onnx
51
51
  Requires-Dist: scikit-learn>=1.6.1; extra == "onnx"
@@ -1,4 +1,4 @@
1
- polars!=1.35.1,<=1.36.1,>=1.30
1
+ polars!=1.35.1,<=1.39.3,>=1.30
2
2
  typing_extensions
3
3
 
4
4
  [adm]
@@ -17,7 +17,7 @@ anyio
17
17
  [app]
18
18
  pdstools[healthcheck]
19
19
  streamlit>=1.45
20
- polars[rt64]!=1.35.1,<=1.36.1,>=1.30
20
+ polars[rt64]!=1.35.1,<=1.39.3,>=1.30
21
21
  humanize>=4.0.0
22
22
 
23
23
  [dev]
@@ -32,7 +32,7 @@ keywords = [
32
32
  ]
33
33
  requires-python = ">=3.10,<3.14"
34
34
  dependencies = [
35
- "polars>=1.30,!=1.35.1,<=1.36.1",
35
+ "polars>=1.30,!=1.35.1,<=1.39.3",
36
36
  'typing_extensions',
37
37
  ]
38
38
 
@@ -49,7 +49,12 @@ pega_io = ['aioboto3', 'polars_hash']
49
49
  api = ['httpx', 'pydantic', 'anyio']
50
50
  healthcheck = ['pdstools[adm]', 'great_tables>=0.13', 'quarto', 'papermill', 'xlsxwriter>=3.0', 'pydot', 'ipykernel']
51
51
  explanations = ['duckdb', "plotly[express]", "pyarrow", "pyyaml", "ipywidgets"]
52
- app = ['pdstools[healthcheck]', 'streamlit>=1.45', 'polars[rt64]>=1.30,!=1.35.1,<=1.36.1', 'humanize>=4.0.0']
52
+ app = [
53
+ 'pdstools[healthcheck]',
54
+ 'streamlit>=1.45',
55
+ "polars[rt64]>=1.30,!=1.35.1,<=1.39.3",
56
+ 'humanize>=4.0.0',
57
+ ]
53
58
  onnx = [
54
59
  'scikit-learn>=1.6.1',
55
60
  'skl2onnx>=1.19.1', # Updated to be compatible with onnx 1.19.0+
@@ -1,6 +1,6 @@
1
1
  """Pega Data Scientist Tools Python library"""
2
2
 
3
- __version__ = "4.7.0"
3
+ __version__ = "4.7.1"
4
4
 
5
5
  from pathlib import Path
6
6
 
@@ -20,6 +20,7 @@ from typing_extensions import ParamSpec
20
20
  from typing import Concatenate
21
21
 
22
22
  from ..utils import cdh_utils
23
+ from ..utils.metric_limits import MetricLimits
23
24
  from ..utils.namespaces import LazyNamespace
24
25
  from ..utils.plot_utils import get_colorscale
25
26
  from ..utils.types import QUERY
@@ -136,7 +137,7 @@ def fig_update_facet(
136
137
  n_rows = max(math.ceil(len(fig.layout.annotations) / n_cols), 1)
137
138
  height = base_height + (n_rows * step_height)
138
139
  return fig.for_each_annotation(
139
- lambda a: a.update(text=a.text.split("=")[1]),
140
+ lambda a: a.update(text=a.text.split("=")[1]) if "=" in a.text else a,
140
141
  ).update_layout(autosize=True, height=height)
141
142
 
142
143
 
@@ -177,6 +178,46 @@ def add_bottom_left_text_to_bubble_plot(
177
178
  return fig
178
179
 
179
180
 
181
+ def add_metric_limit_lines(
182
+ fig: Figure,
183
+ metric_id: str = "ModelPerformance",
184
+ scale: float = 100.0,
185
+ orientation: str = "vertical",
186
+ ) -> Figure:
187
+ """Add dashed lines at MetricLimits thresholds (red=hard, green=best practice)."""
188
+ limits = MetricLimits.get_limit_for_metric(metric_id)
189
+ if not limits:
190
+ return fig
191
+
192
+ add_line = fig.add_vline if orientation == "vertical" else fig.add_hline
193
+ pos_key = "x" if orientation == "vertical" else "y"
194
+
195
+ line_specs = [
196
+ ("minimum", "rgba(255, 69, 0, 0.5)", "Min"),
197
+ ("best_practice_min", "rgba(0, 128, 0, 0.5)", "Good"),
198
+ ("best_practice_max", "rgba(0, 128, 0, 0.5)", "Good"),
199
+ ("maximum", "rgba(255, 69, 0, 0.5)", "Max"),
200
+ ]
201
+
202
+ for limit_key, color, label in line_specs:
203
+ value = limits.get(limit_key)
204
+ if value is not None:
205
+ scaled = value * scale
206
+ add_line(
207
+ **{pos_key: scaled},
208
+ line_dash="dash",
209
+ line_width=1,
210
+ line_color=color,
211
+ layer="below",
212
+ annotation_text=f"{label} ({scaled:.0f})",
213
+ annotation_position="top" if orientation == "vertical" else "right",
214
+ annotation_font_size=9,
215
+ annotation_font_color=color,
216
+ )
217
+
218
+ return fig
219
+
220
+
180
221
  def distribution_graph(df: pl.LazyFrame, title: str):
181
222
  plot_df = df.collect()
182
223
  fig = make_subplots(specs=[[{"secondary_y": True}]])
@@ -224,6 +265,7 @@ class Plots(LazyNamespace):
224
265
  query: QUERY | None = None,
225
266
  facet: str | pl.Expr | None = None,
226
267
  color: str | None = "Performance",
268
+ show_metric_limits: bool = False,
227
269
  return_df: bool = False,
228
270
  ):
229
271
  """The Bubble Chart, as seen in Prediction Studio
@@ -238,6 +280,9 @@ class Plots(LazyNamespace):
238
280
  The query to apply to the data, by default None
239
281
  facet : Optional[Union[str, pl.Expr]], optional
240
282
  Column name or Polars expression to facet the plot into subplots, by default None
283
+ show_metric_limits : bool, optional
284
+ Whether to show dashed vertical lines at the ModelPerformance
285
+ metric limit thresholds (from MetricLimits.csv), by default False
241
286
  return_df : bool, optional
242
287
  Whether to return a dataframe instead of a plot, by default False
243
288
 
@@ -302,6 +347,8 @@ class Plots(LazyNamespace):
302
347
  labels={"LastUpdate": "Last Updated"},
303
348
  )
304
349
  fig = add_bottom_left_text_to_bubble_plot(fig, df, 1)
350
+ if show_metric_limits:
351
+ fig = add_metric_limit_lines(fig)
305
352
  fig.update_traces(marker=dict(line=dict(color="black")))
306
353
  fig.update_yaxes(tickformat=".3%")
307
354
  return fig
@@ -318,6 +365,7 @@ class Plots(LazyNamespace):
318
365
  cumulative: bool = True,
319
366
  query: QUERY | None = None,
320
367
  facet: str | None = None,
368
+ show_metric_limits: bool = False,
321
369
  return_df: bool = False,
322
370
  ):
323
371
  """Statistics over time
@@ -337,6 +385,10 @@ class Plots(LazyNamespace):
337
385
  The query to apply to the data, by default None
338
386
  facet : Optional[str], optional
339
387
  Whether to facet the plot into subplots, by default None
388
+ show_metric_limits : bool, optional
389
+ Whether to show dashed horizontal lines at the metric limit
390
+ thresholds (from MetricLimits.csv), by default False.
391
+ Only applies when metric is "Performance".
340
392
  return_df : bool, optional
341
393
  Whether to return a dataframe instead of a plot, by default False
342
394
 
@@ -447,6 +499,9 @@ class Plots(LazyNamespace):
447
499
  fig.update_yaxes(tickformat=".2%")
448
500
  fig.update_layout(yaxis={"rangemode": "tozero"})
449
501
 
502
+ if show_metric_limits and metric == "Performance":
503
+ fig = add_metric_limit_lines(fig, orientation="horizontal")
504
+
450
505
  return fig
451
506
 
452
507
  @requires({"ModelID", "Name"})
@@ -9,11 +9,11 @@ import polars as pl
9
9
  from ..utils.namespaces import LazyNamespace
10
10
  from .ExplanationsUtils import (
11
11
  _COL,
12
- _CONTRIBUTION_TYPE,
13
12
  _PREDICTOR_TYPE,
14
13
  _SPECIAL,
15
14
  ContextInfo,
16
15
  ContextOperations,
16
+ _resolve_agg_filter_kwargs,
17
17
  defaults,
18
18
  validate,
19
19
  )
@@ -52,10 +52,7 @@ class Aggregate(LazyNamespace):
52
52
  self,
53
53
  context: dict[str, str] | None = None,
54
54
  top_n: int = defaults.top_n,
55
- descending: bool = defaults.descending,
56
- missing: bool = defaults.missing,
57
- remaining: bool = defaults.remaining,
58
- sort_by: str = defaults.sort_by.value,
55
+ **filter_kwargs,
59
56
  ):
60
57
  """Get the top-n predictor contributions for a given context or overall.
61
58
 
@@ -64,20 +61,23 @@ class Aggregate(LazyNamespace):
64
61
  The context to filter contributions by.
65
62
  If None, contributions for all contexts will be returned.
66
63
  top_n (int):
67
- Number of top predictors
68
- descending (bool):
69
- Whether to sort contributions in descending order.
70
- missing (bool):
71
- Whether to include contributions for missing predictor values.
72
- remaining (bool):
73
- Whether to include contributions for remaining predictors outside the top-n.
74
- sort_by (str):
75
- Method to sort/select top contributions. Options include
76
- `contribution`, `contribution_abs`, `contribution_weighted`.
77
- Default is `contribution_abs` which sorts by absolute average contributions.
64
+ Number of top predictors.
65
+ **filter_kwargs:
66
+ Optional filtering and sorting controls. Valid keys:
67
+
68
+ - ``sort_by`` (str): Column to rank/select top predictors.
69
+ Options: ``contribution``, ``contribution_abs``,
70
+ ``contribution_weighted``, ``contribution_weighted_abs``.
71
+ Default: ``"contribution_abs"``.
72
+ - ``descending`` (bool): Sort most- or least-impactful first.
73
+ Default: ``True``.
74
+ - ``missing`` (bool): Include missing-value bins. Default: ``True``.
75
+ - ``remaining`` (bool): Include an aggregated "remaining" row for
76
+ predictors outside the top-n. Default: ``True``.
77
+ - ``include_numeric_single_bin`` (bool): Include numeric predictors
78
+ that have only a single bin. Default: ``False``.
78
79
  """
79
-
80
- validated_sort_by = _CONTRIBUTION_TYPE.validate_and_get_type(sort_by)
80
+ resolved = _resolve_agg_filter_kwargs(**filter_kwargs)
81
81
 
82
82
  try:
83
83
  validate(top_n=top_n)
@@ -90,10 +90,7 @@ class Aggregate(LazyNamespace):
90
90
  return self._get_predictor_contributions(
91
91
  contexts=[context] if context else None, # type: ignore[list-item]
92
92
  limit=top_n,
93
- descending=descending,
94
- missing=missing,
95
- remaining=remaining,
96
- sort_by=validated_sort_by.value,
93
+ **resolved,
97
94
  )
98
95
 
99
96
  def get_predictor_value_contributions(
@@ -101,10 +98,7 @@ class Aggregate(LazyNamespace):
101
98
  predictors: list[str],
102
99
  context: dict[str, str] | None = None,
103
100
  top_k: int = defaults.top_k,
104
- descending: bool = defaults.descending,
105
- missing: bool = defaults.missing,
106
- remaining: bool = defaults.remaining,
107
- sort_by: str = defaults.sort_by.value,
101
+ **filter_kwargs,
108
102
  ):
109
103
  """Get the top-k predictor value contributions for a given context or overall.
110
104
 
@@ -116,19 +110,22 @@ class Aggregate(LazyNamespace):
116
110
  If None, contributions for all contexts will be returned.
117
111
  top_k (int):
118
112
  Number of unique categorical predictor values to return.
119
- descending (bool):
120
- Whether to sort contributions in descending order.
121
- missing (bool):
122
- Whether to include contributions for missing predictor values.
123
- remaining (bool):
124
- Whether to include contributions for remaining predictors outside the top-n.
125
- sort_by (str):
126
- Method to sort/select top contributions. Options include
127
- `contribution`, `contribution_abs`, `contribution_weighted`.
128
- Default is `contribution_abs` which sorts by absolute average contributions.
113
+ **filter_kwargs:
114
+ Optional filtering and sorting controls. Valid keys:
115
+
116
+ - ``sort_by`` (str): Column to rank/select top predictors.
117
+ Options: ``contribution``, ``contribution_abs``,
118
+ ``contribution_weighted``, ``contribution_weighted_abs``.
119
+ Default: ``"contribution_abs"``.
120
+ - ``descending`` (bool): Sort most- or least-impactful first.
121
+ Default: ``True``.
122
+ - ``missing`` (bool): Include missing-value bins. Default: ``True``.
123
+ - ``remaining`` (bool): Include an aggregated "remaining" row for
124
+ values outside the top-k. Default: ``True``.
125
+ - ``include_numeric_single_bin`` (bool): Include numeric predictors
126
+ that have only a single bin. Default: ``False``.
129
127
  """
130
-
131
- validated_sort_by = _CONTRIBUTION_TYPE.validate_and_get_type(sort_by)
128
+ resolved = _resolve_agg_filter_kwargs(**filter_kwargs)
132
129
 
133
130
  try:
134
131
  validate(top_k=top_k)
@@ -142,10 +139,7 @@ class Aggregate(LazyNamespace):
142
139
  contexts=[context] if context else None, # type: ignore[list-item]
143
140
  predictors=predictors,
144
141
  limit=top_k,
145
- descending=descending,
146
- missing=missing,
147
- remaining=remaining,
148
- sort_by=validated_sort_by.value,
142
+ **resolved,
149
143
  )
150
144
 
151
145
  def validate_folder(self):
@@ -206,15 +200,12 @@ class Aggregate(LazyNamespace):
206
200
  .filter(pl.col(_COL.CONTRIBUTION.value) != 0.0)
207
201
  .sort(by=_COL.PREDICTOR_NAME.value)
208
202
  )
209
- self.df_contextual = self._filter_single_bin_numeric_predictors(self.df_contextual)
210
-
211
203
  self.df_overall = (
212
204
  pl.scan_parquet(f"{self.data_folderpath}/*_OVERALL.parquet")
213
205
  .select(selected_columns)
214
206
  .filter(pl.col(_COL.CONTRIBUTION.value) != 0.0)
215
207
  .sort(by=_COL.PREDICTOR_NAME.value)
216
208
  )
217
- self.df_overall = self._filter_single_bin_numeric_predictors(self.df_overall)
218
209
 
219
210
  self.initialized = True
220
211
 
@@ -226,6 +217,7 @@ class Aggregate(LazyNamespace):
226
217
  descending: bool = defaults.descending,
227
218
  missing: bool = defaults.missing,
228
219
  remaining: bool = defaults.remaining,
220
+ include_numeric_single_bin: bool = defaults.include_numeric_single_bin,
229
221
  sort_by: str = defaults.sort_by.value,
230
222
  ) -> pl.DataFrame:
231
223
  contexts = contexts or []
@@ -236,6 +228,9 @@ class Aggregate(LazyNamespace):
236
228
  # and load the data for those contexts
237
229
  df = self._get_df(contexts)
238
230
 
231
+ if not include_numeric_single_bin:
232
+ df = self._filter_single_bin_numeric_predictors(df)
233
+
239
234
  # If predictors are specified we filter the dataframe for those predictors
240
235
  if len(predictors) > 0:
241
236
  df = self._filter_for_predictors(df, predictors)
@@ -245,10 +240,15 @@ class Aggregate(LazyNamespace):
245
240
  df = df.filter(_COL.BIN_CONTENTS.value != _SPECIAL.MISSING.name)
246
241
 
247
242
  # Aggregate all the different types of contributions
248
- # note: we need to aggregate frequency over partition to calculate weighted contributions
243
+ # note: total_frequency is computed per predictor so the weighted average
244
+ # divides by that predictor's own bin frequencies, not the entire partition.
249
245
  df = self._calculate_aggregates(
250
246
  df,
251
- frequency_over=[_COL.PARTITON.value],
247
+ frequency_over=[
248
+ _COL.PARTITON.value,
249
+ _COL.PREDICTOR_NAME.value,
250
+ _COL.PREDICTOR_TYPE.value,
251
+ ],
252
252
  aggregate_over=[
253
253
  _COL.PARTITON.value,
254
254
  _COL.PREDICTOR_NAME.value,
@@ -300,6 +300,7 @@ class Aggregate(LazyNamespace):
300
300
  descending: bool = defaults.descending,
301
301
  missing: bool = defaults.missing,
302
302
  remaining: bool = defaults.remaining,
303
+ include_numeric_single_bin: bool = defaults.include_numeric_single_bin,
303
304
  sort_by: str = defaults.sort_by.value,
304
305
  ) -> pl.DataFrame:
305
306
  # if no contexts are provided, then we return the overall data
@@ -307,9 +308,12 @@ class Aggregate(LazyNamespace):
307
308
  # and load the data for those contexts
308
309
  df = self._get_df(contexts)
309
310
 
311
+ if not include_numeric_single_bin:
312
+ df = self._filter_single_bin_numeric_predictors(df)
313
+
310
314
  # If predictors are specified we filter the dataframe for those predictors
311
315
  predictors = predictors or []
312
- if predictors is not None or len(predictors) > 0:
316
+ if len(predictors) > 0:
313
317
  df = self._filter_for_predictors(df, predictors)
314
318
 
315
319
  # Aggregate all the different types of contributions
@@ -590,7 +594,7 @@ class Aggregate(LazyNamespace):
590
594
 
591
595
  def _apply(col, alias):
592
596
  return (
593
- (pl.col(col) * pl.col(_COL.FREQUENCY.value)).mean() / pl.col(_SPECIAL.TOTAL_FREQUENCY.value).first()
597
+ (pl.col(col) * pl.col(_COL.FREQUENCY.value)).sum() / pl.col(_SPECIAL.TOTAL_FREQUENCY.value).first()
594
598
  ).alias(alias)
595
599
 
596
600
  return [
@@ -6,6 +6,8 @@ __all__ = [
6
6
  "_TABLE_NAME",
7
7
  "ContextInfo",
8
8
  "ContextOperations",
9
+ "_resolve_agg_filter_kwargs",
10
+ "_resolve_plot_filter_kwargs",
9
11
  "defaults",
10
12
  ]
11
13
 
@@ -118,6 +120,7 @@ class _Defaults:
118
120
  descending: bool = True
119
121
  missing: bool = True
120
122
  remaining: bool = True
123
+ include_numeric_single_bin: bool = False
121
124
  sort_by: _CONTRIBUTION_TYPE = _CONTRIBUTION_TYPE.CONTRIBUTION_ABS
122
125
  display_by: _CONTRIBUTION_TYPE = _CONTRIBUTION_TYPE.CONTRIBUTION
123
126
 
@@ -125,6 +128,48 @@ class _Defaults:
125
128
  defaults = _Defaults()
126
129
 
127
130
 
131
+ def _resolve_agg_filter_kwargs(**kwargs) -> dict:
132
+ """Extract and validate aggregate-layer filter kwargs, filling defaults.
133
+
134
+ Valid keys: ``sort_by``, ``descending``, ``missing``, ``remaining``,
135
+ ``include_numeric_single_bin``.
136
+ Any other key raises ``TypeError``.
137
+ ``sort_by`` is validated against the accepted ``_CONTRIBUTION_TYPE`` values.
138
+ """
139
+ sort_by = kwargs.pop("sort_by", defaults.sort_by.value)
140
+ _CONTRIBUTION_TYPE.validate_and_get_type(sort_by)
141
+ result = {
142
+ "sort_by": sort_by,
143
+ "descending": kwargs.pop("descending", defaults.descending),
144
+ "missing": kwargs.pop("missing", defaults.missing),
145
+ "remaining": kwargs.pop("remaining", defaults.remaining),
146
+ "include_numeric_single_bin": kwargs.pop("include_numeric_single_bin", defaults.include_numeric_single_bin),
147
+ }
148
+ if kwargs:
149
+ raise TypeError(
150
+ f"Unexpected filter kwargs: {set(kwargs)}. Valid keys: sort_by, descending, missing, remaining, include_numeric_single_bin"
151
+ )
152
+ return result
153
+
154
+
155
+ def _resolve_plot_filter_kwargs(**kwargs) -> dict:
156
+ """Extract and validate plot-layer filter kwargs, filling defaults.
157
+
158
+ Extends aggregate filter kwargs with ``display_by``. Any other key raises
159
+ ``TypeError``. Both ``sort_by`` and ``display_by`` are validated against the
160
+ accepted ``_CONTRIBUTION_TYPE`` values.
161
+
162
+ ``sort_by`` and ``display_by`` are returned as ``_CONTRIBUTION_TYPE`` enum
163
+ members so callers can use ``.value`` and ``.alt`` without re-validating.
164
+ """
165
+ display_by = kwargs.pop("display_by", defaults.display_by.value)
166
+ display_by_enum = _CONTRIBUTION_TYPE.validate_and_get_type(display_by)
167
+ result = _resolve_agg_filter_kwargs(**kwargs)
168
+ result["sort_by"] = _CONTRIBUTION_TYPE.validate_and_get_type(result["sort_by"])
169
+ result["display_by"] = display_by_enum
170
+ return result
171
+
172
+
128
173
  class ContextInfo(TypedDict):
129
174
  context_key: str
130
175
  context_value: str