SuperModelingFactory 0.2.0__py3-none-any.whl

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 (79) hide show
  1. ExcelMaster/ExcelFormatTool.py +487 -0
  2. ExcelMaster/ExcelMaster.py +917 -0
  3. ExcelMaster/Template.py +525 -0
  4. ExcelMaster/Utility.py +233 -0
  5. ExcelMaster/__init__.py +3 -0
  6. Modeling_Tool/Core/Binning_Tool.py +1608 -0
  7. Modeling_Tool/Core/Binning_Tool.pyi +48 -0
  8. Modeling_Tool/Core/Check_DuckDB_Compatibility.py +835 -0
  9. Modeling_Tool/Core/Json_Data_Converter.py +621 -0
  10. Modeling_Tool/Core/Model_Registry_Tool.py +199 -0
  11. Modeling_Tool/Core/ODPS_Tool.py +284 -0
  12. Modeling_Tool/Core/Slope_Tool.py +356 -0
  13. Modeling_Tool/Core/Slope_Tool.pyi +31 -0
  14. Modeling_Tool/Core/XOR_Encryptor.py +207 -0
  15. Modeling_Tool/Core/XOR_Encryptor.pyi +26 -0
  16. Modeling_Tool/Core/__init__.py +99 -0
  17. Modeling_Tool/Core/kDataFrame.py +228 -0
  18. Modeling_Tool/Core/kDataFrame.pyi +43 -0
  19. Modeling_Tool/Core/sample_weight_utils.py +77 -0
  20. Modeling_Tool/Core/utils.py +2672 -0
  21. Modeling_Tool/Eval/Evaluation_Tool.py +1452 -0
  22. Modeling_Tool/Eval/Evaluation_Tool.pyi +47 -0
  23. Modeling_Tool/Eval/Model_Eval_Tool.py +2548 -0
  24. Modeling_Tool/Eval/Model_Eval_Tool.pyi +37 -0
  25. Modeling_Tool/Eval/__init__.py +54 -0
  26. Modeling_Tool/Eval/evaluate_model.py +2008 -0
  27. Modeling_Tool/Eval/evaluate_model.pyi +50 -0
  28. Modeling_Tool/Eval/weighted_eval_utils.py +326 -0
  29. Modeling_Tool/Explainability/Coalition_Structure.py +305 -0
  30. Modeling_Tool/Explainability/Model_Explainer.py +743 -0
  31. Modeling_Tool/Explainability/__init__.py +24 -0
  32. Modeling_Tool/Feature/Distribution_Tool.py +509 -0
  33. Modeling_Tool/Feature/Distribution_Tool.pyi +42 -0
  34. Modeling_Tool/Feature/Feature_Insights.py +762 -0
  35. Modeling_Tool/Feature/Feature_Insights.pyi +33 -0
  36. Modeling_Tool/Feature/PSI_Tool.py +1195 -0
  37. Modeling_Tool/Feature/PSI_Tool.pyi +29 -0
  38. Modeling_Tool/Feature/WOE_Engine_Feature_Patch.py +355 -0
  39. Modeling_Tool/Feature/__init__.py +40 -0
  40. Modeling_Tool/Model/Backward_Tool.py +778 -0
  41. Modeling_Tool/Model/Backward_Tool.pyi +45 -0
  42. Modeling_Tool/Model/GBM_Search_Tool.py +251 -0
  43. Modeling_Tool/Model/GBM_Tool.py +1610 -0
  44. Modeling_Tool/Model/GBM_Tool.pyi +90 -0
  45. Modeling_Tool/Model/LRM_Tool.py +1198 -0
  46. Modeling_Tool/Model/LRM_Tool.pyi +47 -0
  47. Modeling_Tool/Model/__init__.py +61 -0
  48. Modeling_Tool/Sample/Distribution_Adaptation.py +131 -0
  49. Modeling_Tool/Sample/Distribution_Adaptation.pyi +30 -0
  50. Modeling_Tool/Sample/Reject_Infer.py +413 -0
  51. Modeling_Tool/Sample/Reject_Infer.pyi +43 -0
  52. Modeling_Tool/Sample/Sample_Split.py +520 -0
  53. Modeling_Tool/Sample/Sample_Split.pyi +43 -0
  54. Modeling_Tool/Sample/__init__.py +31 -0
  55. Modeling_Tool/UAT/UAT_Consistency_Checker.py +1180 -0
  56. Modeling_Tool/UAT/__init__.py +19 -0
  57. Modeling_Tool/WOE/WOE_Adapter.py +204 -0
  58. Modeling_Tool/WOE/WOE_Adapter.pyi +21 -0
  59. Modeling_Tool/WOE/WOE_Master.py +491 -0
  60. Modeling_Tool/WOE/WOE_Master.pyi +40 -0
  61. Modeling_Tool/WOE/WOE_Monotone_Binner.py +3324 -0
  62. Modeling_Tool/WOE/WOE_Monotone_Binner.pyi +71 -0
  63. Modeling_Tool/WOE/WOE_Plot_Tool.py +919 -0
  64. Modeling_Tool/WOE/WOE_Plot_Tool.pyi +46 -0
  65. Modeling_Tool/WOE/WOE_Report_Builder.py +214 -0
  66. Modeling_Tool/WOE/WOE_Report_Builder.pyi +24 -0
  67. Modeling_Tool/WOE/WOE_Tool.py +1094 -0
  68. Modeling_Tool/WOE/WOE_Tool.pyi +41 -0
  69. Modeling_Tool/WOE/__init__.py +86 -0
  70. Modeling_Tool/WOE/plot_woe_tool.py +290 -0
  71. Modeling_Tool/WOE/plot_woe_tool.pyi +25 -0
  72. Modeling_Tool/__init__.py +176 -0
  73. Report/Report_Tool.py +380 -0
  74. Report/__init__.py +3 -0
  75. supermodelingfactory-0.2.0.dist-info/METADATA +268 -0
  76. supermodelingfactory-0.2.0.dist-info/RECORD +79 -0
  77. supermodelingfactory-0.2.0.dist-info/WHEEL +5 -0
  78. supermodelingfactory-0.2.0.dist-info/licenses/LICENSE +102 -0
  79. supermodelingfactory-0.2.0.dist-info/top_level.txt +3 -0
