classifier-toolkit 0.2.2__tar.gz → 0.2.4__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 (143) hide show
  1. classifier_toolkit-0.2.4/.github/pull_request_template/default.md +13 -0
  2. classifier_toolkit-0.2.4/.github/workflows/checks.yaml +134 -0
  3. classifier_toolkit-0.2.4/.github/workflows/master.yaml +48 -0
  4. classifier_toolkit-0.2.4/.github/workflows/working-branch.yaml +14 -0
  5. classifier_toolkit-0.2.4/.gitignore +180 -0
  6. classifier_toolkit-0.2.4/.python-version +1 -0
  7. classifier_toolkit-0.2.4/.sqlfluff +38 -0
  8. classifier_toolkit-0.2.4/Makefile +22 -0
  9. classifier_toolkit-0.2.4/PKG-INFO +177 -0
  10. classifier_toolkit-0.2.2/PKG-INFO → classifier_toolkit-0.2.4/README.md +86 -39
  11. classifier_toolkit-0.2.4/classifier_toolkit/feature_reduction/__init__.py +66 -0
  12. classifier_toolkit-0.2.4/classifier_toolkit/feature_reduction/base.py +168 -0
  13. classifier_toolkit-0.2.4/classifier_toolkit/feature_reduction/correlation.py +833 -0
  14. classifier_toolkit-0.2.4/classifier_toolkit/feature_reduction/counter_intuitive.py +226 -0
  15. classifier_toolkit-0.2.4/classifier_toolkit/feature_reduction/drift.py +1017 -0
  16. classifier_toolkit-0.2.4/classifier_toolkit/feature_reduction/expert_rules.py +103 -0
  17. classifier_toolkit-0.2.4/classifier_toolkit/feature_reduction/low_variance.py +480 -0
  18. classifier_toolkit-0.2.4/classifier_toolkit/feature_reduction/predictive_power.py +579 -0
  19. classifier_toolkit-0.2.4/classifier_toolkit/feature_reduction/reducer.py +887 -0
  20. classifier_toolkit-0.2.4/docs/changelog.md +29 -0
  21. classifier_toolkit-0.2.4/docs/eda/bivariate_analysis.md +42 -0
  22. classifier_toolkit-0.2.4/docs/eda/eda_toolkit.md +69 -0
  23. classifier_toolkit-0.2.4/docs/eda/feature_engineering.md +64 -0
  24. classifier_toolkit-0.2.4/docs/eda/first_glance.md +58 -0
  25. classifier_toolkit-0.2.4/docs/eda/overview.md +128 -0
  26. classifier_toolkit-0.2.4/docs/eda/univariate_analysis.md +52 -0
  27. classifier_toolkit-0.2.4/docs/eda/visualizations.md +55 -0
  28. classifier_toolkit-0.2.4/docs/eda/warnings/default_warnings.md +49 -0
  29. classifier_toolkit-0.2.4/docs/eda/warnings/warning_system.md +36 -0
  30. classifier_toolkit-0.2.4/docs/examples/eda_example.md +71 -0
  31. classifier_toolkit-0.2.4/docs/examples/feature_selection_advanced.md +115 -0
  32. classifier_toolkit-0.2.4/docs/examples/feature_selection_example.md +105 -0
  33. classifier_toolkit-0.2.4/docs/feature_selection/embedded_methods/elastic_net.md +58 -0
  34. classifier_toolkit-0.2.4/docs/feature_selection/feature_stability.md +42 -0
  35. classifier_toolkit-0.2.4/docs/feature_selection/meta_selector.md +97 -0
  36. classifier_toolkit-0.2.4/docs/feature_selection/overview.md +98 -0
  37. classifier_toolkit-0.2.4/docs/feature_selection/utils/data_handling.md +64 -0
  38. classifier_toolkit-0.2.4/docs/feature_selection/utils/scoring.md +54 -0
  39. classifier_toolkit-0.2.4/docs/feature_selection/wrapper_methods/bayesian_search.md +48 -0
  40. classifier_toolkit-0.2.4/docs/feature_selection/wrapper_methods/boruta.md +53 -0
  41. classifier_toolkit-0.2.4/docs/feature_selection/wrapper_methods/rfe.md +67 -0
  42. classifier_toolkit-0.2.4/docs/feature_selection/wrapper_methods/sequential_selection.md +58 -0
  43. classifier_toolkit-0.2.4/docs/index.md +63 -0
  44. classifier_toolkit-0.2.4/docs/reference/eda/bivariate_analysis.md +42 -0
  45. classifier_toolkit-0.2.4/docs/reference/eda/eda_toolkit.md +47 -0
  46. classifier_toolkit-0.2.4/docs/reference/eda/feature_engineering.md +42 -0
  47. classifier_toolkit-0.2.4/docs/reference/eda/first_glance.md +42 -0
  48. classifier_toolkit-0.2.4/docs/reference/eda/overview.md +35 -0
  49. classifier_toolkit-0.2.4/docs/reference/eda/univariate_analysis.md +43 -0
  50. classifier_toolkit-0.2.4/docs/reference/eda/visualizations.md +39 -0
  51. classifier_toolkit-0.2.4/docs/reference/eda/warnings/default_warnings.md +52 -0
  52. classifier_toolkit-0.2.4/docs/reference/eda/warnings/warning_system.md +36 -0
  53. classifier_toolkit-0.2.4/docs/reference/feature_reduction/correlation.md +49 -0
  54. classifier_toolkit-0.2.4/docs/reference/feature_reduction/counter_intuitive.md +40 -0
  55. classifier_toolkit-0.2.4/docs/reference/feature_reduction/drift.md +75 -0
  56. classifier_toolkit-0.2.4/docs/reference/feature_reduction/expert_rules.md +16 -0
  57. classifier_toolkit-0.2.4/docs/reference/feature_reduction/low_variance.md +25 -0
  58. classifier_toolkit-0.2.4/docs/reference/feature_reduction/overview.md +33 -0
  59. classifier_toolkit-0.2.4/docs/reference/feature_reduction/predictive_power.md +50 -0
  60. classifier_toolkit-0.2.4/docs/reference/feature_reduction/reducer.md +121 -0
  61. classifier_toolkit-0.2.4/docs/reference/feature_selection/embedded_methods/elastic_net.md +40 -0
  62. classifier_toolkit-0.2.4/docs/reference/feature_selection/feature_stability.md +38 -0
  63. classifier_toolkit-0.2.4/docs/reference/feature_selection/meta_selector.md +41 -0
  64. classifier_toolkit-0.2.4/docs/reference/feature_selection/overview.md +28 -0
  65. classifier_toolkit-0.2.4/docs/reference/feature_selection/utils/data_handling.md +43 -0
  66. classifier_toolkit-0.2.4/docs/reference/feature_selection/utils/scoring.md +37 -0
  67. classifier_toolkit-0.2.4/docs/reference/feature_selection/wrapper_methods/bayesian_search.md +35 -0
  68. classifier_toolkit-0.2.4/docs/reference/feature_selection/wrapper_methods/boruta.md +34 -0
  69. classifier_toolkit-0.2.4/docs/reference/feature_selection/wrapper_methods/rfe.md +62 -0
  70. classifier_toolkit-0.2.4/docs/reference/feature_selection/wrapper_methods/sequential_selection.md +55 -0
  71. classifier_toolkit-0.2.4/docs/stylesheets/extra.css +0 -0
  72. classifier_toolkit-0.2.4/examples/__init__.py +1 -0
  73. classifier_toolkit-0.2.4/examples/example.py +19 -0
  74. classifier_toolkit-0.2.4/main.py +6 -0
  75. classifier_toolkit-0.2.4/mkdocs.yml +125 -0
  76. classifier_toolkit-0.2.4/notebooks/paylater_removed.json +244 -0
  77. classifier_toolkit-0.2.4/pyproject.toml +83 -0
  78. classifier_toolkit-0.2.4/ruff.toml +46 -0
  79. classifier_toolkit-0.2.4/tests/__init__.py +1 -0
  80. classifier_toolkit-0.2.4/tests/conftest.py +80 -0
  81. classifier_toolkit-0.2.4/tests/eda/__init__.py +0 -0
  82. classifier_toolkit-0.2.4/tests/eda/test_bivariate_analysis.py +51 -0
  83. classifier_toolkit-0.2.4/tests/eda/test_feature_engineering.py +163 -0
  84. classifier_toolkit-0.2.4/tests/eda/test_first_glance.py +92 -0
  85. classifier_toolkit-0.2.4/tests/eda/test_univariate_analysis.py +120 -0
  86. classifier_toolkit-0.2.4/tests/eda/test_visualizations.py +116 -0
  87. classifier_toolkit-0.2.4/tests/eda/test_warnings.py +140 -0
  88. classifier_toolkit-0.2.4/tests/feature_reduction/__init__.py +2 -0
  89. classifier_toolkit-0.2.4/tests/feature_reduction/test_correlation.py +268 -0
  90. classifier_toolkit-0.2.4/tests/feature_reduction/test_counter_intuitive.py +194 -0
  91. classifier_toolkit-0.2.4/tests/feature_reduction/test_drift.py +257 -0
  92. classifier_toolkit-0.2.4/tests/feature_reduction/test_expert_rules.py +109 -0
  93. classifier_toolkit-0.2.4/tests/feature_reduction/test_low_variance.py +244 -0
  94. classifier_toolkit-0.2.4/tests/feature_reduction/test_predictive_power.py +254 -0
  95. classifier_toolkit-0.2.4/tests/feature_reduction/test_reducer.py +208 -0
  96. classifier_toolkit-0.2.4/tests/feature_reduction/test_smoke.py +33 -0
  97. classifier_toolkit-0.2.4/tests/feature_selection/__init__.py +2 -0
  98. classifier_toolkit-0.2.4/tests/feature_selection/test_bayesian_search.py +140 -0
  99. classifier_toolkit-0.2.4/tests/feature_selection/test_boruta.py +108 -0
  100. classifier_toolkit-0.2.4/tests/feature_selection/test_elastic_net.py +98 -0
  101. classifier_toolkit-0.2.4/tests/feature_selection/test_feature_stability.py +107 -0
  102. classifier_toolkit-0.2.4/tests/feature_selection/test_rfe.py +114 -0
  103. classifier_toolkit-0.2.4/tests/feature_selection/test_rfe_catboost.py +801 -0
  104. classifier_toolkit-0.2.4/tests/feature_selection/test_scoring.py +70 -0
  105. classifier_toolkit-0.2.4/tests/feature_selection/test_sequential_selection.py +87 -0
  106. classifier_toolkit-0.2.4/uv.lock +3350 -0
  107. classifier_toolkit-0.2.2/README.md +0 -69
  108. classifier_toolkit-0.2.2/pyproject.toml +0 -65
  109. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/LICENSE +0 -0
  110. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/eda/__init__.py +0 -0
  111. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/eda/bivariate_analysis.py +0 -0
  112. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/eda/eda_toolkit.py +0 -0
  113. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/eda/feature_engineering.py +0 -0
  114. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/eda/first_glance.py +0 -0
  115. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/eda/univariate_analysis.py +0 -0
  116. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/eda/visualizations.py +0 -0
  117. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/eda/warnings/__init__.py +0 -0
  118. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/eda/warnings/automated_warnings.py +0 -0
  119. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/eda/warnings/default_warnings.py +0 -0
  120. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/feature_selection/__init__.py +0 -0
  121. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/feature_selection/base.py +0 -0
  122. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/feature_selection/embedded_methods/__init__.py +0 -0
  123. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/feature_selection/embedded_methods/elastic_net.py +0 -0
  124. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/feature_selection/feature_stability.py +0 -0
  125. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/feature_selection/meta_selector.py +0 -0
  126. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/feature_selection/utils/__init__.py +0 -0
  127. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/feature_selection/utils/data_handling.py +0 -0
  128. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/feature_selection/utils/plottings.py +0 -0
  129. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/feature_selection/utils/scoring.py +0 -0
  130. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/feature_selection/wrapper_methods/__init__.py +0 -0
  131. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/feature_selection/wrapper_methods/bayesian_search.py +0 -0
  132. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/feature_selection/wrapper_methods/boruta.py +0 -0
  133. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/feature_selection/wrapper_methods/rfe.py +0 -0
  134. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/feature_selection/wrapper_methods/rfe_catboost.py +0 -0
  135. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/feature_selection/wrapper_methods/sequential_selection.py +0 -0
  136. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/model_training/__init__.py +0 -0
  137. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/model_training/hyper_parameter_tuning/__init__.py +0 -0
  138. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/model_training/hyper_parameter_tuning/tuner.py +0 -0
  139. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/model_training/models/__init__.py +0 -0
  140. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/model_training/models/base.py +0 -0
  141. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/model_training/models/ensemble_methods.py +0 -0
  142. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/classifier_toolkit/model_training/utils/__init__.py +0 -0
  143. {classifier_toolkit-0.2.2 → classifier_toolkit-0.2.4}/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,134 @@
