recommender

package
v0.0.0-...-2709dfa Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Redrec

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

Redrec struct

func New

func New(url string) (*Redrec, error)

New returns a new Redrec

func (*Redrec) BatchUpdateSimilarUsers

func (rr *Redrec) BatchUpdateSimilarUsers(max int) error

BatchUpdateSimilarUsers runs on all the users, getting the similarity candidates for each user and storing the similar users and scores in a sorted set

func (*Redrec) CalcItemProbability

func (rr *Redrec) CalcItemProbability(user string, item string) (float64, error)

CalcItemProbability takes all the user`s similars that rated the input item and calculates the average score.

func (*Redrec) CloseConn

func (rr *Redrec) CloseConn()

CloseConn closes the Redis connection

func (*Redrec) GetUserSuggestions

func (rr *Redrec) GetUserSuggestions(user string, max int) ([]string, error)

GetUserSuggestions return the existing user suggestions range for a given user as a []string

func (*Redrec) Rate

func (rr *Redrec) Rate(item string, user string, score float64) error

Rate adds user->score to a given item

func (*Redrec) UpdateSuggestedItems

func (rr *Redrec) UpdateSuggestedItems(user string, max int) error

UpdateSuggestedItems gets the candidate suggest items for a given user and stores the calculated probability for each item in a sorted set

Jump to

Keyboard shortcuts

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