Create Pybind wrappers for the Quantiles class
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 550
- Fork
- 143
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của OpenMined/PyDP
-
Type: Question :grey_question:
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
-
Type: Question :grey_question:
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 32/100
-
Type: Improvement :chart_with_upwards_trend:
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
-
Type: New Feature :heavy_plus_sign:
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
-
Support for M1 Mac? Đang mởStatus: Blocked :heavy_multiplication_x: Type: New Feature :heavy_plus_sign:
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Tất cả issue của OpenMined/PyDP
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
browser-use/browser-use#5905 ·
-
type: enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ynput/ayon-python-api#363 ·
-
bug needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
modelscope/FunASR#3728 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
open-compass/opencompass#2655 ·