A non-numeric cell in a numeric column raises a data-dependent exception
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Python
- Estrellas
- 32
- Forks
- 13
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de google/dpsynth
-
`IndependentConfig` synthesis raises "Cliques must be unique."Quizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
-
Marginal counts are rounded to float32 before noise, which increases sensitivity for large valuesAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
-
Dificultad 4/5 1-2 días Aptitud para principiantes 48/100
-
Checkpoints interact with noise seeds in an inconsistent way, which can impact privacy guaranteesAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Todos los issues de google/dpsynth
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
unionai-oss/pandera#2640 ·
Los mantenedores suelen responder en 2 días
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
JdeRobot/RoboticsInfrastructure#843 ·
Los mantenedores suelen responder en 1 día
-
automated endpoint-dead needs-curation
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
almanac-data/climate-almanac#122 ·
Los mantenedores suelen responder en 1 día
-
area:harness enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
evarness-ai/iris-harness#420 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
suitenumerique/find#206 ·
Los mantenedores suelen responder en 2 días