Skip to content

Instantly share code, notes, and snippets.

View kenluck2001's full-sized avatar

Kenneth Emeka Odoh kenluck2001

View GitHub Profile
@kenluck2001
kenluck2001 / experiments.py
Created October 2, 2023 03:25
Differential privacy mechanisms
"""
Evaluation source code
Author: Kenneth Emeka Odoh
References:
https://becominghuman.ai/differential-privacy-noise-adding-mechanisms-ede242dcbb2e
https://arxiv.org/pdf/1912.04222.pdf
https://www.cis.upenn.edu/~aaroth/Papers/privacybook.pdf
Code was tested in Pthon 2.7
@kenluck2001
kenluck2001 / gist:ece4a3549e14b7664d176bac26f97c17
Created January 23, 2017 19:05
improving pyflux for online prediction
import numpy as np
import pyflux as pf
import pandas as pd
class TimeSeriesPrediction:
'Common base for time series prediction'
iterations=500
updateFlag=False
a = 0; b = 4; c = -2; d = 2
n = 20;
h = (b - a)/n; k = (d - c)/n;
x= a:h:b; y=c:k:d;
totallist = zeros( 1, length(y) )
@kenluck2001
kenluck2001 / Gauss_Legendre_iterative_algorithm
Created September 11, 2012 07:14
Gauss Legendre iterative algorithm This repeats the given calculation a number of times until it converges at the desired output. This is faster than infinitive series algorithm although consume more memory like in our solution. The size of the list
#!/usr/bin/python
import math
import decimal
def calculatePi (num_of_iteration):
"""
Gauss Legendre iterative algorithm
This repeats the given calculation a number of times until it converges at the desired output. This is faster than infinitive series algorithm although consume more memory like in our solution. The size of the list increases and that affect space complexity.
"""