structureboost 0.7.0__tar.gz → 0.8.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.
Files changed (60) hide show
  1. structureboost-0.8.0/MANIFEST.in +2 -0
  2. structureboost-0.8.0/PKG-INFO +80 -0
  3. structureboost-0.7.0/PKG-INFO → structureboost-0.8.0/README.md +26 -23
  4. structureboost-0.8.0/pyproject.toml +74 -0
  5. structureboost-0.8.0/setup.py +42 -0
  6. structureboost-0.8.0/structureboost/__init__.py +18 -0
  7. structureboost-0.8.0/structureboost/coarsage.pyx +844 -0
  8. structureboost-0.8.0/structureboost/graphs.pyx +980 -0
  9. structureboost-0.8.0/structureboost/pdf_conformal.pyx +203 -0
  10. structureboost-0.8.0/structureboost/pdf_discrete.pyx +321 -0
  11. structureboost-0.8.0/structureboost/pdf_group.pyx +233 -0
  12. structureboost-0.8.0/structureboost/pdf_set.pyx +67 -0
  13. structureboost-0.8.0/structureboost/prob_regr_unit.pyx +77 -0
  14. structureboost-0.8.0/structureboost/prob_regressor.pyx +445 -0
  15. structureboost-0.8.0/structureboost/structure_dt.pyx +1207 -0
  16. structureboost-0.8.0/structureboost/structure_dt_multi.pyx +245 -0
  17. structureboost-0.8.0/structureboost/structure_gb.pyx +1352 -0
  18. structureboost-0.8.0/structureboost/structure_gb_multi.pyx +764 -0
  19. structureboost-0.8.0/structureboost/structure_rf.pyx +514 -0
  20. structureboost-0.8.0/structureboost/structure_rfdt.pyx +340 -0
  21. {structureboost-0.7.0 → structureboost-0.8.0}/structureboost/utils.py +4 -2
  22. structureboost-0.8.0/structureboost.egg-info/PKG-INFO +80 -0
  23. structureboost-0.8.0/structureboost.egg-info/SOURCES.txt +36 -0
  24. structureboost-0.8.0/structureboost.egg-info/requires.txt +6 -0
  25. structureboost-0.8.0/structureboost.egg-info/top_level.txt +1 -0
  26. {structureboost-0.7.0/structureboost → structureboost-0.8.0}/tests/test_basics.py +2 -2
  27. {structureboost-0.7.0/structureboost → structureboost-0.8.0}/tests/test_coarsage_1.py +6 -3
  28. {structureboost-0.7.0/structureboost → structureboost-0.8.0}/tests/test_dt.py +1 -1
  29. {structureboost-0.7.0/structureboost → structureboost-0.8.0}/tests/test_gb.py +16 -13
  30. {structureboost-0.7.0/structureboost → structureboost-0.8.0}/tests/test_graphs.py +1 -1
  31. {structureboost-0.7.0/structureboost → structureboost-0.8.0}/tests/test_multi_1.py +5 -2
  32. {structureboost-0.7.0/structureboost → structureboost-0.8.0}/tests/test_predict_options.py +6 -2
  33. {structureboost-0.7.0/structureboost → structureboost-0.8.0}/tests/test_prob_reg_1.py +5 -2
  34. {structureboost-0.7.0/structureboost → structureboost-0.8.0}/tests/test_shap.py +24 -13
  35. structureboost-0.7.0/README.md +0 -23
  36. structureboost-0.7.0/README.rst +0 -6
  37. structureboost-0.7.0/pyproject.toml +0 -30
  38. structureboost-0.7.0/setup.py +0 -44
  39. structureboost-0.7.0/structureboost/__init__.py +0 -19
  40. structureboost-0.7.0/structureboost/coarsage.c +0 -35577
  41. structureboost-0.7.0/structureboost/graphs.c +0 -43877
  42. structureboost-0.7.0/structureboost/pdf_conformal.c +0 -16957
  43. structureboost-0.7.0/structureboost/pdf_discrete.c +0 -25194
  44. structureboost-0.7.0/structureboost/pdf_group.c +0 -22329
  45. structureboost-0.7.0/structureboost/pdf_set.c +0 -12971
  46. structureboost-0.7.0/structureboost/prob_regr_unit.c +0 -10863
  47. structureboost-0.7.0/structureboost/prob_regressor.c +0 -21959
  48. structureboost-0.7.0/structureboost/structure_dt.c +0 -68411
  49. structureboost-0.7.0/structureboost/structure_dt_multi.c +0 -20362
  50. structureboost-0.7.0/structureboost/structure_gb.c +0 -60472
  51. structureboost-0.7.0/structureboost/structure_gb_multi.c +0 -49298
  52. structureboost-0.7.0/structureboost/tests/__init__.py +0 -0
  53. structureboost-0.7.0/structureboost.egg-info/PKG-INFO +0 -46
  54. structureboost-0.7.0/structureboost.egg-info/SOURCES.txt +0 -35
  55. structureboost-0.7.0/structureboost.egg-info/requires.txt +0 -11
  56. structureboost-0.7.0/structureboost.egg-info/top_level.txt +0 -13
  57. {structureboost-0.7.0 → structureboost-0.8.0}/LICENSE +0 -0
  58. {structureboost-0.7.0 → structureboost-0.8.0}/setup.cfg +0 -0
  59. {structureboost-0.7.0 → structureboost-0.8.0}/structureboost.egg-info/dependency_links.txt +0 -0
  60. {structureboost-0.7.0/structureboost → structureboost-0.8.0}/tests/test_pdfgroup1.py +0 -0
