Skip to content

Commit eb946d4

Browse files
authored
[ENH] Cython axis-aligned multi-view splitter (neurodata#129)
* Cython multiview --------- Signed-off-by: Adam Li <[email protected]>
1 parent ccacf7b commit eb946d4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2031
-257
lines changed

.github/workflows/build_wheels.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ concurrency:
1919
cancel-in-progress: true
2020

2121
jobs:
22+
create_artifacts_folder:
23+
name: Create Artifacts Folder
24+
runs-on: ubuntu-latest
25+
outputs:
26+
artifacts_folder: ${{ steps.set_folder.outputs.folder_name }}
27+
28+
steps:
29+
- name: Set Artifacts Folder
30+
id: set_folder
31+
run: echo "folder_name=artifacts/${{ github.run_id }}" >> $GITHUB_ENV
32+
2233
build_wheels:
2334
name: Build wheels on ${{ matrix.os[1] }} - ${{ matrix.os[2] }} with Python ${{ matrix.python[0] }}
2435
runs-on: ${{ matrix.os[0] }}

.github/workflows/main.yml

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -249,52 +249,6 @@ jobs:
249249
name: sktree-build
250250
path: $PWD/build
251251

252-
# release is ran when a release is made on Github
253-
release:
254-
name: Release
255-
runs-on: ubuntu-latest
256-
needs: [build_and_test_slow]
257-
if: startsWith(github.ref, 'refs/tags/')
258-
steps:
259-
- name: Checkout repository
260-
uses: actions/checkout@v4
261-
- name: Setup Python ${{ matrix.python-version }}
262-
uses: actions/[email protected]
263-
with:
264-
python-version: 3.9
265-
architecture: "x64"
266-
- name: Install dependencies
267-
run: |
268-
python -m pip install --progress-bar off --upgrade pip setuptools wheel
269-
python -m pip install --progress-bar off build twine
270-
- name: Prepare environment
271-
run: |
272-
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
273-
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
274-
- name: Download package distribution files
275-
uses: actions/download-artifact@v3
276-
with:
277-
name: package
278-
path: dist
279-
# TODO: refactor scripts to generate release notes from `whats_new.rst` file instead
280-
# - name: Generate release notes
281-
# run: |
282-
# python scripts/release_notes.py > ${{ github.workspace }}-RELEASE_NOTES.md
283-
- name: Publish package to PyPI
284-
run: |
285-
twine upload -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} dist/*
286-
- name: Publish GitHub release
287-
uses: softprops/action-gh-release@v1
288-
env:
289-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
290-
with:
291-
# body_path: ${{ github.workspace }}-RELEASE_NOTES.md
292-
prerelease: ${{ contains(env.TAG, 'rc') }}
293-
files: |
294-
dist/*
295-
296-
297-
298252
# build-windows:
299253
# name: Meson build Windows
300254
# runs-on: windows-2019

.github/workflows/release.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: "Release to PyPI"
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.type }}
5+
cancel-in-progress: true
6+
7+
on:
8+
workflow_run:
9+
workflows: ["build_and_test_slow"]
10+
types:
11+
- completed
12+
workflow_dispatch:
13+
14+
env:
15+
INSTALLDIR: "build-install"
16+
CCACHE_DIR: "${{ github.workspace }}/.ccache"
17+
18+
jobs:
19+
# release is ran when a release is made on Github
20+
release:
21+
name: Release
22+
runs-on: ubuntu-latest
23+
needs: [build_and_test_slow]
24+
if: startsWith(github.ref, 'refs/tags/')
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
- name: Setup Python ${{ matrix.python-version }}
29+
uses: actions/[email protected]
30+
with:
31+
python-version: 3.9
32+
architecture: "x64"
33+
- name: Install dependencies
34+
run: |
35+
python -m pip install --progress-bar off --upgrade pip setuptools wheel
36+
python -m pip install --progress-bar off build twine
37+
- name: Prepare environment
38+
run: |
39+
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
40+
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
41+
- name: Download package distribution files
42+
uses: actions/download-artifact@v3
43+
with:
44+
name: package
45+
path: dist
46+
# TODO: refactor scripts to generate release notes from `whats_new.rst` file instead
47+
# - name: Generate release notes
48+
# run: |
49+
# python scripts/release_notes.py > ${{ github.workspace }}-RELEASE_NOTES.md
50+
- name: Publish package to PyPI
51+
run: |
52+
twine upload -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} dist/*
53+
- name: Publish GitHub release
54+
uses: softprops/action-gh-release@v1
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
with:
58+
# body_path: ${{ github.workspace }}-RELEASE_NOTES.md
59+
prerelease: ${{ contains(env.TAG, 'rc') }}
60+
files: |
61+
dist/*

DEVELOPING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,8 @@ Verify that installations work as expected on your machine.
7676

7777
twine upload dist/*
7878

79+
or if you have two-factor authentication enabled: https://pypi.org/help/#apitoken
80+
81+
twine upload dist/* --repository scikit-tree
82+
7983
4. Update version number on ``meson.build`` and ``_version.py`` to the relevant version.

doc/api.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ how scikit-learn builds trees.
6565
PatchObliqueRandomForestClassifier
6666
PatchObliqueRandomForestRegressor
6767
HonestForestClassifier
68+
MultiViewRandomForestClassifier
6869

6970
.. currentmodule:: sktree.tree
7071
.. autosummary::
@@ -75,6 +76,7 @@ how scikit-learn builds trees.
7576
PatchObliqueDecisionTreeClassifier
7677
PatchObliqueDecisionTreeRegressor
7778
HonestTreeClassifier
79+
MultiViewDecisionTreeClassifier
7880

7981
Unsupervised
8082
------------

doc/whats_new/v0.3.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Changelog
1414
---------
1515
- |Fix| Fixes a bug in consistency of train/test samples when ``random_state`` is not set in FeatureImportanceForestClassifier and FeatureImportanceForestRegressor, by `Adam Li`_ (:pr:`135`)
1616
- |Fix| Fixes a bug where covariate indices were not shuffled by default when running FeatureImportanceForestClassifier and FeatureImportanceForestRegressor test methods, by `Sambit Panda`_ (:pr:`140`)
17+
- |Enhancement| Add multi-view splitter for axis-aligned decision trees, by `Adam Li`_ (:pr:`129`)
1718

1819
Code and Documentation Contributors
1920
-----------------------------------

examples/README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Examples
2-
--------
2+
========
33

44
Examples demonstrating how to use scikit-tree algorithms.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. _hyppo_examples:
2+
3+
Hypothesis testing with decision trees
4+
--------------------------------------
5+
6+
Examples demonstrating how to use decision-trees for statistical hypothesis testing.

0 commit comments

Comments
 (0)