A non-numeric cell in a numeric column raises a data-dependent exception
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
調査の方向性
Start with the unguarded float conversions in dpsynth/local_mode/initialization.py and dpsynth/local_mode/vectorized_transformations.py, then trace how numeric cell values are standardized before histogram aggregation. Reproduce the failure with the provided ? value in the numeric column and check related tests. Done means malformed numeric values are handled consistently with the documented per-row standardization, without a data-dependent exception.
索引モデルが issue の本文から書いたものです。
説明
The accounting philosopy doc states that "During execution, individual cell values (None, NaN, ±∞, out-of-range numbers, or unknown categories) are standardized deterministically per row before any histogram aggregation occurs (by clamping to declared bounds or routing to a dedicated out-of-domain bin), ensuring that malformed records do not raise data-dependent exceptions that break DP.)".
This doesn't appear to be fully the case: a non-numeric value in a numeric column fails because of unguarded casts to floats here and here. Repro:
import io, math
import numpy as np
import pandas as pd
import dpsynth
D = pd.read_csv(io.StringIO("x\n3\n18\n25\n41\n60\n77\n"))
D2 = pd.read_csv(io.StringIO("x\n3\n18\n25\n41\n60\n77\n?\n"))
N, EPS, DELTA = 20, 1.0, 1e-5
schema = dpsynth.Schema({"x": dpsynth.NumericalAttribute(min_value=0, max_value=100)})
mech = dpsynth.calibrate(dpsynth.TabularConfig(discrete_mechanism=dpsynth.discrete_mechanisms.IndependentConfig(pgm_iters=5)),
schema, epsilon=EPS, delta=DELTA)
rng = np.random.default_rng(0)
hits = {}
for name, data in (("D", D), ("D'", D2)):
hits[name] = 0
for _ in range(N):
try:
mech(rng, data)
except Exception as e:
hits[name] += 1
p, p2 = hits["D"] / N, hits["D'"] / N
print(f"P_D[E] = {p:.3f}, P_D'[E] = {p2:.3f}; ({EPS}, {DELTA})-DP allows P_D'[E] <= e^eps * P_D[E] + delta = "
f"{math.exp(EPS) * p + DELTA:.3f}")
prints:
P_D[E] = 0.000, P_D'[E] = 1.000; (1.0, 1e-05)-DP allows P_D'[E] <= e^eps * P_D[E] + delta = 0.000
- 主要言語
- Python
- スター
- 32
- フォーク
- 13
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
google/dpsynth のほかの issue
-
`IndependentConfig` synthesis raises "Cliques must be unique."再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
Marginal counts are rounded to float32 before noise, which increases sensitivity for large valuesオープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
難易度 4/5 1〜2日 初心者へのやさしさ 48/100
-
Checkpoints interact with noise seeds in an inconsistent way, which can impact privacy guaranteesオープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
unionai-oss/pandera#2640 ·
メンテナーはふだん 2 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
JdeRobot/RoboticsInfrastructure#843 ·
メンテナーはふだん 1 日以内に返信
-
automated endpoint-dead needs-curation
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
almanac-data/climate-almanac#122 ·
メンテナーはふだん 1 日以内に返信
-
area:harness enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
evarness-ai/iris-harness#420 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
suitenumerique/find#206 ·
メンテナーはふだん 2 日以内に返信