@@ -0,0 +1,2 @@
1
+ include structureboost/*.pyx
2
+ exclude structureboost/*.c
@@ -0,0 +1,80 @@
1
+ Metadata-Version: 2.4
2
+ Name: structureboost
3
+ Version: 0.8.0
4
+ Summary: Gradient Boosting and Probabilistic Regression with categorical structure
5
+ Author-email: Brian Lucena <brian@numeristical.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/numeristical/structureboost
8
+ Project-URL: Documentation, https://structureboost.readthedocs.io/
9
+ Project-URL: Source, https://github.com/numeristical/structureboost
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Cython
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: numpy>=1.23.5
25
+ Requires-Dist: pandas>=1.5
26
+ Requires-Dist: scipy>=1.9
27
+ Requires-Dist: matplotlib>=3.5
28
+ Requires-Dist: joblib>=1.0
29
+ Requires-Dist: splinecalib>=0.0.13
30
+ Dynamic: license-file
31
+
32
+ # StructureBoost
33
+
34
+ StructureBoost is a package to do Gradient Boosting in a manner that exploits the **structure** of categorical variables.
35
+
36
+ Have you ever used "US state" as a variable in a prediction problem and thought "Why can't my algorithm use the geography of the states to make better predictions?"
37
+
38
+ Or you've used the month of the year as a predictor, but noticed that January should border December the same way that June borders July. (or hour of the day, or day of the week)
39
+
40
+ StructureBoost can help. Read the documentation and references below. Or dive into some [examples](https://github.com/numeristical/structureboost/tree/master/examples)
41
+
42
+ ## Video Lectures
43
+
44
+ There are some explanatory videos on the [Numeristical Youtube Channel](https://www.youtube.com/channel/UCfsbASar8nsLs4NbhQwuaVg)
45
+
46
+
47
+ ## Documentation
48
+ [Read the Docs](https://structureboost.readthedocs.io/)
49
+
50
+ ## References:
51
+
52
+ Lucena, B. "Exploiting Categorical Structure with Tree-Based Methods. Proceedings of the Twenty Third International Conference on Artificial Intelligence and Statistics, PMLR 108:2949-2958, 2020. [http://proceedings.mlr.press/v108/lucena20a/lucena20a.pdf](http://proceedings.mlr.press/v108/lucena20a/lucena20a.pdf)
53
+
54
+ Lucena, B. "StructureBoost: Efficient Gradient Boosting for Structured Categorical Variables." [https://arxiv.org/abs/2007.04446](https://arxiv.org/abs/2007.04446)
55
+
56
+ ## Development
57
+
58
+ The compiled modules are generated from the Cython sources (`structureboost/*.pyx`) at build time, so a C compiler is needed to build from source.
59
+
60
+ ```bash
61
+ pip install . # build and install
62
+ pytest # run the test suite against the installed package
63
+ python -m build # build an sdist and wheel into dist/
64
+ ```
65
+
66
+ Run `pytest` rather than `python -m pytest`: the latter puts the repository root on the import path, so the uncompiled `structureboost/` source folder would shadow the installed package.
67
+
68
+ ### Releasing
69
+
70
+ Releases are built and published by GitHub Actions (`.github/workflows/release.yml`); nothing is uploaded from a local machine.
71
+
72
+ 1. Update `__version__` in `structureboost/__init__.py` and merge to `master`.
73
+ 2. Tag the merged commit and push the tag:
74
+ ```bash
75
+ git tag v0.8.0
76
+ git push origin v0.8.0
77
+ ```
78
+ 3. The workflow checks that the tag matches `__version__`, builds and tests wheels for Linux, macOS and Windows (Python 3.10–3.14), uploads them to PyPI via trusted publishing, and creates a GitHub Release.
79
+
80
+ To test the wheel builds without publishing, run the `release` workflow by hand from the Actions tab.
@@ -1,26 +1,3 @@
1
- Metadata-Version: 2.4
2
- Name: structureboost
3
- Version: 0.7.0
4
- Summary: Gradient Boosting and Probabilistic Regression with categorical structure
5
- Author-email: Brian Lucena <brian@numeristical.com>
6
- License-Expression: MIT
7
- Classifier: Programming Language :: Python :: 3
8
- Classifier: Operating System :: OS Independent
9
- Requires-Python: >=3.8
10
- Description-Content-Type: text/markdown
11
- License-File: LICENSE
12
- Requires-Dist: pandas>=1.3
13
- Requires-Dist: numpy>=1.23.5
14
- Requires-Dist: scipy>=1.6
15
- Requires-Dist: matplotlib>=1.0
16
- Requires-Dist: joblib>=0.14.1
17
- Requires-Dist: ml_insights>=1.0.5
18
- Provides-Extra: dev
19
- Requires-Dist: Cython>=3.1.0b1; extra == "dev"
20
- Requires-Dist: build; extra == "dev"
21
- Requires-Dist: setuptools; extra == "dev"
22
- Dynamic: license-file
23
-
24
1
  # StructureBoost
25
2
 
26
3
  StructureBoost is a package to do Gradient Boosting in a manner that exploits the **structure** of categorical variables.
@@ -44,3 +21,29 @@ There are some explanatory videos on the [Numeristical Youtube Channel](https://
44
21
  Lucena, B. "Exploiting Categorical Structure with Tree-Based Methods. Proceedings of the Twenty Third International Conference on Artificial Intelligence and Statistics, PMLR 108:2949-2958, 2020. [http://proceedings.mlr.press/v108/lucena20a/lucena20a.pdf](http://proceedings.mlr.press/v108/lucena20a/lucena20a.pdf)
45
22
 
46
23
  Lucena, B. "StructureBoost: Efficient Gradient Boosting for Structured Categorical Variables." [https://arxiv.org/abs/2007.04446](https://arxiv.org/abs/2007.04446)
24
+
25
+ ## Development
26
+
27
+ The compiled modules are generated from the Cython sources (`structureboost/*.pyx`) at build time, so a C compiler is needed to build from source.
28
+
29
+ ```bash
30
+ pip install . # build and install
31
+ pytest # run the test suite against the installed package
32
+ python -m build # build an sdist and wheel into dist/
33
+ ```
34
+
35
+ Run `pytest` rather than `python -m pytest`: the latter puts the repository root on the import path, so the uncompiled `structureboost/` source folder would shadow the installed package.
36
+
37
+ ### Releasing
38
+
39
+ Releases are built and published by GitHub Actions (`.github/workflows/release.yml`); nothing is uploaded from a local machine.
40
+
41
+ 1. Update `__version__` in `structureboost/__init__.py` and merge to `master`.
42
+ 2. Tag the merged commit and push the tag:
43
+ ```bash
44
+ git tag v0.8.0
45
+ git push origin v0.8.0
46
+ ```
47
+ 3. The workflow checks that the tag matches `__version__`, builds and tests wheels for Linux, macOS and Windows (Python 3.10–3.14), uploads them to PyPI via trusted publishing, and creates a GitHub Release.
48
+
49
+ To test the wheel builds without publishing, run the `release` workflow by hand from the Actions tab.
@@ -0,0 +1,74 @@
1
+ [build-system]
2
+ requires = [
3
+ "setuptools>=77",
4
+ "Cython>=3.0.11",
5
+ "numpy>=2.0",
6
+ ]
7
+ build-backend = "setuptools.build_meta"
8
+
9
+ [project]
10
+ name = "structureboost"
11
+ dynamic = ["version"]
12
+ description = "Gradient Boosting and Probabilistic Regression with categorical structure"
13
+ readme = "README.md"
14
+ authors = [
15
+ { name = "Brian Lucena", email = "brian@numeristical.com" },
16
+ ]
17
+ license = "MIT"
18
+ license-files = ["LICENSE"]
19
+ requires-python = ">=3.10"
20
+ dependencies = [
21
+ "numpy>=1.23.5",
22
+ "pandas>=1.5",
23
+ "scipy>=1.9",
24
+ "matplotlib>=3.5",
25
+ "joblib>=1.0",
26
+ "splinecalib>=0.0.13",
27
+ ]
28
+ classifiers = [
29
+ "Development Status :: 4 - Beta",
30
+ "Intended Audience :: Science/Research",
31
+ "Operating System :: OS Independent",
32
+ "Programming Language :: Cython",
33
+ "Programming Language :: Python :: 3",
34
+ "Programming Language :: Python :: 3.10",
35
+ "Programming Language :: Python :: 3.11",
36
+ "Programming Language :: Python :: 3.12",
37
+ "Programming Language :: Python :: 3.13",
38
+ "Programming Language :: Python :: 3.14",
39
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
40
+ ]
41
+
42
+ [project.urls]
43
+ Homepage = "https://github.com/numeristical/structureboost"
44
+ Documentation = "https://structureboost.readthedocs.io/"
45
+ Source = "https://github.com/numeristical/structureboost"
46
+
47
+ [dependency-groups]
48
+ test = ["pytest>=8"]
49
+ dev = [
50
+ "Cython>=3.0.11",
51
+ "numpy>=2.0",
52
+ "setuptools>=77",
53
+ "build",
54
+ { include-group = "test" },
55
+ ]
56
+
57
+ [tool.setuptools]
58
+ packages = ["structureboost"]
59
+ include-package-data = false
60
+
61
+ [tool.setuptools.dynamic]
62
+ version = { attr = "structureboost.__version__" }
63
+
64
+ [tool.pytest.ini_options]
65
+ testpaths = ["tests"]
66
+ addopts = ["--import-mode=importlib"]
67
+
68
+ [tool.cibuildwheel]
69
+ # CPython 3.10-3.14 (not the experimental free-threaded "t" builds),
70
+ # skipping 32-bit and musl Linux targets.
71
+ build = ["cp310-*", "cp311-*", "cp312-*", "cp313-*", "cp314-*"]
72
+ skip = ["*-win32", "*-manylinux_i686", "*-musllinux_*"]
73
+ test-groups = ["test"]
74
+ test-command = "pytest {project}/tests"
@@ -0,0 +1,42 @@
1
+ """Build configuration for the compiled extensions of structureboost.
2
+
3
+ All project metadata lives in pyproject.toml; this file only declares the
4
+ Cython extension modules, which are compiled from the .pyx sources at build
5
+ time.
6
+ """
7
+
8
+ import numpy
9
+ from Cython.Build import cythonize
10
+ from setuptools import Extension, setup
11
+
12
+ MODULES = [
13
+ "graphs",
14
+ "structure_dt",
15
+ "structure_dt_multi",
16
+ "structure_gb",
17
+ "structure_gb_multi",
18
+ "pdf_discrete",
19
+ "pdf_group",
20
+ "pdf_set",
21
+ "pdf_conformal",
22
+ "prob_regr_unit",
23
+ "prob_regressor",
24
+ "coarsage",
25
+ ]
26
+
27
+ extensions = [
28
+ Extension(
29
+ f"structureboost.{name}",
30
+ [f"structureboost/{name}.pyx"],
31
+ include_dirs=[numpy.get_include()],
32
+ define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")],
33
+ )
34
+ for name in MODULES
35
+ ]
36
+
37
+ setup(
38
+ ext_modules=cythonize(
39
+ extensions,
40
+ compiler_directives={"language_level": "3"},
41
+ ),
42
+ )
@@ -0,0 +1,18 @@
1
+ """structureboost is a Python package for Gradient Boosting using categorical structure"""
2
+
3
+ from . import graphs
4
+ from .structure_gb import StructureBoost
5
+ from .structure_gb_multi import StructureBoostMulti
6
+ from .structure_dt import StructureDecisionTree
7
+ from .structure_dt_multi import StructureDecisionTreeMulti
8
+ from .prob_regr_unit import ProbRegressorUnit
9
+ from .prob_regressor import PrestoBoost
10
+ from .coarsage import Coarsage
11
+ from .pdf_discrete import PdfDiscrete, average_densities
12
+ from .pdf_group import PdfGroup, log_loss_pdf, test_between_quantiles_pdf, test_in_pred_regions
13
+ from .pdf_set import PdfSet
14
+ from .pdf_conformal import PdfConformalizer
15
+ from .utils import get_basic_config, apply_defaults, default_config_dict, ice_plot, log_loss
16
+
17
+ __version__ = '0.8.0'
18
+