1
+ name: Checks
2
+
3
+ on:
4
+ workflow_call:
5
+ secrets:
6
+ NEXUS_READER_PASSWORD:
7
+ required: true
8
+ inputs:
9
+ python_version:
10
+ required: false
11
+ type: string
12
+ default: "3.12.6"
13
+
14
+ env:
15
+ UV_INDEX_URL: "https://${{ vars.NEXUS_READER_USERNAME }}:${{ secrets.NEXUS_READER_PASSWORD }}@package-registry.tooling-production.qonto.co/repository/pypi-proxies/simple"
16
+
17
+ jobs:
18
+ dependencies:
19
+ runs-on: default
20
+ steps:
21
+ - uses: actions/checkout@v6
22
+
23
+ - name: Set up Python
24
+ uses: actions/setup-python@v4
25
+ with:
26
+ python-version: ${{ inputs.python_version }}
27
+
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
+ - name: Configure Git
34
+ run: |
35
+ git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
36
+ env:
37
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38
+
39
+ - name: Install uv
40
+ run: |
41
+ curl -LsSf https://astral.sh/uv/install.sh | sh
42
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
43
+
44
+ - name: Cache uv
45
+ uses: actions/cache@v5
46
+ with:
47
+ path: |
48
+ ~/.cache/uv
49
+ .venv
50
+ key: ${{ runner.os }}-uv-${{ github.ref_name }}-${{ hashFiles('**/pyproject.toml', '**/uv.lock') }}
51
+ restore-keys: |
52
+ ${{ runner.os }}-uv-${{ github.ref_name }}-
53
+
54
+ - name: Install dependencies
55
+ run: uv sync --group test --extra liveplotting
56
+ env:
57
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58
+
59
+ lint:
60
+ needs: dependencies
61
+ runs-on: default
62
+ steps:
63
+ - uses: actions/checkout@v6
64
+
65
+ - name: Set up Python
66
+ uses: actions/setup-python@v4
67
+ with:
68
+ python-version: ${{ inputs.python_version }}
69
+
70
+ - name: Install uv
71
+ run: |
72
+ curl -LsSf https://astral.sh/uv/install.sh | sh
73
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
74
+
75
+ - name: Install system dependencies
76
+ run: |
77
+ sudo apt-get update
78
+ sudo apt-get install -y build-essential gcc g++ make
79
+
80
+ - name: Restore cache
81
+ uses: actions/cache@v5
82
+ with:
83
+ path: |
84
+ ~/.cache/uv
85
+ .venv
86
+ key: ${{ runner.os }}-uv-${{ github.ref_name }}-${{ hashFiles('**/pyproject.toml', '**/uv.lock') }}
87
+
88
+ - name: Install dependencies
89
+ run: uv sync --group lint
90
+
91
+ - name: Run linting
92
+ run: uv run make lint
93
+
94
+ test:
95
+ needs: dependencies
96
+ runs-on: default
97
+ strategy:
98
+ fail-fast: false
99
+ matrix:
100
+ test-group: [eda, feature_selection, feature_reduction]
101
+ steps:
102
+ - uses: actions/checkout@v6
103
+
104
+ - name: Set up Python
105
+ uses: actions/setup-python@v4
106
+ with:
107
+ python-version: ${{ inputs.python_version }}
108
+
109
+ - name: Install system dependencies
110
+ run: |
111
+ sudo apt-get update
112
+ sudo apt-get install -y build-essential gcc g++ make
113
+
114
+ - name: Install uv
115
+ run: |
116
+ curl -LsSf https://astral.sh/uv/install.sh | sh
117
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
118
+
119
+ - name: Restore cache
120
+ uses: actions/cache@v5
121
+ with:
122
+ path: |
123
+ ~/.cache/uv
124
+ .venv
125
+ .pytest_cache
126
+ key: ${{ runner.os }}-uv-${{ github.ref_name }}-${{ hashFiles('**/pyproject.toml', '**/uv.lock') }}
127
+ restore-keys: |
128
+ ${{ runner.os }}-uv-${{ github.ref_name }}-
129
+
130
+ - name: Install dependencies
131
+ run: uv sync --group test --extra exp --extra liveplotting
132
+
133
+ - name: Run tests (${{ matrix.test-group }})
134
+ run: uv run pytest tests/${{ matrix.test-group }}/ -v --lf --ff
@@ -0,0 +1,48 @@
1
+ name: Master
2
+ run-name: "${{ github.actor }} - Merge to Master"
3
+
4
+ on:
5
+ push:
6
+ branches:
7
+ - master
8
+
9
+ jobs:
10
+ run-checks:
11
+ name: Checks
12
+ uses: ./.github/workflows/checks.yaml
13
+ secrets:
14
+ NEXUS_READER_PASSWORD: ${{ secrets.NEXUS_READER_PASSWORD }}
15
+
16
+ build-and-publish:
17
+ needs: run-checks
18
+ runs-on: default
19
+ permissions:
20
+ contents: write
21
+ steps:
22
+ - uses: actions/checkout@v6
23
+
24
+ - name: Set up Python
25
+ uses: actions/setup-python@v4
26
+ with:
27
+ python-version: "3.12.6"
28
+
29
+ - name: Install system dependencies
30
+ run: |
31
+ sudo apt-get update
32
+ sudo apt-get install -y build-essential gcc g++ make
33
+
34
+ - name: Install uv
35
+ run: |
36
+ curl -LsSf https://astral.sh/uv/install.sh | sh
37
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
38
+
39
+ - name: Install dependencies
40
+ run: uv sync
41
+ env:
42
+ UV_INDEX_URL: "https://${{ vars.NEXUS_READER_USERNAME }}:${{ secrets.NEXUS_READER_PASSWORD }}@package-registry.tooling-production.qonto.co/repository/pypi-proxies/simple"
43
+
44
+ - name: Build package
45
+ run: uv build
46
+
47
+ - name: Publish to PyPI
48
+ run: uv publish --token ${{ secrets.PYPI_TOKEN }}
@@ -0,0 +1,14 @@
1
+ name: Working Branch
2
+ run-name: "${{ github.ref_name }} - Working Branch"
3
+
4
+ on:
5
+ push:
6
+ branches-ignore:
7
+ - master
8
+
9
+ jobs:
10
+ run-checks:
11
+ name: Checks
12
+ uses: ./.github/workflows/checks.yaml
13
+ secrets:
14
+ NEXUS_READER_PASSWORD: ${{ secrets.NEXUS_READER_PASSWORD }}
@@ -0,0 +1,180 @@
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
+ *.ipynb
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ #Pipfile.lock
97
+
98
+ # poetry
99
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
100
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
101
+ # commonly ignored for libraries.
102
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
103
+ #poetry.lock
104
+
105
+ # pdm
106
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
107
+ #pdm.lock
108
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
109
+ # in version control.
110
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
111
+ .pdm.toml
112
+ .pdm-python
113
+ .pdm-build/
114
+
115
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
116
+ __pypackages__/
117
+
118
+ # Celery stuff
119
+ celerybeat-schedule
120
+ celerybeat.pid
121
+
122
+ # SageMath parsed files
123
+ *.sage.py
124
+
125
+ # Environments
126
+ .env
127
+ .venv
128
+ env/
129
+ venv/
130
+ ENV/
131
+ env.bak/
132
+ venv.bak/
133
+
134
+ # Spyder project settings
135
+ .spyderproject
136
+ .spyproject
137
+
138
+ # Rope project settings
139
+ .ropeproject
140
+
141
+ # mkdocs documentation
142
+ /site
143
+
144
+ # mypy
145
+ .mypy_cache/
146
+ .dmypy.json
147
+ dmypy.json
148
+
149
+ # Pyre type checker
150
+ .pyre/
151
+
152
+ # pytype static type analyzer
153
+ .pytype/
154
+
155
+ # Cython debug symbols
156
+ cython_debug/
157
+
158
+ # PyCharm
159
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
160
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
161
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
162
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
163
+ #.idea/
164
+
165
+ # VS Code
166
+ .vscode/
167
+
168
+ # Mac OS
169
+ .DS_Store
170
+
171
+ # Output files
172
+ *.parquet
173
+ *.csv
174
+ /**/output/*
175
+
176
+ # Catboost files
177
+ catboost_info/
178
+
179
+ # Gitkeep
180
+ !/**/.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.4
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.