Documentation
¶
Overview ¶
Package metric holds different metrics for sets similarity compare
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metric ¶
type Metric interface {
// MinY returns the minimum ngram cardinality for candidate
MinY(alpha float64, size int) int
// MinY returns the maximum ngram cardinality for candidate
MaxY(alpha float64, size int) int
// Threshold returns required intersection between A and B for given alpha
Threshold(alpha float64, sizeA, sizeB int) int
// Distance calculate distance between 2 sets
Distance(inter, sizeA, sizeB int) float64
}
Metric defined here, is not pure mathematics metric definition as distance between each pair of elements of a set. Here we can also ask metric to give as minimum intersection between A and B for given alpha, min/max candidate cardinality
func CosineMetric ¶
func CosineMetric() Metric
CosineMetric returns a Metric that represents Cosine Metric
func ExactMetric ¶
func ExactMetric() Metric
ExactMetric returns a Metric that represents exact matching between 2 ngram sets
func JaccardMetric ¶
func JaccardMetric() Metric
JaccardMetric returns a Metric that represents Jaccard Metric
func OverlapMetric ¶
func OverlapMetric() Metric
OverlapMetric returns a Metric that represents Overlap metric
Click to show internal directories.
Click to hide internal directories.