sigo

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Anonymize

func Anonymize(source RecordSource, factory GeneralizerFactory,
	k int, l int, dim int, anonymyzer Anonymizer, sink RecordSink, debugger Debugger) error

func ExpNumber

func ExpNumber(mean float64) float64

func GaussianNumber

func GaussianNumber(loc float64, scale float64) float64

func IQR

func IQR(values []float64) float64

func LaplaceNumber

func LaplaceNumber() float64

func Mean

func Mean(listValues []float64) (m float64)

func Median

func Median(listValues []float64) (m float64)

func Std

func Std(listValues []float64) (s float64)

func Sum

func Sum(listValues []float64) (sum float64)

Types

type AggregationAnonymizer

type AggregationAnonymizer struct {
	// contains filtered or unexported fields
}

func NewAggregationAnonymizer

func NewAggregationAnonymizer(typeAgg string) AggregationAnonymizer

func (AggregationAnonymizer) Anonymize

func (a AggregationAnonymizer) Anonymize(rec Record, clus Cluster, qi, s []string) Record

type AnonymizedRecord

type AnonymizedRecord struct {
	// contains filtered or unexported fields
}

func (AnonymizedRecord) QuasiIdentifer

func (ar AnonymizedRecord) QuasiIdentifer() []float32

func (AnonymizedRecord) Row

func (ar AnonymizedRecord) Row() map[string]interface{}

func (AnonymizedRecord) Sensitives

func (ar AnonymizedRecord) Sensitives() []interface{}

type Anonymizer

type Anonymizer interface {
	Anonymize(Record, Cluster, []string, []string) Record
}

type Cluster

type Cluster interface {
	Records() []Record
	ID() string
	Bounds() []bounds
}

type CodingAnonymizer

type CodingAnonymizer struct{}

func NewCodingAnonymizer

func NewCodingAnonymizer() CodingAnonymizer

func (CodingAnonymizer) Anonymize

func (a CodingAnonymizer) Anonymize(rec Record, clus Cluster, qi, s []string) Record

type Debugger

type Debugger interface {
	Information(Record, Cluster) Record
}

func NewNoDebugger

func NewNoDebugger() Debugger

type GeneralAnonymizer

type GeneralAnonymizer struct {
	// contains filtered or unexported fields
}

func NewGeneralAnonymizer

func NewGeneralAnonymizer() GeneralAnonymizer

func (GeneralAnonymizer) Anonymize

func (a GeneralAnonymizer) Anonymize(rec Record, clus Cluster, qi, s []string) Record

type Generalizer

type Generalizer interface {
	Add(Record)
	Clusters() []Cluster
	String() string
	Build()
}

type GeneralizerFactory

type GeneralizerFactory interface {
	New(k int, l int, dim int) Generalizer
}

type InfosRecord

type InfosRecord struct {
	// contains filtered or unexported fields
}

func (InfosRecord) QuasiIdentifer

func (ir InfosRecord) QuasiIdentifer() []float32

func (InfosRecord) Row

func (ir InfosRecord) Row() map[string]interface{}

func (InfosRecord) Sensitives

func (ir InfosRecord) Sensitives() []interface{}

type KDTree

type KDTree struct {
	// contains filtered or unexported fields
}

func (KDTree) Add

func (t KDTree) Add(r Record)

func (KDTree) Build

func (t KDTree) Build()

func (KDTree) Clusters

func (t KDTree) Clusters() []Cluster

func (KDTree) String

func (t KDTree) String() string

type KDTreeFactory

type KDTreeFactory struct{}

func NewKDTreeFactory

func NewKDTreeFactory() KDTreeFactory

func (KDTreeFactory) New

func (f KDTreeFactory) New(k int, l int, dim int) Generalizer

type NoAnonymizer

type NoAnonymizer struct{}

func NewNoAnonymizer

func NewNoAnonymizer() NoAnonymizer

func (NoAnonymizer) Anonymize

func (a NoAnonymizer) Anonymize(rec Record, clus Cluster, qi, s []string) Record

type NoDebugger

type NoDebugger struct{}

func (NoDebugger) Information

func (d NoDebugger) Information(rec Record, cluster Cluster) Record

type NoiseAnonymizer

type NoiseAnonymizer struct {
	// contains filtered or unexported fields
}

func NewNoiseAnonymizer

func NewNoiseAnonymizer(mechanism string) NoiseAnonymizer

func (NoiseAnonymizer) Anonymize

func (a NoiseAnonymizer) Anonymize(rec Record, clus Cluster, qi, s []string) Record

type Quartiles

type Quartiles struct {
	Q1 float64
	Q2 float64
	Q3 float64
}

func Quartile

func Quartile(values []float64) Quartiles

type Record

type Record interface {
	QuasiIdentifer() []float32
	Sensitives() []interface{}
	Row() map[string]interface{}
}

type RecordSink

type RecordSink interface {
	Collect(Record) error
}

type RecordSource

type RecordSource interface {
	Next() bool
	Err() error
	Value() Record
	QuasiIdentifer() []string
	Sensitive() []string
}

type SequenceDebugger

type SequenceDebugger struct {
	// contains filtered or unexported fields
}

func NewSequenceDebugger

func NewSequenceDebugger(key string) SequenceDebugger

func (SequenceDebugger) Information

func (d SequenceDebugger) Information(rec Record, cluster Cluster) Record

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL