rfgboost 0.1.0__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.
- rfgboost-0.1.0/.github/workflows/ci.yml +117 -0
- rfgboost-0.1.0/.github/workflows/compatibility.yml +71 -0
- rfgboost-0.1.0/.github/workflows/pypi-release.yml +196 -0
- rfgboost-0.1.0/.github/workflows/testpypi-release.yml +153 -0
- rfgboost-0.1.0/.github/workflows/typecheck.yml +47 -0
- rfgboost-0.1.0/.gitignore +22 -0
- rfgboost-0.1.0/CHANGELOG.md +24 -0
- rfgboost-0.1.0/Cargo.lock +450 -0
- rfgboost-0.1.0/Cargo.toml +17 -0
- rfgboost-0.1.0/LICENSE +21 -0
- rfgboost-0.1.0/PKG-INFO +103 -0
- rfgboost-0.1.0/README.md +65 -0
- rfgboost-0.1.0/pyproject.toml +150 -0
- rfgboost-0.1.0/rfgboost/__init__.py +20 -0
- rfgboost-0.1.0/rfgboost/_woe.py +416 -0
- rfgboost-0.1.0/src/boosting.rs +1052 -0
- rfgboost-0.1.0/src/decision_tree.rs +170 -0
- rfgboost-0.1.0/src/histogram.rs +72 -0
- rfgboost-0.1.0/src/lib.rs +29 -0
- rfgboost-0.1.0/src/random_forest.rs +253 -0
- rfgboost-0.1.0/src/tree.rs +642 -0
- rfgboost-0.1.0/src/tree_shap.rs +165 -0
- rfgboost-0.1.0/src/unsupervised.rs +650 -0
- rfgboost-0.1.0/tests/test_decision_tree.py +82 -0
- rfgboost-0.1.0/tests/test_multiclass_cat.py +87 -0
- rfgboost-0.1.0/tests/test_random_forest.py +76 -0
- rfgboost-0.1.0/tests/test_rfgboost.py +225 -0
- rfgboost-0.1.0/tests/test_sample_weight.py +261 -0
- rfgboost-0.1.0/tests/test_to_dict.py +211 -0
- rfgboost-0.1.0/tests/test_tree_shap.py +108 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main, develop ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
20
|
+
uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: ${{ matrix.python-version }}
|
|
23
|
+
|
|
24
|
+
- name: Install uv
|
|
25
|
+
uses: astral-sh/setup-uv@v8.1.0
|
|
26
|
+
with:
|
|
27
|
+
version: "latest"
|
|
28
|
+
|
|
29
|
+
- name: Cache uv
|
|
30
|
+
uses: actions/cache@v4
|
|
31
|
+
with:
|
|
32
|
+
path: ~/.cache/uv
|
|
33
|
+
key: ${{ runner.os }}-uv-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml', '**/uv.lock') }}
|
|
34
|
+
restore-keys: |
|
|
35
|
+
${{ runner.os }}-uv-${{ matrix.python-version }}-
|
|
36
|
+
${{ runner.os }}-uv-
|
|
37
|
+
|
|
38
|
+
- name: Cache cargo
|
|
39
|
+
uses: actions/cache@v4
|
|
40
|
+
with:
|
|
41
|
+
path: |
|
|
42
|
+
~/.cargo/registry
|
|
43
|
+
~/.cargo/git
|
|
44
|
+
target
|
|
45
|
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml', '**/Cargo.lock') }}
|
|
46
|
+
restore-keys: |
|
|
47
|
+
${{ runner.os }}-cargo-
|
|
48
|
+
|
|
49
|
+
- name: Install dependencies
|
|
50
|
+
run: uv sync --dev
|
|
51
|
+
|
|
52
|
+
- name: Run tests
|
|
53
|
+
run: uv run python -m pytest tests/ -v --tb=short
|
|
54
|
+
|
|
55
|
+
- name: Cleanup test artifacts
|
|
56
|
+
if: always()
|
|
57
|
+
run: |
|
|
58
|
+
rm -rf .pytest_cache/
|
|
59
|
+
rm -rf .venv/
|
|
60
|
+
rm -rf __pycache__/
|
|
61
|
+
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
|
|
62
|
+
|
|
63
|
+
lint:
|
|
64
|
+
runs-on: ubuntu-latest
|
|
65
|
+
steps:
|
|
66
|
+
- uses: actions/checkout@v4
|
|
67
|
+
|
|
68
|
+
- name: Set up Python
|
|
69
|
+
uses: actions/setup-python@v5
|
|
70
|
+
with:
|
|
71
|
+
python-version: '3.11'
|
|
72
|
+
|
|
73
|
+
- name: Install uv
|
|
74
|
+
uses: astral-sh/setup-uv@v8.1.0
|
|
75
|
+
with:
|
|
76
|
+
version: "latest"
|
|
77
|
+
|
|
78
|
+
- name: Install dependencies
|
|
79
|
+
run: uv sync --dev
|
|
80
|
+
|
|
81
|
+
- name: Run ruff
|
|
82
|
+
run: uv run ruff check rfgboost/ tests/
|
|
83
|
+
|
|
84
|
+
- name: Run ruff format check
|
|
85
|
+
run: uv run ruff format --check rfgboost/ tests/
|
|
86
|
+
|
|
87
|
+
type-check:
|
|
88
|
+
runs-on: ubuntu-latest
|
|
89
|
+
steps:
|
|
90
|
+
- uses: actions/checkout@v4
|
|
91
|
+
|
|
92
|
+
- name: Set up Python
|
|
93
|
+
uses: actions/setup-python@v5
|
|
94
|
+
with:
|
|
95
|
+
python-version: '3.11'
|
|
96
|
+
|
|
97
|
+
- name: Install uv
|
|
98
|
+
uses: astral-sh/setup-uv@v8.1.0
|
|
99
|
+
with:
|
|
100
|
+
version: "latest"
|
|
101
|
+
|
|
102
|
+
- name: Cache cargo
|
|
103
|
+
uses: actions/cache@v4
|
|
104
|
+
with:
|
|
105
|
+
path: |
|
|
106
|
+
~/.cargo/registry
|
|
107
|
+
~/.cargo/git
|
|
108
|
+
target
|
|
109
|
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml', '**/Cargo.lock') }}
|
|
110
|
+
restore-keys: |
|
|
111
|
+
${{ runner.os }}-cargo-
|
|
112
|
+
|
|
113
|
+
- name: Install dependencies
|
|
114
|
+
run: uv sync --dev
|
|
115
|
+
|
|
116
|
+
- name: Run mypy
|
|
117
|
+
run: uv run mypy rfgboost/
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
name: Python Version Compatibility
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main, develop ]
|
|
8
|
+
# schedule:
|
|
9
|
+
# # Run weekly on Sundays (disabled to save GitHub Actions minutes)
|
|
10
|
+
# - cron: '0 0 * * 0'
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
compatibility-test:
|
|
14
|
+
runs-on: ${{ matrix.os }}
|
|
15
|
+
strategy:
|
|
16
|
+
fail-fast: false
|
|
17
|
+
matrix:
|
|
18
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
19
|
+
python-version: ['3.9', '3.12', '3.13']
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
|
|
24
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
25
|
+
uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: ${{ matrix.python-version }}
|
|
28
|
+
|
|
29
|
+
- name: Install uv
|
|
30
|
+
uses: astral-sh/setup-uv@v8.1.0
|
|
31
|
+
with:
|
|
32
|
+
version: "latest"
|
|
33
|
+
|
|
34
|
+
- name: Cache uv dependencies
|
|
35
|
+
uses: actions/cache@v4
|
|
36
|
+
with:
|
|
37
|
+
path: ~/.cache/uv
|
|
38
|
+
key: ${{ runner.os }}-uv-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml', '**/uv.lock') }}
|
|
39
|
+
restore-keys: |
|
|
40
|
+
${{ runner.os }}-uv-${{ matrix.python-version }}-
|
|
41
|
+
${{ runner.os }}-uv-
|
|
42
|
+
|
|
43
|
+
- name: Cache cargo
|
|
44
|
+
uses: actions/cache@v4
|
|
45
|
+
with:
|
|
46
|
+
path: |
|
|
47
|
+
~/.cargo/registry
|
|
48
|
+
~/.cargo/git
|
|
49
|
+
target
|
|
50
|
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml', '**/Cargo.lock') }}
|
|
51
|
+
restore-keys: |
|
|
52
|
+
${{ runner.os }}-cargo-
|
|
53
|
+
|
|
54
|
+
- name: Install dependencies
|
|
55
|
+
run: uv sync --dev
|
|
56
|
+
|
|
57
|
+
- name: Verify installation
|
|
58
|
+
run: |
|
|
59
|
+
uv run python -c "import rfgboost; print('rfgboost imported successfully')"
|
|
60
|
+
|
|
61
|
+
- name: Run test suite
|
|
62
|
+
run: uv run python -m pytest tests/ -v --tb=short
|
|
63
|
+
|
|
64
|
+
- name: Cleanup test artifacts
|
|
65
|
+
if: always()
|
|
66
|
+
shell: bash
|
|
67
|
+
run: |
|
|
68
|
+
rm -rf .pytest_cache/
|
|
69
|
+
rm -rf .venv/
|
|
70
|
+
rm -rf __pycache__/
|
|
71
|
+
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v[0-9]+.[0-9]+.[0-9]+'
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
inputs:
|
|
9
|
+
version:
|
|
10
|
+
description: 'Version to release (e.g., 0.1.0)'
|
|
11
|
+
required: true
|
|
12
|
+
type: string
|
|
13
|
+
|
|
14
|
+
permissions:
|
|
15
|
+
contents: read
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
test:
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- name: Set up Python
|
|
24
|
+
uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: '3.11'
|
|
27
|
+
|
|
28
|
+
- name: Install uv
|
|
29
|
+
uses: astral-sh/setup-uv@v8.1.0
|
|
30
|
+
with:
|
|
31
|
+
version: "latest"
|
|
32
|
+
|
|
33
|
+
- name: Install dependencies
|
|
34
|
+
run: uv sync --dev
|
|
35
|
+
|
|
36
|
+
- name: Run tests
|
|
37
|
+
run: uv run python -m pytest tests/ -v
|
|
38
|
+
|
|
39
|
+
linux:
|
|
40
|
+
needs: test
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
strategy:
|
|
43
|
+
matrix:
|
|
44
|
+
target: [x86_64, aarch64]
|
|
45
|
+
steps:
|
|
46
|
+
- uses: actions/checkout@v4
|
|
47
|
+
|
|
48
|
+
- uses: actions/setup-python@v5
|
|
49
|
+
with:
|
|
50
|
+
python-version: '3.11'
|
|
51
|
+
|
|
52
|
+
- name: Build wheels
|
|
53
|
+
uses: PyO3/maturin-action@v1
|
|
54
|
+
with:
|
|
55
|
+
target: ${{ matrix.target }}
|
|
56
|
+
args: --release --out dist --find-interpreter
|
|
57
|
+
sccache: 'true'
|
|
58
|
+
manylinux: auto
|
|
59
|
+
|
|
60
|
+
- name: Upload wheels
|
|
61
|
+
uses: actions/upload-artifact@v4
|
|
62
|
+
with:
|
|
63
|
+
name: wheels-linux-${{ matrix.target }}
|
|
64
|
+
path: dist
|
|
65
|
+
|
|
66
|
+
macos:
|
|
67
|
+
needs: test
|
|
68
|
+
runs-on: macos-latest
|
|
69
|
+
strategy:
|
|
70
|
+
matrix:
|
|
71
|
+
target: [x86_64, aarch64]
|
|
72
|
+
steps:
|
|
73
|
+
- uses: actions/checkout@v4
|
|
74
|
+
|
|
75
|
+
- uses: actions/setup-python@v5
|
|
76
|
+
with:
|
|
77
|
+
python-version: '3.11'
|
|
78
|
+
|
|
79
|
+
- name: Build wheels
|
|
80
|
+
uses: PyO3/maturin-action@v1
|
|
81
|
+
with:
|
|
82
|
+
target: ${{ matrix.target }}
|
|
83
|
+
args: --release --out dist --find-interpreter
|
|
84
|
+
sccache: 'true'
|
|
85
|
+
|
|
86
|
+
- name: Upload wheels
|
|
87
|
+
uses: actions/upload-artifact@v4
|
|
88
|
+
with:
|
|
89
|
+
name: wheels-macos-${{ matrix.target }}
|
|
90
|
+
path: dist
|
|
91
|
+
|
|
92
|
+
windows:
|
|
93
|
+
needs: test
|
|
94
|
+
runs-on: windows-latest
|
|
95
|
+
strategy:
|
|
96
|
+
matrix:
|
|
97
|
+
target: [x64]
|
|
98
|
+
steps:
|
|
99
|
+
- uses: actions/checkout@v4
|
|
100
|
+
|
|
101
|
+
- uses: actions/setup-python@v5
|
|
102
|
+
with:
|
|
103
|
+
python-version: '3.11'
|
|
104
|
+
architecture: ${{ matrix.target }}
|
|
105
|
+
|
|
106
|
+
- name: Build wheels
|
|
107
|
+
uses: PyO3/maturin-action@v1
|
|
108
|
+
with:
|
|
109
|
+
target: ${{ matrix.target }}
|
|
110
|
+
args: --release --out dist --find-interpreter
|
|
111
|
+
sccache: 'true'
|
|
112
|
+
|
|
113
|
+
- name: Upload wheels
|
|
114
|
+
uses: actions/upload-artifact@v4
|
|
115
|
+
with:
|
|
116
|
+
name: wheels-windows-${{ matrix.target }}
|
|
117
|
+
path: dist
|
|
118
|
+
|
|
119
|
+
sdist:
|
|
120
|
+
needs: test
|
|
121
|
+
runs-on: ubuntu-latest
|
|
122
|
+
steps:
|
|
123
|
+
- uses: actions/checkout@v4
|
|
124
|
+
|
|
125
|
+
- name: Build sdist
|
|
126
|
+
uses: PyO3/maturin-action@v1
|
|
127
|
+
with:
|
|
128
|
+
command: sdist
|
|
129
|
+
args: --out dist
|
|
130
|
+
|
|
131
|
+
- name: Upload sdist
|
|
132
|
+
uses: actions/upload-artifact@v4
|
|
133
|
+
with:
|
|
134
|
+
name: wheels-sdist
|
|
135
|
+
path: dist
|
|
136
|
+
|
|
137
|
+
publish:
|
|
138
|
+
name: Publish to PyPI
|
|
139
|
+
needs: [linux, macos, windows, sdist]
|
|
140
|
+
runs-on: ubuntu-latest
|
|
141
|
+
steps:
|
|
142
|
+
- name: Download all artifacts
|
|
143
|
+
uses: actions/download-artifact@v4
|
|
144
|
+
with:
|
|
145
|
+
path: dist
|
|
146
|
+
pattern: wheels-*
|
|
147
|
+
merge-multiple: true
|
|
148
|
+
|
|
149
|
+
- name: Publish to PyPI
|
|
150
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
151
|
+
with:
|
|
152
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
153
|
+
|
|
154
|
+
create-release:
|
|
155
|
+
needs: publish
|
|
156
|
+
runs-on: ubuntu-latest
|
|
157
|
+
permissions:
|
|
158
|
+
contents: write
|
|
159
|
+
steps:
|
|
160
|
+
- uses: actions/checkout@v4
|
|
161
|
+
with:
|
|
162
|
+
fetch-depth: 0
|
|
163
|
+
|
|
164
|
+
- name: Extract version from tag
|
|
165
|
+
id: get_version
|
|
166
|
+
run: |
|
|
167
|
+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
|
168
|
+
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
|
|
169
|
+
echo "tag=v${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
|
|
170
|
+
else
|
|
171
|
+
echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
|
|
172
|
+
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
|
173
|
+
fi
|
|
174
|
+
|
|
175
|
+
- name: Create GitHub Release
|
|
176
|
+
uses: ncipollo/release-action@v1
|
|
177
|
+
with:
|
|
178
|
+
tag: ${{ steps.get_version.outputs.tag }}
|
|
179
|
+
name: Release ${{ steps.get_version.outputs.tag }}
|
|
180
|
+
body: |
|
|
181
|
+
## Changes
|
|
182
|
+
|
|
183
|
+
See [CHANGELOG.md](https://github.com/xRiskLab/rfgboost/blob/main/CHANGELOG.md) for detailed changes.
|
|
184
|
+
|
|
185
|
+
## Installation
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
pip install rfgboost==${{ steps.get_version.outputs.version }}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## What's New in v${{ steps.get_version.outputs.version }}
|
|
192
|
+
|
|
193
|
+
Check the [CHANGELOG](https://github.com/xRiskLab/rfgboost/blob/main/CHANGELOG.md#version-${{ steps.get_version.outputs.version }}) for full details.
|
|
194
|
+
draft: false
|
|
195
|
+
prerelease: false
|
|
196
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
name: Test Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- '*-test' # Tags ending with -test (e.g., v0.1.0-test)
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
inputs:
|
|
9
|
+
version:
|
|
10
|
+
description: 'Version to release to TestPyPI (e.g., 0.1.0)'
|
|
11
|
+
required: true
|
|
12
|
+
type: string
|
|
13
|
+
|
|
14
|
+
permissions:
|
|
15
|
+
contents: read
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
test:
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- name: Set up Python
|
|
24
|
+
uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: '3.11'
|
|
27
|
+
|
|
28
|
+
- name: Install uv
|
|
29
|
+
uses: astral-sh/setup-uv@v8.1.0
|
|
30
|
+
with:
|
|
31
|
+
version: "latest"
|
|
32
|
+
|
|
33
|
+
- name: Install dependencies
|
|
34
|
+
run: uv sync --dev
|
|
35
|
+
|
|
36
|
+
- name: Run tests
|
|
37
|
+
run: uv run python -m pytest tests/ -v
|
|
38
|
+
|
|
39
|
+
linux:
|
|
40
|
+
needs: test
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
strategy:
|
|
43
|
+
matrix:
|
|
44
|
+
target: [x86_64, aarch64]
|
|
45
|
+
steps:
|
|
46
|
+
- uses: actions/checkout@v4
|
|
47
|
+
|
|
48
|
+
- uses: actions/setup-python@v5
|
|
49
|
+
with:
|
|
50
|
+
python-version: '3.11'
|
|
51
|
+
|
|
52
|
+
- name: Build wheels
|
|
53
|
+
uses: PyO3/maturin-action@v1
|
|
54
|
+
with:
|
|
55
|
+
target: ${{ matrix.target }}
|
|
56
|
+
args: --release --out dist --find-interpreter
|
|
57
|
+
sccache: 'true'
|
|
58
|
+
manylinux: auto
|
|
59
|
+
|
|
60
|
+
- name: Upload wheels
|
|
61
|
+
uses: actions/upload-artifact@v4
|
|
62
|
+
with:
|
|
63
|
+
name: wheels-linux-${{ matrix.target }}
|
|
64
|
+
path: dist
|
|
65
|
+
|
|
66
|
+
macos:
|
|
67
|
+
needs: test
|
|
68
|
+
runs-on: macos-latest
|
|
69
|
+
strategy:
|
|
70
|
+
matrix:
|
|
71
|
+
target: [x86_64, aarch64]
|
|
72
|
+
steps:
|
|
73
|
+
- uses: actions/checkout@v4
|
|
74
|
+
|
|
75
|
+
- uses: actions/setup-python@v5
|
|
76
|
+
with:
|
|
77
|
+
python-version: '3.11'
|
|
78
|
+
|
|
79
|
+
- name: Build wheels
|
|
80
|
+
uses: PyO3/maturin-action@v1
|
|
81
|
+
with:
|
|
82
|
+
target: ${{ matrix.target }}
|
|
83
|
+
args: --release --out dist --find-interpreter
|
|
84
|
+
sccache: 'true'
|
|
85
|
+
|
|
86
|
+
- name: Upload wheels
|
|
87
|
+
uses: actions/upload-artifact@v4
|
|
88
|
+
with:
|
|
89
|
+
name: wheels-macos-${{ matrix.target }}
|
|
90
|
+
path: dist
|
|
91
|
+
|
|
92
|
+
windows:
|
|
93
|
+
needs: test
|
|
94
|
+
runs-on: windows-latest
|
|
95
|
+
strategy:
|
|
96
|
+
matrix:
|
|
97
|
+
target: [x64]
|
|
98
|
+
steps:
|
|
99
|
+
- uses: actions/checkout@v4
|
|
100
|
+
|
|
101
|
+
- uses: actions/setup-python@v5
|
|
102
|
+
with:
|
|
103
|
+
python-version: '3.11'
|
|
104
|
+
architecture: ${{ matrix.target }}
|
|
105
|
+
|
|
106
|
+
- name: Build wheels
|
|
107
|
+
uses: PyO3/maturin-action@v1
|
|
108
|
+
with:
|
|
109
|
+
target: ${{ matrix.target }}
|
|
110
|
+
args: --release --out dist --find-interpreter
|
|
111
|
+
sccache: 'true'
|
|
112
|
+
|
|
113
|
+
- name: Upload wheels
|
|
114
|
+
uses: actions/upload-artifact@v4
|
|
115
|
+
with:
|
|
116
|
+
name: wheels-windows-${{ matrix.target }}
|
|
117
|
+
path: dist
|
|
118
|
+
|
|
119
|
+
sdist:
|
|
120
|
+
needs: test
|
|
121
|
+
runs-on: ubuntu-latest
|
|
122
|
+
steps:
|
|
123
|
+
- uses: actions/checkout@v4
|
|
124
|
+
|
|
125
|
+
- name: Build sdist
|
|
126
|
+
uses: PyO3/maturin-action@v1
|
|
127
|
+
with:
|
|
128
|
+
command: sdist
|
|
129
|
+
args: --out dist
|
|
130
|
+
|
|
131
|
+
- name: Upload sdist
|
|
132
|
+
uses: actions/upload-artifact@v4
|
|
133
|
+
with:
|
|
134
|
+
name: wheels-sdist
|
|
135
|
+
path: dist
|
|
136
|
+
|
|
137
|
+
publish:
|
|
138
|
+
name: Publish to TestPyPI
|
|
139
|
+
needs: [linux, macos, windows, sdist]
|
|
140
|
+
runs-on: ubuntu-latest
|
|
141
|
+
steps:
|
|
142
|
+
- name: Download all artifacts
|
|
143
|
+
uses: actions/download-artifact@v4
|
|
144
|
+
with:
|
|
145
|
+
path: dist
|
|
146
|
+
pattern: wheels-*
|
|
147
|
+
merge-multiple: true
|
|
148
|
+
|
|
149
|
+
- name: Publish to TestPyPI
|
|
150
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
151
|
+
with:
|
|
152
|
+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
|
153
|
+
repository-url: https://test.pypi.org/legacy/
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Type Checking
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main, develop ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
type-check:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.11"]
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Install uv
|
|
20
|
+
uses: astral-sh/setup-uv@v8.1.0
|
|
21
|
+
with:
|
|
22
|
+
version: "latest"
|
|
23
|
+
|
|
24
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
25
|
+
run: uv python install ${{ matrix.python-version }}
|
|
26
|
+
|
|
27
|
+
- name: Cache cargo
|
|
28
|
+
uses: actions/cache@v4
|
|
29
|
+
with:
|
|
30
|
+
path: |
|
|
31
|
+
~/.cargo/registry
|
|
32
|
+
~/.cargo/git
|
|
33
|
+
target
|
|
34
|
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml', '**/Cargo.lock') }}
|
|
35
|
+
restore-keys: |
|
|
36
|
+
${{ runner.os }}-cargo-
|
|
37
|
+
|
|
38
|
+
- name: Install dependencies
|
|
39
|
+
run: uv sync --dev
|
|
40
|
+
|
|
41
|
+
- name: Verify installation
|
|
42
|
+
run: |
|
|
43
|
+
uv run python -c "import rfgboost; print('rfgboost installed')"
|
|
44
|
+
uv run python -c "import mypy; print('mypy installed')"
|
|
45
|
+
|
|
46
|
+
- name: Run mypy
|
|
47
|
+
run: uv run mypy rfgboost/
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
target/
|
|
2
|
+
.venv/
|
|
3
|
+
__pycache__/
|
|
4
|
+
*.pyc
|
|
5
|
+
*.so
|
|
6
|
+
*.dylib
|
|
7
|
+
*.egg-info/
|
|
8
|
+
dist/
|
|
9
|
+
build/
|
|
10
|
+
.pytest_cache/
|
|
11
|
+
.mypy_cache/
|
|
12
|
+
.ruff_cache/
|
|
13
|
+
.mypy_cache/
|
|
14
|
+
catboost_info/
|
|
15
|
+
outputs/
|
|
16
|
+
.DS_Store
|
|
17
|
+
.idea/
|
|
18
|
+
.vscode/
|
|
19
|
+
.env
|
|
20
|
+
tmp/
|
|
21
|
+
uv.lock
|
|
22
|
+
.python-version
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to rfgboost will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.1.0] - 2026-04-20
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- Initial public release.
|
|
14
|
+
- `RFGBoostClassifier` and `RFGBoostRegressor`: gradient boosting with random forest base learners (binary, multiclass, regression).
|
|
15
|
+
- `RandomForestClassifier`, `RandomForestRegressor`, `RandomForestUnsupervised`: standalone Rust random forests.
|
|
16
|
+
- `DecisionTree`: single-tree implementation matching sklearn splits.
|
|
17
|
+
- `TreeSHAP`: exact tree-path-dependent SHAP values matching the official `shap` package.
|
|
18
|
+
- Async tree building with Rayon work-stealing and CI-based convergence (Wilson/normal intervals, `tol=0` auto-stop).
|
|
19
|
+
- 256-bin histogram splitting for O(n + bins) split search.
|
|
20
|
+
- Split conformal prediction intervals for regression.
|
|
21
|
+
- Categorical feature support via WOE encoding (`fastwoe-rs`).
|
|
22
|
+
|
|
23
|
+
[Unreleased]: https://github.com/xRiskLab/rfgboost/compare/v0.1.0...HEAD
|
|
24
|
+
[0.1.0]: https://github.com/xRiskLab/rfgboost/releases/tag/v0.1.0
|