Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Create Pybind wrappers for the Quantiles class

オープン
#485 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
cpp, python
領域
api

調査の方向性

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 の本文から書いたものです。

説明

Type: New Feature :heavy_plus_sign:

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:

  1. Quantiles.__init__: which calls Quantiles<double>::Builder. It should have all parameters as in Builder.

  2. Quantiles

The following public methods of the Quantiles class should be wrapped:

AddEntry(const T&)
Serialize() const
Merge(const Summary&)
GetQuantiles() const
Result()

Considerations:

  1. The Build() method returns an absl::StatusOr. The wrappers should handle the status and raise an exception on failure.

  2. The SetLaplaceMechanism method takes a std::unique_ptr. For Python binding let's use enum - Laplace, Gaussian.

主要言語
Python
スター
550
フォーク
142
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

OpenMined/PyDP のほかの issue

OpenMined/PyDP の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。