summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Langesten <daniel.langest@gmail.com>2015-03-10 14:47:32 +0100
committerDaniel Langesten <daniel.langest@gmail.com>2015-03-10 14:47:32 +0100
commit2fa27f737093b186ceeb910f385f5d25e0d0d744 (patch)
tree055c2a4ba6e626f02d9d4df9b9ad801018ada89b
parent814e2f47ce0db4b2da816f2be70f4ad2ece7ef2a (diff)
added epsilon to conf
-rw-r--r--cleaner.go3
-rw-r--r--config.go1
-rw-r--r--config.json1
3 files changed, 3 insertions, 2 deletions
diff --git a/cleaner.go b/cleaner.go
index 74875d0..588dbec 100644
--- a/cleaner.go
+++ b/cleaner.go
@@ -14,7 +14,6 @@ const (
DATABASE_PASS = "nil"
DATABASE_CONNECTION = "" //e.g. "tcp(localhost:55555)
DATABASE_NAME = "netflow"
- EPSILON = 1000
)
func cleanData(conf Config) (err error) {
@@ -61,7 +60,7 @@ func cleanData(conf Config) (err error) {
//Add noise for differential privacy
for i := range cDat {
- cDat[i].occurances = diffpriv(cDat[i].occurances, 1, EPSILON)
+ cDat[i].occurances = diffpriv(cDat[i].occurances, 1, conf.Epsilon)
}
//Begin transaction
diff --git a/config.go b/config.go
index fb023dd..af84071 100644
--- a/config.go
+++ b/config.go
@@ -9,6 +9,7 @@ import (
type Config struct {
Volumes []VolumeInfo `json:volumes`
Interval string `json:interval`
+ Epsilon float64 `json:epsilon`
}
type VolumeInfo struct {
diff --git a/config.json b/config.json
index 10519b7..645a760 100644
--- a/config.json
+++ b/config.json
@@ -1,5 +1,6 @@
{
"interval": "5min",
+ "epsilon": 10000,
"volumes": [
{
"size": "small",