GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - OpenMined/clojure-dp

BranchesTags
Open more actions menu

Latest commit

 

History

36 Commits
36 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
doc
doc
 
 
src/differential_privacy_clj
src/differential_privacy_clj
 
 
test/differential_privacy_clj
test/differential_privacy_clj
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
project.clj
project.clj
 
 

Repository files navigation

differential-privacy-clj

codecov

A Clojure wrapper for the Java differential-privacy library.

See online demo notebooks.

Installation

Steps to build it locally:

  1. Make sure you have Maven, Bazel and Leiningen installed.

  2. Download and build the Java differential-privacy library:

git clone https://github.com/google/differential-privacy.git
cd differential-privacy/java/
bazel build "..."
  1. Install libdifferentialprivacy.jar and libsummary-proto-speed.jar in your local Maven repository:
mvn install:install-file -Dfile=bazel-bin/main/com/google/privacy/differentialprivacy/libdifferentialprivacy.jar -DgroupId=com.google.privacy.differentialprivacy -DartifactId=libdifferentialprivacy -Dversion=1.0 -Dpackaging=jar

mvn install:install-file -Dfile=bazel-bin/external/com_google_differential_privacy/proto/libsummary-proto-speed.jar -DgroupId=com.google.differentialprivacy -DartifactId=libsummary-proto-speed -Dversion=1.0 -Dpackaging=jar
  1. Clone this repository and install the library:
git clone https://github.com/OpenMined/clojure-dp.git
cd clojure-dp
lein install

Usage

See demo notebooks (run online).

Examples:

(require '[differential-privacy-clj.core :as dp])

(def example-data (take 1000 (repeatedly #(rand 10.0))))

(println "True sum: "
         (reduce + example-data))
(println "DP sum:   "
         (dp/bounded-sum example-data :epsilon 0.1
                         :lower 0 :upper 10
                         :max-partitions-contributed 1))

(println "True count:"
         (count example-data))
(println "DP count:  "
         (dp/count example-data :epsilon 0.1
                   :max-partitions-contributed 1))

(println "True mean:" (/ (reduce + example-data)
                         (count example-data)))
(println "DP mean:" (dp/bounded-mean example-data :epsilon 0.1
                                     :lower 0 :upper 10
                                     :max-partitions-contributed 1
                                     :max-contributions-per-partition 1))

will print something like:

True sum:  4988.542973798648
DP sum:    5175.075793958153
True count: 1000
DP count:   999
True mean: 4.988542973798648
DP mean: 5.002603661455349

Available algorithms:

✔️ - Supported ✅ - Planned

Algorithm
Count ✔️
Sum ✔️
Mean ✔️
Variance ✅
Standard deviation ✅
Order statistics (incl. min, max, and median) ✅

Support

For support in using this library, please join the #lib_dp_java Slack channel. If you’d like to follow along with any code changes to the library, please join the #code_dp_clojure Slack channel. Click here to join our Slack community!

About

No description or website provided.

Topics

clojuredifferential-privacyjvm

Resources

Readme
Apache-2.0 license

Code of conduct

Code of conduct

Contributing

Contributing
Activity
Custom properties

Stars

1 star

Watchers

9 watching

Forks

1 fork
Report repository

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.