Skip to content

Instantly share code, notes, and snippets.

View Shoeboxam's full-sized avatar

Michael Shoemate Shoeboxam

View GitHub Profile
@Shoeboxam
Shoeboxam / make_stable_constructor.py
Last active October 22, 2021 02:07
Pseudocode of an OpenDP combinator for privatizing a certain class of vector-valued transformations
# Pseudocode of an OpenDP combinator for privatizing a certain class of vector-valued transformations
def make_some_transformation_stable(trans_query: Transformation, scale, threshold):
assert trans_query.input_metric == SymmetricDistance
assert trans_query.output_metric == L1Distance
# must be equivalent to representation 2 in https://arxiv.org/pdf/1709.05396.pdf, Section 2.2.1
assert trans_query.output_domain == HashMapDomain[AllDomain[KeyType], AllDomain[FloatCountType]]
def function(data):
noised = {k: v + sample_laplace(scale) for k, v in trans_query.invoke(data)}
import pandas as pd
import matplotlib.pyplot as plt
from dateutil import parser
plt.style.use("bmh")
data = pd.read_excel("/Users/michael/Downloads/MD 4 year.XLS", parse_dates=['Gift Date'])
def plot_cumulative_per_year(event_days, min_delta, max_delta):
cumulative_sums = []
@Shoeboxam
Shoeboxam / README.md
Last active May 18, 2020 20:36
markdown test

Build Status

WhiteNoise Core
Differential Privacy Library Python Bindings

This repository contains python bindings to Whitenoise-Core and its underlying Rust binaries.

  • For examples of this library in action, please see the Python notebooks in WhiteNoise-Samples.
  • In addition, see the accompanying WhiteNoise-System repository which includes WhiteNoise tools for differential privacy.

@Shoeboxam
Shoeboxam / pipeline_grpc_demo.py
Last active June 21, 2019 17:47
Construct pipelines in the ta2ta3-api specification to be passed over GRPC
import d3m
from d3m.metadata.pipeline import Pipeline, PrimitiveStep
from d3m.metadata.base import ArgumentType
from google.protobuf.json_format import MessageToJson
from ta3ta2_api import utils
import json
types = [
utils.ValueType.RAW,
@Shoeboxam
Shoeboxam / pipeline_grpc_demo_separate.py
Last active June 21, 2019 18:05
Constructing pipelines for D3M TA2's via ta2ta3-api compatible json
import d3m
from d3m.metadata.pipeline import Pipeline, PrimitiveStep
from d3m.metadata.base import ArgumentType
from google.protobuf.json_format import MessageToJson
from ta3ta2_api import utils
import json
types = [
utils.ValueType.RAW,
@Shoeboxam
Shoeboxam / ravenConfig.json
Created May 30, 2019 15:20
test raven config
{
"hardManipulations": [],
"problems": {
"DA_college_debt_problem": {
"description": "The task here is to predict the median debt-to-earnings ratio of colleges across the US. The supplied dataset consists of the College Scorecards dataset which make it easier for students to search for a college that is a good fit for them. They can use the College Scorecard to find out more about a college's affordability and value so they can make more informed decisions about which college to attend, including factors such as median debt-to-earning ratio of graduates. This is a regression problem.",
"firstTarget": {
"colIndex": 4,
"colName": "DEBT_EARNINGS_RATIO",
"resID": "0",
"targetIndex": 0
import Popper from 'popper.js';
import m from 'mithril';
class PopperWrapper {
onupdate({state}) {
if (state.popper) state.popper.update()
}
view(vnode) {
let {attrs, children, state} = vnode;
---
title: "Statistical/Machine Learning Mini-Project VI"
author: "Michael Shoemate"
date: "April 23, 2019"
output: pdf_document
---
# Section 1
```{R echo = F, results = 'hide', message=F, warning=F}
# installs each package if not exists, and attaches
---
title: "Statistical/Machine Learning Mini-Project IV"
author: "Michael Shoemate"
date: "March 26, 2019"
output: pdf_document
---
# Section 1
```{R echo = F, results = 'hide', message=F, warning=F}
# installs each package if not exists, and attaches
@Shoeboxam
Shoeboxam / tworavens.sh
Last active January 9, 2019 07:58
TwoRavens automated environment setup
#!/bin/bash
# On Ubuntu, I installed Redis with apt. It autostarts and requires `/etc/init.d/redis-server stop` to kill
# disable autostart with this: `sudo update-rc.d redis-server disable`
# The config file referenced in `fab redis_run` doesn't exist; I just start redis explicitly
cd ~/TwoRavens/
. `which virtualenvwrapper.sh`
workon 2ravens
: $(fab celery_restart)