Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
repos
security
Differential Privacy
Commits
b5897534
Commit
b5897534
authored
Sep 29, 2022
by
Htriedman
Browse files
Update differential_privacy/utils/budget.py
parent
55d74783
Pipeline
#6434
passed with stages
in 10 minutes and 48 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
differential_privacy/utils/budget.py
View file @
b5897534
...
...
@@ -10,6 +10,15 @@ def gen_rho(epsilon, delta):
return
(
sqrt
(
epsilon
+
logterm
)
-
sqrt
(
logterm
))
**
2
def
date_to_str
(
year
,
month
,
day
):
if
isinstance
(
year
,
str
):
year
=
int
(
year
)
if
isinstance
(
month
,
str
):
month
=
int
(
month
)
if
isinstance
(
day
,
str
):
day
=
int
(
day
)
return
date
(
year
=
year
,
month
=
month
,
day
=
day
).
strftime
(
"%Y-%m-%d"
)
def
write_to_global_privacy_budget
(
spark
,
table
,
epsilon
,
year
,
month
,
day
,
delta
=
0
,
rho
=
None
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment