probcmp

package module
v0.0.0-...-42d2854 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

README

Probabilistic Record Linkage

I learned about Probabilistic Record Linkage from https://www.youtube.com/watch?v=rGKEOMUtJfE, and since it looked interesting, I implemented it in Go.

References

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NameMatch

func NameMatch(a string, b string) bool

NameMatch compares with phonetic values

Types

type Comparable

type Comparable interface {
	GetField(name string) (string, bool)
}

Comparable provides a way for Matcher to read the comparison data.

type ComparablePatient

type ComparablePatient struct {
	Data map[string]string
}

ComparablePatient is the patient data to be compared.

func (*ComparablePatient) GetField

func (c *ComparablePatient) GetField(name string) (string, bool)

GetField makes ComparablePatient comparable to Matcher.

type Deterministic

type Deterministic struct {
	Keys []string
}

Deterministic defines the keys to be used for deterministic comparisons.

func (*Deterministic) Match

func (d *Deterministic) Match(a Comparable, b Comparable) (float64, error)

Match is a Matcher implementation of Deterministic. The result will be 0 or 1.

type Matcher

type Matcher interface {
	Match(a Comparable, b Comparable) (float64, error)
}

Matcher returns the result of the comparison as a float64.

type Probabilistic

type Probabilistic struct {
	Probabilities []Probability
}

Probabilistic defines the probability of a key to perform a probabilistic comparison

func (*Probabilistic) Match

func (p *Probabilistic) Match(a Comparable, b Comparable) (float64, error)

Match is a Matcher implementation of Probabilistic.

type Probability

type Probability struct {
	Key         string
	MatchProb   float64
	UnmatchProb float64
	MatchFunc   func(a string, b string) bool
}

Probability defines the Match-Probability and Unmatch-Probability of a Key

Jump to

Keyboard shortcuts

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