Create Pybind wrappers for the Quantiles class
还没有人认领这个 Issue。
评估
调研方向
Start with cc/algorithms/quantiles.h to compare the C++ Builder and public methods, then inspect pydp/src/bindings/PyDP/algorithms/qunatile_tree.cpp for PyDP binding conventions. Add pydp/src/bindings/PyDP/algorithms/quantiles.cpp for the double instantiation, status handling, and mechanism enum. Done means the listed methods are exposed and Build failures raise Python exceptions.
由索引模型根据 Issue 内容生成。
描述
Create Pybind wrappers for the Quantiles class
Create Pybind11 wrappers for the differential_privacy::Quantiles. This will expose the functionality to the PyDP library.
Background:
The C++ Differential Privacy library includes a Quantiles class for calculating differentially private quantiles ( source). The PyDP library, which provides Python wrappers for the C++ library, already has bindings for the QuantileTree class ( Python differential pr...). To provide a more complete and user-friendly API, we should also create wrappers for the higher-level Quantiles class.
Implementation Details:
The new wrappers should be created in a new file, pydp/src/bindings/PyDP/algorithms/quantiles.cpp. The Python API should follow the existing conventions in PyDP and mirror the C++ API of the Quantiles class as closely as possible.
The Quantiles class is templated on arithmetic types (int, double, etc.). The Pybind wrappers should be instantiated for common numerical only for double.
Classes and Methods to Wrap:
-
Quantiles.__init__: which callsQuantiles<double>::Builder. It should have all parameters as in Builder. -
Quantiles
The following public methods of the Quantiles class should be wrapped:
AddEntry(const T&)
Serialize() const
Merge(const Summary&)
GetQuantiles() const
Result()
Considerations:
-
The
Build()method returns anabsl::StatusOr. The wrappers should handle the status and raise an exception on failure. -
The SetLaplaceMechanism method takes a std::unique_ptr. For Python binding let's use enum - Laplace, Gaussian.
- 主要语言
- Python
- 星标
- 550
- 派生
- 142
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
OpenMined/PyDP 的其他 Issue
-
Type: Question :grey_question:
难度 3/5 1-2 天 新手友好度 25/100
-
Type: Question :grey_question:
难度 4/5 3-5 天 新手友好度 32/100
-
Type: Improvement :chart_with_upwards_trend:
难度 3/5 1-2 天 新手友好度 35/100
-
Type: New Feature :heavy_plus_sign:
难度 3/5 1-2 天 新手友好度 38/100
-
Status: Blocked :heavy_multiplication_x: Type: New Feature :heavy_plus_sign:
难度 4/5 3-5 天 新手友好度 35/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
-
bug
难度 1/5 1 小时以内 新手友好度 88/100
qgis/QGIS-Plugins-Website#459 ·
-
bug severity:medium
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
bot-found bug priority: P3
难度 2/5 1-3 小时 新手友好度 84/100
madenvel/KalinkaPlayer#179 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
ls1intum/edutelligence#1098 ·
维护者通常 1 天内回复