day287

package
v0.0.0-...-d40efbb Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WebsitePair

type WebsitePair struct {
	A, B       string
	Similarity float64
}

WebsitePair represents a tuple of websites. Also contains a Similarity score based on Jaccard index. High similarity score is better.

func TopKMostSimilarPairs

func TopKMostSimilarPairs(visits []WebsiteVisitor, k int) []WebsitePair

TopKMostSimilarPairs returns k WebsitePairs. Runs in O(N^2) because it compares all pairs for similarity.

type WebsiteVisitor

type WebsiteVisitor struct {
	Website string
	UserID  int
}

WebsiteVisitor represents a user visiting a website.

Jump to

Keyboard shortcuts

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