classifier-toolkit 0.2.2__tar.gz → 0.2.3__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 (146) hide show
  1. classifier_toolkit-0.2.3/.github/pull_request_template/default.md +13 -0
  2. classifier_toolkit-0.2.3/.github/workflows/ci.yaml +227 -0
  3. classifier_toolkit-0.2.3/.github/workflows/master.yaml +44 -0
  4. classifier_toolkit-0.2.3/.gitignore +179 -0
  5. classifier_toolkit-0.2.3/.python-version +1 -0
  6. classifier_toolkit-0.2.3/.sqlfluff +38 -0
  7. classifier_toolkit-0.2.3/Makefile +22 -0
  8. classifier_toolkit-0.2.3/PKG-INFO +177 -0
  9. classifier_toolkit-0.2.2/PKG-INFO → classifier_toolkit-0.2.3/README.md +86 -39
  10. classifier_toolkit-0.2.3/WEBAPP_IMPACT.md +37 -0
  11. classifier_toolkit-0.2.3/classifier_toolkit/feature_reduction/__init__.py +66 -0
  12. classifier_toolkit-0.2.3/classifier_toolkit/feature_reduction/base.py +168 -0
  13. classifier_toolkit-0.2.3/classifier_toolkit/feature_reduction/correlation.py +833 -0
  14. classifier_toolkit-0.2.3/classifier_toolkit/feature_reduction/counter_intuitive.py +226 -0
  15. classifier_toolkit-0.2.3/classifier_toolkit/feature_reduction/drift.py +1017 -0
  16. classifier_toolkit-0.2.3/classifier_toolkit/feature_reduction/expert_rules.py +103 -0
  17. classifier_toolkit-0.2.3/classifier_toolkit/feature_reduction/low_variance.py +480 -0
  18. classifier_toolkit-0.2.3/classifier_toolkit/feature_reduction/predictive_power.py +579 -0
  19. classifier_toolkit-0.2.3/classifier_toolkit/feature_reduction/reducer.py +887 -0
  20. classifier_toolkit-0.2.3/docs/changelog.md +29 -0
  21. classifier_toolkit-0.2.3/docs/eda/bivariate_analysis.md +42 -0
  22. classifier_toolkit-0.2.3/docs/eda/eda_toolkit.md +69 -0
  23. classifier_toolkit-0.2.3/docs/eda/feature_engineering.md +64 -0
  24. classifier_toolkit-0.2.3/docs/eda/first_glance.md +58 -0
  25. classifier_toolkit-0.2.3/docs/eda/overview.md +128 -0
  26. classifier_toolkit-0.2.3/docs/eda/univariate_analysis.md +52 -0
  27. classifier_toolkit-0.2.3/docs/eda/visualizations.md +55 -0
  28. classifier_toolkit-0.2.3/docs/eda/warnings/default_warnings.md +49 -0
  29. classifier_toolkit-0.2.3/docs/eda/warnings/warning_system.md +36 -0
  30. classifier_toolkit-0.2.3/docs/examples/eda_example.md +71 -0
  31. classifier_toolkit-0.2.3/docs/examples/feature_selection_advanced.md +115 -0
  32. classifier_toolkit-0.2.3/docs/examples/feature_selection_example.md +105 -0
  33. classifier_toolkit-0.2.3/docs/feature_selection/embedded_methods/elastic_net.md +58 -0
  34. classifier_toolkit-0.2.3/docs/feature_selection/feature_stability.md +42 -0
  35. classifier_toolkit-0.2.3/docs/feature_selection/meta_selector.md +97 -0
  36. classifier_toolkit-0.2.3/docs/feature_selection/overview.md +98 -0
  37. classifier_toolkit-0.2.3/docs/feature_selection/utils/data_handling.md +64 -0
  38. classifier_toolkit-0.2.3/docs/feature_selection/utils/scoring.md +54 -0
  39. classifier_toolkit-0.2.3/docs/feature_selection/wrapper_methods/bayesian_search.md +48 -0
  40. classifier_toolkit-0.2.3/docs/feature_selection/wrapper_methods/boruta.md +53 -0
  41. classifier_toolkit-0.2.3/docs/feature_selection/wrapper_methods/rfe.md +67 -0
  42. classifier_toolkit-0.2.3/docs/feature_selection/wrapper_methods/sequential_selection.md +58 -0
  43. classifier_toolkit-0.2.3/docs/index.md +63 -0
  44. classifier_toolkit-0.2.3/docs/reference/eda/bivariate_analysis.md +42 -0
  45. classifier_toolkit-0.2.3/docs/reference/eda/eda_toolkit.md +47 -0
  46. classifier_toolkit-0.2.3/docs/reference/eda/feature_engineering.md +42 -0
  47. classifier_toolkit-0.2.3/docs/reference/eda/first_glance.md +42 -0
  48. classifier_toolkit-0.2.3/docs/reference/eda/overview.md +35 -0
  49. classifier_toolkit-0.2.3/docs/reference/eda/univariate_analysis.md +43 -0
  50. classifier_toolkit-0.2.3/docs/reference/eda/visualizations.md +39 -0
  51. classifier_toolkit-0.2.3/docs/reference/eda/warnings/default_warnings.md +52 -0
  52. classifier_toolkit-0.2.3/docs/reference/eda/warnings/warning_system.md +36 -0
  53. classifier_toolkit-0.2.3/docs/reference/feature_reduction/correlation.md +49 -0
  54. classifier_toolkit-0.2.3/docs/reference/feature_reduction/counter_intuitive.md +40 -0
  55. classifier_toolkit-0.2.3/docs/reference/feature_reduction/drift.md +75 -0
  56. classifier_toolkit-0.2.3/docs/reference/feature_reduction/expert_rules.md +16 -0
  57. classifier_toolkit-0.2.3/docs/reference/feature_reduction/low_variance.md +25 -0
  58. classifier_toolkit-0.2.3/docs/reference/feature_reduction/overview.md +33 -0
  59. classifier_toolkit-0.2.3/docs/reference/feature_reduction/predictive_power.md +50 -0
  60. classifier_toolkit-0.2.3/docs/reference/feature_reduction/reducer.md +121 -0
  61. classifier_toolkit-0.2.3/docs/reference/feature_selection/embedded_methods/elastic_net.md +40 -0
  62. classifier_toolkit-0.2.3/docs/reference/feature_selection/feature_stability.md +38 -0
  63. classifier_toolkit-0.2.3/docs/reference/feature_selection/meta_selector.md +41 -0
  64. classifier_toolkit-0.2.3/docs/reference/feature_selection/overview.md +28 -0
  65. classifier_toolkit-0.2.3/docs/reference/feature_selection/utils/data_handling.md +43 -0
  66. classifier_toolkit-0.2.3/docs/reference/feature_selection/utils/scoring.md +37 -0
  67. classifier_toolkit-0.2.3/docs/reference/feature_selection/wrapper_methods/bayesian_search.md +35 -0
  68. classifier_toolkit-0.2.3/docs/reference/feature_selection/wrapper_methods/boruta.md +34 -0
  69. classifier_toolkit-0.2.3/docs/reference/feature_selection/wrapper_methods/rfe.md +62 -0
  70. classifier_toolkit-0.2.3/docs/reference/feature_selection/wrapper_methods/sequential_selection.md +55 -0
  71. classifier_toolkit-0.2.3/docs/stylesheets/extra.css +0 -0
  72. classifier_toolkit-0.2.3/examples/__init__.py +1 -0
  73. classifier_toolkit-0.2.3/examples/example.py +19 -0
  74. classifier_toolkit-0.2.3/main.py +6 -0
  75. classifier_toolkit-0.2.3/mkdocs.yml +125 -0
  76. classifier_toolkit-0.2.3/notebooks/feature_reduction_example.ipynb +2308 -0
  77. classifier_toolkit-0.2.3/notebooks/feature_reduction_paylater_comparison.ipynb +2198 -0
  78. classifier_toolkit-0.2.3/notebooks/paylater_reference.ipynb +712 -0
  79. classifier_toolkit-0.2.3/notebooks/paylater_removed.json +244 -0
  80. classifier_toolkit-0.2.3/pyproject.toml +83 -0
  81. classifier_toolkit-0.2.3/ruff.toml +48 -0
  82. classifier_toolkit-0.2.3/tests/__init__.py +1 -0
  83. classifier_toolkit-0.2.3/tests/conftest.py +80 -0
  84. classifier_toolkit-0.2.3/tests/eda/__init__.py +0 -0
  85. classifier_toolkit-0.2.3/tests/eda/test_bivariate_analysis.py +51 -0
  86. classifier_toolkit-0.2.3/tests/eda/test_feature_engineering.py +163 -0
  87. classifier_toolkit-0.2.3/tests/eda/test_first_glance.py +92 -0
  88. classifier_toolkit-0.2.3/tests/eda/test_univariate_analysis.py +120 -0
  89. classifier_toolkit-0.2.3/tests/eda/test_visualizations.py +116 -0
  90. classifier_toolkit-0.2.3/tests/eda/test_warnings.py +140 -0
  91. classifier_toolkit-0.2.3/tests/feature_reduction/__init__.py +2 -0
  92. classifier_toolkit-0.2.3/tests/feature_reduction/test_correlation.py +268 -0
  93. classifier_toolkit-0.2.3/tests/feature_reduction/test_counter_intuitive.py +194 -0
  94. classifier_toolkit-0.2.3/tests/feature_reduction/test_drift.py +257 -0
  95. classifier_toolkit-0.2.3/tests/feature_reduction/test_expert_rules.py +109 -0
  96. classifier_toolkit-0.2.3/tests/feature_reduction/test_low_variance.py +244 -0
  97. classifier_toolkit-0.2.3/tests/feature_reduction/test_predictive_power.py +254 -0
  98. classifier_toolkit-0.2.3/tests/feature_reduction/test_reducer.py +208 -0
  99. classifier_toolkit-0.2.3/tests/feature_reduction/test_smoke.py +33 -0
  100. classifier_toolkit-0.2.3/tests/feature_selection/__init__.py +2 -0
  101. classifier_toolkit-0.2.3/tests/feature_selection/test_bayesian_search.py +140 -0
  102. classifier_toolkit-0.2.3/tests/feature_selection/test_boruta.py +108 -0
  103. classifier_toolkit-0.2.3/tests/feature_selection/test_elastic_net.py +98 -0
  104. classifier_toolkit-0.2.3/tests/feature_selection/test_feature_stability.py +107 -0
  105. classifier_toolkit-0.2.3/tests/feature_selection/test_rfe.py +114 -0
  106. classifier_toolkit-0.2.3/tests/feature_selection/test_rfe_catboost.py +801 -0
  107. classifier_toolkit-0.2.3/tests/feature_selection/test_scoring.py +70 -0
  108. classifier_toolkit-0.2.3/tests/feature_selection/test_sequential_selection.py +87 -0
  109. classifier_toolkit-0.2.3/uv.lock +3350 -0
  110. classifier_toolkit-0.2.2/README.md +0 -69
  111. classifier_toolkit-0.2.2/pyproject.toml +0 -65
  112. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/LICENSE +0 -0
  113. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/eda/__init__.py +0 -0
  114. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/eda/bivariate_analysis.py +0 -0
  115. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/eda/eda_toolkit.py +0 -0
  116. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/eda/feature_engineering.py +0 -0
  117. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/eda/first_glance.py +0 -0
  118. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/eda/univariate_analysis.py +0 -0
  119. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/eda/visualizations.py +0 -0
  120. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/eda/warnings/__init__.py +0 -0
  121. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/eda/warnings/automated_warnings.py +0 -0
  122. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/eda/warnings/default_warnings.py +0 -0
  123. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/feature_selection/__init__.py +0 -0
  124. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/feature_selection/base.py +0 -0
  125. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/feature_selection/embedded_methods/__init__.py +0 -0
  126. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/feature_selection/embedded_methods/elastic_net.py +0 -0
  127. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/feature_selection/feature_stability.py +0 -0
  128. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/feature_selection/meta_selector.py +0 -0
  129. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/feature_selection/utils/__init__.py +0 -0
  130. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/feature_selection/utils/data_handling.py +0 -0
  131. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/feature_selection/utils/plottings.py +0 -0
  132. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/feature_selection/utils/scoring.py +0 -0
  133. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/feature_selection/wrapper_methods/__init__.py +0 -0
  134. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/feature_selection/wrapper_methods/bayesian_search.py +0 -0
  135. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/feature_selection/wrapper_methods/boruta.py +0 -0
  136. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/feature_selection/wrapper_methods/rfe.py +0 -0
  137. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/feature_selection/wrapper_methods/rfe_catboost.py +0 -0
  138. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/feature_selection/wrapper_methods/sequential_selection.py +0 -0
  139. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/model_training/__init__.py +0 -0
  140. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/model_training/hyper_parameter_tuning/__init__.py +0 -0
  141. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/model_training/hyper_parameter_tuning/tuner.py +0 -0
  142. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/model_training/models/__init__.py +0 -0
  143. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/model_training/models/base.py +0 -0
  144. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/model_training/models/ensemble_methods.py +0 -0
  145. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/model_training/utils/__init__.py +0 -0
  146. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.3}/classifier_toolkit/model_training/utils/params.py +0 -0