@@ -0,0 +1,37 @@
1
+ # =============================================================================
2
+ # Modeling_Tool.Eval.Model_Eval_Tool
3
+ # -----------------------------------------------------------------------------
4
+ # Copyright (c) 2026 Kyle Sun <github.com/Kyle-J-Sun>. All rights reserved.
5
+ # SuperModelingFactory — Licensed under the Business Source License 1.1.
6
+ #
7
+ # This stub describes the public API of a closed-source module compiled to a
8
+ # native extension (.so / .pyd). The original source is not distributed.
9
+ # Production / commercial use requires a separate commercial license.
10
+ #
11
+ # FINGERPRINT: SMF-MODELEVALTOO-09e04fef
12
+ # (Unique trace marker. Do not remove or alter — used for plagiarism
13
+ # detection across the public internet.)
14
+ # =============================================================================
15
+
16
+ import logging
17
+ import os
18
+ import numpy as np
19
+ import pandas as pd
20
+ from Modeling_Tool.Core.Binning_Tool import get_bin_range_list, super_binning
21
+ from Modeling_Tool.Core.utils import load_model, calc_iv, calc_woe
22
+ from .evaluate_model import evaluate_performance
23
+ def get_gains_table(data, dep, nbins = 10, precision = 5, min_bin_prop = 0.05, include_missing = True, score = None, model = None, varlist = None, equal_freq = True, chi2_method = False, grp_name = None, min_data_size = 100, grp_colname = None, sync_range = True, chi2_p = 0.95, init_equi_bins = 100, fillna = -999999, spec_values = [], retSummary = False, tree_binning = False, random_state = 42, ascending = False, withSummary = False, wholeGroup = False, add_func = None): ...
24
+ def get_perf_summary(train, validation, oot, tgt_name, scr_name = None, model = None, feature_cols = None, fig_save_path = None, rpt_save_path = None, to_show = False, display = True, dist_bins = 20, pct_bins = 10, precision = 5, min_bin_prop = 0.05, include_missing = False, equal_freq = True, chi2_method = False, init_equi_bins = 1000, chi2_p = 0.9, oot_grp_name = None, min_data_size = 100, grp_colname = None, tree_binning = False, random_state = 42, gains_table = False): ...
25
+ def cross_risk(data, score_list, dep, nbins, agg_col = None, precision = 5, min_bin_prop = 0.05, include_missing = False, equal_freq = True, binning_numeric = [True, True], agg_func = 'mean', chi2_method = False, chi2_p = 0.95, init_equi_bins = 100, fillna = -999999, spec_values = [], tree_binning = False, random_state = 42): ...
26
+ def get_gains_table_by_cust_metrics(data, dep, nbins = 10, precision = 5, min_bin_prop = 0.05, include_missing = True, score = None, model = None, varlist = None, equal_freq = True, chi2_method = False, grp_name = None, min_data_size = 100, grp_colname = None, sync_range = True, chi2_p = 0.95, init_equi_bins = 100, fillna = -999999, spec_values = [], tree_binning = False, random_state = 42, ascending = True, eval_metrics = ['age', 'monthly_income', 'education'], metric_agg_func = 'mean', withSummary = False): ...
27
+ def tie_score_rate(data, score): ...
28
+ def score_unique_rate(data, score): ...
29
+
30
+ class GainsTableCalculator:
31
+ def __init__(self, data, dep, nbins = 10, precision = 5, min_bin_prop = 0.05, include_missing = True, score = None, model = None, varlist = None, equal_freq = True, chi2_method = False, chi2_p = 0.95, init_equi_bins = 100, fillna = -999999, spec_values = [], tree_binning = False, random_state = 42, ascending = False): ...
32
+ def calculate(self, grp_name = None, min_data_size = 100, grp_colname = None, sync_range = True, retSummary = False, withSummary = False, wholeGroup = False, add_func = None): ...
33
+
34
+ class PerformanceEvaluator:
35
+ def __init__(self, tgt_name, scr_name = None, model = None, feature_cols = None, dist_bins = 20, pct_bins = 10, precision = 5, min_bin_prop = 0.05, include_missing = False, equal_freq = True, chi2_method = False, init_equi_bins = 1000, chi2_p = 0.9, tree_binning = False, random_state = 42): ...
36
+ def add_dataset(self, name, data): ...
37
+ def evaluate(self, oot_grp_name = None, min_data_size = 100, grp_colname = None, fig_save_path = None, rpt_save_path = None, to_show = False, display = True, gains_table = False, benchmark_dataset = None): ...
@@ -0,0 +1,54 @@
1
+ from .Model_Eval_Tool import (
2
+ get_gains_table,
3
+ get_perf_summary,
4
+ cross_risk,
5
+ tie_score_rate,
6
+ score_unique_rate,
7
+ get_gains_table_by_cust_metrics,
8
+ GainsTableCalculator,
9
+ PerformanceEvaluator,
10
+ )
11
+
12
+ from .Evaluation_Tool import (
13
+ EvaluationPipeline,
14
+ Model_Evaluation_Tool,
15
+ Utility_Functions,
16
+ )
17
+
18
+ from .evaluate_model import (
19
+ calc_pr,
20
+ summarize_pr,
21
+ plot_pr_curve,
22
+ calc_roc,
23
+ plot_ks_curve,
24
+ plot_roc_curve,
25
+ calc_equid_dist,
26
+ plot_kde_curve,
27
+ plot_dist_curve,
28
+ calc_equid_pct,
29
+ summarize_pct,
30
+ plot_pct_curve,
31
+ calc_fixed_pct,
32
+ plot_cumdist_curve,
33
+ plot_cumpct_curve,
34
+ plot_gain_curve,
35
+ evaluate_performance,
36
+ evaluate_distribution,
37
+ comparison_performance,
38
+ calc_lift_apt,
39
+ resturct_gains,
40
+ )
41
+
42
+ __all__ = [
43
+ 'get_gains_table', 'get_perf_summary', 'cross_risk', 'tie_score_rate',
44
+ 'score_unique_rate', 'get_gains_table_by_cust_metrics',
45
+ 'GainsTableCalculator', 'PerformanceEvaluator',
46
+ 'EvaluationPipeline', 'Model_Evaluation_Tool', 'Utility_Functions',
47
+ 'calc_pr', 'summarize_pr', 'plot_pr_curve',
48
+ 'calc_roc', 'plot_ks_curve', 'plot_roc_curve',
49
+ 'calc_equid_dist', 'plot_kde_curve', 'plot_dist_curve',
50
+ 'calc_equid_pct', 'summarize_pct', 'plot_pct_curve',
51
+ 'calc_fixed_pct', 'plot_cumdist_curve', 'plot_cumpct_curve', 'plot_gain_curve',
52
+ 'evaluate_performance', 'evaluate_distribution', 'comparison_performance',
53
+ 'calc_lift_apt', 'resturct_gains',
54
+ ]