vectormodel

package
v0.0.0-...-1be907b Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2018 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package vectormodel provides primitives for serving Matrix Factorization based Recommender System models. We assume that the document vectors were calculated according to the paper "Collaborative Filtering for Implicit Feedback Datasets". Given the document vectors and the list of documents consumed by a user, this package can calculate the user vectors in realtime to generate recommendations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DocumentScore

type DocumentScore struct {
	DocumentID int
	Score      float64
}

DocumentScore is the result of a recommendation

type VectorModel

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

VectorModel is a struct to handle document vector space models.

func NewVectorModel

func NewVectorModel(documents map[int][]float64, confidence, regularization float64) (*VectorModel, error)

NewVectorModel creates a new VectorModel

func (*VectorModel) Rank

func (vm *VectorModel) Rank(candidates []int, seenDocs map[int]bool) (scores []float64, err error)

Rank sorts a list of candidate assets for a given user history

func (*VectorModel) Recommend

func (vm *VectorModel) Recommend(seenDocs map[int]bool, n int) (recommendations []DocumentScore, err error)

Recommend returns a list of recommendedDocs and a list of scores

Jump to

Keyboard shortcuts

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