@@ -0,0 +1,13 @@
1
+ ## Objective
2
+
3
+ ## Why
4
+
5
+ ## How
6
+
7
+ ## Publishing teps
8
+
9
+ - [ ] Run the pipeline
10
+ - [ ] Run all section examples with changes
11
+ - [ ] Update version
12
+ - [ ] Merge before publishing
13
+ - [ ] Add a tag with the corresponding version
@@ -0,0 +1,227 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - '**'
7
+ pull_request:
8
+ branches:
9
+ - '**'
10
+
11
+ env:
12
+ APP_NAME: ${{ github.event.repository.name }}
13
+ PYTHON_VERSION: "3.12.6"
14
+ UV_INDEX_URL: "https://${{ vars.NEXUS_READER_USERNAME }}:${{ secrets.NEXUS_READER_PASSWORD }}@package-registry.tooling-production.qonto.co/repository/pypi-proxies/simple"
15
+
16
+ jobs:
17
+ dependencies:
18
+ runs-on: default
19
+ steps:
20
+ - uses: actions/checkout@v6
21
+
22
+ - name: Set up Python
23
+ uses: actions/setup-python@v4
24
+ with:
25
+ python-version: ${{ env.PYTHON_VERSION }}
26
+
27
+ # Install system dependencies
28
+ - name: Install system dependencies
29
+ run: |
30
+ sudo apt-get update
31
+ sudo apt-get install -y build-essential gcc g++ make
32
+
33
+ # Configure Git for private repo access
34
+ - name: Configure Git
35
+ run: |
36
+ git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
37
+ env:
38
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39
+
40
+ # Install uv
41
+ - name: Install uv
42
+ run: |
43
+ curl -LsSf https://astral.sh/uv/install.sh | sh
44
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
45
+
46
+ - name: Cache uv
47
+ id: cache-uv
48
+ uses: actions/cache@v5
49
+ with:
50
+ path: |
51
+ ~/.cache/uv
52
+ .venv
53
+ key: ${{ runner.os }}-uv-${{ github.ref_name }}-${{ hashFiles('**/pyproject.toml', '**/uv.lock') }}
54
+ restore-keys: |
55
+ ${{ runner.os }}-uv-${{ github.ref_name }}-
56
+
57
+ - name: Install dependencies
58
+ run: |
59
+ uv sync --group test --extra liveplotting
60
+ env:
61
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62
+
63
+ - name: Save uv environment
64
+ if: always()
65
+ run: echo "Dependencies installed with uv."
66
+
67
+ lint:
68
+ needs: dependencies
69
+ runs-on: default
70
+ steps:
71
+ - uses: actions/checkout@v6
72
+
73
+ - name: Set up Python
74
+ uses: actions/setup-python@v4
75
+ with:
76
+ python-version: ${{ env.PYTHON_VERSION }}
77
+
78
+ # Install uv
79
+ - name: Install uv
80
+ run: |
81
+ curl -LsSf https://astral.sh/uv/install.sh | sh
82
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
83
+
84
+ # Add make installation
85
+ - name: Install make
86
+ run: sudo apt-get update && sudo apt-get install -y make
87
+
88
+ - name: Restore cache
89
+ uses: actions/cache@v5
90
+ with:
91
+ path: |
92
+ ~/.cache/uv
93
+ .venv
94
+ key: ${{ runner.os }}-uv-${{ github.ref_name }}-${{ hashFiles('**/pyproject.toml', '**/uv.lock') }}
95
+
96
+ - name: Install dependencies
97
+ run: uv sync --group lint
98
+
99
+ - name: Run linting
100
+ run: uv run make lint
101
+
102
+ # Uncomment if you want to use mypy
103
+ # mypy:
104
+ # needs: dependencies
105
+ # runs-on: default
106
+ # steps:
107
+ # - uses: actions/checkout@v6
108
+ #
109
+ # - name: Set up Python
110
+ # uses: actions/setup-python@v4
111
+ # with:
112
+ # python-version: ${{ env.PYTHON_VERSION }}
113
+ #
114
+ # # Install uv
115
+ # - name: Install uv
116
+ # run: |
117
+ # curl -LsSf https://astral.sh/uv/install.sh | sh
118
+ # echo "$HOME/.local/bin" >> $GITHUB_PATH
119
+ #
120
+ # # Add make installation
121
+ # - name: Install make
122
+ # run: sudo apt-get update && sudo apt-get install -y make
123
+ #
124
+ # - name: Restore cache
125
+ # uses: actions/cache@v4
126
+ # with:
127
+ # path: |
128
+ # ~/.cache/uv
129
+ # .venv
130
+ # key: ${{ runner.os }}-uv-${{ github.ref_name }}-${{ hashFiles('**/pyproject.toml', '**/uv.lock') }}
131
+ #
132
+ # - name: Install dependencies
133
+ # run: uv sync --group lint
134
+ #
135
+ # - name: Run mypy
136
+ # run: uv run make mypy
137
+
138
+ test:
139
+ needs: dependencies
140
+ runs-on: default
141
+ # Layer 2: Split tests in parallel
142
+ strategy:
143
+ fail-fast: false
144
+ matrix:
145
+ test-group: [eda, feature_selection, feature_reduction]
146
+ steps:
147
+ - uses: actions/checkout@v6
148
+
149
+ - name: Set up Python
150
+ uses: actions/setup-python@v4
151
+ with:
152
+ python-version: ${{ env.PYTHON_VERSION }}
153
+
154
+ # Install system dependencies
155
+ - name: Install system dependencies
156
+ run: |
157
+ sudo apt-get update
158
+ sudo apt-get install -y build-essential gcc g++ make
159
+
160
+ # Install uv
161
+ - name: Install uv
162
+ run: |
163
+ curl -LsSf https://astral.sh/uv/install.sh | sh
164
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
165
+
166
+ - name: Restore cache
167
+ uses: actions/cache@v5
168
+ with:
169
+ path: |
170
+ ~/.cache/uv
171
+ .venv
172
+ .pytest_cache
173
+ key: ${{ runner.os }}-uv-${{ github.ref_name }}-${{ hashFiles('**/pyproject.toml', '**/uv.lock') }}
174
+ restore-keys: |
175
+ ${{ runner.os }}-uv-${{ github.ref_name }}-
176
+
177
+ - name: Install dependencies
178
+ run: uv sync --group test --extra exp --extra liveplotting
179
+
180
+ # Layer 3: Run failed tests first, then rest
181
+ - name: Run tests (${{ matrix.test-group }})
182
+ run: uv run pytest tests/${{ matrix.test-group }}/ -v --lf --ff
183
+
184
+ build_test:
185
+ needs: [lint, test]
186
+ runs-on: default
187
+ if: github.ref == 'refs/heads/master' || github.base_ref == 'master'
188
+ steps:
189
+ - uses: actions/checkout@v6
190
+
191
+ - name: Set up Python
192
+ uses: actions/setup-python@v4
193
+ with:
194
+ python-version: ${{ env.PYTHON_VERSION }}
195
+
196
+ # Install uv
197
+ - name: Install uv
198
+ run: |
199
+ curl -LsSf https://astral.sh/uv/install.sh | sh
200
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
201
+
202
+ # Add make installation if your build process uses make
203
+ - name: Install make
204
+ run: sudo apt-get update && sudo apt-get install -y make
205
+
206
+ - name: Restore cache
207
+ uses: actions/cache@v5
208
+ with:
209
+ path: |
210
+ ~/.cache/uv
211
+ .venv
212
+ key: ${{ runner.os }}-uv-${{ github.ref_name }}-${{ hashFiles('**/pyproject.toml', '**/uv.lock') }}
213
+
214
+ - name: Install dependencies
215
+ run: uv sync
216
+
217
+ - name: Build and test
218
+ run: |
219
+ uv build
220
+ uv pip install dist/*.whl
221
+ uv run python examples/example.py
222
+
223
+ - name: Upload artifacts
224
+ uses: actions/upload-artifact@v7
225
+ with:
226
+ name: dist
227
+ path: dist/
@@ -0,0 +1,44 @@
1
+ name: Master
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+
8
+ env:
9
+ PYTHON_VERSION: "3.12.6"
10
+
11
+
12
+ jobs:
13
+ build-and-publish:
14
+ runs-on: default
15
+ permissions:
16
+ contents: write
17
+ steps:
18
+ - uses: actions/checkout@v6
19
+
20
+ - name: Set up Python
21
+ uses: actions/setup-python@v4
22
+ with:
23
+ python-version: ${{ env.PYTHON_VERSION }}
24
+
25
+ - name: Install system dependencies
26
+ run: |
27
+ sudo apt-get update
28
+ sudo apt-get install -y build-essential gcc g++ make
29
+
30
+ - name: Install uv
31
+ run: |
32
+ curl -LsSf https://astral.sh/uv/install.sh | sh
33
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
34
+
35
+ - name: Install dependencies
36
+ run: uv sync
37
+ env:
38
+ UV_INDEX_URL: "https://${{ vars.NEXUS_READER_USERNAME }}:${{ secrets.NEXUS_READER_PASSWORD }}@package-registry.tooling-production.qonto.co/repository/pypi-proxies/simple"
39
+
40
+ - name: Build package
41
+ run: uv build
42
+
43
+ - name: Publish to PyPI
44
+ run: uv publish --token ${{ secrets.PYPI_TOKEN }}
@@ -0,0 +1,179 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
110
+ .pdm.toml
111
+ .pdm-python
112
+ .pdm-build/
113
+
114
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
115
+ __pypackages__/
116
+
117
+ # Celery stuff
118
+ celerybeat-schedule
119
+ celerybeat.pid
120
+
121
+ # SageMath parsed files
122
+ *.sage.py
123
+
124
+ # Environments
125
+ .env
126
+ .venv
127
+ env/
128
+ venv/
129
+ ENV/
130
+ env.bak/
131
+ venv.bak/
132
+
133
+ # Spyder project settings
134
+ .spyderproject
135
+ .spyproject
136
+
137
+ # Rope project settings
138
+ .ropeproject
139
+
140
+ # mkdocs documentation
141
+ /site
142
+
143
+ # mypy
144
+ .mypy_cache/
145
+ .dmypy.json
146
+ dmypy.json
147
+
148
+ # Pyre type checker
149
+ .pyre/
150
+
151
+ # pytype static type analyzer
152
+ .pytype/
153
+
154
+ # Cython debug symbols
155
+ cython_debug/
156
+
157
+ # PyCharm
158
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
159
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
160
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
161
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
162
+ #.idea/
163
+
164
+ # VS Code
165
+ .vscode/
166
+
167
+ # Mac OS
168
+ .DS_Store
169
+
170
+ # Output files
171
+ *.parquet
172
+ *.csv
173
+ /**/output/*
174
+
175
+ # Catboost files
176
+ catboost_info/
177
+
178
+ # Gitkeep
179
+ !/**/.gitkeep
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,38 @@
1
+ [sqlfluff]
2
+ dialect = snowflake
3
+ encoding = utf-8
4
+ max_line_length = 120
5
+ exclude_rules = AM06, ST06
6
+ large_file_skip_byte_limit = 0
7
+ templater = placeholder
8
+
9
+ [sqlfluff:templater:placeholder]
10
+ param_style = pyformat
11
+
12
+ # Layout configuration
13
+ [sqlfluff:layout:type:comma]
14
+ line_position = trailing
15
+
16
+ # Common rules
17
+ [sqlfluff:indentation]
18
+ tab_space_size = 4
19
+ indent_unit = space
20
+
21
+ # Some rules have their own specific config
22
+ [sqlfluff:rules:capitalisation.keywords]
23
+ capitalisation_policy = upper
24
+
25
+ [sqlfluff:rules:capitalisation.identifiers]
26
+ extended_capitalisation_policy = lower
27
+
28
+ [sqlfluff:rules:references.consistent]
29
+ single_table_references = consistent
30
+
31
+ [sqlfluff:rules:capitalisation.functions]
32
+ extended_capitalisation_policy = upper
33
+
34
+ [sqlfluff:rules:capitalisation.literals]
35
+ capitalisation_policy = upper
36
+
37
+ [sqlfluff:rules:capitalisation.types]
38
+ extended_capitalisation_policy = upper
@@ -0,0 +1,22 @@
1
+ lint:
2
+ ruff check .
3
+ ruff format --check --diff .
4
+ sqlfluff lint . --processes 0
5
+
6
+ lint-fix:
7
+ ruff check --fix .
8
+ ruff format .
9
+ sqlfluff fix . --processes 0
10
+
11
+ format:
12
+ ruff format .
13
+ sqlfluff fix . --processes 0
14
+
15
+ mypy:
16
+ mypy --install-types classifier_toolkit
17
+
18
+ test:
19
+ pytest -v
20
+
21
+ docs:
22
+ mkdocs serve
@@ -0,0 +1,177 @@
1
+ Metadata-Version: 2.4
2
+ Name: classifier-toolkit
3
+ Version: 0.2.3
4
+ Author-email: "senih.yilmaz" <senih.yilmaz@qonto.com>, "jeremy.fraoua" <jeremy.fraoua@qonto.com>, "gauthier.marquand" <gauthier.marquand@qonto.com>, "arnaud.alepee" <arnaud.alepee@qonto.com>
5
+ License-File: LICENSE
6
+ Requires-Python: <3.13,>=3.9
7
+ Requires-Dist: catboost<2.0.0,>=1.2.2
8
+ Requires-Dist: category-encoders<3.0.0,>=2.6.3
9
+ Requires-Dist: colorama<0.5.0,>=0.4.6
10
+ Requires-Dist: lightgbm<5.0.0,>=4.5.0
11
+ Requires-Dist: matplotlib<4.0.0,>=3.9.2
12
+ Requires-Dist: nbformat>=5.10.4
13
+ Requires-Dist: numpy<2.0
14
+ Requires-Dist: optuna<4.0.0,>=3.5.0
15
+ Requires-Dist: pandas<3.0.0,>=2.2.0
16
+ Requires-Dist: polars<2.0.0,>=1.2.1
17
+ Requires-Dist: pyarrow<19.0.0,>=18.0.0
18
+ Requires-Dist: scikit-learn<2.0.0,>=1.4.0
19
+ Requires-Dist: scipy<1.14
20
+ Requires-Dist: shap<0.45.0,>=0.44.1
21
+ Requires-Dist: statsmodels<0.15.0,>=0.14.2
22
+ Requires-Dist: tabulate<0.10.0,>=0.9.0
23
+ Requires-Dist: tqdm<5.0.0,>=4.66.0
24
+ Requires-Dist: xgboost<3.0.0,>=2.1.1
25
+ Provides-Extra: exp
26
+ Requires-Dist: bayesian-optimization<3.0.0,>=2.0.0; extra == 'exp'
27
+ Provides-Extra: liveplotting
28
+ Requires-Dist: nbformat>=4.2.0; extra == 'liveplotting'
29
+ Description-Content-Type: text/markdown
30
+
31
+ [PyPI: classifier-toolkit](https://pypi.org/project/classifier-toolkit/)
32
+
33
+ ```bash
34
+ pip install classifier-toolkit
35
+ ```
36
+
37
+ # Classifier Toolkit
38
+
39
+ [![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
40
+ [![Linting - Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
41
+ [![Code style - Black](https://img.shields.io/badge/Code%20Style-Black-000000.svg)](https://github.com/psf/black)
42
+
43
+ This is a new project.
44
+
45
+ -----
46
+
47
+ ## Table of Content
48
+
49
+ <!-- [[_TOC_]] -->
50
+
51
+ 1. [Installation](#installation)
52
+ 2. [Usage](#usage)
53
+ 3. [Modules Overview](#modules-overview)
54
+ 4. [Development & CI/CD](#development--cicd)
55
+ 5. [Future Work](#future-work)
56
+
57
+ ### Installation
58
+
59
+ This library is published in the PyPI directory. To install, users can run pip install 'classifier_toolkit' command.
60
+
61
+ ### Usage
62
+
63
+ This library automates binary classification tasks in the finance domain, specifically for default and fraud labeling. It includes several packages designed to address the main steps in any machine learning/data science task:
64
+
65
+ 1. **EDA**: accessible via `EDA_Toolkit`. Provides EDA and feature engineering functionality with all necessary visualizations.
66
+ 2. **Feature Reduction**: filter-style pre-selection pipeline (expert rules, low variance, drift, predictive power, counter-intuitive direction, high correlation).
67
+ 3. **Feature Selection**: wrapper and embedded methods (RFE, Boruta, Sequential, Bayesian, ElasticNet, MetaSelector).
68
+ 4. Model fitting and hyperparameter tuning: To be implemented.
69
+ 5. Evaluation and reporting: To be implemented.
70
+
71
+ In the future, the package architectures will be included here. However, for now please consult the docstrings in the specific methods in the relevant modules.
72
+
73
+ **Note**: that this library does not contain data wrangling steps (although it contains feature engineering), it's an intermediate step between EDA and feature engineering where users should fix any data quality related issues. Therefore, conducting the EDA is crucial to mitigate any issues before moving onto the feature engineering and the subsequent steps.
74
+
75
+ ### Modules Overview
76
+
77
+ - **EDA Toolkit**: This module includes classes and methods for performing comprehensive exploratory data analysis. It provides automated warnings for data quality issues, univariate and bivariate analysis, and various data visualizations to help understand the dataset.
78
+
79
+ - **Univariate Analysis**: This class focuses on the analysis of individual variables. It includes methods for calculating statistical measures, visualizing distributions, and assessing relationships between variables and a target through techniques like Cramer's V and Information Value. This helps in understanding the significance and distribution of each feature independently.
80
+
81
+ - **Bivariate Analysis**: This class deals with the analysis of two variables to understand their relationship. It includes functionalities for generating correlation heatmaps, performing ANOVA tests between numerical and categorical variables, and computing pairwise Cramer's V for categorical features. This aids in identifying patterns and correlations between pairs of variables, which is crucial for feature selection and engineering.
82
+
83
+ - **Feature Engineering**: This module assists in transforming features, handling missing values, encoding categorical variables, and more. It aims to enhance the dataset's quality for better model performance.
84
+
85
+ - **Visualizations**: This module offers a wide range of plotting capabilities to visually analyze data distributions, relationships, and other crucial aspects of the dataset.
86
+
87
+ - **Automated Warnings**: A utility to automatically check the dataset for common issues such as missing or duplicate values, outliers, and more, providing warnings to guide data cleaning efforts.
88
+
89
+ - **Feature Reduction**: Filter-style pipeline that reduces the feature set *before* model-based selection. Six sequential steps, each independently configurable:
90
+ 1. **Expert Rules** — drop features by hand-coded list.
91
+ 2. **Low Variance** — drop near-constant numerical and categorical features.
92
+ 3. **Drift** — drop features whose distribution has shifted (PSI, KS, JS and more).
93
+ 4. **Predictive Power** — drop features with weak univariate Gini / PR-AUC.
94
+ 5. **Counter-Intuitive Direction** — drop features violating a business prior.
95
+ 6. **High Correlation** — drop pairwise-redundant features (Pearson/Spearman/Kendall; Cramér's V).
96
+
97
+ The `FeatureReducer` orchestrates all six steps in one sklearn-compatible `fit` / `transform` call.
98
+
99
+ ```python
100
+ from classifier_toolkit.feature_reduction import FeatureReducer
101
+
102
+ reducer = FeatureReducer(gini_threshold=0.01, numeric_correlation_threshold=0.85)
103
+ reducer.fit(X_train, y=y_train, X_val=X_val)
104
+ X_filtered = reducer.transform(X_train)
105
+
106
+ reducer.summary() # print pipeline summary
107
+ reducer.export_summary("summary.xlsx", format="excel")
108
+ ```
109
+
110
+ Standalone helpers are also available for ad-hoc analysis outside the pipeline:
111
+
112
+ ```python
113
+ from classifier_toolkit.feature_reduction import (
114
+ calculate_feature_predictive_metrics, # Gini + PR-AUC for every feature
115
+ CorrelationAnalyser, # inspect all correlated pairs
116
+ DriftAnalyser, # inspect drift stats per feature
117
+ )
118
+ ```
119
+
120
+ Logs are **silent by default**. To enable them:
121
+
122
+ ```python
123
+ import logging
124
+
125
+ logging.basicConfig(level=logging.INFO)
126
+ logging.getLogger("classifier_toolkit.feature_reduction").setLevel(logging.INFO)
127
+ ```
128
+
129
+ - **Feature Selection**: This module provides various feature selection techniques:
130
+ - **Embedded Methods**: Includes ElasticNet for regularization-based feature selection.
131
+ - **Wrapper Methods**:
132
+ - Recursive Feature Elimination (RFE) with support for various ensemble methods (Random Forest, XGBoost, LightGBM, CatBoost).
133
+ - Sequential Feature Selection (forward, backward, floating, and bidirectional).
134
+ - **Meta Selector**: Combines multiple feature selection methods to provide a robust selection.
135
+ - **Utility Functions**: Includes scoring functions and plotting utilities for feature importance visualization.
136
+
137
+ ### Development & CI/CD
138
+
139
+ This project uses modern tooling for fast and efficient development workflows:
140
+
141
+ #### Dependency Management
142
+ - **UV**: Lightning-fast Python package installer and resolver (replacing Poetry)
143
+ - Install UV: `curl -LsSf https://astral.sh/uv/install.sh | sh`
144
+ - Install dependencies: `uv sync --group dev --group lint --group test`
145
+
146
+ #### CI/CD Pipeline
147
+ Our CI/CD pipeline is optimized for speed and efficiency:
148
+
149
+ - **Parallel Test Execution**: Tests are split into two groups (`eda` and `feature_selection`) that run simultaneously, reducing test time by ~50%
150
+ - **Shared Caching**: Both parallel jobs share the same dependency cache (~1.7GB), avoiding duplicate downloads
151
+ - **Smart Test Reruns**: Failed tests run first (`pytest --lf --ff`) for faster feedback on fixes
152
+ - **Master Protection**: Build tests only run on `master` branch and PRs targeting `master`, saving CI resources on feature branches
153
+ - **Automatic Linting**: Code quality checks (Ruff, SQLFluff) run on every push
154
+
155
+ **Pipeline Jobs:**
156
+ 1. `dependencies` - Installs and caches project dependencies
157
+ 2. `lint` - Runs code quality checks (Ruff, SQLFluff)
158
+ 3. `test` - Executes tests in parallel with shared cache
159
+ 4. `build_test` - Builds and validates package (master/PRs only)
160
+
161
+ **Local Development:**
162
+ ```bash
163
+ # Run linting
164
+ uv run make lint
165
+
166
+ # Run tests
167
+ uv run make test
168
+
169
+ # Build package
170
+ uv build
171
+ ```
172
+
173
+ ### Future Work
174
+ The next planned improvements and additions to the library include:
175
+ * Adding model fitting and hyperparameter tuning functionalities.
176
+ * Developing comprehensive evaluation and reporting tools to assist with model assessment.
177
+ * Expanding documentation to include architecture diagrams and detailed usage examples.