Skip to content

Commit

Permalink
fix feature_bin_stats return_cols
Browse files Browse the repository at this point in the history
  • Loading branch information
itlubber committed Jul 15, 2024
1 parent 4f55422 commit 08bf842
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 212 deletions.
352 changes: 144 additions & 208 deletions examples/auto_report.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Cython
wget
numpy>1.23.1
numpy>1.23.1,<1.24.0
pandas
matplotlib
seaborn>=0.10.0
Expand All @@ -9,7 +9,7 @@ statsmodels<0.14,>=0.13.2
scikit-learn>=1.3.1
toad
scorecardpy
ortools<9.8.0
ortools<9.8.0,>=9.7.0
ropwr>=0.4.0
optbinning
CairoSVG>=2.7.0
Expand Down
4 changes: 2 additions & 2 deletions scorecardpipeline/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,10 +871,10 @@ def feature_bin_stats(data, feature, target="target", overdue=None, dpd=None, ru
combiner = Combiner(target=target, adj_rules=rules, method=method, empty_separate=empty_separate, min_n_bins=2, max_n_bins=max_n_bins, min_bin_size=min_bin_size, max_bin_size=max_bin_size, **kwargs)
combiner.fit(_datasets)

table, rule = Combiner.feature_bin_stats(_datasets, feature, target=target, method=method, desc=desc, combiner=combiner, ks=ks, max_n_bins=max_n_bins, min_bin_size=min_bin_size, max_bin_size=max_bin_size, greater_is_better=greater_is_better, empty_separate=empty_separate, return_cols=return_cols, return_rules=True, verbose=verbose, **kwargs)
table, rule = Combiner.feature_bin_stats(_datasets, feature, target=target, method=method, desc=desc, combiner=combiner, ks=ks, max_n_bins=max_n_bins, min_bin_size=min_bin_size, max_bin_size=max_bin_size, greater_is_better=greater_is_better, empty_separate=empty_separate, return_rules=True, verbose=verbose, **kwargs)
table.columns = pd.MultiIndex.from_tuples([("分箱详情", c) if c in merge_columns else (target, c) for c in table.columns])
else:
_table = Combiner.feature_bin_stats(_datasets, feature, target=target, method=method, desc=desc, combiner=combiner, ks=ks, max_n_bins=max_n_bins, min_bin_size=min_bin_size, max_bin_size=max_bin_size, greater_is_better=greater_is_better, empty_separate=empty_separate, return_cols=return_cols, verbose=verbose, **kwargs)
_table = Combiner.feature_bin_stats(_datasets, feature, target=target, method=method, desc=desc, combiner=combiner, ks=ks, max_n_bins=max_n_bins, min_bin_size=min_bin_size, max_bin_size=max_bin_size, greater_is_better=greater_is_better, empty_separate=empty_separate, verbose=verbose, **kwargs)
_table.columns = pd.MultiIndex.from_tuples([("分箱详情", c) if c in merge_columns else (target, c) for c in _table.columns])

table = table.merge(_table, on=[("分箱详情", c) for c in merge_columns])
Expand Down

0 comments on commit 08bf842

Please sign in to comment.