polars-optbinning 0.2.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 (43) hide show
  1. polars_optbinning-0.2.0/.gitignore +22 -0
  2. polars_optbinning-0.2.0/.python-version +1 -0
  3. polars_optbinning-0.2.0/AGENTS.md +13 -0
  4. polars_optbinning-0.2.0/CODE_OF_CONDUCT.md +17 -0
  5. polars_optbinning-0.2.0/CONTRIBUTING.md +23 -0
  6. polars_optbinning-0.2.0/Cargo.lock +2839 -0
  7. polars_optbinning-0.2.0/Cargo.toml +37 -0
  8. polars_optbinning-0.2.0/LICENSE +21 -0
  9. polars_optbinning-0.2.0/PKG-INFO +286 -0
  10. polars_optbinning-0.2.0/README.md +251 -0
  11. polars_optbinning-0.2.0/examples/.gitkeep +0 -0
  12. polars_optbinning-0.2.0/examples/example_iris.py +63 -0
  13. polars_optbinning-0.2.0/examples/example_linear.py +60 -0
  14. polars_optbinning-0.2.0/examples/example_multiclass_models.py +143 -0
  15. polars_optbinning-0.2.0/examples/example_perpetual.py +116 -0
  16. polars_optbinning-0.2.0/polars_optbinning/__init__.py +28 -0
  17. polars_optbinning-0.2.0/polars_optbinning/_polars_optbinning.pyi +334 -0
  18. polars_optbinning-0.2.0/polars_optbinning/expr.py +149 -0
  19. polars_optbinning-0.2.0/polars_optbinning/py.typed +0 -0
  20. polars_optbinning-0.2.0/polars_optbinning/transformer.py +647 -0
  21. polars_optbinning-0.2.0/pyproject.toml +72 -0
  22. polars_optbinning-0.2.0/scripts/gitee_release.py +554 -0
  23. polars_optbinning-0.2.0/src/_2d.rs +452 -0
  24. polars_optbinning-0.2.0/src/error.rs +21 -0
  25. polars_optbinning-0.2.0/src/expression.rs +151 -0
  26. polars_optbinning-0.2.0/src/lib.rs +32 -0
  27. polars_optbinning-0.2.0/src/model/lgbm.rs +248 -0
  28. polars_optbinning-0.2.0/src/model/perpetual.rs +818 -0
  29. polars_optbinning-0.2.0/src/model/tree.rs +934 -0
  30. polars_optbinning-0.2.0/src/model/xgb.rs +269 -0
  31. polars_optbinning-0.2.0/src/model.rs +654 -0
  32. polars_optbinning-0.2.0/src/objective.rs +235 -0
  33. polars_optbinning-0.2.0/src/rule.rs +2778 -0
  34. polars_optbinning-0.2.0/src/solver/binary.rs +124 -0
  35. polars_optbinning-0.2.0/src/solver/continuous.rs +102 -0
  36. polars_optbinning-0.2.0/src/solver/multiclass.rs +0 -0
  37. polars_optbinning-0.2.0/src/solver.rs +1041 -0
  38. polars_optbinning-0.2.0/src/stat.rs +190 -0
  39. polars_optbinning-0.2.0/src/utils.rs +56 -0
  40. polars_optbinning-0.2.0/tests/test_binning_transformer.py +494 -0
  41. polars_optbinning-0.2.0/tests/test_gitee_release.py +129 -0
  42. polars_optbinning-0.2.0/tests/test_perpetual_models.py +150 -0
  43. polars_optbinning-0.2.0/tests/test_tree_models.py +330 -0
@@ -0,0 +1,22 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Virtual environments
10
+ .env
11
+ .venv
12
+ uv.lock
13
+
14
+ # build
15
+ target/
16
+ *.pyd
17
+ *.so
18
+ *.pdb
19
+ Cargo.lock
20
+
21
+ # Generated example model artifacts
22
+ examples/models/
@@ -0,0 +1 @@
1
+ 3.13
@@ -0,0 +1,13 @@
1
+ # AGENTS.md
2
+ ## 项目通用约定
3
+ - 本项目依赖管理采用`cargo`和`uv`,
4
+ - 发布编译需要用`--release`参数
5
+ - rust扩展进行检查时采用`rust clippy`进行lint检查
6
+ - examples目录的脚本作为示例直接在__main__区域进行示例,方便repl调试
7
+ - tests目录的代码主要是功能稳定性测试,需要pytest依赖进行测试
8
+ ## 算法内容约定
9
+ - 尽量使用ndarray/numpy/nalgebra等成熟的数值计算库,提升性能和代码质量
10
+ - 非递归型可并行算法的实现,评估并发量足够大时使用rayon进行并行化, 以提升性能,如果并发量很小则不使用rayon,以避免过度并行化带来的性能损失
11
+ - python端的输入只考虑polars Series/DataFrame以及numpy array, 进入到rust侧需要零拷贝转换,避免不必要的内存复制和性能损失
12
+ - 使用utils::ProgressReporter进行算法进度的报告,以便在python端能够显示进度条
13
+ - 任何rust侧的更新都需要在python侧更新*.pyi/__init__.py文件,以保持接口的可读性,其次也需要实现examples或tests作为示例和功能测试用例
@@ -0,0 +1,17 @@
1
+ # Code of Conduct
2
+
3
+ This project is committed to a welcoming, respectful, and harassment-free
4
+ community.
5
+
6
+ Participants are expected to communicate constructively, respect differing
7
+ viewpoints and experiences, accept responsibility for mistakes, and focus on
8
+ what is best for the project and its users. Harassment, discrimination,
9
+ personal attacks, deliberate disruption, or publishing another person's
10
+ private information are not acceptable.
11
+
12
+ Project maintainers may edit, reject, or remove contributions and may
13
+ temporarily or permanently restrict participation when behavior violates these
14
+ expectations.
15
+
16
+ Report conduct concerns privately in [Gitee issue tracker](https://gitee.com/Ky1eYang/polars-optbinning/issues).
17
+ Reports will be reviewed promptly and handled as confidentially as practical.
@@ -0,0 +1,23 @@
1
+ # Contributing
2
+
3
+ Contributions and bug reports are welcome through the
4
+ [Gitee issue tracker](https://gitee.com/Ky1eYang/polars-optbinning/issues).
5
+
6
+ ## Development
7
+
8
+ Install the development dependencies and compile the Rust extension:
9
+
10
+ ```bash
11
+ uv sync --group dev
12
+ uv run maturin develop --release
13
+ ```
14
+
15
+ Before submitting a change, run:
16
+
17
+ ```bash
18
+ cargo clippy --all-targets --all-features -- -D warnings
19
+ uv run pytest
20
+ ```
21
+
22
+ Rust API changes must also update the Python `*.pyi`/`__init__.py` interface and
23
+ include an example or functional test.